基于pci 和usb總線的開放式運動控制器開發(fā).doc
基于pci 和usb總線的開放式運動控制器開發(fā),基于pci 和usb總線的開放式運動控制器開發(fā) 摘 要開放式數(shù)控系統(tǒng)已成為當今數(shù)控技術的發(fā)展方向,目前的開放式數(shù)控系統(tǒng)多以pc機為基礎,配上各種開放式運動控制器。運動控制器的應用已走出機械加工行業(yè),越來越多地應用于其它工業(yè)自動化設備控制,如機器人控制、電子機械、木工機械、紡織機械、印刷機械等諸多行業(yè)?;趐c總線的以d...


內(nèi)容介紹
此文檔由會員 wanghua273849 發(fā)布基于PCI 和USB總線的開放式運動控制器開發(fā)
摘 要
開放式數(shù)控系統(tǒng)已成為當今數(shù)控技術的發(fā)展方向,目前的開放式數(shù)控系統(tǒng)多以PC機為基礎,配上各種開放式運動控制器。運動控制器的應用已走出機械加工行業(yè),越來越多地應用于其它工業(yè)自動化設備控制,如機器人控制、電子機械、木工機械、紡織機械、印刷機械等諸多行業(yè)。
基于PC總線的以DSP和CPLD/FPGA作為核心處理器的開放式運動控制器將PC機的信息處理能力和開放式的特點與運動控制器的運動軌跡控制能力有機地結(jié)合在一起,具有信息處理能力強、開放程度高、運動軌跡控制準確、通用性好等優(yōu)點,因此發(fā)展迅速。今后基于計算機標準總線的開放式運動控制器仍然是市場發(fā)展的主流。PCI總線解決了ISA總線的響應速度較慢的瓶頸,近幾年,基于USB總線的設備也因其優(yōu)點而得以迅速發(fā)展。
針對國內(nèi)外開放式運動控制器存在的一些缺點,諸如國外產(chǎn)品價格太高、技術支持相對較差,國內(nèi)產(chǎn)品不支持USB總線、存在一些技術上的不足等,本文以DSP芯片TMS320LF2407作為處理器,分別基于PCI和USB總線開發(fā)了多軸開放式運動控制器,并采用PCI 9052和ISP-1581作為接口芯片構建PC-DSP通訊電路,利用CPLD器件EPM7128構建兩路QEP信號處理電路并輔助完成譯碼等功能,同時開發(fā)了接口卡負責完成控制卡與外部器件的互聯(lián)并進行光電隔離和電平轉(zhuǎn)換。
DSP除了完成與上位機的通訊,內(nèi)部還嵌入了許多控制算法,包括基于前饋補償?shù)腜ID控制算法、參數(shù)曲線的自適應時間分割插補算法、直線/圓弧/NURBS插補算法等。同時,提供了豐富的動態(tài)鏈接庫函數(shù)供用戶調(diào)用,并在此基礎上開發(fā)了測試軟件。實驗和仿真結(jié)果表明,系統(tǒng)設計合理,具有實時性好,跟隨誤差小,加工精確度高等優(yōu)點。
關鍵詞 開放式運動控制器;USB 2.0協(xié)議;PCI總線;NURBS插補;DSP
Development of Open-Type Motion Controller Based on PCI and USB Bus Abstract
The open-type numerical control system has become the development trend of NC technology nowadays, and the present NC systems are mainly based on PCs (personal computers) with various motion controllers. The application of motion controllers has extended out of the machine-processing field; more and more are applied in control of other industrial automation devices, such as robot control, electronic machinery, woodworking machinery, textile machinery, printing mechanism, and so on.
The open-type motion controller has developed rapidly, which uses DSP and CPLD/FPGA as core processors and combines the information-handling capacity and the open-type characteristic of PC with the controller’s motion path control ability, having many advantages such as strong information-handling capacity, good open-type characteristic, precise motion path, good versatility. From now on, the development of open-type motion controllers based on computer standard bus is still the market mainstream. The PCI bus solves the problem of low response velocity of ISA bus, and in recent years, equipments based on USB bus have also developed rapidly because of the merits of USB.
Aiming at the shortcomings of domestic and foreign open-type motion controllers, for example, the overseas product price is high, the technical support is relatively weak, and the domestic product does not support USB bus, existing some technical flaws. this thesis develops multi-axis motion controllers based on PCI bus and USB bus respectively with TMS320LF2407 as their processors. PCI 9052 and ISP-1581 chips are adopted to construct the PC-DSP communication channel; CPLD component EMP7128 is used to achieve the functions of two groups of QEP signal processing and address decoding; at the same time, the auxiliary I/O card is also developed to connect the controller and external components after photo-electricity isolation and level transformation.
Besides the communicating with PCs, the DSP has also been embedded many control algorithms, including the PID control algorithm with feed-forward compensation, the parameter curve auto-adapted time-division interpolation algorithm, the line/circle /NURBS interpolation algorithm, etc. A lot of dynamic link library functions are also provided for the users, and test software is developed with the functions. Experiment and simulation result indicates that the system is designed reasonably, with many advantages such as good real-time performance, little following error and high processing precision.
Key words open-type motion controller; USB 2.0 protocol; PCI bus; NURBS
interpolation; DSP
目 錄
摘要 I
Abstract II
第1章 緒論 1
1.1 開放式運動控制技術概述 1
1.1.1 開放式數(shù)控系統(tǒng) 1
1.1.2 基于PC機的開放式運動控制器 2
1.2 開放式運動控制器研究現(xiàn)狀、不足及發(fā)展趨勢 4
1.2.1 運動控制器的分類 4
1.2.2 國內(nèi)外開放式運動控制器的研究現(xiàn)狀 5
1.2.3 目前基于PC的運動控制器存在的不足 6
1.2.4 基于PC的開放式運動控制器的發(fā)展趨勢 7
1.3 課題來源及主要研究內(nèi)容 8
第2章 伺服系統(tǒng)控制關鍵技術研究 9
2.1 運動系統(tǒng)的控制技術概述 9
2.2 伺服電機控制原理 9
2.2.1 交流伺服電機介紹 9
2.2.2 交流伺服電機的控制模式 10
2.2.3 伺服電機的PID調(diào)節(jié)方案 11
2.3 參數(shù)曲線的時間分割插補算法 14
2.3.1 時間分割插補原理 14
2.3.2 參數(shù)曲線自適應插補算法 14
2.4 NURBS插補原理 17
2.4.1 NURBS插補介紹 17
2.4.2 三次NURBS曲線的數(shù)學描述 17
2.4.3 NURBS曲線插值原理 19
2.5 本章小結(jié) 21
第3章 PCI和USB總線規(guī)范與操作 22
3.1 PCI總線 22
3.1.1 PCI總線的基本概念 22
3.1.2 PCI總線的特點 22
3.1.3 PCI局部總線信號定義 23
3.1.4 PCI總線協(xié)議基礎 24
3.2 USB總線 27
3.2.1 USB的優(yōu)點 27
3.2.2 USB系統(tǒng)的分層結(jié)構 27
3.2.3 USB數(shù)據(jù)通訊結(jié)構 29
3.2.4 USB的控制傳輸與中斷傳輸 30
3.2.5 USB軟件編程基礎 33
3.3 本章小結(jié) 34
第4章 PC機與DSP通訊電路設計 35
4.1 運動控制器硬件電路總體設計方案 35
4.2 DSP 芯片TMS320LF2407介紹 36
4.3 PCI總線與DSP通訊電路設計 37
4.3.1 PCI總線接口電路實現(xiàn)方法 37
4.3.2 PCI總線接口芯片選擇 38
4.3.3 PCI 9052的主要特點 38
4.3.4 PCI 9052的工作原理 39
4.3.5 E2PROM的配置 40
4.3.6 PCI-DSP通訊電路 41
4.4 USB總線與DSP通訊電路設計 43
4.4.1 USB接口芯片選擇 43
4.4.2 ISP-1581的特性 43
4.4.3 ISP-1581的引腳介紹 44
4.4.4 ISP-1581相關寄存器簡介 45
4.4.5 USB-DSP通訊電路設計 47
4.5 本章小結(jié) 48
第5章 運動控制器硬件電路設計 49
5.1 DSP輔助電路 49
5.1.1 JTAG測試接口電路 49
5.1.2 供電電路 50
5.1.3 時鐘電路 50
5.2 存儲器擴展電路 51
5.3 控制電壓轉(zhuǎn)換電路 51
5.4 CPLD處理電路 52
5.4.1 地址譯碼 53
5.4.2 正交編碼脈沖處理及計數(shù) 53
5.4.3 中斷邏輯 56
5.5 接口卡電路分析 56
5.5.1 差分信號處理電路 56
5.5.2 輸入輸出信號處理電路 57
5.6 運動控制器硬件開放性的實現(xiàn) 59
5.7 本章小結(jié) 59
第6章 運動控制器軟件開發(fā)及調(diào)試 60
6.1 控制器軟件開發(fā)概述 60
6.2 DSP底層程序開發(fā) 60
6.2.1 USB控制器的固件(Firmware)編程 61
6.2.2 DSP核心程序 64
6.3 設備驅(qū)動程序開發(fā) 69
6.4 動態(tài)鏈接庫函數(shù)開發(fā) 70
6.4.1 動態(tài)鏈接庫函數(shù)及其優(yōu)點 70
6.4.2 動態(tài)鏈接庫的設計 71
6.4.3 用DLL實現(xiàn)運動控制器的開放式功能 72
6.5 測試軟件開發(fā) 73
6.6 本章小結(jié) 76
結(jié)論 77
參考文獻 78
致謝 82