摘 要:在CNC系統(tǒng)中,一般以工業(yè)用PC機(jī)作為上位機(jī),由嵌入式系統(tǒng)構(gòu)成的機(jī)床控制器作為下位機(jī)。在此介紹一種基于C8051和μC/OS-Ⅱ的數(shù)控機(jī)床嵌入式執(zhí)行控制器,詳細(xì)介紹該執(zhí)行控制器的軟硬件結(jié)構(gòu)、μC/OS-Ⅱ?qū)崟r操作系統(tǒng)在C8051f020上的移植方法,并給出了執(zhí)行控制器軟件模塊的任務(wù)劃分、優(yōu)先級的確定以及任務(wù)間通信的實現(xiàn)。經(jīng)驗證,該系統(tǒng)能夠滿足數(shù)控系統(tǒng)的要求,具有可行性。關(guān)鍵詞:C8051; μC/OS-Ⅱ; 嵌入式執(zhí)行控制器; 數(shù)控系統(tǒng)
中圖分類號:TN911-34; TP391 文獻(xiàn)標(biāo)識碼:A
文章編號:1004-373X(2010)16-0063-03
Realization of Embedded ActuatorController for CNC Machine
Tool Based on C8051 and μC/OS-II
LIU Yan-jun
(Department of Computer Science, Chongqing University of Arts and Sciences, Chongqing 402160, China)
Abstract: In CNC system, IPC is generally used as a master controller while machine tool controller, which is composed of embedded system, is used as a slave controller. An embedded actuatorcontroller based on C8051 and μC/OS-II for CNC machine tool is introduced. The hardware and software architectures, and the transplantation of μC/OS-II to the C8051f020 are elaborated. The task partitioning of actuatorcontroller software module, priority setting and implementation of communication between tasks are discussed. The verification result indicates that the system can meet the requirements of numerical control system and is feasible.
Keywords: C8051; μC/OS-Ⅱ; embedded actuatorcontroller; numerical control system
在數(shù)控機(jī)床系統(tǒng)中,功能模塊可分為兩大部分:一部分是實時性要求不高的功能,例如人機(jī)界面交互管理等;另一部分是實時性要求高的功能,主要有伺服控制、插補計算等。根據(jù)這一特點,該系統(tǒng)采用兩級控制結(jié)構(gòu),利用IPC豐富的軟件資源,提供圖形化的人機(jī)交互環(huán)境;利用嵌入式執(zhí)行控制器的高實時性和穩(wěn)定性,實現(xiàn)快速、可靠的控制,充分發(fā)揮了二者的優(yōu)點[1]。兩級之間用串行口進(jìn)行實時通信[2]。本文主要介紹嵌入式執(zhí)行控制器的實現(xiàn)。
1 數(shù)控機(jī)床系統(tǒng)硬件結(jié)構(gòu)
數(shù)控機(jī)床系統(tǒng)硬件結(jié)構(gòu)如圖1所示,IPC作為上位機(jī),安裝有專用軟件,實現(xiàn)人機(jī)交互;C8051020芯片[3]及其外圍電路構(gòu)成的嵌入式執(zhí)行控制器作為下位機(jī),負(fù)責(zé)實時、可靠的控制。執(zhí)行控制器通過串行口接收上位機(jī)的命令信息(包括:插補命令、開關(guān)量控制命令),再將這些信息轉(zhuǎn)換成控制信號輸送給相應(yīng)的執(zhí)行部件。例如,將插補命令轉(zhuǎn)換成一連串的插補信號,輸送給電機(jī)控制部件;將開關(guān)量控制命令轉(zhuǎn)換成輸出信號,通過I/O驅(qū)動隔離接口板輸送給相應(yīng)的開關(guān)控制器?!?br>