附錄1
PUMA560機器人的硬件改進和計算轉矩的控制
更新用于教育事業(yè)的工業(yè)控制器
英國Reading大學的自動控制系有一臺Puma 560教學機器人,由于原來的硬件控制部分和人機界面有所欠缺,因此此文就控制部分的改進作了闡述。本論文描述了兩個自動化系的研究生的研究結果,這個課題涉及了基于個人計算機的機器人操作臂的人機界面和計算轉矩的控制設計。
Puma 560機器人是一個六自由度的機器人操作臂,由六個直流伺服電機驅動,關節(jié)位置由編碼器和電位計測定。三個大功率的電機用于驅動腰部關節(jié),肩關節(jié)和肘關節(jié),而三個較小功率的電機用于驅動腕關節(jié)位置和方位。Puma 560機器人有一個寬廣的可達空間和較大的加速度,加速度大的超出人的想象。Puma 560機器人設計的初衷是用于工業(yè)裝配和操作控制,目前大多用于科研院所作為研究的目的來應用?,F在機器人操作臂本身仍然有高的強度和動力,然而原來的Unimation Mark Ⅱ控制器已經過時并且急需替代。隨著現代科技的快速發(fā)展,出現了能夠運行MATLAB/SIMULINK軟件的個人計算機,并且還存在有其它的功能,例如實時監(jiān)控設備、快速成型、以及用于控制機器人操作臂的高級在線測試?;跈C器人控制 “工具箱”的SIMULINK軟件可以控制Puma 560機器人操作臂,但是它不具備控制計算轉矩的功能,正因為此,本文重點介紹這一技術的相關內容。
Puma 560機器人的改進和接口部分
為了利用個人計算機來控制Puma 560機器人操作臂,我們特意去掉了原來的LSI/11計算機、EEPROM存儲器芯片、CMOS芯片、ad/ac接口、數字伺服控制板、以及操作臂接口卡。正如操作臂接口卡中所描述的一樣,原來的功率放大器以及電流、轉矩控制器在新設計的控制結構體系中仍然存在。Puma 560機器人控制部分的硬件結構如圖一所描述。
專用的TRC041改進卡代替原來的芯片安裝在Mark Ⅱ控制器的背面??刂破魃系腡RC041芯片通過專用的電纜與Q8數據采集器相連接,而Q8數據采集器又與個人計算機上的PCI接口相連接。 奔騰4, 2.4GHz的個人計算機在Windows 2000操作系統下運行,用于控制機器人操作臂的精確運動。伺服電機的轉矩通過Mark Ⅱ控制器來控制,并且與由個人計算機通過Q8數據采集器發(fā)送過來的數字電壓相比較。Q8數據采集器從TRC041芯片上接收到編碼器和電位計上的信號。 電位計上的信號用來校準和標定最近接收到的標志信號,然后校準編碼器上的讀數用來決定關節(jié)的位置和方位。
控制器設計
利用控制計算轉矩來實現機器人操作臂的控制,這一項技術多用于非線形的動態(tài)系統的控制中,用來去掉操作臂控制的非線形、也方便內部控制和定值的獲得。關節(jié)位置通過微分積分調節(jié)器控制計算轉矩,進而來控
個人計算機
Windows 2000
MATLA 6.5/Simulink5.0
Wincon 402
PUMA560操作臂
改進的UNIMATE控制器
PCI總線
Q8數據采集器
TRC041網卡設置
圖1 硬件結構
專用的TRC041改進卡安裝在MarkⅡ控制器上,控制器上的TRC041改進卡和Q8數據采集器通過專用的電纜線來連接。奔騰4,2.4GH的個人計算機在Windows2000操作系統下運行,同時應用MATLAB/SIMULINK以及Wincon應用軟件來控制機器人操作臂。
制關節(jié)位置,計算轉矩控制器計算必須的參考轉矩值,參考轉矩值的計算公式如下:
ι=M(q)(q+Ke`+Ke+Kε)+N(q,q`) (A-1)
在這里ι∈R6是一個矢量,是指關節(jié)轉矩的參考值;q∈R6也是一個矢量,一般是指關節(jié)變量;M(q)是轉動慣量矩陣;N(q,q`)代表非線性的術語,例如向心力和震動的影響,以及摩擦和重力(萬有引力)的影響;e(t)=qd(t)-q(t)是跟蹤誤差;qd(t)∈R6是理想的軌跡值;ε∈R6是總的跟蹤誤差;并且Kp、 Ki和 Kv是微分,積分調節(jié)器在各個關節(jié)的參數設定值的矩陣真值表。因為公式(1)是一個在時間上連續(xù),即動態(tài)參數的公式在應用的初期通常應在數字計算機中利用。
假定這個動態(tài)的模型應用的相當恰當和精確,這個設計將對機器人操作臂提供有效的控制,幸運的是這種Puma 560機器人操作臂的動態(tài)性正如其所描述的一樣,滿足這種設計要求。相對的動態(tài)性和Denavit-Hatenburg操作臂所應用的參數是基于[4][5],參考文獻中所描述的一樣。PID調節(jié)器參數的獲取可參考文獻[4]。
軟件部分設計
軟件結構的實現是基于在Windows 2000下運行的SIMULINKLAB和SIMULINK軟件來實現的。SIMULINK軟件使控制算法的快速設計得以實現,并且允許利用C代碼來實現特殊的功能,并稱之為S功能。除此之外,Wincon 4.1[6]用來實時執(zhí)行已經編譯的C代碼,這些C代碼是來自于SIMULINK軟件項目下的實時監(jiān)控處得來的,并且通過它來與Q8數據采集器通信。
圖2 利用PID調節(jié)器設計計算轉矩控制
并在SIMULINK軟件下實現控制
利用PID調節(jié)器設計計算轉矩控制并在SIMULINK軟件下實現控制。已知當前的關節(jié)位置和過去的關節(jié)位置通過調節(jié)器計算當前的關節(jié)速度。飽和反饋用來防止積分器出錯,采樣間隔是1ms。
軌跡生成
軌跡的生成也即是關節(jié)的運行路線的生成,是通過MATLAB代碼來實現的。在實時控制器運行的時候通過關節(jié)點理想軌跡的離線計算可以充分利用處理器,提高處理器的利用效率。第五個命令是用來計算關節(jié)沿著指定的路線運動時關節(jié)角的矩陣變換。這個矩陣一旦被計算出來,這個變換矩陣就被用來作為控制器的表格來實現理想關節(jié)角的插值。
控制器的實現
PID計算轉矩控制器利用SIMULINK軟件來實現,它的實現如圖2所示。由公式(1)給定的計算轉矩的控制準則有一部分寫成C代碼作為SIMULINK軟件的S功能。專門的SIMULINK軟件模塊與Q8數據采集器連接在一起來實現控制算法的計算,并且將計算轉矩的參考值傳送到Mark Ⅱ控制器。
假定這個動態(tài)的模型應用的相當恰當和精確,這個設計將對機器人操作臂提供有效的控制,幸運的是這種Puma 560機器人操作臂的動態(tài)性正如其所描述的一樣,滿足這種設計要求。相對的動態(tài)性和Denavit-Hatenburg操作臂所應用的參數是基于[4][5]參考文獻中所描述的一樣。PID調節(jié)器參數的獲取可參考文獻[4]。
用戶界面
基于MATLAB的用戶使用界面允許使用者通過改變由軌跡生成器生成的代碼參數來詳細的了解目標軌跡和用戶界面。用戶使用界面如圖三所示。這個機器人操作的用戶使用界面十分友好,關節(jié)空間的軌跡可以被儲存,也可以被重新裝載。末端執(zhí)行器在笛卡爾坐標系中的位置和方位可以利用定義在文獻[7]中的運動學方程來得到。關節(jié)到達笛卡爾坐標系中某一特定位置和方位的關節(jié)角由文獻[8]中給定的逆運動學方程來求解。
實驗調試
在模擬環(huán)境中完成測試,并且達到有效性的要求后,也應該調試一下實際的機器人操作臂的應用情況。很多測試指標都用來評估控制器的性能??刂破髡{試的結果表明此控制器的設計結構有很好的使用性能,對于不同的軌跡參考值均能達到小的跟蹤誤差,并且這些誤差在要求的范圍之內。
為了達到跟蹤誤差的高性能和高精度,在此設計中采用了飛投運動的原理。飛投指的是漁民投擲魚線到河中的某一位置。這一涉及到飛投的行為存在以下幾種狀態(tài),向前投擲,向前的運動,腕部關節(jié)的抖動,以及投擲運動的完成。PUMA 560機器人操作臂的運動通過提供一個預先設定的關節(jié)軌跡到控制器上,然后大體上來模仿投擲運動的原理來實現關節(jié)軌跡的控制。參考軌跡包括正弦曲線信號的合適的相位,量值,以及應用在關節(jié)二、三、五上的頻率。運動結果實現了由人來完成的投擲運動的效果。PUMA 560機器人操作臂實驗的關節(jié)軌跡的數值如圖四所示,這個界面里包括了投擲運動的三個循環(huán)周期。實驗用的視頻是AVI格式的,你可以在文獻[10]里下載。
圖3應用界面
該界面顯示了當前的關節(jié)角度和末端執(zhí)行器的笛卡爾坐標位置。在關節(jié)的運動范圍內編輯器提供有效的關節(jié)角度,利用其可以設定理想關節(jié)角度。它也顯示了末端執(zhí)行器的理想笛卡爾坐標位置。該應用界面也可以存儲當前位置和裝載以前存儲的位置。
教學過程
研究這個課題的學生獲得了改進工業(yè)機器人操作臂的能力和接口部分的設計。這個課題包括閱讀和解釋即熟練掌握相關科技文獻上的相關知識,移去UNIMATE控制器上的多余的芯片,根據使用指南插入改進后的芯片選擇和購買電纜和終端,以及接口電源,伺服系統,編碼器,以及電位計和數據采集器。學生也學習了計算轉矩控制的原理,并且將其熟練的應用到了PUMA 560機器人操作臂的運動控制當中。運動控制的實現還涉及到計算轉矩控制方程的模型代碼,在這里計算轉矩控制方程是通過C語言編制的SIMULINK軟件的S功能來實現的;運動控制的實現還包括作為校準的SIMULINK系統的設計,比例微分積分調節(jié)器控制,軌跡生成,以及外部信號接口。
機器人的應用開發(fā)
由于該課題是在2002-2003學年完成的,機器人和基于接口技術的新的個人計算機運動控制的開發(fā)已經由另外的兩個再讀研究生來完成,這次歷時四年。這兩次計算轉矩的控制開發(fā)都是用在內環(huán)上。這次研究的主要內容是:
⑴ PUMA機器人操作臂的力控制。這個內容涉及到操作臂的末端執(zhí)行器的六個力傳感器以及和計算機的接口部分的設計,也包括在SIMULINK下對控制器的控制。
⑵ 實現PUMA機器人操作臂的隨意控制。這個內容包括利用專用的控制器替換在2002-2003年使用的比例微分積分調節(jié)器控制的控制。
在基于神經網絡控制器的發(fā)展和實現的基礎上,未來的研究主題因該是利用神經網絡控制器來控制PUMA機器人操作臂。一些機器人控制的實驗手冊可以提供給學生二手的資料,以便了解機器人控制的相關知識,也可以利用它來評估不同的控制器設計的優(yōu)劣,包括0重力加速度、計算轉矩控制、阻抗控制、以及導納控制等。這篇論文描述了PUMA 560機器人操作臂的改進,與個人計算機的接口,基于MATLAB軌跡生成和友好的用戶界面的軟件的開發(fā),在SIMULINK下比例微分積分調節(jié)器控制的實現。這個項目是利用先進的技術將在技術上落后但機械結構上仍還完善的機器人實驗臺變廢為寶的恰當的例證,能夠使使用者在低成本的基礎上利用基于SIMULINK和MATLAB開發(fā)的先進的、柔性的軟件來實現對機器人操作臂的實驗研究。
附錄 2
Hardware Retrofit and Computed Torque Control of a Puma 560 Robot
Updating an industrial manipulator for educational use
The Department of Cybernetics at the University of Reading U.K. had, for a number of years, a functional PUMA 560 manipulator robot with its original control hardware and human interfaces. This article describes the results of a third-year project by two undergraduate students in the Cybernetics Department. The project consisted of interfacing the robot arm with a PC and developing software for the real-time implementation of a computed torque control scheme.
The PUMA 560 is a six-degree-of-freedom robotic manipulator that uses six dc servomotors for joint control. Joint positions are measured using encoders and potentiometers. Three large motors provide control of the waist, shoulder, and elbow, while three smaller motors position the orientation of the wrist. The PUMA 560 has a large reach and can achieve impressive acceleration. Originally designed for assembly and manipulation tasks, the PUMA arm is now widely adopted by academic institutions for research purposes. While the robot arm itself is still relatively robust, the original Unimation Mark II controller was outdated and in need of replacement. The use of a PC running MAT-LAB/SIMULINK and associated real-time tools facilitates the prototyping, development, and on-line testing of advanced schemes for controlling the manipulator. A SIMULINK-based robotic toolkit for controlling the PUMA 560 manipulator, but which excludes the computed torque control technique employed in this article, is reported in[1].
Retrofitting and Interfacing the PUMA 560 Robot
To control the PUMA arm using a PC, we removed the original LASI/11 computer, EEPROM boards, and arm interface card. The original power amplifiers and current/torque controllers remain in the control architecture, as does the arm cable card. The hardware configuration is illustrated in Figure 1.
Special-purpose TRC041 retrofit cards [2] re installed in the backplane of the Mark II controller, replacing the original boards. Custom-made cables are used to interface the TRC041 cards and a Q8 data acquisition board[3], which is connected to the PCI interface of the PC. An Intel Pentium 4.2.4 GHz PC running the Windows 2000 operating system is used to control the arm. Servo torques are controlled by the Mark II controller, with reference values sent as
Personal Computer
Windows 2000
MATLAB6.5/Simulink5.0
Wincon 402
P PUMA560
Manipulator
Retrofitted
UNIMATE
Controller
PCI BUS Q8 Data Acquisition Board
TRC041
Cable
Card
Set
Figure1. Hardware configuration.
Special TRC041 retrofit cards were installed in the Mark II controller. The TRC041 cards in the controller and a Q8 data acquisition board were interfaced using custom-made cables. An Intel Pentium 4 2.4 GHz PC running the Windows 2000 operating system, together with MATLAB/SLMULINK and Wincon, are used to control the arm.
analog voltages from the PC through the Q8 board. The Q8 board receives encoder and potentiometer signals from the TRC041. Readings from the potentiometers are used to calibrate the encoders to the nearest index purse. The calibrated encoder readings are then used to determine the joint positions.
Controller Design
Control of the arm is performed using computed torque control[4]. This technique uses a nonlinear dynamic model of the system to remove the nonlinearities of the manipulator, facilitating external control with fixed gains. Joint positions are controlled by means of a proportional integral-derivative (PID) computed torque controller, which calculates the six required reference torque values by means of
ι=M(q)(q+Ke`+Ke+Kε)+N(q,q`) (A-1)
Whereι∈R6 is a vector of joint torque references;q∈R6 is a vector of generalized joint variables; M(q) is the inertia matrix; N(q,q`) represents nonlinear terms, including Coriolis/centripetal effects, friction, and gravity; e(t)=qd(t)-q(t) is the tracking error, qd(t)∈R6 is the desired trajectory;ε∈R6 is the integral of the tracking error; and Kp, Ki and Kv are diagonal matrices with the proportional, derivative, and integral gains for each joint, respectively. Since (1) is a continuous-time formulation, a sufficiently short sampling period should be used in a digital computer-based implementation.
Provided the dynamic model employed is reasonably accurate, this scheme provides effective control of the arm. Fortunately, the dynamics of the PUMA 560 manipulator are well known and reported. The inverse dynamics and Denavit-Hatenburg arm parameters employed are based on those reported in [4][5]. The PID controller gains employed are reported in[4].
Software Design
The implemented software architecture is based on MATLAB and SIMULINK running under Windows 2000. SIMULINK enables rapid design of control algorithms and allows specific functions to be implemented in C code as S-functions. In addition, WinCon 4.[6] is used for real-time execution of the compiled C-code generated by the Real Time Work shop form the SIMULINK diagram, and to communicate with the Q8 board.
Trajectory Generation
Trajectory generation, which is performed in joint space, was implemented in MATLAB code. The off-line calculation of points on the desired trajectory reduces the overhead on the processor while the real-time controller is running. A fifth-order polynomial is used to calculate a matrix of joint angles along the specified trajectory. Once calculated, this matrix is used as a look-up table to interpolate the desired joint angles for the controller.
Figure2. SIMULIK implementation of the
PID computed torque control scheme
Figure2. SIMULIK implementation of the PID computed torque control scheme. Joint velocities are computed using a filtered derivative the current and past joint positions. A saturation feedback scheme is used to prevent integrator windup. The sample interval is 1 ms.
Controller Implementation
The PID computed torque controller was implemented in SIMULINK as shown in Figure 2. The computed torque control law given by (1) was partly written in C as a SIMULINK S-function. Special SIMULINK blocks interface with the Q8 board to bring measurements into the control algorithm and to send torque references to the Mark II controller. Results show that the implemented control scheme has good performance, achieving small tracking errors for different reference trajectories.
Graphical User Interface
A MATLAB-based graphical-user interface (GUI) allows the user to specify the desired trajectory by changing the parameters used by the trajectory generation code. The GUL, shown in Figure 3, is designed for user-friendly operation of the robot, enabling joint-space trajectories to be stored and reloaded. The Cartesian position and orientation of the end effector are obtained using the forward kinematic equations defined in[7]. The joint angles required to reach a specified cartesian position and orientation are calculated using the inverse kinematics given in[8].
Experiments
After initial testing and validation of the implemented controller in a simulated environment, real-time experiments with the actual manipulator were carried out. Several tests were made to assess the performance of the implemented controller. The results show that the implemented control scheme has good performance, achieving small tracking errors for different reference trajectories.
To illustrate the tracking performance of the implemented control scheme, a demonstration was designed based on the action of fly-casting[9]. Flycasting is used by fishermen to cast off the fishing line to a position in the river. The actions involved in flycasting are the forward cast, the forward motion, the flick of the wrist joint, and completion of the cast.
The Cartesian position of the end-effector is displayed together with the current joint angles. Desired joint angles are set using edit boxes that provide validation of the joint angle with respect to the arm limitations. It is also possible to specify the desired cartesian store positions and load previously saved positions.
The flycasting motion was approximately modeled using the PUMA manipulator by supplying a predefined join trajectory to the controller. The reference trajectory consists of sinusoidal signals with appropriate phase, magnitude, and frequency applied to joints 2,3, and 5. The resulting motion resembles the flycasting action performed by a human. Experimental joint trajectories of the PUMA manipulator are shown in Figure 4, which includes three cycled of the flycasting motion. A video of the experiment in AVI format can be downloaded from[10].
Figure 3. The graphical user interface.
The Pedagogical Process
The students involved in this project gained experience in retrofitting and interfacing an industrial manipulator robot. This experience included reading and interpreting technical documentation, removing board from the UNIMATE controller, inserting the retrofit boards according to the manufacturer’s instructions, specifying and purchasing cables and terminals and interfacing power-up, servo encoder, and potentiometer signals with a data acquisition board. The students also learned the theory of computed torque control, and applied it to the PUMA 560 manipulator robot. The implementation involved coding the model-based computed torque control equations in a SIMULINK S-function using the C programming language, as well as the design of a SIMULINK system for calibration, PID control, trajectory generation, and external signal interfacing.
Further Use of the Robot
Since this project was carried out during the academic year 2002-2003,the robot and its new PC-based interface have been used for two additional undergraduate projects, this time at the fourth-year level. In both cases, the computed torque control scheme developed in the 2002-2003project was used in an inner loop. The topics of these projects were:
(1)Force control of the PUMA manipulator robot. This project involved the coupling of a six-axis force sensor with the end-effector of the manipulator and its interface with the control computer. The project also involved the implementation in SIMULINK of admittance and impedance controllers.
(2)Constrained predictive control of the PUMA manipulator robot. This project involved replacing the multivariable PID control employed in the 2002-2003 project with a constrained predictive controller. Future projects include the development and implementation of a neural-network-based controller on the PUMA manipulator. Moreover, a laboratory manual is being written to allow students of an undergraduate module entitled Manipulator Robotics to gain hands-on experience with manipulator control and to assess the performance of different control, Cartesian control, impedance control, and admittance control.
The project is an example of how a mechanically sound robotic platform with obsolete interfaces can be revitalized at low cost, enabling users to perform experimental research on the manipulator using a modern and flexible software interface.
Conclusions
This article describes a third-year undergraduate project that involved the retrofit of a PUMA 560 manipulator robot, its interface with a PC, MATLAB-based software development for trajectory generation and graphical user interface, and SIMULINK implementation of a PID computed torque control scheme. The project is an example of how a mechanically sound robotic platform with obsolete interfaces can be revitalized at low cost, enabling users to perform experimental research on the manipulator using a modern and flexible software interface based on MATLAB and SIMULINK.