16th Triennial World Congress, Prague, Czech Republic

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Copyright (c) 2005 IFAC.

All rights reserved


16th Triennial World Congress, Prague, Czech Republic

PREDICTIVE COMPUTED-TORQUE
CONTROL OF A PUMA 560 MANIPULATOR
ROBOT

Victor M. Becerra, Steven Cook and Jiamei Deng

University of Reading, Department of Cybernetics,


Reading RG6 6AY, UK

Abstract: This paper describes the integration of constrained predictive control and
computed-torque control, and its application on a six degree-of-freedom PUMA
560 manipulator arm. The real-time implementation was based on SIMULINK,
with the predictive controller and the computed-torque control law implemented
in the C programming language. The constrained predictive controller solved a
quadratic programming problem at every sampling interval, which was as short
as 10 ms, using a prediction horizon of 150 steps and an 18th order state space
model. Copyright c 2005 IFAC

Keywords: Predictive control, robotic manipulators, computed-torque control.

1. INTRODUCTION benefits of predictive control is that constraints


on the inputs and outputs of the system can
be explicitly considered in the control problem
This paper describes the integration of con-
formulation and its solution.
strained predictive control and computed-torque
control, and its application in real time to control The success of linear predictive control has in-
a six degree-of-freedom PUMA 560 manipulator spired researchers to look into the possibility of
arm. Until recent years the application of con- extending it for non-linear control applications.
strained predictive control to a manipulator with Since manipulator robots exhibit strong nonlin-
six degrees of freedom, although theoretically pos- earities, their performance can be significantly
sible, has not been practical as computer proces- improved by using nonlinear control strategies.
sors have not been fast enough to solve online Computed-torque control (Lewis et al., 2004) is a
the associated constrained optimisation problem technique that uses a nonlinear dynamic model of
within the short sampling periods that are re- the system to remove the nonlinearities of the ma-
quired by the application. Predictive control has nipulator, facilitating external control with fixed
been proposed on a simulated two-link PUMA 560 gains. Poignet et al. (2000) describe a combined
arm as described in (Torres et al., 2001), who used predictive functional control / computed-torque
local linearisation to define the internal model. In control scheme, with simulated tests on a two
the work by (Bemporad et al., 1997), a predictive degree-of-freedom SCARA robot.
path generator was designed to deal with various
The PUMA 560, shown in Figure 1, is a six-
constraints, and experiments on a PUMA 560
degree of freedom robotic manipulator that uses
manipulator were made using three links of arm.
six dc servomotors for joint control. Joint po-
The essence of predictive control is to optimise, sitions are measured using encoders and poten-
over the manipulable inputs, forecasts of process tiometers. Three large motors provide control of
behaviour (Maciejowski, 2002). One of the main

229
the waist, shoulder, and elbow, while three smaller Notice that, as a result of using the feedback
motors position the orientation of the wrist. The linearising transformation (4), the tracking error
PUMA 560 has a large reach, and can achieve dynamics are given by a linear state equation
impressive acceleration. Originally designed for with constant coefficients. The feedback linearis-
assembly and manipulation tasks, the PUMA arm ing transformation (4) can be inverted to give
is now widely adopted by academic institutions for
τ = M (q)(q̈d − u) + N (q, q̇). (7)
research purposes.
This is the computed-torque control law. An outer
loop controller is often used. The role of the outer
loop controller is to provide the input u. For
example, PD and PID and LQR computed-torque
controllers have been proposed as outer loop con-
trollers (Lewis et al., 2004). The computed-torque
control technique is known to perform well when
the robot arm parameters are known fairly accu-
rately. Fortunately, the dynamics of the PUMA
560 manipulator are well known and reported.
The inverse dynamics and Denavit-Hartenberg
arm parameters employed in this work are based
on those reported in (Lewis et al., 2004) and
(Corke and Armstrong-Helouvry, 1994).

Fig. 1. PUMA robot manipulator arm 2.2 The predictive control problem

In this work, a constrained predictive controller is


2. DESCRIPTION OF THE CONTROL
employed as an outer loop controller to generate
SCHEME
the input u, and the robot dynamics are feedback
2.1 Computed torque control (CTC) linearised by means of the computed-torque con-
trol law (7). The predictive control formulation
The reference torque for each joint of the arm is below assumes a linear, discrete-time, state-space
calculated using computed-torque control (Lewis model of the plant:
et al., 2004). This technique is used to remove the x(k + 1) = Ax(k) + Bu(k)
nonlinearities of the PUMA by employing feed- y(k) = Cy x(k) (8)
back linearisation. The arm dynamics are given
z(k) = Cz x(k),
by:
M (q)q̈ + N (q, q̇) + τd = τ (1) where x(k) is the state vector at time k, u(k) is
where q(t) ∈ <6 is a vector of joint variables, the vector of inputs, y(k) is the vector of measured
τ (t) ∈ <6 the control torque, τd (t) ∈ <6 outputs, and z(k) is the vector of outputs which
is a disturbance, M (q) is the inertia matrix, are to be controlled to satisfy some constraints, or
N (q, q̇) represents nonlinear terms including cori- to particular set-points, or both. In this work, a
olis/centripetal effects, friction, and gravity. Kalman filter was used that can be described as
follows:
Suppose that a reference trajectory qd (t) has been
x̂(k + 1|k) = Ax̂(k|k − 1) + Bu(k) + Lê(k|k)
chosen for the arm motion. The tracking error is
defined as: ŷ(k|k − 1) = Cy x̂(k|k − 1)
e(t) = qd (t) − q(t) (2) ẑ(k|k − 1) = Cz x̂(k|k − 1),
If the tracking error is differentiated twice, then (9)
where x̂(k + 1|k) is the estimate of the state
ë = q̈d + M −1 (N + τd − τ ). (3)
at future time k + 1 based on the information
Define the feedback linearising input function as available at time k, ŷ(k|k − 1) is the estimate of
u = q̈d + M −1 (N − τ ), (4) the plant output at time k based on information
at time k − 1, L is the Kalman filter gain matrix
and the disturbance function as
and ê(k|k) is the estimated error: ê(k|k) = y(k) −
w = M −1 τd . (5) ŷ(k|k − 1).
Then the tracking error dynamics can be ex- The formulation given in this paper is inspired
pressed as follows by the constrained predictive control algorithm
        
d e 0 I66 e 0 0 presented in (Maciejowski, 2002). The cost func-
= + u+ w.
dt ė 0 0 ė I66 I66 tion V minimised by the predictive controller
(6) penalises deviations of the predicted controlled

230
 
outputs ẑ(k+i|k) from a reference trajectory r(k+ Cz A
i|k) and also it penalises changes in the future  ..
manipulated inputs ∆û(k + i|k). Define the cost

 .

 Cz A m 
function as follows ψ=
 m+1  ,

 Cz A 
 .. 
 . 
p
X Cz A p
 
V (k) = ||ẑ(k + i|k) − r(k + i|k)||2Q(i) Cz B
i=1  .. 
 m−1 .
 
m−1
X 
X 
+ ||∆û(k + i|k)||2R(i) , (10)  i 
 Cz A B 
i=0  
 i=0
m

X 
Υ= i ,
 Cz A B  
 i=0 
where the prediction and control horizons are p  
 .. 
and m, respectively, Q(i) and R(i) are output  . 
 
and input weight matrices, respectively. The cost Xp−1 
 
function can also be written as follows: Cz A i B
i=0
 
Cz B . . . 0
V (k) = ||Z(k) − T (k)||2Q + ||∆U (k)||2R , (11)  AB + B . . .
 0 

 .. .. .. 
.
 m−1. .
 

X 
where 
 i
A B ... B


 
 i=0 
Θ=X m .
 
ẑ(k + 1|k)

 Ai B ... AB + B  
 i=0 

Z(k) =  ..   
.   .. .. .
.. 
 . . 
ẑ(k + p|k) 
Xp−1 p−m


  X
r̂(k + 1|k) 
Ai B ... Cz A i B


T (k) =  .. 
(12) i=0 i=0
. 
Define
r̂(k + p|k)
  ε(k) = T (k) − ψx(k) − Υu(k − 1). (15)
∆û(k|k)

∆U (k) =  .. 
. ,
Now the following can be obtained:
∆û(k + m − 1|k)

V (k) = ||Θ∆U (k) − ε(k)||2Q + ||∆U (k)||2R


= ε(k)T Qε(k) − 2∆U (k)T ΘT Qε(k)
 
R(0) 0 . . . 0 + ∆U (k)T [ΘT QΘ + R]∆U (k). (16)
 0 R(1) . . . 0 
 
R= . . . . 
 .. .. .. .. 
Equation (16) has the form
0 0 . . . R(m − 1)
  (13)
Q(1) 0 . . . 0 V (k) = const − ∆U (k)T ϑ + ∆U (K)T H∆U (k),
 0 Q(2) . . . 0 
  (17)
Q= . .. . . . . where
 .. . . .. 
ϑ = 2ΘT Qε(k), (18)
0 0 . . . Q(p)
and
H = ΘT QΘ + R. (19)
Note that
Then, to minimise V as given by equation (10),
the following constrained optimization problem
Z(k) = ψx(k) + Υu(k − 1) + Θ∆U (k), (14) can be solved:
min ∆U (k)T H∆U (k) − ϑT ∆U (k), (20)
∆U (k)

where subject to the inequality constraints:

231
u(k) ≥ umin (k) 3. IMPLEMENTATION AND RESULTS
u(k) ≤ umax (k)
|∆u(k)| ≤ ∆umax (k) 3.1 Hardware configuration
(21)
z(k) ≥ zmin (k)
The original Mark II controller of this PUMA
z(k) ≤ zmax (k). arm has been retrofitted to enable control from
This optimisation problem can be expressed as a personal computer. Special purpose TRC041
follows: retrofit cards (Mark V Automation Inc., 2000)
are installed in the backplane of the Mark II
min θT φθ + ϕT θ, (22) controller. Custom-made cables are used to inter-

face the TRC041 cards and a Q8 data acquisition
subject to
board (Quanser Consulting Inc., 2003a), which is
Ωθ ≤ ω, (23) connected to the PCI interface of the personal
where θ = ∆U (k), φ = H, ϕ = −ϑ. Expressions computer. An Intel Pentium 4 2.4 GHz personal
for matrix Ω and vector ω are obtained from computer running the Windows 2000 operating
Equations (21) and (14). system is used to control the arm. Servo torques
are controlled by the Mark II controller, with
reference values sent as analog voltages from the
personal computer through the Q8 board. The
Q8 board receives encoder and potentiometer sig-
2.3 The state space model employed nals from the TRC041 and is interfaced with
SIMULINK.
The linear tracking dynamics (6) can be discre-
tised using the zero order hold method with sam-
pling interval h to yield, ignoring the unmeasured
3.2 Software configuration
disturbance input w, the following discrete time
model:
Figure 2 shows a SIMULINK diagram of the
xd (k + 1) = Ad xd (k) + Bd u(k) real-time control scheme. MATLAB’s Real Time
(24) Workshop and Wincon (Quanser Consulting Inc.,
y(k) = Cd xd (k)
2003b) were used to generate and execute real-
where k is an integer time index, xd (k) = time code.
[e(kh) ė(kh)]T is the discrete time state vec-
tor, y(k) = e(kh) is the output vector, and
Ad , Bd , Cd , Dd are discrete time model matrices.
Define
∆u(k) = u(k) − u(k − 1)
(25)
∆x(k) = x(k) − x(k − 1).
A convenient augmented model can be obtained
as follows:
x(k + 1) = Ax(k) + B∆u(k)
(26)
y(k) = Cx(k) Fig. 2. SIMULINK system implementing the real-
time control scheme
where  
∆xd (k) The computed torque control law given by Equa-
x(k) =
y(k) tion (7) was implemented by means of a SIMULINK
 
Ad 0126 S-function written in C (The Mathworks, Inc.,
A=
Cd A d I 6 (27) 2001). The predictive algorithm has been imple-
 
Bd mented in the C programming language and in-
B= terfaced to SIMULINK through an S-function.
Cd B d
The implemented predictive control algorithm is
C = [01212 I6 ]
described in Table 1. The algorithm uses linear
This augmented 18th order model was used by state space models of the form given in Equa-
the real-time predictive controller employed in tion (26). The algorithm follows the formulation
this work. If the system is at steady state, then given in section 2.2. A public domain quadratic
∆x(0) = 0. As y(0) is the initial position of the programming (QP) algorithm by K. Schittkowski
system, x(0) is known. This augmented model is was employed (Schittkowski, 1992). The controller
therefore easily initialized, which is an advantage tuning parameters can be set through the S-
over the general state space model (24). function interface.

232
Table 1. Predictive control algorithm prediction horizon p, the control horizon m, and
implemented by S-function the input and output weights uwt and ywt.

Step Description For rapidly changing systems, such as the PUMA


arm, a high sample rate is required. A sampling
1 read in measured output vector y(k).
period of about h = 0.001 s is usually considered
2 form matrices φ, Ω and vectors ϕ and ω.
3 solve the quadratic programming problem suitable for such a system. It is important to
given by Eqns. (22) and (23). consider the amount of time taken to solve the
4 compute the control vector from the resulting QP problem, as it must be solved within each
increment u(k) = u(k − 1) + ∆û(k|k). sampling period. This load is influenced by factors
5 store u(k) and increase the sampling index:
such as the prediction and control horizon, as well
k ← k + 1.
6 write out control signal vector u(k). as the size of the model and the speed of the
7 go to 1 and repeat again. computer. Through experimentation, it was found
that the use of a sampling period of h = 0.01 s
The software was designed with the assumption
was feasible, as the computer was not fast enough
that the bounds on variables are constant over
to calculate the solution to the QP with suitable
their relevant time horizons. Under this assump-
prediction and control horizons within 1 ms.
tion, the limits ulim and ylim, which are ma-
nipulated and output variable constraints, respec- Initial tuning was carried out based on simultane-
tively, are defined as follows: ous filtered step changes on the references using
a simulated manipulator based on the Denavit-
ulim = [uTmin uTmax ]T Hartenberg model of the PUMA (Lewis et al.,
T T
(28) 2004), (Corke and Armstrong-Helouvry, 1994).
ylim = [zmin zmax ]T . Controller tuning was refined through real-time
Similarly, it is assumed that the input and out- experiments on the actual manipulator, and the
put weights are constant along the relevant time final tuning employed was:
horizons, so that R(1) = R(2) = · · · R(m) = R • p = 150,
and Q(1) = Q(2) = · · · Q(p) = Q, with R and • m = 6,
Q diagonal matrices. Under this assumption, the • uwt = [60, 60, 60, 65, 60, 60]
weight vectors uwt and ywt, which are input and • ywt = [50, 50, 50, 50, 50, 50]
output weight vector, respectively, are defined as
follows: Figure 3 shows the trajectory of the joint vari-
ables q1 and q2 of the PUMA under predictive
computed-torque control, and the corresponding
uwt = [R1,1 , . . . , Rnu ,nu ] references, for one of the experiments carried out
(29)
ywt = [Q1,1 , . . . , Qny ,ny ]. as part of this work.

0
3.3 Constraints qd1
−0.5 q1
The feedback input to the predictive controller is −1
1
q

the tracking error on each joint. The controller


−1.5
output is a correctional value of the angular ac-
celeration which must be subtracted from the −2
0 5 10 15 20
required angular acceleration. Constraints can be time (s)

placed on the input and output of the predictive −0.6


qd2
controller. This is useful since it is, in theory, −0.8
q2
possible to prevent the manipulator from moving −1
2
q

too far away from the reference trajectory. It is −1.2

also possible to constrain the rate at which the −1.4

controller can change its input to the system. −1.6


0 5 10 15 20
With the formulation given in this paper, it would time (s)

be difficult to consider physical constraints such


as torque or current, due to the nonlinear connec- Fig. 3. Trajectory following under predictive
tions between the actual torque and servo-motor computed-torque control.
current, and the predictive controller output.

3.4 Controller tuning 4. CONCLUSIONS

The tuning parameters associated with the pre- This paper describes the integration of con-
dictive controller are the sampling period h, the strained predictive control and computed-torque

233
control, and its application in real-time to control Mark V Automation Inc. (2000). TRC004 User’s
a 6-DOF PUMA manipulator arm. Manual.
Poignet, P. and M. Gautier (2000). Nonlinear
It is felt by the authors that the work reported
model predictive control of a robot manip-
here is a good start in exploring the benefits of
ulator. In: Proc. 6th International Workshop
using predictive computed-torque control on the
on Advanced Motion Control. Nagoya, Japan.
PUMA arm. However, the tuning reported in this
pp. 401 – 406.
paper can be improved. A significant improvement
Quanser Consulting Inc. (2003a). Q8 Data Acqui-
in performance could be achieved with a faster
sition System: WinCon Support and Installa-
control computer. This is because the sampling
tion Guide, Version 1.0.
period could be made shorter and, conversely, the
Quanser Consulting Inc. (2003b). WinCon 4.1
prediction horizon longer.
User’s Manual, Version 1.2.
Constraints can be placed on the input and output Schittkowski, K. (1992). Quadratic Programming
of the predictive controller. This is useful since, in implementation - C version translated from
theory, it is possible to prevent the manipulator Fortran Version 1.4 (March 1987) - C transla-
from moving too far away from the reference tra- tion 1992, modified by M.J.D. Powel (Univer-
jectory. It is also possible to include information sity of Cambridge), A.L. Tits, J.L. Zhou and
about future reference trajectories in the predic- C. Lawrence (University of Maryland). Math-
tive control computations, such that the controller ematisches Institut, Universitaet Bayreuth,
can optimally anticipate future changes in the Germany.
reference trajectory. This feature may be useful The Mathworks, Inc. (2001). Writing S-Functions.
when the manipulator is required to do repeti- The Mathworks, Inc.
tive tasks. These capabilities give constrained pre- Torres, S., J.A. Mendez, L. Acosta, M. Sigut, G.N.
dictive control a significant advantage over PID Marichal and L. Moreno (2001). A predictive
computed-torque control which can not optimally control algorithm with interpolation for a ro-
handle constraints on input or output variables, or bot manipulator with constraints. In: Proc.
information about future reference trajectories. 2001 IEEE Int. Conference on Control Appli-
cations. Mexico City, Mexico. pp. 536 – 541.

5. ACKNOWLEDGEMENTS

This paper summarises the results obtained by


Steven Cook in his final year project of the MEng
in Cybernetics at the University of Reading. The
real-time predictive control algorithm employed
in this work was implemented by Jiamei Deng
and Victor Becerra with funding from the EPSRC
under grant GR/R64193. The computed-torque
control algorithm was implemented by Callum
Cage as part of his 3rd year project of the MEng
in Computer Science and Cybernetics at the Uni-
versity of Reading.

REFERENCES
Bemporad, A., T. Tarn and N. Xi (1997). Pre-
dictive path parameterization for constrained
robot control. IEEE Trans. on Control Sys-
tems Technology 7(6), 648–656.
Corke, P.I. and B. Armstrong-Helouvry (1994). A
search for consensus among model parame-
ters reported for the PUMA 560 robot. In:
Proc. IEEE Conf. Robotics and Automation.
pp. 1608–1613.
Lewis, F.L., D.M. Dawson and C.T. Abdallah
(2004). Robot Manipulator Control. Marcel
Dekker.
Maciejowski, J.M. (2002). Predictive control with
constraints. Prentice Hall.

234

You might also like