1
APPLICATION OF MPC ALGORITHM FOR TRACKING CONTROL ỨNG DỤNG ĐIỀU KHIỂN DỰ BÁO TRONG ĐIỀU KHIỂN BÁM QUỸ ĐẠO Lam Chuong VO1a, Luan Vu TRUONG NGUYEN1b, Hieu Giang LE1c 1 Ho Chi Minh City University of Technology and Education, Ho Chi Minh City, Vietnam a
[email protected] b
[email protected] c
[email protected] ABSTRACT In this work, the model predictive control (MPC) is utilized for the controller design of vessel models (IFAC Benchmark models) in terms of the tracking control problem. Besides, the linearized and non-linear models are also used as the vessel models. Accordingly, MPC algorithm is first developed to get an optimal control sequence for the linearized models. In case of the non-linear models, the linearization technique must be first applied at the current states and the control output given by MPC algorithm with linearized model is then calculated in the systematic way. Furthermore, the wave disturbances and some constraints on variables are also introduced to guarantee a realistic evaluation. The extended Kalman Filter (EKF) is applied to estimate the state variables in the presence of the disturbances. The results are demonstrated that it still can guarantee the recursive feasibility and convergence due to computationally cheap. Keywords: Model predictive control (MPC), Non-linear model predictive control, Wave spectra formulation, Extended Kalman Filter (EKF), IFAC Benchmark model. TÓM TẮT Bài báo này khảo sát đầy đủ ứng dụng của điều khiển dự báo (MPC) trong điều khiển bám quỹ đạo của các mô hình tàu (mô hình chuẩn IFAC). Trong bài báo, hai mô hình toán phi tuyến và tuyến tính hóa của tàu được sử dụng. Đầu tiên, giải thuật MPC được sử dụng để đạt được tín hiệu điều khiển tối ưu cho mô hình tuyến tính hóa. Kế tiếp, trong trường hợp mô hình phi tuyến, chúng tôi thực hiện việc tuyến tính hóa tại các trạng thái hiện tại, và sau đó tính toán tín hiệu điều khiển sử dụng giải thuật MPC cho hệ tuyến tính ở bước trước. Nhiễu do sóng biển và giới hạn của một số biến trong hệ cũng được khảo sát để đảm bảo quá trình đánh giá phù hợp thực tế. Bộ lọc Kalman mở rộng (EKF) được dùng để ước lượng các biến trạng thái trong trường hợp có nhiễu tác động. Từ khóa: Điều khiển dự báo, Điều khiển dự báo hệ phi tuyến, Mô hình phổ sóng biển, Bộ lọc Kalman mở rộng, Mô hình chuẩn IFAC. 1.
INTRODUCTION
Recently, the model predictive control (MPC) is widely used in the industry, which is socalled the advanced control techniques that is tremendously successful in practical applications [1]. The MPC is established by considering the current control action, as well as solving an optimization problem on-line at each sampling instantly. This method uses an explicit model and feedback states to predict the future behavior of a plant on a finite horizon. The MPC algorithm yields an optimal control sequence and only the first control in this sequence is applied to the plant [1], [2], [3]. The MPC algorithm is also an efficient algorithm that deals with multivariable system and constraints on system variables [1]. The MPC is first introduced for the linear system and then extended to the non-linear system.
2 The IFAC benchmark models, which consist of linearized and non-linear mathematical models of a ship, have been used to evaluate the performance of MPC controller [4], [5]. The wave disturbances (Fossen, 1994) are implemented within the system simulation to investigate the disturbance rejection capabilities of this control theory. This paper is organized as follows. Section 2 is briefly introduced the simulation models for both the linearized and non-linear problems. The dynamic model of wave disturbances is also discussed in this section. The MPC algorithm is presented in section 3. In next section, all the results of simulation without the presence of wave disturbances are shown for several case studies. Finally, conclusions are given in section 5. 2.
SIMULATION MODEL
2.1. Vessel Models 2.1.1 Linearized vessel models Two linearized models representing the heading dynamics of cargo vessel and an oil tanker are used as the control objects for this research. These are defined as IFAC benchmark models (Källström et al.,) [6], [7]. Direction Fixed
x
v y
: rudder angle of ship (rad) v : sway velocity of ship (m/s)
: turning yaw rate (rad/s) : heading angle of ship (rad)
Figure 1: Notation is used to describe ship’s motion The linearized model of a ship moving under constant velocity (in a straight line motion) is described as follows:
x Ax Bu (1) y Cx where x R3 , x [v ]T , is the system states vector; u R1 , u , is the control input. A, B, C are system, input and output matrix respectively. The structure of A, B, C is given by: a11 a12 0 b1 A a21 a22 0 , B b2 , C 0 0 1 (2) 0 0 1 0 where a11 , a12 , a21 , a22 , b1 , b2 are constant parameters. 2.1.2 Non-linear vessel models The non-linear model of ships is described as follows:
3
x1 a11 x1 a12 x2 cx1 x1 b1u x2 a21 x1 a22 x2 b2u x x 2 3
(3)
(4) y x3 where c is also a constant parameter. All constant parameters of linearized and non-linear model are shown in the IFAC Benchmark problems [7], [8]. Both linearized and non-linear systems have to meet some constraints on input, rate of change of input and output (Källström et al., 1979) [7] (a). The rudder motion is constrained: u 400
(5)
(b). The rate of change of rudder motion is constrained: u 100 / sec (c). No overshoot occurs in the output response.
(6) (7)
To satisfy these design specifications, the desired response of the heading angle, ψ, is designed to be a zig-zag critically damped second order response (Fossen, 1994) [9]. 2.2. Wave Disturbances In order to simulate the motion of ocean vehicles and the robustness of controller in the presence of irregular waves, we will consider the effect of wave disturbances. The earliest spectral formulation is due to Neumann (1952) who proposed the one-parameter spectrum. Pierson and Moskowitz (1963) developed a wave spectra formulation for fully developed wind-generated seas from analyses of wave spectra in the North Atlantic Ocean. The PiersonMoskowitz (PM) spectrum, [9], is written as follows: (8) S ( ) A 5 exp( B 4 ) 2 2 (9) A 0.0081g , B 3.11/ H s where H s is the significant wave height (m). For simulating the time domain of wave disturbances, we use the linear wave spectrum approximation (Balchen 1976): h( s )
Kws s 2o s o 2 2
(10)
Rewriting (10) in state-space form: xw A wxw ew w yw c w x w (11) where 1 0 0 Aw , ew , 2 o 2o Kw
cw 0 1 ,
K w 2o w (gain constant)
(12)
Here w is the constant describing the wave intensity, is the damping coefficient while o is the dominating wave frequency. 3.
MODEL PREDICTIVE CONTROLLER
Given a specific sampling time Ts , the plant is easily transformed into its discrete-time version:
4
x(k 1) A d x(k ) B d u (k ) (13) y ( k ) Cd x( k ) Then, the MPC online optimization problem can be formulated as follows: at each time instant k , we will find the optimal control sequence u(k ), u(k 1),... u (k Nu 1) to minimize the following quadratic cost function: Np
J (k ) y sp (k p | k ) y(k p | k )
Nu 1
2 ( p)
p 1
u (k p | k ) p 0
2 ( p)
(14)
Subject to: umax u (k p | k ) umax umin u (k p | k ) umax y y (k p | k ) y min max
p 0,1,..., N u 1 p 0,1,..., N u 1 p 1, 2,..., N p
(15)
where equation (15) stands for constraints of the IFAC benchmark problem (5), (6), (7); y sp is the reference trajectory; , are the corresponding weighting matrices. N p , N u are the prediction and control horizon respectively. Only the first value of the control sequence, u (k ) , is applied to the system. Let us define vectors: x(k 1| k ) u (k | k ) X( k ) , U(k ) x(k N p | k ) u ( k N 1| k ) u
From the state space equations of the system (13), we calculate the state vector predicted at sampling instant k for the future instant k p in the prediction horizon: (16) X(k ) Ax(k ) M x U(k ) Vu(k 1) where Bd Ad ( A d I )B d A 2 d Nu 1 A Nu , M x A d i B d i 0 Ad N N p 1 p A d Ad i Bd i 0
Bd ( A I )B d d Nu 1 i Bd , V Ad Bd i 0 N p Nu N p 1 i i A B A B d d i 0 d d i 0 0 0
The cost function can also be written as follows:
J (k ) Y sp (k ) Y pred (k )
2
U(k )
2
where Y pred (k ) CX(k ) Replace (16) into (18), we have: Y pred (k ) CAx(k ) CVu(k 1) CM x U(k ) Yo (k ) Y(k ) where Yo (k ) CAx(k ) CVu(k 1) (19) Y(k ) CM x U(k ) (20) and
(17) (18)
5
C d 0 C 0
0 Cd 0
0 0 Cd
Since the cost function is a quadratic form and all constraints are linear, we can use quadratic programming (QP) to solve the optimization problem. The problem (14), (15) can be easily written in an equivalent form which is standard for quadratic programming: 1 (21) min J (x) xT Hx f T x 2 x x x max subject to: min Ax b where x U(k ), xmin Umax , xmax Umax , H 2(MT M )
f 2MT (Ysp (k ) Yo (k )) U min U(k 1) J U U(k 1) J A , b max Ymin Yo (k ) M o M Ymax Y (k ) where Yo (k ) is according to the equation (19), M CM x
umax u min , U max , U min umax umin 1 u (k 1) 1 and U(k 1) , J u (k 1) 1 4.
umax ymin ymax U max , Ymin , Ymax umax ymin ymax 0 0 1 0 1 1 1
SIMULATION RESULTS
A zig-zag maneuver ( 45o ) is chosen as the desired heading or yaw angle trajectory. The zigzag test is a standard maneuver used to compare the maneuvering properties and control characteristics of a ship with those of other ships. In all simulation results, the sampling time Ts is chosen as 1 (second). 4.1. Linearized system with wave disturbances For the linearized model, it can be seen that the controller provides an excellent tracking ability, both heading errors of cargo vessel and oil tanker are in the range of 0.1o . In the case of the cargo vessel, we choose N p 35, Nu 4 . For the oil tanker, we need to adapt these parameters because the oil tanker is bigger and faster than the cargo vessel, and N p 40, Nu 5 are chosen. In the presence of wave disturbances, we use Kalman filter to estimate the states of the system and filter this disturbances out of the output of system [10].
6 Cargo #2: l 161(m), v 15(knot )
Tanker #2: l 322(m), v 16(knot ) Response of Ship Heading(deg)
Response of Ship Heading(deg)
50
50
0
0
reference output actual output
reference output actual output -50
-50 0
100
200
300
400
500
600
700
800
900
1000
0
100
200
300
400
500
600
700
800
900
1000
700
800
900
1000
700
800
900
1000
Error of Trajectory Tracking(deg)
Error of Trajectory Tracking(deg) 0.1
0.1
0.05
0.05
0
0
-0.05
-0.05 -0.1
-0.1 0
100
200
300
400
500
600
700
800
900
0
1000
100
200
300
400
500
600
The rudder motion(deg)
The rudder motion(deg)
40
10
20
5 0
0
-5
-20
-10 0
100
200
300
400
500 Time(s)
600
700
800
900
1000
-40
0
100
200
300
400
500 Time(s)
600
Figure 4: The responses of cargo vessel and oil tanker with wave disturbances 4.2 Nonlinear system with wave disturbances 4.2.1 MPC for nonlinear system with successive linearization (MPC-NSL) In order to use the MPC algorithm above for the nonlinear system, we need to do some modifications for better performances. At each sampling instant, we perform a linearization of the nonlinear model at current process states, and then calculate the control input using the linear MPC algorithm (section 3) with linearized model. It is called MPC Nonlinear with Successive Linearization (MPC-NSL) [1]. The responses of nonlinear models are as follows Cargo #2: l 161(m), v 15(knot )
Tanker #2: l 322(m), v 16(knot )
Response of Ship Heading(deg)
Response of Ship Heading(deg)
50
50
0
0 reference output actual output
-50
0
100
200
300
400
reference output actual output 500
600
700
800
900
1000
-50
0
100
200
Error of Trajectory Tracking(deg) 0.2
0.05
0.1
0
0
-0.05
-0.1
-0.1
0
100
200
300
400
500
600
700
300
400
500
600
700
800
900
1000
700
800
900
1000
700
800
900
1000
Error of Trajectory Tracking(deg)
0.1
800
900
1000
-0.2
0
100
200
300
The rudder motion(deg)
400
500
600
The rudder motion(deg) 40
10
20
0
0 -20
-10 0
100
200
300
400
500 Time(s)
600
700
800
900
1000
-40
0
100
200
300
400
500 Time(s)
600
Figure 5: The responses of nonlinear models of the vessels using MPC-NSL In this case, N p 35, Nu 7 and N p 42, Nu 8 are chosen for cargo and tanker respectively. That means we need a longer prediction and control horizon to keep an excellent performance of the tracking control. The heading errors of this case are even better than those of linearized model. 4.2.2 Nonlinear system with wave disturbances In the presence of wave disturbances in the nonlinear model, the extended Kalman filter [3] is adopted to estimate the states of the system and reject those disturbances.
7 Similar to the case of no disturbances, the errors of tracking are still in the range of 0.05o for cargo vessel and 0.1o for oil tanker. However, the rudder, in this case, has to fluctuate constantly to keep the ship for tracking the reference. Cargo #2: l 161(m), v 15(knot )
Tanker #2: l 322(m), v 16(knot )
Response of Ship Heading(deg)
Response of Ship Heading(deg)
50
50
0
0 reference output actual output
-50
0
100
200
300
400
reference output actual output 500
600
700
800
900
1000
-50
0
100
200
Error of Trajectory Tracking(deg)
300
400
500
600
700
800
900
1000
700
800
900
1000
700
800
900
1000
Error of Trajectory Tracking(deg)
0.05
0.1 0.05
0
0 -0.05 -0.1
-0.05 0
100
200
300
400
500
600
700
800
900
1000
0
100
200
300
The rudder motion(deg) 20
40
10
20
0
0
-10
-20
-20
0
100
200
300
400
500 Time(s)
600
400
500
600
The rudder motion(deg)
700
800
900
1000
-40
0
100
200
300
400
500 Time(s)
600
Figure 6: The responses of nonlinear model with wave disturbances using MPC-NSL CONCLUSION In this paper, the MPC algorithm is applied in the ship’s heading control for the course keeping. It is investigated both case of the linear and non-linear models, and the wave disturbances as well. The output responses of the plants are excellent for all cases. The errors of tracking are in the range of 0.1o for both the cargo vessel and oil tanker in terms of the linearized and non-linear models, in which the errors are only in the range of 0.05o for the cargo vessel and 0.1o for the oil tanker. In accordance with all case studies, the control parameters of the MPC algorithm, such as N p , Nu is adjusted to keep the excellent performance of the control system. Moreover, the rudder is also operated constantly for tracking exactly in the presence of wave disturbances.
REFERENCES [1] Piotr Tatjewski, Advanced Control of Industrial Processes: Structures and Algorithms, Springer-Verlag London Limited, 2007. [2] Maciejowski J.M. Predictive Control with Constraints, Prentice Hall, 2000. [3] Bemporad A., Borrelli F., Morari M., Model Predictive Control Based on Linear Programming - The Explicit Solution, IEEE Transactions on Automatic Control, Dec. 2002, Vol. 47, No. 12. [4] Zhen Li, Jing Sun, Soryeok Oh, Path Following for Marine Surface Vessels with Rudder and Roll Constraints: an MPC Approach, American Control Conference, June 2009.
8 [5] Zhen Li, Jing Sun, Disturbance Compensating Model Predictive Control with Application to Ship Heading Control, IEEE Transactions on Control Systems Technology. [6] Åström K. J., Källström C. G., Identification of Ship Steering Dynamics, Automatica, 1976, Vol. 12, p. 9-22. [7] Källström C.G., Åström K.J., Thorell N.E., Eriksson J. and Sten L., Adaptive Autopilots for Tankers, Automatica, 1979, Vol. 15, No. 3, p. 241-254. [8] Goclowski J., Gelb A., Dynamics of an Automatic Ship Steering System, IEEE Transactions on Automatic Control, July 1966, Vol. 11, No. 3. [9] Fossen T. I. Guidance and Control of Ocean Vehicles, John Wiley & Sons, 1994. [10] Robert G. B., Patrick Y. C. H., Introduction to Random Signals and Applied Kalman Filtering, John Wiley & Sons, 1997.