PID Controller Design for Cruise Control System using Particle Swarm Optimization

: This paper presents a design of a Proportional-Integral-Derivative (PID) controller for automobile cruise control system. The parameters of the PID controller, which are the proportional ( ), derivative ( ) , and integrator ( ), have been selected using Particle Swarm Optimization (PSO) algorithm. In this study, the overall system performance has been compared with other predesigned controllers (conventional PID, Fuzzy logic PID, state space, and Genetic algorithm based PID controller). The simulation result illustrates that PSO based PID controller gives the best response in terms of settling time, rise time, peak time, and maximum overshot. The robustness analysis shows that the system is robust despite the deviations in some of the system parameters.


Introduction
Nowadays, the cruise control system has become a common feature of the modern vehicles [1].Cruise control system helps in providing the comfortability to the driver while driving in a long-distance travel.Using cruise control system, travelling on the highways has become easier than before, because it reduces the mental and physical stress that caused from regularly monitoring the speed of the vehicle and frequently pressing the gas pedal to maintain the speed [2].The main functionality of the cruise control system is to maintain the speed of the vehicle at a set-point previously set by the driver.The Cruise control system has a push button that enables the driver to set a reference speed.Then, the system will compare the actual speed with the reference point and adjust the throttle so as to equalize the actual speed with the reference point.
Proportional-Integral-Derivative (PID) controller provides a great way to stabilize systems.It has the ability to change the response of the system to be stable and reliable when it is used for controlling systems.PID controller has three parameters: proportional (K p ), integral (K i ), and derivative (K d ).These three parameters are tuned in a manner so the system will be stabilized according to predefined criteria.Furthermore, most of the feedback systems are controlled by using PID controller.Also, PID controller can be implemented as PID, PI, or PD.So, it helps the researchers with diverse choices to work with it [3].
Particle Swarm Optimization (PSO) is a metaheuristic algorithm which is used to optimize the solution of a given problem.PSO is used to solve complex mathematical models equations which are difficult to handle using the conventional methods [4].
Many researches have been through the modelling of automobile cruise control system [5] [6].Some of the researchers designed controllers to enhance the functionality of the cruise control system.A PID controller is used for this purpose [6] [7].The researchers used different methods to tune the parameters of the PID controller such as state space, fuzzy logic, and genetic algorithm (GA).The state space, and fuzzy logic based PID controller showed a fair output response.The GA based PID Controller showed a good output response.However, a PSO based PID controller has not yet been investigated.This paper proposes a tuned PID controller that stabilize the unstable cruise control system and a PSO algorithm has been used to optimize the PID controller parameters in accordance to predefined specifications.The objective of this study is to minimize the settling time and overshoot of the cruise control system.Compared with earlier studies that proposed a conventional PID, Fuzzy [8], state space [9] based controllers, and genetic algorithm based PID controller [7]. the PSO based controller gives a better transient response.A simulation has been handled using m-file code and the values are confirmed.

Cruise Control System
The cruise control system is a device that regulates and maintains the speed of the vehicle at a set point.The driver sends a command signal and the cruise control system then maintains the speed to the given point of the command signal.There are two main disturbances affect on the constant speed, first is the wind resistance against the velocity of the vehicle, and second is the slope of the road which generates the gravity pull effect.Figure (1) shows a schematic diagram of a vehicle on a sloped road

Figure (1): A schematic diagram for a vehicle on a sloped road
The cruise control system generates a control signal and delivers this signal to the actuators that controls the vehicle throttle valve, thus controls the fuel injection in the engine and providing a constant speed.
The transfer function of the cruise control system is[10]:

…………..(1)
Also, A delay time ……… Where is the aerodynamic drag coefficient, is the mass of the vehicle including passenger(s) and is the velocity, is the force saturation constant, and is the time constant of the first order lag [6].After substituting all the constants and equation (2) in equation ( 1

PID Controller
Proportional-Derivative-Integral controller is the most common controller used in the feedback control system because of its simplicity and easiness of use.The PID controller has the ability to compensate several practical processes [11].The general Formula of the PID controller is: ……………………..

Particle Swarm Optimization Algorithm
Particle swarm optimization is a nature inspired technique developed by Kennedy-Eberhart [12]- [15].PSO is a simple and powerful optimization algorithm and it is successfully applied to enormous applications in various fields of science and engineering.Initially, the PSO system has randomly selected values of solutions called population.Each single solution is called a particle.Furthermore, for each particular particle, there is a velocity which is randomly selected.Another, there is a position called best position (Pbest) for each particle.The particles move and keep tracking of the Pbest, and there is a fitness value for each Pbest.The greatest fitness value is called the global best (Gbest).
There are two main equations in the algorithm of the PSO, velocity and position vectors [16] and they are respectively shown below in equations ( 5) and ( 6).

Controller Design
PID controller is widely used to compensate many systems in order to reach the stability status.In this paper, a PID controller is the solution that is used to compensate the response of the cruise control system.The PID controller cannot take the system to the set point because it does not know the correct output.A feedback signal enables the PID controller to drive the system to the set point.The design specifications have considered that settling time (T s ≤5 sec) and maximum overshoot (M p ) is less than 10%.The PSO algorithm is used to extract the PID controller parameters" values (Kp, Ki, and Kd).There are many objective functions can be used in the PSO algorithm to get the PID parameters values.The most widely used function isthe time domain integral error performance criteria which depends on calculating the error between the input signal and the system output signal [17].The integral of time multiplied by absolute error (ITAE) objective function, which is shown in equation ( 7), has been optimized through PSO algorithm for finding the PID controller parameters values.∫ …………..(7)

Simulation and Results
To implement the simulation, several parameters values have to be predefined to run the simulation.PID parameters, , , and have given a range of values decided after a number of trials and they are shown in table (1) [7].The PSO algorithm parameters considered for the MATLAB code have been given in table (2).After running the simulation, the main objective function has been optimized, and it"s been found that the best PID parameters values are , , and . Figure (4) shows the output response of the system before and after adding the PID controller.

Figure (4): cruise control system response
The settling time, rise time, peak time, and maximum overshot for this design are 1.27 sec, 0.82 sec, 1.75 sec, and 0.82% respectively.The performance of the PSO based PID controller is compared with a several results found in a paper [7] as shown in table (3) below.

Root locus analysis
To analyse the system stability of the time domain, root locus analysis is the way for checking the stability [18].Figure (5) shows the root locus analysis for the cruise control system with PID controller.It is obvious that all the poles are lying in the left side of the s-plane, which means that the system is stable.

Bode Plot Analysis
To analyse the frequency response of the system, we have to use bode plot analysis [18].

Robustness Analysis
The ability of the controller to tolerate uncertainties existed in some parameters of the system can be evaluated by using the robustness analysis [19].The PID controller that is designed for the cruise control system is tested with the presence of some parameters uncertainties.The uncertainties of the cruise control system model are specified in terms of variations in the aerodynamic drag, mass, and time delay constants ( , , and respectively).These constants are deviated in a range of of their nominal values with a step size of .Figures (7) through (9) show the step responses of the PID controlled cruise control system with , , and constants variations around their nominal responses respectively.Figures (7) through (9) give the impression that the deviation of the response curves (±50% and ±25%) for the selected parameters around their nominal response is small.In addition, this analysis can ensure the capability of the PID controller to maintain the stability of the cruise control system and to perform well in spite of the large variation.Table ( 4) and ( 5) list a summary of the results of PID robustness analysis and show the total deviation ranges of the system respectively.From table (5), the average of deviation of maximum overshoot, settling time, rise time and peak time are 0.0571, 0.6973, 0.3576 and 2.5994 respectively.It can be figured out that the ranges of total deviation are within the limits and are acceptable.In accordance to the previous results, the cruise control system with PSO based PID controller can be considered as robust as it can hold its stability with the variations of some parameters constants.

Conclusion
In this study, a PID controller using PSO algorithm has been proposed to undertake the controlling of cruise control system.A comparison based on the system performance has been done among the PSO based PID controller, conventional PID, fuzzy logic controller, state space controller, and Genetic algorithm based PID controller.The result of the comparison shows that there is a great improvement in the response over other controllers in terms of settling time, rise time, peak time, and maximum overshot.Finally, the uncertainty test analysis shows a robust behavior of the PID based cruise control system in terms of the variation of some system parameters.

( 4 )
Figure (2): PID Controller Schematic Diagram vectors, and their values lies between 0 and 1.The parameters and represent the acceleration constants or the learning parameters, and they are typically taken as ≈ ≈ 2 [16].The parameter represents the velocity and parameter represents the position.The parameters and are the G best and P best respectively.The pseudo-code of the PSO algorithm is shown in figure (3).

Figure ( 6
) illustrates the frequency response (magnitude and phase plot) of the open loop cruise control system together with the PSO based PID controller.

Journal for computers and Informatics (IJCI)
(3)m table(3), we can conclude that PSO based PID controller gives the best system response among the other controllers.