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

Pmceedqs 01 the 2w2 IEEE Intematicd

confererreon ccnbol Appliims


September i&M, Z W 2 0 Glasgow, SmUand. U.K.

Nonlinear Receding Horizon Control of an RC Hovercraft


Hiroaki Seguchi and Toshiyuki Ohtsuka
Department of Computer-Controlled Mechanical Systems
Graduate School of Engineering, Osaka University
2-1 Yamadaoka, Suita, Osaka 5650871, Japan
ohtsuka@mech.eng.osaka-u.ac.jp

Abstract

This paper describes position control of an RC hov-


ercraft. The hovercraft has two b e d thrusters, and
the thrusters generate thrusts of only three discrete
values, that is, forward, backward and zero. Non-
linear receding horizon control is applied to position
control of the hovercraft with the discretevalued in-
puts approximated by constrained continuous-valued
inputs. Although the nonlinear receding horizon con-
trol requires real-time constrained optimization, a fast
algorithm is successfully implemented for.the hardware
experiment.

Figure 1: RC hovercraft,
1 Introduction

Position control of an underactuated vehicle is a diffi-


cult problem in general. Especially, if there is no fric- The hovercraft has two thrusters that are k e d on the
tion in the environment, an underactuated vehicle often body and generate thrusts of only three discrete values.
drifts in the direction without actuation. For example, In comparison with a previous study [3] in the litera-
it is di5cult to control positions of such vehicles as a ture, the present hovercraft has less degrees of freedom
satellite, a hovercraft, and an airship unless sufficient for atuation and is more difficult to control. A nonlin-
number of thrusters or torquers are available. Since ear receding horizon control problem is formulated for
a large attitude motion leads to inherent nonlinear dy- the hovercraft with a quadratic performance index and
namics, a nonlinear control method is essential for their constraints on the thrusts. The discrete-valued thrusts
position control. are approximated with continnowvalued thrusts that
are nearly bang-bang. An algorithm called C/GNRES
Nonlinear receding horizon control (model predictive 141 is employed to solve the problem in real time with
control) is one of potential approaches to feedback con- the sampling period of 1/120 [sec],which is specified by
trol of nonlinear systems and has been successfully a p the frame rate of the CCD camera used in the experi-
plied to chemical processes in recent years (see, e.g., ment. The results of simulation and experiment show
11, 21). However, it is still a challenging problem to a p that nonlinear receding horizon control is implemented
ply nonlinear receding horizon control to such systems successfully in real time.
with fast dynamics as mechanical systems, since a non-
linear optimal control problem over a finite future has
to be solved at eaeh time in nonlinear receding horizon
control. Therefore, efficient and reliable numerical al- 2 Experimental Setup
gorithms are necessary for nonlinear receding horizon
control. We employ an RC hovercraft (Taiyo Toy Ltd., Typhoon
T-3, 356 [mm] x 212 [mm] x 142 [nun])shown in Fig.
The main objective of this paper is t o demonstrate a 1 on a planar ground as the system to be controlled.
real-time algorithm of nonlinear receding horizon con- The posit.ion of the center of mass and attitude angle of
trol for an underactuated vehicle in a hardware experi- the hovercraft are denoted by (+, y) and 8, respectively
ment. We employ an RC hovercraft for the experiment. (Fig. 2). The thrusts generated by the thrusters are

0-78W-7385-31Mlt17.W 02002 IEEE 1076


9 effect of no& in the finite difference approximation.
m A computer (CPU AMD Athlon, 900 MHa) processes
the measured data, computes the control inputs with a
real-time algorithm for nonlinear receding horizon con-
trol and sends the command signal to the hovercraft
through a D/A converter and the transmitter (Fig. 3).

3 'Nonlinear Receding Horizon Control

In nonlinear receding horizon control, control perfor-


mance is optimized at each time over a finite future.
Namely, a performance index with a moving horizon
is minimbed, which requires real-time optimization.
Moreover, since the control input takes only three dis.
Figure 2 Model of the hovercraft. Crete values in the experiment, we approximate the
discretevalued input with a constrained continuous
valued input. That is, the following inequality con-
straints are imposed.

ER
I Uh
ub 6
5 U1 5 Ua
212 6 u o '
(4)

where U, = 0.342 [NI and U* = -0.121 [NI. The in-


equality constraints can he converted into equality con-
straints by introducing dummy inputs VI and 212 as fol-
lows.

Figure 3 Experimental setup.


C(2,U) :=
[
(U, - U,")2
(U2 - Ua.)2
+
+
U12
V2Z
-
- (U. - ILau)t
U@")

=o,
I (5)
where uav = (ua+ub)/2, and U is the augmented input
vector deiined by U = [ U ~ , U Z , U ~ ,The
V ~ equality
]~.
denoted by u1 and u2, the mass and moment of inertia constraints can also depend on the state in general.
of the hovercraft are denoted by M and I, respectively.
The equations of motion are given by Then, the performance index J of nonlinear receding
horizon control is chosen as
MX = UI + uz
COS@ COS@, (1) t+T
My = U, sin8 + uzsin8, (2) J = rp(r(t + T))+Jt L(s(t'), u(t'))dt',
I8 = ulr - u g . (3) 1
io(z) = 2(" - =t)TS,(x -If),
The state equation is obtained from the equations of 1
motion with the state vector x = [x,y,@?x,y, @IT, The L(I, U) SI(= z +U ~ R U
- z ~ ) ~ Q-(sf)
thrusters of the hovercraft generate thrust of only three - TlVl - T2V21,
discrete values, that is, 0.342 [NI, -0.121 [NI and zero
because the transmitter sends only an onfoffcommand. where T is the horizon length, zf the objective state,
Other parameters are: I = 0.0125 [kgm'], A4 = 0.894 Sf, Q, R,rl and r2 are weights. The penalties on VI
[kg], and r = 0.0485 [m]. and z12 are added to avoid indefiniteness in the signs
of the dummy inputs in Eq. (5). If all weights on the
Two electric bulbs are put on the hovercraft, and their inputs are zero, the minimum principle implies that
positions are measured by an optical position sensor both continuous-valued inputs and discretevalued in-
(OKK Inc., Video Tracker G280) to calculate the PO puts lead to an identical optimal control of bang-bang
sition (s,y)of the center of mass aqd the attitude type, although zero weights on inputs are not advisable
angle 8 of t.he hovercraft. The translational velocity from the viewpoint of numerical computation. There
and angular velocity are obtained with finite difference fore, if the weights on the inputs are sufliciently small,
approximation from the position and attitude angle. the optimal control with the continuous-valued inputs
Low-pass filters are &o implemented to reduce the is nearly bang-bang and is expected to approximate

1077
the optimal control with the discretevalued inputs of t. The actual control input to the system is given by
tua,U), 0). Once the continuous-valued inputs are cal- u(t)= ugt).
culated, their discretization gives the actual discrete-
valud inputs. Let N denote the Hamiltonian defined by

Given the actual state z(t) as the initial state for the H(a,X,u,p) :=L(z,U)+XTf(z,U)+~=c(s,U),
optimal control problem, the optimal control is deter-
where X denotes the costate, and p denotes the La-
+
mined over the horizon [t,t T ] so as t.o m i n i i e the
grange multiplier associated with the equality con-
performance index, and only its initial value at time t
straint. The first-order necessary conditions for the
is used as the actual input to the system. Since the
optimal control depends on the initial state s(t),this
sequences of optimal control {U; (t)}E;', multiplier
{ p f ( t ) ) z i ' and Costate { A l ( t ) } c oare obtained by the
strategy results in a state feedback control law. The
calculus of variation as
optimal trajectory starting from z(t) is not necessarily
identical to the actual trajectory of the closed-loop s y s = 0,
NU(zf(t),~~'(t),Uf(t),pf(t)) (10)
tem over [t,t +TI,since the optimal control is updated
at each time. = X+lN
+ H;(zf(t), X:+l(t), (11)
a f ( t ) P.f(t))AT,
,
Closed-loop stability of nonlinear receding horizon con-
trol has been studied extensively in recent years (see, U t ) = rp:(zi(t)). (12)
e.g., [SI).However, existing stability conditions are still The sequences of the optimal control {uf(t)}E;l and
conservative, and a closed-loop system is often stable the multiplier {pf(t)}&' have to satisfy Eqs. (6) - (8),
without satisfyiug them. It is almost hopeless to guar- (10) - ( E ) , which defines a two-point boundary-value
antee the stability analytically in the present problem problem (TPBVP) for the discretized optimal control
because the system is highly nonlinear and only the problem. It should be noted that the TPBVP for the
discrete-valued control inputs are available. S i c e the discretized problem is identical to a finite difference a p
linearized system is not stabilizable, we cannot guar- proximation of the TPBVP for the original continuous-
antee even local stability near the objective state. Al- time problem. Therefore, the solution of the discretized
though analytic approaches are not available, the real- problem converges to the solution of the continuous-
time optimization is expected to result in the best p o s time problem as N -+ m under mild conditions 161.
sible control performance with respect to the given per- Other high order discretization schemes can also be
formance index. employed at the expense of simplicity.

We define a vector of the inputs and multipliers as


4 Real-Time Algorithm
U ( t ):= [UGT(t)j g ( t )U ; = @ ) p;T(t)
Real-time algorithm is also a major issue in n o d i - . . . ~ f y T _ ~~( t $) - ~ ( tE )R"
],~
ear receding horizon control. An algorithm called where m := m,, +
m. with m, and m, denoting the
CIGhlRES [SIis employed in this experiment to solve
the optimal control problem at each time. We divide
the horizon into N steps and discretize the optimal
control problem with the forward difference as follows:
projection Po : R" R"- as -
dimensions of U and p, respectively. We also define a

Po(U) :=U;.
4 + i ( t ) = zf(t) + f(lf(t),Uf(t))Ar, (6) For a given U ( t ) and z ( t ) ,{ s f ( t ) } g oare calculated
43)= d t ) , (7) recursively by Eqs. (6) and (7), and then, { ~ ( t ) ) ~ o
are also calculated recursively from i = N to i = 0 by
C ( z f ( t ) , u f ( t=
) ) 0, (8)
Eqs. (11) and (12). Since eT(t) and Af(t) are deter-
mined b y z ( t ) and U ( t )through Eqs. (6), (7),(11) and
(12), Eqs. (8) and (10) can be regarded as an equation
defined as
where f(+,U) denotes the vector field ofthe state equ%
tion, AT := T I N , sf(t) corresponds to the discrete
time trajectory starting from s ( t ) at i = 0. Since t,he
horizon T depends on time t in general, so does AT.
Note that only the problem over the horizon is d i s
cretized, and the dependence on t remains continuous
:= I I
at this stage of problem formulation. Given the ini-
tial state of the discretized problem, z;(t)= z(t),the
control sequence {uf(t)}&' is optimized at each time =O. (13)

1078
The equation also depends on time t through AT in
general. If the equation is solved with respect to V ( t )
for the measured ~ ( tat) each timet, then the control
input u(t) = Po(U(t))is determined.

Since such an iterative method as Newton method is


n u m e r i d y expensive to solve Eq. (13) in real time,
we employ another equivalent condition to trace the
time-dependent solution as follows.

i.(U(t),I(t)>t)=
F(U(O),I(O),O) = 0,
- c ~ ( w ) > 4 ~ ) , tc)>, 0,
where the right-hand side in the first equation is added
5$11_1 .
..................................................

~,)(
.......................................................
7.2 *I
4
~

m
r". ,
.
I
$6 h
to stabilize F = 0. If the Jacobian Fu is nonsingular,
(a) S i d a t i o n with (b) Experiment with
we obtain a Merentid equation of U ( t ) as
continuowvalued inputs, discrete-valued inputs.
U = F;'(-/F - FIB - F'). (14) Figure 4: Time histories of onedimensional motion.
Then, U ( t ) can be updated without any successive
approximation by integrating Eq. (14) in real time,
which is a kind of the continuation method [7]. A sim-
file by processing an input file given by a user. The
ple method for initializing U ( 0 ) is to choose a t i m e
input file defines the state equation, performance in-
dependent horizon T ( t )as a smooth function such that
dex, simulation conditions, and so on. The experiment
T ( 0 ) = 0 and T ( t ) -* Tf (t -t CO), e.g., T ( t ) =
program can also be developed easily by modifying the
Tf(l - e-"') (Tf,a > 0). Then, the equation on U(0) generated simulation program.
reduces to an equation on only ui(0) and &(O), which
can be solved more easily than the original equation. First, results of the experiment and simulation
are compared for simple one-dimensional motion
Since Eq. (14) still involves numerically expensive o p
to evaluate the approximate solution method with
erations to solve the linear equation arsociated with
the constrained continuousvalued inputs. Figure
F;', we also employ the GMRES (Generalized Mini-
4 compares time histories of the Simulation with
mum RESidual) [8]with forward difference approxima-
the continuousvalued inputs and the experiment
tion for products of Jacobians and vectors. GMRES is
with the discretevalued inputs. The parameters
a kind of Krylov subspace methods for linear equations.
in the performance index are chosen as: T =
Error analysis of the entire continuation/GMR.ES al- Tf(l - e-*'), Tf = 0.5 [sec], a = 1, Sf =
gorithm (41 shows that the error lIFl1 is bounded under diag[8.85,0,0,1.85,0,0], Q = diag[8.85,0,0,1.85,0,0],
some assumptions if the parameter is chosen so that R = diag[0.01,0.01,0.01,0.01], T I = T Z = 0.1, and
0 < CAt 5 ?At with 1 5 <At < 2, where At denotes zf = 0. The inltialstate is IO = [-0.667,0,0,0, 0,OjT.
the time step of numerical integration of Eq. (14) and It is confirmed from the figure that the control input in
corresponds to the sampling period in the hardware the simulation is nearly bang-bang, as is expected..The
experiment. responses of the states are similar between the simula-
tion and experiment, although chattering is observed
in the control input of the experiment to keep the hov-
ercraft near the objective state.
5 Experimental Results
Next, results of the experiment and simulation for
The real-time algorithm in the previous section is coded two-dimensional motion are compared in Figs. 5
in C and is implemented in the computer with the sam- and 6. The simulation is also carried out with
pling period of 1/120 [sec], which is specified by the the discretevalued inputs to predict the experi-
frame rate of the CCD camera. Numerical simulation mental result. The parameters in the performance
is also carried out, and its results are compared with index are chosen BS: T = Tf(1 - e-='), Tf = 1
the experimental results. The simulation program in C [sec], a = 1, Sf = diag[5,15,0.05,1,1,0.01],
is generated by an automatic code generation system Q = diag[5,10,0.1,1,1,0.01], R =
called AutoGenU [9]. AutoGenU is a Mathematica p r e diag[O.Ol,0.01,0.001,0.001], r 1 = rz = 0.1,
gram to generate a simulation program for nonlinear r e and z, = 0. The initial state is o0 =
ceding horizon control utilizing Mathematica packages [-0.38,0.30,0.052,0.0092,-0.0053,0.0021] T.
Format [lo], Optimize 1111 and a Mathematica com-
mand Splice [14. AutoGenU generates a C source Figure 5 shows that the simulation result predicts

1079
D., 1 Dll , 1

. . . ...; .............. .:

(a) Trajectory of simulation.

0.4.. ....... ~ . . . . . . . . . . . $ . . . . . . . . . .:.

-E
I

Figure 5: Time histories of the hovercraft; solid lines: >


experiment. dashed lines: simulation.

roughly the experimental result. Although the ohjec- L


-04 4.2 0
tive state is not asymptotically stable because the s y s x [ml
tem is nonholonomic, the state stays near the Objective (h) Trajectory of experiment
state. Therefore, it is concluded that nonlinear reced-
ing horizon control is successhlly implemented in real Figure 6 Trajectories of the hovercraft until 5.8 [sec];
time and achieves a sort of practical stability. (a) simulation, (h) experiment. The hover-
craft is drawn every 0.92 [sec].
Figure 6 shows trajectories of the hovercraft until 5.8
[sec] in the simulation and experiment, respectively.
The hovercraft is drawn every 0.92 [sec] to indicate its
attitude angle, and thrusts of the two thrusters are ex- fectiveness of the control method,
pressed as straight lines to indicate the magnitude and
direction of the thrusts. The hovercraft is successfully
driven toward the origin without thrusts in the lateral Acknowledgements
direction.
This research is partially supported by the Research
Fund of the Kurata Memorial Science and Technol-
6 Conclusions ogy Promotion Foundation and Grants for Receivers
of Doctorates by the Foundation for C&C Promotion.
Nonlinear receding horizon control has been applied to
an RC hovercraft with only two k e d thrusters. The
system dynamics is highly nonlinear, and the thrusters References
generate thrusts of only three discrete values. A real- [l] E. S. Meadows and J. B. Rawlings, “Model pre-
time algorithm called C/GMRES has successfully been dictive control,” in Nonlinear Process Control, M. A.
implemented for the hardware experiment. The con- Henson and D.E. Sehorg, Eds.,chapter 5, pp. 233-310.
strained optimal control problem is solved in real time Prentice Hall, NJ, 1997.
with the sampling period of 1/120 [sec] in spite of noises
and m o d e l e d dynamics in the real world. Although [2] S. Joe Qin and T. A. Badgwell, “An overview
asymptotic stability of the objective state is not guar- of nonlinear model predictive control applications,” in
anteed because the system is nonholonomic, nonlinear Nonlinear Model Predictive Control, F. Allgower and
receding horizon control drives the state sufficiently A. Zheng, Eds., pp. 369-392. Birkhawr, 2000.
close to the objective state, which shows practical ef- 131 R. Hayashi, K. Osuka, and T. Ono, “Trajectory

1080
control experiments of an air cushion vehicle,” Jour-
nal of the Japan Society for Aemnautical and Space
Sciences, vol. 44, no. 514, pp. 6 2 M 3 6 , 1996, (in
Japanese).
141 T, Ohtsuka, “Contiuuation/GMRES method h r
fast algorithm of nonlinear receding horizon control,”
in Pmceedings of the 39th IEEE Conference on Deci-
sion and Control, Sydney, Australia, Dec. ZOOO, pp.
766-771.
[SI D. Q . Mayne, J. B. Rawlings, C. V. Rao, and
P. 0. M. S C O W , ”Constrainedmodel predictive con-
t r o l Stabnity and optimality,” Automatica, vol. 36,
no. 6, pp. 784-814, 2000.
161 U. M. Ascher, R. M. M. Mattheji, and R. D.Rus
. - sel, Numerical.Solution of Boundary Value Problems
for Ordinary Difleerential Equations, SIAM, Philadel-
phia, PA, 1995.
[7] S. L. Richter and R. A. DeCarlo, “Continua-
tion methods: Theory and applications,” IEEE l h w -
actions on Automatic Control, vol. AC28, no. 6, pp.
660-665, 1983.
IS] C. T. Kelley, Iterative Methods for Linenr and
Nonlineor Equations, vol. 16 of f i n t i e r s in Applied
Mathematics, SIAM, Philadelphia, PA, 1995.
[9] T. Ohtsuka, http://www-newton.mech. eng.
Osaka-u.ac.jp/-ohtsuka/code/index.htm, 20M).
\IO) M. Soboniou, ftp://ftp.cent.r.osaka-u.ac.jp/
MathSource/Enhancements/Interfacing/Other/O%OS-
%54/, 1994.
1111 M. Sofroniou, ftp://ftp.center.osaka-u.ac.jp/
MathSource/Enhancements/Language/O%O6-592/,
1994.
1121 S. Wolfram, The Mathematic0 Book, Wolfram
Media / CambridgeUniversity Press, 3rd edition, 1996.

1081

You might also like