You are on page 1of 6

Improved control of visually observed robotic agents based on

autoregressive model prediction

Guilherme A. S. Pereira1;2 Mario F. M. Campos1;2 Luis A. Aguirre1;3


1
Programa de Pos-Graduac~ao em Engenharia Eletrica,
2
Departamento de Ci^encia da Computac~ao,
3
Departamento de Engenharia Eletr^onica,
Universidade Federal de Minas Gerais,
Av. Ant^onio Carlos 6626, 31270-901, Belo Horizonte, MG, Brasil.
E-mail: fgpereira, mariog@dcc.ufmg.br, aguirre@cpdee.ufmg.br

Abstract autoregressive model is derived from the physics of the


process and its parameters are estimated using input
Recent investigation on the cooperation of multiple and output data. In the context of robotics this kind
robotic agents with centralized control, has ushered in of autoregressive modeling was used in [3] to predict
small and less sophisticated robots that are observed the actual position of obstacles and to facilitate path
by a global vision system. This paper presents a mod- planning. To compensation for time delays, predictive
eling methodology that enables accurate prediction of techniques have been used [4] but in most cases the
such small robot's position and orientation from data Smith Predictor [5] is used based on rst order linear
measured using the global vision system. Results of approximated models.
several experiments show that the predictions of the The remainder of this text is organized as follows:
model can be used to compensate time delays and im- Section 2 describes the system brie y. Section 3 fo-
prove the transient response of the robots. cuses on the physical modeling of the system which
is used in Section 4 to show the e ects of dead time
in the robot control. Section 5 shows the time delay
compensation based on model prediction and Section 6
1 Introduction presents the experimental validation of the model and
the results of the compensation. Finally, the main
Until recently the control and navigation of mobile points of the paper are summarized in section 7.
robots was mainly performed based on exteroceptive
sensing. With the emphasis on the coordination and
cooperation of multiple robots [1] the use of global
vision, has been increasing [2]. In this scenario, sev- 2 System Overview
eral small robots with very limited local sensing and
processing capabilities, are controlled by a central- The architecture of the robot system used in this
ized computing system from the visual information re- work can be seen in Figure 1. The system is com-
ceived from a camera mounted above the working area. posed by two host computers (one for planning and
It is usually very diÆcult to control the robots due to robot control, and the other for vision processing), a
time delays in the image processing steps and to the standard video camera and the three small robots. Po-
lack of local odometry. In order to provide precise con- sitions and orientations of the color coded objects on
trol, there is a need to precisely model each robot. In the working area is provided at 40 frames/sec.
this paper a modeling methodology will be described The robot was built based on modi ed remote con-
which provides accurate on line prediction of robot's trolled (R/C) model airplane components. These in-
position. This prediction is used in the control loop of clude microservos, receivers and a transmitter. A de-
the robot to compensate dead times and to improve tailed description of the system can be found in [6].
its time response. It is important to note that unlike Speed information (position in the original R/C
the traditional modeling based on physics only, here an system) is encoded as a pulse which is sent by the
TCP/IP
Y V2
F2
V
Vision Control Tx Rx ma
Fa1
V1
S1 S2 r F1
G θ
Camera Robot y


Figure 1: System Architecture. L
2
Fa2

L
2

R/C transmitter in a continuously modulated pulse x X

streams. However, due to time restrictions of the Figure 3: Model of the robot.
micro-controller used in the interface, the host com-
puter discretizes the widths into only 128 values, which
provides suÆcient resolution in this case. At the re- as:
ceiver, a circuit extracts the pulses from the carrier, xk = xk 1 + [Vk 1 T + (a1 u1 k d + a2 u2 k d +
and makes them available at each servo port. The 
servos have been modi ed from an output torque of T2
2:5 kgf  cm, and speed of 64:8 rpm to a new torque +Fa1 k 1 + Fa2 k 1 ) m cos(k 1 )
of 0:186 kgf  cm and the speed of 892 rpm. Wheel yk = yk 1 + [Vk
1 T + (a1 u1 k d + a2 u2 k d +
radius is 1:85 cm, which permits a maximum speed T2

of 172:8 cm/s. Leveling of the robot was achieved +Fa1 k 1 + Fa2 k 1 ) m sin(k 1 )
through two small ball bearings. The robot structure
complies with the restrictions of a 7:5 cm side cube. A T2
k = k 1 + !k 1 T + (a1 u1 k d a2 u2 k d )
cross-section of the robot can be seen in Figure 2. 2I ;
(1)
where xk indicates the value of x at time k T and xk 1
3 Robot Modeling indicates the value of x one sampling interval, T , be-
fore. The terms V and !, are the linear and angular
velocity components of the robot and the Fa1 and Fa2
This section presents the mathematical modeling terms are the friction forces at the contact line between
for the robots. In the diagram shown in Figure 1 it the bearings and the oor. m represent the robot mass
can be seen that all the information on the robot is and I is the moment of inertia about the robot's cen-
provided by the vision system. The raw information is ter of mass, G. The robot is commanded by the two
processed resulting in speed set points that are trans- signals, u1 and u2 , that represent the magnitude of
mitted by radio to the servos on the robot. The vari- the voltage at the right and left motors, respectively.
ables measured by the vision system are the position, Between the time of the action of these signals and
(x; y), of the geometrical center of the robot and the the visualization of its e ects there is a delay time, d.
angle, , between the main axis of the robot and the The model (1) is a physically motivated approxi-
X axis of the playing eld (Figure 3). mate description of the system. One of the problems
Based on Figure 3 and Newton's second law a dy- in the model is that some terms, such as friction forces,
namic model for the robot can be derived and written are diÆcult to obtain. Another relevant problem is
that the velocity terms are not directly measured by
the vision system. This can be circumvented by an
adequate parameterization of the model followed by
consistent parameter estimation. Thus, the physical
model can be rewritten as:
xk = xk 1 + c1 VX k 1 + [c2 u1 k d + c3 u2 k d ] cos(k 1 )
yk = yk 1 + c4 VY k 1 + [c5 u1 k d + c6 u2 k d ] sin(k 1 )
k = k 1 + c7 !k 1 + c8 u1 k d + c9 u2 k d ; (2)

where VX and VY are the projections of the linear


Figure 2: Mechanical structure. velocity V on the X and Y axis respectively. It is
important to note that the mass m, sampling time T 15

and friction forces Fai are grouped together in the ci 10

parameters.

input
u1
5

The velocity component in X , VX , at rst, can be


u2

roughly approximated by:


0
0 0.5 1 1.5 2 2.5

400

position (pixels)
xk 1 xk 2
300 x

VX k 1 =
y

: 200

T 100

Using this, the rst line of (2) can be represented as


0
0 0.5 1 1.5 2 2.5

an autoregressive model with exogenous inputs of the 3

form [7]:
2.8

θ (rad)
2.6

2.4

xk = a1 xk 1 + a2 xk 2 + [b1 u1 k d + b2 u2 k d ] cos(k 1) : 2.2


0 0.5 1 1.5 2 2.5
(3) t (s)

The same procedure can be applied to both y and


 . Hence, the robot model can be represented by the Figure 4: Step response of the system.
following equations:
xk = aX X
1 xk 1 + a2 xk 2 + 2. The system must be properly excited to allow
+ bX1 u1 k d + bX2 u2 k d cos(k 1 )
 parameter estimation;
yk = aY Y
1 yk 1 + a2 yk 2 + 3. Since model (4) was derived considering basic
+ bY1 u1 k d + bY2 u2 k d sin(k 1 )
 physical laws and assuming some approximations,
a number of real observed phenomena might not
k = a   
1 k 1 + a2 k 2 + b1 u1 k d + b2 u2 k d : be well represented by it, such as nonlinearities
(4) between servo inputs and applied forces. In or-
It is important to notice that in the rst two equa- der to reduce the e ect of unmodeled phenom-
tions of (4) nonlinear functions of one of the model ena, it was decided to excite the robot, whenever
outputs multiply other regressors. This results in weak possible, within a limited range around an oper-
nonlinearity in the sense that although there are non- ating point.
linear regressors, model (4) is still linear in the pa- Item 1 is diÆcult to obtain experimentally in the
rameters. Hence, strictly speaking, the rst two equa- setup used here, since both the robot's working area
tions of the model are NARX (nonlinear autoregres- and the vision system eld of view are limited. Hence,
sive with exogenous inputs) [8] whereas the last one is even if the robot does not leave the eld of view, it may
a linear ARX equation [7]. In fact, the nonlinearities occasionally collide against the side walls that delimit
of the rst two equations of (4), that are sometimes the working area, which would insert large disconti-
referred to as transcendental NARX equations, arise nuities in the measured data. One way to avoid this
as a consequence of the nonlinear static relationship problem is to use low amplitude signals, in order to
among the signals involved [9]. Fortunately, the model slow down the robot motion, and at the same time
in (4) is linear in the parameters and well known lin- decrease the probability of collisions. Nevertheless,
ear estimators can be used [7], as discussed in the next during the experiments a few low impact collisions
section. were observed. Since the number of points in the data
stream from normal robot trajectories is much larger
3.1 Parameter Estimation
to those due to collisions, the overall in uence of such
In order to estimate the parameters of the model (4) impacts is assumed to be negligible.
using a general least squares method, practice data Step response data were used to perform prelimi-
from the control inputs, u1 and u2 , and the system nary tests and to aid in the dead time (delay) estima-
output, x, y and  are necessary. The acquisition pro- tion. From the data shown in Figure 4, a dead time of
cess of this variables demand a few considerations: approximately 215ms was estimated. For parameter
estimation, however, Pseudo Random Binary Signals
1. Ideally, dynamical testing should be performed (PRBS) [7] were used as inputs in order to guarantee
in open loop to avoid correlation between input that the system was properly excited. A typical out-
signal and measurement noise, which otherwise come of such a test is shown in Figure 5. This type
could cause parameter bias; of signal is usually employed in system identi cation
10
1
5 Z
0.8

input
0 u1

−5 u 0.6
2

−10 0.4
0 5 10 15 20 25 30

300 0.2

Imag Axis
position (pixels)

x
200 0
y

-0.2
100

-0.4
0
0 5 10 15 20 25 30
-0.6
20

0 -0.8
θ (rad)

−20 -1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
−40 Real Axis

−60
0 5 10 15 20 25 30

Figure 6: Root locus of the original system.


t (s)

Figure 5: Part of data used in parameter estimation.


the controller. Therefore the controller needs to be
because it is easy to implement and the corresponding adjusted to slow time response since fast controllers
frequency spectrum is similar to the that of white noise can generate unstable closed loops. To better explain
for the range of frequencies of interest. Prompted by this idea, let the third sub-model in equation (5) be
remark 3, a rather small amplitude PRBS was used. written as:
Cross-correlation between inputs and outputs was gen- U1(z ) z 7 0:0065 U2(z ) z 7 ;
erally small and this was somewhat compensated by (z ) = (z 0:0063 +
1)(z 0:5640) (z 1)(z 0:5640)
the use of suÆciently large number of points.
The sampling time was initially chosen to be 27ms which is its Z transform form [11]. Notice that the
based on characteristics of the vision, control and com- capital letters represent the Z transform of the sig-
munication systems. A simple procedure suggested nals. In order to obtain a single transfer function
in [10] con rmed that the previous choice was ade- for the orientation of the robot, it can be considered
quate to estimate the parameters of the robot dynam- that  can be controlled by a unique signal u where
ical model. Then, based on this value and on the u1 = u=0:0063 and u2 = u=0:0065. Then,
chosen time delay, d = 8.
After 10 iterations of the extended least squares (z ) = G (z ) = Kz 7
algorithm on the data shown in Figure 5, the following U (z )
 (z 1)(z 0:5640) ; (6)
model was obtained: where K in this case is 2. Figure 6 shows the root-
xk = 1:6824 xk 1 0:6824 xk 2 + locus of the discrete transfer function (6). Notice that
+ [0:0441 u1 k 8 + 0:0403 u2 k 8 ] cos(k 1 ) there are 7 poles at z = 0, caused by the delay time.
yk = 1:7150 yk 1 0:7152 yk 2+
The e ect of those poles can be clearly seen when com-
pared to those in Figure 7 where the root-locus of the
+ [0:0336 u1 k 8 + 0:0318 u2 k 8 ] sin(k 1 ) same system is shown without the dead time. The
k = 1:5640 k 1 0:5640 k 2+ poles in Figure 6 causes a \curvature" in the root-locus
0:0063 u1 k 8 + 0:0065 u2 k 8 : (5) of the original poles z = 1 and z = 0:5640. As a con-
sequence, the gain margin of the orientation system,
that represent the interval where K can be adjusted
without causing instability, was reduced. This fact is
4 E ect of Dead Time clearly seen in the root-locus of the original poles into
the unit circle, that is the limit of stability, which is
In model (5), can be seen that there is a large time very small in presence of delay. In the rst gure the
delay or dead time of 8 sample times, between the gain in the stability limit is 0:07 and in the second is
inputs and the outputs of the system. This means 0:44. It is important to note that if the system con-
that an actual output was caused by a pair of input tains dead time, the gains have to be small to avoid
signals 8 sample times or 215 ms before. The main oscillations. In other words, a system with delay is
problem of this delay is that the e ects of the control more unstable than a similar without delay. Conse-
action and disturbances are not immediately seen by quently the controller has to be slower.
1
Z
0.8
200
0.6

0.4

Imag Axis 0.2 150

y (pixels)
-0.2
100
-0.4

-0.6

-0.8 50

-1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
Real Axis

0
0 50 100 150 200 250 300 350

Figure 7: Root locus of the system without dead-time.


x (pixels)

Figure 9: Predictions obtained using the complete


model (5). The continuous line shows the position
xsp, ysp,θsp x(k), y(k),θ(k) measured by the vision system and the dotted line
represents the 10-step-ahead predicted position.
u1(k), u2(k)
Controler Robot

x(k+d), y(k+d),θ(k+d)
6 Results
Predictor
To prove that the model (5) can be used as a predic-
tor, Figure 9 shows the 10-steps-ahead predictions of
Figure 8: Dead-time compensation based on dynamic the complete model for the robot describing a general
model. trajectory. In this gure, the robot and its working
area are drawn to scale in order to make the errors
easily visible and physically meaningful.
5 Prediction and Delay Compensation Figure 10 shows the control of the robot's orienta-
tion in two situations: with (M) an without (Æ) the
delay compensator. In both situations the orientation
Since dead time is the cause of poor loop perfor- was controlled by a standard digital PI (proportional
mance, there have been various attempts to cancel its + integral) lter. It is easy to note that without the
e ect in the control loop. The most famous technique compensation, the transient response of the system is
is the Smith Predictor [5]. The disadvantages of this poor causing the robot to spend a long time to in-
method are that it is restricted to a particular kind of tercept the set-point. In other way, the system with
system and the fact that the disturbance delay is not compensation is faster in spite of the presence of more
compensated. In opposite of the Smith Predictor, the oscillations. The main di erence is that in the second
propose of this article is to use the model previously case (with dead time compensation) the gains of the
identi ed to predict the position and orientation of controllers can be ne tuned.
the robot and use these prediction as a measurement Even though the results where obtained using a lin-
variables to the controller. This situation is showed ear lter to control the orientation of the robot, it can
in Figure 8. In this gure, the predictor is a recursive be shown that the delay compensation can be used
algorithm that uses the model (5). At the rst interac- in others types of controllers such as nonlinear and
tion, the one-step-prediction is calculated with the real multi-variable, which can also be used to control the
value measured by the vision and the inputs u1 and other variables of the robot as well.
u2 , d steps before. The next iteration calculates the
two-step-prediction based on the one-step-prediction
and the inputs d 1 steps before. The algorithm con- 7 Conclusions
tinues while the present inputs are not used. If d is
very large the prediction d-steps-ahead can be bad. The development of a dynamic model for a single
In this case, to allow the control, the algorithm can small robot which is observed by an external vision
calculate less steps of prediction. system and the use of this model to improve the time
response of the robot was described here. Based on
careful study of the robot's physical characteristics, 1.2

a model structure was chosen for which parameters


were estimated. The methodology is very simple and 1

provides a model that accurately represented the real 0.8

system. It can be easily extended to other types of


mobile robots for which input and output data can be

θ (rad)
0.6

either measured or estimated. 0.4

Next steps for this research will be rst to use the


current model in order to improve the control of multi- 0.2

ple small robots in the context of multiple robot coop- 0

eration. The nal goal will be to apply the technique


in other types of mobile robots, mainly ones that use −0.2
0 5 10 15

vision as a sensor, when the dead time is generally a


t (s)

problem. Figure 10: Control of robot's orientation. The marks


(M) represent the step response of the original system
and the (Æ) represent the step response of the system
Acknowledgments using a predictor based on model (5). In both cases
the controller is a linear PI lter.
The authors would like to acknowledge CNPq and
CAPES for their nancial support. [6] M.F.M. Campos, M.M. Ancio, M.A.S. Car-
valho, R.M. Dias, A. Hartmann, D.A.P. Nagem,
V.H.A. Oliveira, E.S. Oliveira, G.A.S. Pereira,
References A.F. Ribeiro, F.C. Sanches, and M.A. Silveira,
\MIneiROSOT { the development of a central-
[1] Y. Uny Cao, Alex S. Fukunaga, Andrew B. ized control set of soccer-playing micro-robots,"
Kahng, and Frank Meng, \Cooperative mobile in Proc. of FIRA Robot World Cup, Paris, July
robotics: Antecedents and directions," in Proc. 1998, pp. 57{62.
of IEEE/TSJ International Conference on In-
telligent Robots and Systems, Yokohama, Japan, [7] L. Ljung, System Identi cation { Theory for the
1995. User, Prentice Hall, New Jersey, 1987.

[2] Hiroaki Kitano, Minoru Asada, Yasuo Kuniyoshi, [8] I. J. Leontaritis and S. A. Billings, \Input-output
Itsuki Noda, Eiichi Osawa, and Hitoshi Matsub- parametric models for nonlinear systems part I:
ara, \RoboCup { a challenge problem for AI," AI deterministic nonlinear systems," Int. Journal of
Control, vol. 41, no. 2, pp. 303{328, 1985.
Magazine, vol. 18, no. 1, pp. 73{85, Spring 1997.
[9] L. A. Aguirre and C. R. F. Jacome, \Cluster anal-
[3] Ashraf Elnagar and Kamal Gupta, \Motion pre- ysis of NARMAX models for signal-dependent
diction of moving objects based on autoregressive systems," IEE Proc. Control Theory and Appli-
model," IEEE Trans. on Systems, Man, and Cy- cations, vol. 145, no. 4, pp. 409{414, 1998.
bernetics | Part A: Systems and Humans, vol.
28, no. 6, pp. 803{810, November 1998. [10] Luis Antonio Aguirre, \A nonlinear correlation
function for selecting the delay time in dynamical
[4] Julio E. Normey-Rico, J. Gomez Ortega, and reconstructions," Physics Letters A, vol. 203, pp.
I. Alcala, \Control predictivo para seguimiento de 88{94, 1995.
caminos en un robot del tipo \synchro-drive"," in
Proc. of XII Brazilian Automatic Control Confer- [11] Benjamin C. Kuo, Automatic Control Systems,
ence, Uberl^andia, MG, Brazil, September 1998, Prentice Hall, 7th edition, 1995.
pp. 611{616.
[5] Gregory K. McMillan,
Tuning and Control Loop
Performance: A Practitioner's Guide, Instru-
ment Society of America, 3th edition, 1994.

You might also like