COMPARISON BETWEEN PROPORTIONAL INTEGRAL DERIVATIVE (PID) AND MODEL PREDICTIVE CONTROL (MPC) FOR SHIP HEADING CONTROL

In this paper discussed about ship heading control problem. Ship heading control is one of the ship control problem in the application in the marine field. Controllers are needed to increase the level of safety when the ship is maneuvering. With rudder angle as input control, the heading angle controlled therefore it can reach reference heading angle with minimum energy. Due to the maneuver characteristics, the rudder efficiency for large ships can be poor under slow-speed conditions. Therefore, to maintain the safe navigation of ships, accurate heading control research is crucial. In this research we use Nomoto model, considering only one degree of freedom, that is yaw. The ships used as model is Warship Class Corvette SIGMA. Proportional Integral Derivative (PID) control is used on that ship as controller. In this research, we compare two method for control the heading angle, that is Proportional Integral Derivative (PID) and Model Predictive Control (MPC). The urgency of the comparison between both method is to provide control considerations applicable to the Warship Class Corvette SIGMA. PID is a controller that determine the presition of an instrumentation system with feedback characteristic on the system. MPC is a control technique, which embeds optimization within feedback to deal with systems subject to constraints on inputs and states. From the simulation result, MPC can compansate the disturbance better than PID. The time to reach reference angle when controlled using MPC faster than using PID. The results show the advantage of MPC for dealing with the system dynamics over PID, also could be designed for faster and more complex system dynamics even in presence of constraints.


INTRODUCTION
When maneuvering, ship has six degree of freedom.This movement is centered on three major axis, there are longitudinal axis, transversal axis, and vertical axis.In the longitudinal axis, there are surge as translation motion and roll as rotation motion.In the transversal axis, there are sway as translation motion and pitch as rotation motion.In the vertical axis, there are heave as translation motion and pitch as rotation motion [1].Generally, the ship motion system used is three degrees of freedom, namely surge, yaw and sway.In many cases, uncontrolled surge, sway and yaw speeds can produce other movements such as pitch, heave and roll which can cause violent shaking and cargo damage to the ship [2].Therefore, controllers are needed to increase the level of safety when the ship is maneuvering.One of the main control systems on a ship's autopilot is to control the ship's bow or usually called ship heading control [3].This system aims to lead the ship on the desired trajectory, able to shorten the journey by 3-5% and reduce fuel consumption [4].Ship heading control is one of the ship control problems in the application in the marine field [1].During encounters, a small change in the heading angle of large ships might cause negative results.The propulsion efficiency and maneuverability of ships in inland waterways are poor, with ships becoming more difficult to maneuver and control [5,6].Due to the maneuver characteristics, the rudder efficiency for large ships can be poor under slow-speed conditions [7].Therefore, to maintain the safe navigation of ships, accurate heading control research is crucial.The aim of this research is to design controls that will be used to control the heading angle of the ship.
Yaw rate velocity when manuvered became important thing when designing control [8].A big yaw velocity cause ship motion become unstable, also can cause cargo damage [1,2].Therefore In this paper will be designed control system to control the heading angle of the ship which only considered with one degree of freedom, that is yaw.With assumption that another motion does not give an effect.In the transfer function approach, Nomoto Model was used.In the Nomoto model only considered with one degree of freedom, that is yaw, and one control input, that is rudder angle.Effectiveness of the models has been assessed on the basis of main properties of Nomoto model i.e. controllability, observability, identifiability.[9] To implement the control, an appropriate control method was choosed.Proportional Integral Derivative (PID) is a controller that determine the presition of an instrumentation system with feedback characteristic on the system [3].In PID, parameter of control was determined, therefore the performance of the system can be as expected before.Output signal of PID controller directly proportional with error signal, error velocity, and sum of error [4].PID method has been widely applied this day in the control process of dynamic system, due to their simplicity of application, ease of design, low cost, and effectiveness in the majority of linear systems [5].PID first introduced by Minorsky, in 1922, in the model with single input and single output, where heading angle of ship measured with gyrocompass.Autopilot compare the heading angle from measurement with the setpoint, or expected angle [10].The error from comparing process used as input to controller.Output from controller then transmitted to rudder servo that produce appropriate control signal to move the steering wheel of the ship [11].
Ship autopilot designed based on PID controllers are simple, reliable, and easy to construct [12].The traditional PID controller for ships is determined by three control parameters Kp, Ki and Kd.When the sea situation changes, the parameters cannot be adjusted online according to the sea situation.So PID control has no good adaptability for systems whose precise mathematical model is unknown.However, dynamic characteristics of the ship change in the navigation process, following changes of ship's speed, load, sea conditions, and other factors.Consequently, their performance in various conditions is not as good as desired [13,14].
In recent decades, various control techniques have been proposed to improve the controller performance in changing environmental conditions.Moradi and Katebi (2001) used linear models for the controller design in ship autopilots [15].The author used a general predictive algorithm to calculate the optimal gains for PID controller.Lee et al. (2009) studied the ship's motion control in shallow waters and deep waters using PID control algorithm and fuzzy logic control algorithm [16].Tomera (2010) used the fuzzy self-tuning method to auto-tune the PID controller gains [8].The proposed control algorithm's performance was shown to be improved in terms of settling time and the overshoot both numerically and experimentally.
In 1970, a new control method was developed, there is Model Predictive Control (MPC).Qin, in journal "An Overview of Industrial Model Predictive Control Technology," state that MPC has many application in industry [17].MPC is a control technique, which embeds optimization within feedback to deal with systems subject to constraints on inputs and states [18].Using an explicit model, and the current measured or estimated state as the initial state to predict the future response of a plant.MPC determines the control action by solving a finite horizon open loop optimal control problem at each sampling interval [19,20].Furthermore, because of its natural appeal to multivariable systems, MPC can handle underactuated or overactuated problem by combining all the objectives into a single objective function [21].
The impact disturbance caused by wave is an external disturbance that will affect the stability on a ship when maneuvering in the ocean.To overcome these problems, it is necessary to use a robust control system in overcoming the impact disturbance of wave.
The following four main aspects of MPC make the design of this method attractive to practitioners and academics [22].The first aspect is the design formulation using multivariable system [23] (multi input multi output).The second aspect is the ability of the method to handle the constraints on the system.The third aspect is the ability to perform an online optimization process.The fourth aspect is the simplicity of the design of control in dealing with complex problems.Some researchers have been done in ship heading control using MPC, using one degree of freedom that is yaw [24], two degrees of freedom that is sway and yaw [25], and four degrees of freedom that is surge, sway, yaw, and roll [24].In [24], the Model Predictive Control (MPC) has been proposed to satisfy the state constraints in the presence of environmental disturbances.The simulation results show good performance of the proposed controller in terms of satisfying yaw velocity and actuator saturation constraint [26].
In this paper, we compare between PID and MPC to control heading angle in the ship heading control problem The urgency of the comparison between both method is to provide control considerations applicable to the Warship Class Corvette SIGMA.We use Nomoto model with parameter from Corvette Sigma Ship.

Mathematical Model For Ship Heading Control
The mathematical model of ship motion is a description of ship maneuverability.It determines the mathematical relationship between input variables and output variables in the course of navigation.According to the laws of ship motion and related theories, the mathematical model of ship motion is constructed.According to the data of a specific ship, the corresponding model parameters are solved, therefore the controller design and system simulation can be carried out later.In kinematics, a ship is usually regarded as a rigid system.The front and rear directions of a ship are represented by its head and tail, which are called longitudinal directions; the left and right hulls are used to represent the left and right directions, which are called transverse directions, and the Y directions are used to represent the left and right hulls.
The transfer function of the ship's heading response to the steering gear is Convert (1) into the frequency domain expression as follows: Among them, K and T are ship maneuverability index, K is ship cyclicity index, T is ship tracking index.Equation ( 2) is the famous Nomoto equation, also known as the first-order linear model equation of ship maneuvering.It is an important equation describing ship maneuverability.The design and test of all the controllers in this paper are based on this model for the controlled object.
From Figure 1, the heading angle of the ship applied to the rudder angle (), therefore the heading angle () can be as expected before (  ).The ships used as model is Warship Class Corvette SIGMA.Parameter used for simulation describe in Table 1 [2].
Based on parameter in Table 1 can be obtained hydrodynamic coefficient of ship as below [1]: From parameter of ship in Table 1, and from hydrodinamic coefficient of ship in (3) obtained the transfer function of Nomoto Model [1] Using forward finite difference method to (5), for Δ = .1,can be obtained discrete system as below.
We can write (6) as: With  = [ In the system gave disturbance that comes from sea wave.This disturbance in the form of a wave sinusoidal on the yaw movement of the vessels of the ship dynamic system.
Where  is sea wave frequency against ship dynamic system, and   is amplitude value from the wave.
By adding disturbance to the system, we can define (7) as below.
( + 1|) = () + () + () From matrix A dan B can be shown if rank [|] = 2, which means that the system is controllable.Therefore, we can design a control to the system.

Proportional Integral Derivative (PID)
A classical conventional PID controller used to control ship's course changes is described by the following control rule.
Where   () = |  () − ()| is the error between heading angle () and desired heading angle (  ),   is the rudder deflection.Then a discrete version of this controller was implemented in the ship steering control system after replacing the continuous time by a series of discrete sampling points.
Where   is the sampling period.Then the continuous integral part of controller can be replaced by following approximate numerical integration.∫   () ≈ ∑   (  ) =   ∑   ()  =0  =0  0 (11) The differential part can be substituted by the substraction of the neighbouring error. (12) By substituting (11) and ( 12) to (10), the control law is formed as: () =     () +   ∑   () +   (  () −   ( − 1))  =0 (13) Where, To avoid the sum in ( 13), we can define: Then, the output of the controller is obtained as: The parameters of the linear PID controller were selected using the pole placement method with Nomoto Model of the ship [1] as below:

Model Predictive Control (MPC)
The MPC controller requires an objective function.The objective function of this research is to control the heading angle of ship when there is a wave disturbance, minimize the energy using for control the heading angle, and minimize the error between heading angle and expected heading angle.The objective function of the controller MPC represented below.
The constraints in Equations ( 19) represent the prediction model using mathematical model, and the constraints in Equation ( 21)-( 23) for state, input control, and increment input, respectively.  and   are prediction horizon and control horizon.In this paper used for   =   . Where:

RESULTS AND DISCUSSION
In this paper, the heading angle controlled from initial angle, that is 30°, to the reference angle, that is 0°.Given disturbance from sea wave to the system.In this paper, we compare two methods for control the heading angle, that is using PID and MPC.

Ship Heading Control Using PID
From transfer function in Equation ( 4) and formula in equation ( 15)-( 17) obtained parameters of linear PID controller as below.

Table 2. List Parameter PID
No. Proportional Parameter PID for initial simulation using result from Equation (24).For another simulation using tuning parameter in Matlab with various agressivity.The parameter for simulation showed in Table 2.
From the five scenarios in Table 2, the fastest time reached from Scenario d.Scenario d also give minimum overshoot, that is 0%.But Scenario d give the biggest error, that is .002717.The slowest time reached from Scenario a. Scenario a also give maximum overshoot that is 8.87%, and smallest error, that is .0006688.Because we want to control heading angle with minimum error, therefore best scenario for PID is scenario a. Overall, PID can be used for control the heading angle.Figure 2 shows simulation ship heading control using PID.

Ship Heading Control Using MPC
In this simulation, Model Predictive Control (MPC) used for ship heading control when there is disturbance, that is ocean wave.When simulating using MPC, we need linear discrete system as defined in Equation 19.The rudder angles constraints are || ≤ 35° and the yaw rate constraints are || ≤ 0.0932 rad/s.The constraints of the control system can written back as below: The value of weight matrix is  = (300, 300) and  = 1.The disturbance given to the system is: In this simulation, we use various prediction horizon (Np) value as showed in Table 3, that is Np = 40, 50, 60, 70 and 80. Selection of prediction horion (Np) values is based on trial and error experiments.Parameter MPC for initial simulation using result from Equation ( 24)- (26).From the simulation, the smallest error produced by Np = 40.The biggest error produced by Np = 80.The fastest time to reach reference angle produced by Np = 80 and the slowest time to reach reference angle produced by Np = 40.Because in this simulation we want to minimize the error, therefore the best simulation is using Np = 40.Figure 3 show simulation ship heading control using MPC.

Comparison Between PID and MPC
In this section, we compare simulation result between PID and MPC.For simulation used initial angle 0 degrees.The controls are used to control the heading angle of the ship to 30 degrees.For MPC simulations, the weight matrix used in MPC is Q = diag(300,300) and R = 1, with control limits as defined in equations ( 24)- (25).The prediction horizon value is Np=40.Meanwhile, for PID simulation, we use Kp=.0023127, Ki=.00068733, Kd=.00086545.
From Figure 4, using PID, system reach reference angle in 15 seconds, while using MPC, system reach reference angle in 4 seconds.Therefore, MPC can control system to reach reference heading angle faster than PID.From Figure 4, both methods, namely MPC and PID, can control the system to achieve the expected reference angle.But PID has an overshot above the reference angle, while MPC reaches the target set point exactly.MPC is faster in controlling the ship heading angle than PID.MPC have better set point tracking capabilities than PID controllers because of this controller working in optimal conditions by considering process constraints, that's why there is no overshoot during MPC control action.Both controllers have the same settling time.MPC produces no overshoot while PID has higher overshoot.
In Figure 5, the rudder angle control on MPC and PID meets the constraints defined in Equations ( 24)- (25).When using PID, in early simulation, the value of control is 2.5 degrees.Then the control value approaches 0 until the end of the simulation.This is in accordance with the characteristics of PID, where the control value is calculated at the beginning of the simulation.
In MPC, the control value at 3 seconds reaches the maximum value, that is 5 degrees.Next, the control value decreases until it approaches 0 degrees at 4 seconds.This is because the heading angle has reached the reference angle at 4 seconds.Furthermore, the control value is constant, because the reference angle has been reached so that the rudder is no longer used to control the heading angle.
From the result of simulation in Table 2 and Table 3, can be summarized if PID controller can produce less error than MPC controller.But MPC controller can control the angle to the reference with faster time than PID controller.The result of PID controller desired of the parameter that we choose.Difference parameter can give very difference result.The small proportional parameter value can accelerate the rise time.The small integral parameter value can accelerate the settling time and reduce the overshoot.The derivative parameter can reduce the oscillation and response time.From the combination of proportional, integral, and derivative parameter can be choosed the best simulation result as desired that minimized the error.
In the MPC, we trial the value of prediction horizon (Np).The time to reach reference angle for difference Np relative same.The biggest Np can produce the fastest time to reach reference angle.But the biggest Np produce the biggest error.
Overall, when designing control using MPC, the simulation results almost same because MPC doing control using model itself.Therefore, changing parameter control give almost same result.It was different with PID controller that very sensitive with the different parameter.MPC controller also can compensate the disturbance.Therefore the simulation result from MPC almost stable even given a disturbance to the system.Because in the MPC, the disturbance used in the model process for designing control.It was difference with PID controller.When given disturbance to the system, the PID controller recalculate the parameter control.Therefore PID controller produce slower time to reach reference angle than MPC.MPC is more robust to multiple changes in the system dynamics, while PID would need adjustment of its parameters for any of the changes during the system operation.
One of the advantages of MPC control algorithm is its ability to implement the constraint within the steps of design of the MPC controller while in the PID could not do it.MPC is more robust to multiple changes in the system dynamics.PID would need adjustment of its parameters for any of the changes during the system operation.

Figure 2 .
Figure 2. Ship heading control using PID

Figure 3 .
Figure 3. Ship heading control using MPC

Table 1 . Parameter of Ship Model
order 2 as follows: Equation (4) can be transformed into state space function as below.