【正文】
本科畢業(yè)設計(論文) 題 目: 步進電機的遠程實時控制系統(tǒng)設計 學 院: 機械電子工程學院 專 業(yè): 學 號: 學生姓名: 指導教師: 職 稱: 二 O 一 二 年 五 月 二 十 日 南京林業(yè) 大學本科畢業(yè)設計(論文) 摘 要 以步進電機為控制對象,完成一套基于 485總線 步進電機轉(zhuǎn)速遠程實時控制系統(tǒng) 。 該系統(tǒng)以上位機( PC機)和下位機(單片機控制系統(tǒng))組 成。 通過 Visual Basic 的串行通信控件 MSComm和 RS485總線完成兩者之間的通信 。 上位機發(fā)出控制指令 , 通過串行口通信 , 由下位機完成兩臺步進電機的速度與方向控制 , 并實現(xiàn)步進電機速度的實時顯示。上位機要發(fā)出正轉(zhuǎn)、反轉(zhuǎn)、加速、減速及檢測速度等指令。因為是遠距離的通訊,指令的傳輸要通過 485總線,而數(shù)據(jù)的發(fā)送和接收則要依靠 Visual Basic的通信控件。 通過通信接口,用戶可以利用計算機與下位機進行聯(lián)機,而從儀器上取得數(shù)據(jù)或設置,直接控制儀器的操作,而計算機又在數(shù)據(jù)處理上又是單片機本身所不能及的 ,所以研究此系統(tǒng)是必要的,實時運行的結果表明該系統(tǒng)的實用性和可靠性。 關鍵詞 :單片機;步進電機;串行通信 南京林業(yè) 大學本科畢業(yè)設計(論文) ABSTRACT The integral design of a set of speed remote realtime control system is designed , which uses stepper motors as the controlled object . The system is posed of personal puter and single chip microputer , which realizes munication with the Visual Basic serial munication controls and RS485 bus. The personal puter sends out the control mands and shows the real time velocity graph , and the single chip microputer controls the speed and direction of two stepper motors through serial munication. The personal puter sends control mand such as forward ,backward, accelerate, decelerate the speed and direction detection. Because it is in longdistance munications, direct transmission through 485 bus, and the display image data and data transmission and reception will have to rely on Visual Basic drawing, Communication Control. Equipment provided by the munication interface, the user equipment can be used with puter equipment online, from the device access to data, or set up, even the direct control of equipment operation, in the puter data processing equipment is not their own and, the study of this system is necessary. The experimental results show the practicability and reliability of the system. Key words : single chip microputer 。 stepper motor 。 serial munication 南京林業(yè) 大學本科畢業(yè)設計(論文) 目 錄 摘 要 ........................................................................................................................... Ⅰ ABSTRACT ................................................................................................................... Ⅱ 1. 緒論 ............................................................................................................................ 1 課題背景及目的 .................................................................................................. 1 國內(nèi)外同類研究狀況 ........................................................................................... 1 課題研究的主要內(nèi)容 ........................................................................................... 2 2. 系統(tǒng)方案設計 .............................................................................................................. 3 功能技術指標分析 .............................................................................................. 3 步進電機的正、反轉(zhuǎn)與加、減速控制方案 ............................................................ 3 步進電動機速度檢測的方案 ................................................................................ 4 步進電機速度實時顯示方案 ................................................................................ 4 本章小結 ............................................................................................................ 4 3. 硬件設計 ..................................................................................................................... 5 串行通信的硬件介紹 ........................................................................................... 5 MAX485 芯片介紹 ..................................................................................... 5 RS485 標準的優(yōu)點 ..................................................................................... 7 單片機與 PC 機串行通信系統(tǒng)構成 ...................................................................... 8 步進電機的 介紹 .................................................................................................. 9 步進電機的基本特點 ................................................................................ 10 步進電機的工作原理 ............................................................................... 11 步進電機的單片機控制原理 ..................................................................... 12 本章小結 .......................................................................................................... 14 4. 軟件設計 ................................................................................................................... 15 開發(fā)環(huán)境、工具介紹 ....................................................................................... 15 Visual Basic ...................................................................................... 15 Visual Basic 的編程特點 ......................................................................... 15 VB 控件的介紹 ................................................................................................ 17 窗體設計 .......................................................................................................... 19 功能設計 .......................................................................................................... 21 VB 程序流程圖 ......................................................................................... 21 通信協(xié)議模塊 .......................................................................................... 22 初始化模塊 ............................................................................................. 22 控制代碼發(fā)送模塊 ................................................................................... 22 速度調(diào)節(jié)模塊 .......................................................................................... 24 附加功能模塊 ................