Copyright @ IF AC Manoeuvring and Control of Marine Craft, Aalborg, Denmark, 2000
AN ADAPTIVE OPTIMAL AUTOPILOT USING THE RECURSIVE PREDICTION ERROR METHOD Due-Hung Nguyen and Kohei Ohtsu
Ship Maneuvering Laboratory, Tokyo University of MercantiLe Marine 2-1-6 Etchyujima, Koto-ku, Tokyo 135-8533, Japan, TeL & Fax: +81-3-5245-7389 EmaiL:
[email protected]@ipc.tosho-u.ac.jp
Abstract: This paper presents a new type of ship autopilot applying the linear quadratic gaussian (LQG) optimal control algorithm linked to the recursive prediction error (RPE) algorithm. The RPE method is used to online estimate of unknown parameters of a multivariate auto-regressive exogenous (MARX) model. Full-scale experiments for the optimal autopilot were quite successful and gave excellent results. It has been found that the RPE method is a good method to online identify the ship steering dynamics and the optimal autopilot has very good steering characteristics. Choices of the design parameters determine the steering characteristics of the optimal autopilot. Copyright © 2000IFAC
Keywords: auto-regressive models, identification algorithms, recursive estimation, ship control, LQG control and control applications.
form by Gavel and Azevedo and then applied to identification of ship hydrodynamics by Zhou and Blanke (1986), Zhou (1988) and Thou et al. (1989) in both linear and nonlinear versions. The RPE techniques were used for identification of both linear and non linear marine systems with good results. It was proved that estimated ship hydrodynamic coefficients had the good convergence according to Zhou et al. (1986, 1988, 1989). However, the RPE method might not have been applied to identify ship steering dynamics and combined to a control law to design a ship autopilot system. The authors have applied the RPE method to identify the ship steering dynamics and then used the identified parameters to design a ship autopilot system by linear quadratic optimal control theory.
1. INTRODUCTION
Designing a computer-based autopilot for ships is always a challenging problem in marine control engineering. A ship operating in seawater is strongly by unpredictable environmental influenced disturbances such as wind, waves and current Therefore, the ship must have a robust autopilot system with good maneuvering characteristics. To design a robust computer-based autopilot system that is well adaptive to changes of the environment a designer must construct a mathematical representation of ship steering dynamics in a suitable form. In addition, one of the challenging problems involved in designing a computer-based autopilot is to find a suitable estimation method for a chosen model (for more information, see Fossen (1994), Ohtsu et al. (1997) and Nguyen and Le (2000)).
The motivation for applying the RPE method is that when the authors designed a self-tuning pole assignment typed autopilot for ships by using the recursive least squares (RLS) method to estimate parameters of an ARX model of ship, there was a problem that one of estimated parameters tended to
Ljung (1979, 1987) and Ljung and Soderstrom (1983) first proposed the RPE method applied to estimate parameters of a linear dynamic system. Since then, the method has been developed into the non linear
185
polynomials of Z·I which is the backward shift operator z''y(t) = yet-i), and defined by A(Z·I) = 1 + a lz· 1 + a2z·2 + . .. + a.."Z·m (2) B(Z·I) = bo + blz·1 + ~Z·2 + . .. + bnz'" (3) The system (1) can be expressed in the matrix form. (4) yet) = 8
zero. Consequently, when calculating the control gain this caused the issue of dividing by zero or singularity of the inverse matrix. Then, the control was unstable. The authors circumvented the issue by pre-fixing one parameter or modifying the algorithm as stated by Nguyen et al. (1998, 2(00). The authors would like to find a more suitable identification method to design a robust control system for ships. The RPE method is a choice because it has the property of good convergence of estimates and can be applied to both linear and nonlinear dynamic systems as many other authors stated in their works.
where 8 = [ai' a 2, ... a..", bo, b l, ... ,bn ] is the matrix of unknown parameters and cp = [-yet-I), -y(t-2), .. . , yet-m), u(t-k), u(t-k-I), ... , u(t-k-n)f is the matrix of input and output measurements, and E(t) is the vector of errors. The RPEM is to minimize the following criterion function
The authors have got a goal to design an optimal route tracking controller with a multi variable ARX model for ships by combining the RPE method with the optimal control algorithm. As the first step on the way to realize such a route tracking system, the authors have done a primary feasibility study on this type of autopilot. An optimal autopilot for coursekeeping and -changing has been designed and its steering performance has been verified by full-scale experiments aboard a Japanese small training ship at sea. The main purposes of the paper are: - to formulate the optimal control algorithm, hereafter called "the RPE optimal control algorithm", by combination of the RPE technique with the linear quadratic optimal control algorithm - to perform a case study for estimation of ship steering dynamics (maneuverability indices) by applying the RPE method. - to actually test the performance of the RPE optimal autopilot by full-scale experiments.
(5) where A (t) is a positive definite matrix, and a Gauss-Newton search direction is chosen as f(t) = H- 1(t)\jI(t,8)A-Ict)E(t,8) (6) where H(t) is the Hessian, the second derivative of the criterion function with respect to 8, and \jI (t, 8) is the gradient of predicted output with respect to 8 . In short, the RPEM using the GaussNewton search direction to estimate the parameter 8 of (4) is summarized as follows (see Ljung 1979, Ljung et al. 1983, Thou and Blanke, 1986 and Thou et aI., 1988, 1989 for further details of the RPEM). 1) Step 1: Form the predicted error by using (7) E(t) = yet) - yet) 2) Step 2: Form the weighting matrix by A(t)=A(t-I)+a(t)[EET -A(t-I)] (8) 3) Step 3: Form the Hessian H(t) = H(t -1) + a(t)[\jI(t)A- 1(t)\jI T (t) - H(t -1)] (9)
The authors will report on the general feature of the RPE optimal autopilot for course-keeping and coursechanging. Sect.2 describes the RPE control algorithm including the RPE method (modeling of ship steering dynamics in a discrete-time form) and the LQG optimal control algorithm. Sect.3 gives a case study performed for the estimation of ship's maneuvering indices. Full-scale experiments aboard the training ship Shioji Maru and results are discussed in Sect.4. Sect.5 gives some conclusions and future works.
4) Step 4: Update the estimated parameters 8(t) = 8(t -1) + a(t)H-1(t)\jI(t)A-1(t)E(t)
(10)
5) Step 5: Update the predicted output ht + 1) = 8(t)cp(t + 1) (11) 6) Step 6: Calculate the gradient of predicted output by (12) 7) Step 7: To update data and loop back to the step 1.
2. CONTROL ALGORITHM It should be noted that a is the step size factor and given by Ljung and Soderstrom (1979, 1983, 1986), Zhou and Blanke (1986, 1988, 1989) as follows. 1 aCt) = (13) l+t
In this section, the control algorithm, including the RPE algorithm and LQG optimal control algorithm, is briefly described.
2.1 Recursive Prediction Error Algorithm 2.2 linear Quadratic Gaussian (LQG) Optimal Control Algorithm
In general, assuming that a vessel is a dynamic system with a linear discrete-time MARX model as follows. (1) A(Z·I)y(t) = B(z·l)u(t-k) +e(t) where k is time delay, yet) and u(t-k) are vectors of measured outputs and inputs, respectively, e(t) is zero mean white noise and A(Z·I) and B(Z·I) are
For designing an optimal autopilot, the system (1) is expressed by a state-space model below. x(t + 1) = F(8)x(t) + G(8)u(t) (14) yet) = C(8)x(t)
186
where x(t), u(t) are the state vector of measured outputs and the vector of measured inputs, and F( e ), G( e), C( e) are dynamic matrix, input matrix and output matrix, respectively, and determined by the estimated parameter matrix e.
(15)
-jV~
1=1
where Q and R are weighting matrices (symmetric and positive definite matrices). The state feedback control gain can be obtained from the solution of the following discrete-time Riccati equation (Astrom et al., 1984, Shoji, 1994 and Stengel. 1994). FTRF -S -FTRG[R +GTRFrIGTRF +Q = 0 (16)
100 ,~ " . . . ... --=ono! ( PI _ 0 S )
-~~r:=
(17)
o
1 SO
o !t,
1
200
Fig.1 Values of T and K estimated by simulation using the MMG model.
In practical aspect of designing and implementing such the autopilot. the main task is to choose proper weightings (Q and R) in the cost function . sampling time and initial parameters during implementing simulation and full-scale experiments. This task will be discussed in further details in the next section.
JI:
T""""' _ _ I"·O.S,
.1
J~~~ . -.1
3. ESTIMATION OF SIllP MANEUVERABILITY INDICES Identification of ship steering dynamics is an important task of the optimal control design process. In this section. the RPE method is applied to estimate the ship maneuverability indices of a simple model of ship. The first-order Nomoto model with the maneuverability indices T and K is of the form as follows (for more details. see Fossen (1994) and Iseki et al. (1998» . (19) Tr+r = Ko This equation can be expressed in the discrete-time model below.
T _ ;'" _ond
(to -
o .S )
Fig.2 Values of T and K estimated by the actual zigzag test data. Table I Statistical values ofT and K Value Mean Min Max Final
h T
r(t) = exp( --)r(t -1) + K[I- exp( --»)O(t -I) (20) This model is known as an ARX model. The equation (20) can be written in the following matrix form (21) r(t) =
Simulation T K 5.6569 0.1116 0.0398 -0.0457 0.1352 7.0217 5.9978 0.1112
Zigzag test data T K 4.8154 0.1600 -106.35 -1.6767 37.3631 4.3284 6.6420 0.1563
In the case of simulation. the ship forward speed was calculated as 11.55 knots (the average forward speed). In the case of using zigzag test data. the ship forward speed was measured as 10.65 knots (the average forward speed).
where
1 00
T ......... .-cond Ch -
Finally. the command rudder angle is calculated by u(t) = -Kx(t) (18)
h T
(25)
It should be noted that h is the sampling time (chosen as 0.5 seconds). Fig.1 shows the T. K estimated by computer simulation using the MMG model with random noise. Fig.2 shows values of T and K estimated by using actual zigzag test data.
M-I
The state feedback control gain is resulted as K = [R +GTSGrIGTSF
hK(I-exp(-h/T)]T
e=[exp(-h/T)
The linear quadratic optimal control law is to minimize the cost function (10)'
10 = ~)xT(t)Qx(t)+uT(t)Ru(t)l
O(t _I)]T and
O(t-I»)T and
e = [exp(-h/T) K(l-exp(-h/T»]T (22) If r(t) is not available. the first-order Nomoto model is of the form TW + \jI = Ko (23) The discrete-time model is of the form A\jI(t)=
Looking at Fig.! and Fig.2. it could be seen that estimated ship maneuverability indices (T and K) converge well in both cases. In the case of simulation. the indices have a slight fluctuation in convergence. In the case of using the actual zigzag test data. in the first 30 seconds. estimates of ship maneuverability indices may not be correct because of straightrunning data. In both cases. the estimated indices
187
converge at some values close to the theoretical values assumed by Mizuno et al. (1989) as T = 5.5, K = 0.15, and experimental values estimated by Iseki at al. (1998) as T = 7.537 and K = 0.133.
control systems for full-scale experiments. One of them uses REALoop as an I/O interface tool for controlling the ship. Fig.4 shows the real-time control system using the REALoop running in the MATLAB/Simulink environment.
4. FUlL-SCALE EXPERIMENTS AND RESULTS
4.2 Experiments and Results 4.1 Brief Description of the Training Ship
As above mentioned, the autopilot was used to keep and change the ship's course. The control program was coded in Simulink model and M-files. Figure 5 shows the block diagram of the RPE optimal autopilot system. Many experiments were carried out aboard the training ship Shioji Maru. In experiments, the MARX model (1) was simplified as an SISO ARX model with k = 1 and polynomials A and B as follows. (26) A = 1 + a1z· 1+ a2z.2 + a3z· 3 (m = 3) B = he (n = 0) (27) Therefore, e and q> in (4) become e = [a J
Table 2 Particular dimensions of the Shioji Maru Breath Disp. Propeller S. lbruster
46.00m 3.00m 425.00t 2.4t
1O.00m 717.52t Cpp 1.8t
The ship's autopilot designed based on the abovementioned algorithm was verified by computer simulation of which results are not reported in this paper and the full-scale experiments aboard the training ship Shioji Maru of TUMM at sea. Particular dimensions of the Shioji Maru are shown in Table 2. The full-scale experiments and results will be described in details below.
REA Loop
r-----------
I
a 3 boJ and
q>=[-y(t-I) -y(t-2) -y(t-3) u(t-l)Y(28) Then, using the estimated parameters by the RPE algorithm the equation (1) can be expressed by the following state space model. x(t + 1) = F(e)x(t) + G(e)u(t) (29) yet) = C(e)x(t) where x(t), u(t) are the state vector of deviation yet) between the set course and true course and rudder angle, respectively. F( e), G( e), C( e ) are defined as in (14), and take their values as follows .
Fig.3 Shioji Maru at sea
Length Draft GRT B. Thruster
a2
X(t)=[~~:=~~l·F(e)=[ ~ ~ yet-I)
G(e) =
PC
[~l
-a3
-a2
& C(e) = [0 0
11
(30)
After calculating the state feedback gain by solving the Riccati equation recursively, the command rudder angle is determined by (31) u(t) = -Kx(t)
I
Feedback
S&A
SHIP
Fig.4 Real-time control system using REALoop (S & A stands for Sensors and Actuators)
Fig.5 Block diagram of the optimal autopilot (eS c = command rudder, eSt = true rudder)
On board the training ship, there are three real-time
188
rate) was used (see Oda et ai., 1999 for further details about the effectiveness of DDVC system).
; ~l .
·~
As shown in Fig.6, the RPE optimal autopilot was used to keep and change ship 's course during experiment. The set course was 200 degree, then was changed to 210, then changed to 190 degree then to 200 degree. In this experiment, Q was chosen as 5.013' R as 1.0. Final values of the estimated parameters a" a2, a3 and bo are -1.5981, -2.4968, 2.6009 and -1.7848, respectively.
.~
J
' 1.1:
..,
~
.... r
)')
_,c
~,
":I'Cl"". l!1
t
r,.
~
..
E
-'
"1
.«
no
)11)
....... rllCO"'C'n ...
.~
,~
" -.
';J:
tn.FI
o
t"--'
~,.,I
~1
!lI..I;.'
.~)
~...
r... "leaIId.'. CI~
IC
i
t')J
O ~·
Looking at Fig.6, it can be seen that the RPE optimal autopilot has a good performance to keep and change the ship's course, state feedback control gains (k" k2 and k3) are stationary in each period and change when the set course is changed. Estimated parameters converge well at some values according to the change of the set course.
., 1
,
o
~
10((
l:'
NCZed.,.
,~,
:lOt>
~
T""~"'~ I ,
""
. . (t:!.t
I(lI';
Fig.6 Time series of ship responses (left) and state feedback gains (right)
Table 3 Statistical yalues of estimated parameters for the full-scale experiments
'()5~
,'~
;;
.1 .5 ~
/ - - - L - - - - - ' - -_ __
----:l
.2,1 _ _- ' - _ ' - ---'-----"'---'-_ _-'-----'----.J
,~t;;;;: r..-------j : ,~5 ' .'~ : - :----; '1 1
'r.-------->:
',:~~ : o
50
100
150
200
250
300
350
::I
400
450
500
Time in second (h.z: 0.5)
Fig.7 Time series of estimated parameters Before implementing full-scale experiments aboard the actual ship, the authors investigated the feature of the RPE optimal control and chose the design ~arameters such as weightings (Q & R), sampling tl.me, and initialization of parameters and so on by slmulauon. When carrying out full-scale experiments, the design parameters were chosen again based on the real conditions of the sea. As a result, experiments of the designed autopilot for course-keeping and coursechanging were successful.
Para. a, a2 a3
bo
Mean -1.3995 -3.1851 2.4617 -3.4654
Max -0.5726 -2.4756 4.9883 -1.7083
Min -1.6020 -4.2365 1.5026 -7.6766
Final -1.5981 -2.4968 2.6009 -1.7848
During the experiments an attempt was made to choose the best optimal weightings to optimize the RPE optimal autopilot as desired. However, the overshoot in every change of ship's course was still a little bit larger than expected. The overshoot was about 2.5-3.0 degrees. Unfortunately, during preparation of this paper, there was no more chance to carry out full-experiments for the RPE optimal autopilot with a multivariate ARX model aboard the Shioji Maru.
4. CONCLUSIONS AND FUTURE WORKS It has been found that the RPE method has been a good method to online estimate parameters of an assumed dynamic system. The estimated parameters converged well. By simulation and full-scale experiments, it has also been found that the designed autopilot has got very good performance to keep and change the ship's course as desired. Choices of the design parameters such as weighting matrices, sampling time and initial settings of parameters are very important and detennine the steering characteristics of the autopilot.
In this paper, a representative experiment with the RPE optimal autopilot for course-changing maneuvering is described. Fig.6 shows the time series of ship's responses (left) and state feedback gains (right). Fig.7 shows the estimated parameters.
Full-experiment experiments for the RPE optimal autopilot with a multivariate ARX model should be carried out. Full-scale experiments for comparison of pole assignment typed autopilot using the RLS algorithm with the RPE optimal autopilot should be implemented. The RPE optimal autopilot can be
In this experiment, the optimal autopilot was carried out when the DDVC (Direct Drive Volume Control) system with fast slew rate (rudder angle deflection
189
developed into a trajectory-tracking control system for ships in the future work.
5. ACKNOWLEDGEMENTS The sincere acknowledgement would be expressed to Associate Professor I. Hatta, the captain, to Mr. N. Hirose, the chief engineer and to all crew members of the training ship Shio}i Maru of Tokyo University of Mercantile Marine for their enthusiastic helpings in full-scale experiments. The deepest gratitude should be expressed to the Monbusho (Ministry of Education, Science, Culture and Sports, Japanese Government) for the scholarship support.
REFERENCES Astrom, KJ. and c.a Kallstrom (1976). Identification of Ship Steering Dynamics, Automatica, 12, pp.9-22, Pergamon Press, DK. Astrom, KJ. and B. Wittenmark (1984). Computer
Controlled
Systems:
Theory
and
Design,
Ships, The Journal of Japan Institute of Navigation, 99, 235-245 , Japan. Nguyen, D.H., N. Mizuno and K. Ohtsu (2000). A Modified Pole Assignment Typed Autopilot for Ships, The Journal of Japan Institute of Navigation, 102,327-337, Japan. Nguyen, D.H. and M.D . Le (2000), A Challenge to Advanced Autopilot Systems for Ships. Proc. of
the 4th Vietnam Conference on Automation, 226-232, Hanoi, Vietnam. Oda, H, T. Hyodo, K. Ohtsu, M. Ito, N. Hirose, 1.S. Park and H. Sato H. (1999). Designing Advanced Rudder Roll Stabilization System High Power with Small Size Hydraulic System and Adaptive Control, 12th SCSS'99, Hague, The Netherlands. Ohtsu, K, M. Horigome and a Kitagawa (1979). A New Ship's Autopilot Design through a Stochastic Model, Automatica, 15, 255-268, Pergamon, UK. Ohtsu, K., H. Oda and T. Iida (1997). Challenge to Advanced Optimal Ocean Navigation System (in Japanese), the 13th Dynamic Symposium: Ship Motion and Its Control at Seas, 2, 45-91,
the Society of Naval Architecture of Japan,
Prentice-Hall Inc., New Jersey, USA. Astrom, K.J. and B. Wittenmark (1989). Adaptive Control, Addison-Wesley, USA. Fossen, T.!. (1994). Guidance and Control of Ocean Vehicles, John Wiley and Sons Ltd., UK. Holzhuter, T. (1990). A High Precision Track Controller for Ships, IFAC 11th Triennial World Congress, 425-430, Talinn, Estonia, Russia. Iida, T. (1990). On an Adaptive Dynamic Positioning System for Vessels (in Japanese), The Journal of
Tokyo, Japan. Shoji, K. (1994). On Adaptive Optimal Regulator (in Japanese), unpublished lab. report. Stengel, R.E (1994), Optimal Control and Estimation, Dover Publications Inc., NY, USA. Wellstead, P.E. and M.B. Zarrop (1991). Self-tuning Systems: Control and Signal Processing, John Wiley and Sons Ltd., UK. Zhou, w.w. (1988). Linear and Nonlinear Recursive Prediction Error Methods in State-Space Models,
Western Japan Society of Naval Architects, 213,
the 8th IFAC Symposium on Identification and Systems Parameter Estimation. 1092-1099,
89-96, Japan. Iseki, T. and K Ohtsu (1998), On-line Identification of Ship Maneuvarability Indices by Using llR Filters (in Japanese), Journal of the Society of Naval Architects of Japan, 184, 167-173. Kato, K (1996). An Introduction to Optimal Control: Regulator and Kalman Filter (in Japanese), the 5th Edition, The University of Tokyo, Japan. Kallstrom, c.a, K.J. Astrom, N.E. Thorell, 1. Eriksson and L. Sten (1979). Adaptive Autopilots for Tankers, Automatica, 15. 241-254, Pergamon Press, UK. Ljung, L. (1979). Asymptotic Behavior of the Extended Kalman Filter as a Parameter IEEE Estimator for Linear Systems, Transactions on AC, 24(1), 36-50, DK. Ljung, L. and T. Soderstrom (1983). Theory and Practice of Recursive Identification , MIT Press, MA, USA. Ljung, L. (1987). System Identification: Theory for the User, Prentice-Hall, New Jersey, USA. Mizuno, H., T. Okawa, I. Komine, N. Mizuno and K. Ohtsu (1989). Route Tracking System by Adaptive Autopilot, Proc. of CAMS '89, 77-82, Copenhagen, Denmark. Nguyen, D.H., 1.S. Park and K. Ohtsu (1998). Designs of Self-tuning Control Systems for
Beijing, China. Zhou, w.w. and M. Blanke (1986). Identification of a Class of Nonlinear State Space Model Using the RPE Techniques, IEEE Transactions on AC, 34(3),312-316, UK. Zhou, w.w., D.B. Cherchas, S. Calisal and Rohling (1989). Identification of Rudder- Yaw and -Roll Steering Model by Using RPE Techniques, 93-101.
a
190