A New Nonlinear Adaptive Autopilot for Ships

A New Nonlinear Adaptive Autopilot for Ships

A NEW NONLINEAR ADAPTIVE AUTOPILOT FOR SHIPS Jorma Selkainaho Helsinki University of Technology Automation Laboratory Otakaari 5 A SF-02150 Espoo, Fin...

1MB Sizes 16 Downloads 140 Views

A NEW NONLINEAR ADAPTIVE AUTOPILOT FOR SHIPS Jorma Selkainaho Helsinki University of Technology Automation Laboratory Otakaari 5 A SF-02150 Espoo, Finland Abstract An autopilot design project is presented. The design is based on a nonlinear ship model. This nonlinear ship model explains the results obtained from the standard ship manoeuvering tests. Controller parameters are computed as a function of the linearized ship model parameters. The autopilot adapts to changing dynamics by using gain scheduling. A nonlinear modified second order filter is used to filter the wave induced movements from the measurements. The autopilot is tested in a realistic simulation environment. Introduction The first autopilots for ships were based on constant controller parameters. Since the dynamics of the ship varies significantly a controller retuning is required when operating conditions change. To avoid manual retuning a number of different autopilots have emerged on the market. Some of them still have some tuning knobs. There are also some real adaptive autopilots. A ship autopilot development project started in 1990 at the Automation laboratory of Helsinki University of Technology. The goal of the project was to develop a product for the Electronic division of the Hollming shipyard. The Hollming shipyard has gained some expertise when making dynamic positioning systems for ships. It was assumed that some advantages could be gained by using similar technology in autopilot design. Adaptive autopilots have been presented based on recursive identification of ARMAX models. This type of adaptivity is not very robust. For example when the waves are coming from the aft of the ship the rudder flow decreases significantly causing decreased controllability. In this project it was decided to use gain scheduling type adaptive methods together with a sophisticated nonlinear ship models. The advantage in gain scheduling is fast response for changing operating conditions. Also, gain scheduling is more robust than recursive adaptive estimation based on unrealistic linear ship models. The requirement to use gain scheduling control is that there should be a measurable variable which explains the changing system gain and time constants. Astrom and Wittenmark (1989) have found that the rudder to the course rate system gain is strongly dependent on the ship speed. Ship Models In controller design a ship model which explains the dynamics is needed. The ship model definition is started from a coordinate system for a ship which is presented in Fig. 1. The following well known Nomoto model has been a long time a basis for the control synthesis:

299

(1)

x3=a X3-b u

where a and b are parameters, x3 is the turning rate of the ship, and u is the rudder angle. The value of the parameter a is positive for unstable ships. The unstable Nomoto model assumes that the ship course rate grows exponentially with the rudder deflection equal to zero. In practice, an unstable ship reaches quite soon a constant course rate when zero rudder deflection is applied (Astrom and Kallstrom, 1976). no rth

cas t

Fig. 1. The coordinates of the ship models. A better model for control synthesis is presented by Astrom and Wittenmark (1989) as follows:

~2=-(a 11!l)x 1x2-a 12x 1x3+(b l/l)x 12 u

(2)

x3=-(a21/l 2 )x 1x2-(a221l)x 1x3-(b2ll 2 )x 12 u

(3) (4)

where alL a 12, a2 L a22, b L b2 are model parameters, 1 is the ship length and x4 is the ship course. When a zero rudder deflection u=o is applied there exist no steady state solution for the above equations unless the determinant of the matrix

is equal to zero. In this special case there exists an infinite number of pairs (x2,x3) which are the steady state solution to Equations (2)-(3) for u=O. By using the parameter values in Table 1 (Astrom and Wittenmark, 1989) it can be concluded that the determinants differ from zero. For stable ships the determinant is positive and for unstable ships it is · negative. The fact that an unstable ship has two steady state solutions (x20,-x30) and (-x20,x30) for u=O is crucial for control synthesis because it explains the instability in course keeping.

300

Table 1 Model parameters for different ships Minesweeper Length(m) 55 Ship

Cargo Full 161

Tanker Ballast 350

all a12 a21 a22

-0.86 -0.48 -5.2 -2.4

-0.77 -0.34 -3.39 -1.63

-0.45 -0.43 -4.1 -0.81

-0.43 -0.45 -1.98 -1.15

bl b2

0.18 -1.4

0.17 -1.63

0.10 -0.81

0.14 -1.15

In the following a non linear ship model used in dynamic positioning of ships is analyzed: (5)

(6) (7) (8)

where dl, d2 and d3 are the parameters for hydrodynamic drag, ml, m2, m3 and m4 are the mass and inertial parameters including added masses and xO is the ship initial speed at the zero course rate. The rudder coefficients are functions of the rudder and propeller dimensions (Blanke, 1981) as follows:

o

bl =ro«1-wO)2+6.4d 1/« 1-t)pjr hD))A r Pi/(1 +2c/h))/m2

(9) (l0)

where ro=1025 is the water density, Pi=3.14159, c is the rudder length, h is the rudder height, D is the propeller diameter, Ar is the movable rudder area and Ir is the rudder distance from the centre of gravity of the ship. The wake coefficient was set equal to wO=O.l5 and the thrust deduction factor was set equal to t=0.15. This nonlinear model has three steady state solutions: (xO,O,O), (x 1O,x20,-x30) and (x 1O,-x20,x30) Model analysis is continued by using data from a 3000 ton research ship constructed by Hollming. The values of the model parameters are computed by using the following approximate equations:

301

m1=1.2

mo

m2=1.6 mo m3=0.125 12 mo m4=0.025 mo dl=6 Ws d2=436 d r ~ d3=26 d r 14 where the displacement is mo=3000 000, the ship length is 1=74.9, the rudder distance from centre of gravity is lr=35, the breath of the ship is br=15.5, the draught is dr =4.6 and the wetted surface is ws=13oo. By using the above parameter values the following steady state solutions for the zero rudder deflection are obtained: XlO=0.876 xO

(11)

Ix20 I=0.228 x10

(12)

Ix30 I=0.00214 xlO

(13)

With the initial speed of xO=5.5 knots (2.83 m/s) the steady state turning rate is equal to x30 =0.30 deg/s (0.0053 rad/s). This result fits to Fig. 2.

I

I

sta rboard

ra t e o f t ur n (deg/s )

1. 0

port

sta rb oa r d

140

35

30

25

20

15

10

5

5

10

15

20

25

30

35

40

rudder angle (deg)

-0 . 5

-1.0 port

Fig. 2. Steady-state relation between rudder angle and turning rate for an unstable ship.

302

The perfect fitment has been obtained by choosing the Munk moment (Blanke, 1981) tenn in Eq. (7) as ITI4=O.025 mo instead of the generally used (Blanke, 1981)

The nonlinear ship equations are linearized for controller synthesis. The steady state solution Eq. (12)-(13) is substituted in Eq. (6)-(7). Furthennore, the surge speed x 1 is assumed to be practically constant. The following equations are obtained: x2

-a11x1 -a12xl

x3 = -a21 x l -a22x1

0 ( x21 I, I:

I

blX1 2

1I

;

o ' x3 !+ -b2x1 2 u

(14)

i I

X4

0

1

0

x4 J

0

The feedback from the turning rate is chosen to be inversely proportional to the ship surge speed as follows: (15)

u=(g l/x 1)x3+g2x4

The feedback has positive coefficients because a negative rudder angle generates positive turning rate. Substituting Eq. (15) to the Eq. (14) the closed loop model x=Ax

(16)

is obtained, where the coefficient matrix A is equal to

(17)

The controller gains gl and g2 can now be designed by consideIing the eigenvalues of the Eq. (17). The characteristic equation is obtained by setting det(sI-A)=O

(18)

as a result the following characteristic equation is obtained

303

s3+(all+a22+b2g1)Xls2+(alla22-a12a21+allb2g1+a21blgl+b2g2)X1 2s + (allb2g2+u2lblg2)x13=0

(19)

The characteristic equation is set equal to (20)

(s+sl)(s2+2dws+w2) which results

(21) (22) (23) The above set of non linear equations (21)-(23) was solved to find the pole SI and the control gains gl and g2. The symbolic computation software MATI-IEMATICA v. 1.2 for 80386n was used to solve the set of equations. The symbolic solution was so long that it was not useful for control design. Hence, the parameters in Table 2 were substituted in the symbolic solution: Table 2 Parameters of a 3000 ton ship SI-units all a12 a21 a22 bI b2

scaled (Astrom and Wittenmark, 1989) 74.9 -0.53 -0.75 -0.20 -0.28 0.36 -2.18

0.007056 0.75 0.00003565 0.003791 0.004869 0.0003888

The parameters a2l and a22 in Table 2 differ most significantly from those in Table 1. Parameter a21 present the Munk moment which magnifies the rudder effect and a22 present the course rate damping. When both these parameters are multiplied by about ten as in Table 1 the dynamics of Eq. (3) change only in fast transients. In normal rudder operating frequencies there is no practical difference between models based on parameters in Table 1 and Table 2. The parameters of the second order system were set equal to w=0.02 Xl

and

d=0.7

then the controller gains gland g2 and the independent transfer function pole s I were obtained as: gl =65.4,

g2=1.13

and

304

SI =0.00827 Xl

The values of gl and g2 are independent from the ship speed but the value of pole sI is increasing when ship speed is increasing. This means that the time constants of the closed loop are inversely proportional to the ship speed. When the ship speed is 13.6 knots (7 m/s) the values of time constants are equal to Tsl =1/sl =17 s

and

Tw=1/w=7 s

There are two main modes in ship control. In the course keeping mode the PID control law is (24) By comparing Eq. (15) and (24) the following relations were obtained: K p =g2=1.13

(25)

T d=(gl/g2)!xl =58/xl

(26)

When using PID control the integration time is usually set to (27)

Ti=4 Td=231/x1 In the rate of turn control the PI control law is

(28) where Kp=g l/x 1=65/x 1

(29) (30)

It should be kept in mind that the integral of the rate of turn is actually the course. In practice, it is easier to operate on the map by controlling the turning radius instead of the turning rate (Astrom and Wittenmark, 1989). The turning radius control was achieved by the following algorithm: ' u(k)=K p (x3(k)-Z3(k)+(x4(k)-Z4(k))ITi)

(31 )

where r is the turning radius and

305

v(k)=sgn(x 3 (k) )--J (x 12(k)+x 22(k))

(32)

z3(k)=v(k)/r+(Z4(k)-x4(k))ffi

(33)

The value of the course angle which should be reached in next control interval in order to keep the ship in constant turning radius r is as follows (34)

z4(k+ 1)=z4(k)+Tv (k)/r where T is the control interval.

When changing from the turning radius control to the course keeping control the integrating tenn in the PID-controller is initialized properly to obtain a smooth change.

State Estimation It was assumed that there is available a ship speed measurement from a log, a course measurement and a turning rate measurements from a compass. However, these measurements cannot be used directly for control feedback because these measurements are corrupted by the waves. Hence, a nonlinear filter was constructed to estimate the sway speed x2, the turning rate x3 and the course x4. It was assumed that the ship speed is almost constant and that it is filtered already in the speed measuring log. The non linear model (6)-(8) was used as the basis of the filter design. The measurement equation is linear which simplifies the algorithm. The modified Gaussian second order filter algorithm used is presented in (Maybeck, 1982). This algorithm is using both first and second order derivatives of the non linear system equation. When applied to the model (6)-(8) the filtering algorithm can be presented as follows: t

x(t)=x(t-T)+f (f(x(t))+bb(x(t))dt t-T

(35)

t

P(t)=P(t- T)+f (df(x(t))/dX(t)P+P(df(x(t))/dX(t)) T +Q)dt t-T

(36)

x( t)=x( t)+ K( t)(y( t)-Cx( t))

(37)

K(t)=p(t)CT(CP(t)CT +R)-l

(38)

P(t)=P(t)-K(t)CP(t)

(39)

bbi (t)=( 1/2)Trace(d 2fi (x(t) )/dX 2 ( t) P)

(40)

where f(x) is the right side of (6)-(8) and the measurement coefficient matrix C is equal to

306

c=

[0 1 01 001

The covariance matrix R of the measurement disturbance was chosen equal to the following diagonal matrix: R=diag(0.0025 0.0025) The covariance matrix Q of the error rate in Eq. (6)-(8) was chosen equal to the following diagonal matrix: Q=diag(0.00025 0.00025

0)

The only difference between the modified Gaussian second order filter and the extended Kalman filter is the bias term bb which is added to the system equation. Simulation results The developed control and filtering algorithms were tested in a simulation environment. The simulator is presented in details in (Selkainaho and Saastamoinen, 1989). Figure 3 . shows the adaptive autopilot in operation when the ship speed is equal to 13.7 knots (7 m/s). Wind of 20 m/s and 3 m waves are coming from 180 deg. The turning radius was set to r=0.8 nautical miles. The filter update period was chosen to be 1 s and the autopilot was generating a new rudder command every 5 s. lOO~--~----.----.----.----.----.----.----.----.----,

80 Vl Cl)

~

60

Cl)

Cl

40 20L---~----~--~----~---L----~--~----~--~--~

o

100

200

300

400

500

600

700

800

900

1000

Seconds

Fig. 3 a. The heading measurement when the ship speed is equal to 13.7 knots. 4~---r----~---,----~----.---~----,-----~---r----,

2 Vl Cl) Cl)

So

8

0

_4L----L----~--~----~----L---~----~----~---L--~

o

100

200

300

400

500

600

700

800

900

1000

Seconds

Fig. 3 b. The rudder angle measurement for Fig. 3 a. Figure 4 shows the autopilot in the same environmental conditions when the ship speed is equal to 6.6 knots (3.4 m/s).

307

l00r---~---.----.---~----~---.----.----.----r---1

80 V)

~

o

60

o 40 100

WO

300

400

500

600

700

800

900

1000

Seconds

Fig. 4 a. The heading measurement when the ship speed is equal to 6.6 knots (3.4 rn/s). 10 5 V)

0 0

....

bl)

0

8 -5

-10

0

100

200

300

400

500

600

700

800

900

1000

Seconds

Fig. 4 b. The rudder angle measurement for Fig. 4 a. Conclusions An adaptive autopilot based on gain scheduling has been designed. The controller parameters are functions of the measured ship speed. A nonlinear ship model which explains well the usual manoeuvering tests has been used as the basis in the design procedure. The parameters of the ship model are based on physical dimensions of the ship. The controller structure was chosen to be PID in course keeping and PI in manoeuvering. In the autopilot the course angle and the course rate were filtered before they were used in the feedback. The filtering has been made by a modified Gaussian second order filter. The autopilot has been tested in a realistic simulation environment. Sea trial tests are needed before it can be brought in everyday use. Also, some fine tuning may be required before an optimum is reached between the rudder variance and the course variance. References Blanke, M. (1981) . Ship Propulsion Losses Related to Automatic Steering and Prime Mover Control. Thesis, 1981. Technical University of Denmark. 271 p. Maybeck, P. S. (1982). Stochastic Models, Estimation, and Control, Vol. n. Academic Press. 271 p. Selkainaho, J. and Saastamoinen, M. (1989). Tuning of Dynamic Positioning System by Expert System Techniques. IFAC Workshop on Expert Systems and Signal Processing in Marine Automation, August 28-30. Technical University of Denmark. pp. 59-66. Astrom, K. J. and Ktillstrom, C. G. (1976). Identification of Ship Steering Dynamics. Automatica, Vol. 12. Pergamon Press. pp. 9-22. Astrom, K. J. and Wittenmark, B. (1989). Adaptive control. Addison-Wesley. 516 p.

308