# Evolutionary Tuning Method for PID Controller Parameters of a Cruise Control System Using Metamodeling

Authors: M. N. Ab Malek; M. S. Mohamed Ali
Journal: Modelling and Simulation in Engineering
 (2009)

---

## Abstract

For long time the optimization of controller parameters uses the well-known classical method such as the Ziegler-Nichols and the Cohen-Coon tuning techniques. Despite its effectiveness, these off-line tuning techniques can be time consuming especially for a case of complex nonlinear system. This paper attempts to show a great deal on how Metamodeling techniques can be utilized to tune the PID controller parameters quickly. Note that the plant use in this study is the cruise control system with 2 different models, which are the linear model and the nonlinear model. The difference between both models is that the disturbances were taken into consideration for the nonlinear model, but in the linear model the disturbances were assumed as zero. The Radial Basis Function Neural Network Metamodel is able to prove that it can minimize the time in tuning process as it is able to give a good approximation to the optimum controller parameters in both models of this system.


---

## Body

## 1. Introduction

It is crucial to tune the controller parameters wisely for any control system in order to obtain the optimum results for its output. That is, the system output response should be as similar as possible due to the corresponding reference.There were several techniques that commonly used to tune the controller parameters. For example, the Ziegler-Nichols tuning technique, the Cohen-Coon tuning technique, the tuning based on process response, the Damped Oscillation tuning method and so on. Each technique has its own pros and cons. But, for sure these conventional techniques consume lot of time as the tuning process need to be tuned again and again until the best response is met.Usually, computer simulation is used to model the real complicated system to save cost and time. In spite of the advances in computer technology, the required time to simulate the actual model might still be long and thus it becomes impractical to rely exclusively on simulation for the purpose of design optimization. To overcome this timing issue, the Metamodeling techniques offer good approximation to the actual model due to the usage of simpler model, added on with less computation algorithms.This paper illustrates how to optimize the PID controller parameters for both models (linear and nonlinear) of the cruise control system.


## 2. Metamodeling Review

Metamodeling or sometimes called as “model of the model” has been used extensively in many fields to give simpler model of the input and output function that approximates the relationship between system performances and controller parameters of a system. The required significant set of data for each PID controller parameter that fit the actual set of data will give the best results of approximation.Recently, as studied in [1], Metamodeling had been used to optimize various type of system, included the nonlinear system. Some of the system that were successfully optimized using the Metamodeling technique are the fluid mixing system, the Cartesian coordinates control of hovercraft system and the flexible robot manipulator. Through their study, they also had proved that the Metamodeling technique can optimize various types of controller parameters, for example, the fuzzy logic controller and the PID controller.In another example, in a test Metamodeling for optimization problem in Rashid [2], training a Fuzzy-Neuro Metamodel on 130 measurement data and the search for its global minimum took only 5.62 minutes of execution time using a Pentium based PC. Hence, although the output of the Metamodel is only an approximate of the actual measurement of the complex model, evaluation of this output value is fast and it usually provides enough information especially during the design phase of a project.


## 3. Radial Basis Function Neural Network

The RBFs were first used to design Artificial Neural Networks in 1988 by Broomhead and Lowe [3]. Past works reported that the roots of RBF are entrenched in much older pattern recognition techniques as for example potential functions, clustering, functional approximation, spline interpolation and mixture model [4].In this study, it was used as the Metamodel for matching process between the input-output of the cruise control system. The architecture of the RBF-NN used in this study is illustrated in Figure1.Figure 1
Radial Basis Function Neural Network.The network consists of three layers: an input layer, a hidden layer and an output layer. Here,Rdenotes the number of inputs while Q the number of outputs. Equation (1) is used to calculate the output of the RBF NN for Q=1,Figure 2
A block diagram by Dorf and Bishop [20].(1)η(x,w)=∑k=1S1w1k∅(∥x-ck∥2),
where x∈ℜR×1 is an input vector, ∅(·) is a basis function, ∥·∥2 denotes the Euclidean norm, w1k are the weights in the output layer, S1 is the number of neurons (and centers) in the hidden layer and ck∈ℜR×1 are the RBF centers in the input vector space. Equation (1) can also be written as,(2)η(x,w)=∅T(x)w,
where:(3)∅T(x)=[∅1(∥x-c1∥)⋯∅S1(∥x-cS1∥)],∅(x)=e-x2/β2,
where β is the spread parameter of the RBF. For training, the least squares formula was used to find the second layer weights while the centers are set using the available data samples.RBF NN offer several advantages compared to the Multilayer Perceptrons. RBF-NN has also been successfully applied to a large diversity of applications including interpolation [3, 5], chaotic time series modeling [6], system identification, control engineering [7], electronic device parameter modeling, channel equalization [8–10], speech recognition [8, 11], image restoration [12], shape from shading [13], 3-D object modeling [5, 14], motion estimation and moving object segmentation [15], data fusion [16], and so forth, The advantages of RBF are they can be trained using fast two stages training algorithm without the need for time consuming nonlinear optimization techniques and an ANN RBF possesses the property of “best approximation” [17]. In Metamodeling, RBF NN has also been successfully used, as reported by [18, 19].


## 4. Cruise Control System

This section presents the mathematical equation that represents both linear and nonlinear model of the cruise control system.In this paper, all equations were modeled base on the block diagram given by Dorf and Bishop [20] as shown in Figure 2. The cruise control system properties and values used are given in Table 1.Table 1
Cruise control system variables and values used for simulation.
VariablesDescriptionValuesτTime constant (s)0.2TReal time (s)1MMass of the vehicle (kg)1500FdminDrive force minimum limit (N)-3500FdmaxDrive force maximum limit (N)+3500FaAir drag force (N)VariableFgGravitational force (N)VariableC1Constant related to engine block (no unit)743CaConstant related to air-drag force (Nm−1s2)1.19GConstant related to gravitational force (ms−2)9.81vwVariable related to wind disturbanceVariableUVariable related to desired speedVariableθVariable related to gravity disturbanceVariableThe following equations model the plant dynamics of nonlinear system:(4)v̇=1M(Fd-Fa-Fg),(5)v̇=1M(Fd-Cav2-2Cavvw-Cavw2-(-mgcosθ)),(6)Fḋ=1T(C1u(t-τ)-Fd).
The nonlinear model includes the disturbances parameter into account, therefore all terms include the gravitational force (Fg) and the wind disturbance variable (vw) were used in (4), (5), and (6). These disturbances are actually opposing forces that reduced the forward force that accelerates the car. Also note that in this paper, the wind gust was assumed to be in the front direction only. Hence, it was calculated into the error signal together with the output signal.Take a glance at (5) above. There is squared terms in that equation. To eliminate the squared term in (5), equations (5) and (6) were differentiated both left and right sides to yield:(7)ddtv̇=1M(-2Cavδv+δFd-2Caδvδvw-2Cavwδvw-mgsinθδθ),ddtFḋ=1T(C1δu(t-τ)-δFd).
The inverse Laplace Transform will facilitate the solution of this plant to be modeled in SIMULINK model. Hence, taking the inverse Laplace Transform of (7) yields:(8)sΔV(s)-v(0)=1M(-2CavΔV(s)+ΔFd(s)-2CaΔV(s)ΔVw(s)-2CavwΔVw(s)-mgsinθΔθ(s)),sΔFd(s)-Fd(0)=1T(C1ΔU(s)e-τs-ΔFd(s)).
Lastly by equating all initial conditions for (8) to zero, the complete equation that model the nonlinear model become:(9)sΔV(s)=1M(-2CavΔV(s)+ΔFd(s)-2CaΔV(s)ΔVw(s)-2CavwΔVw(s)-mgsinθΔθ(s)),sΔFd(s)=1T(C1ΔU(s)e-τs-ΔFd(s)).
In contrast, the linear model did not consider all disturbances parameter into the equation. That is, all terms involving the disturbances parameter such as the gravitational force (Fg) and the wind disturbance variable (vw) were eliminated. The following equations model the plant dynamics of linear system:(10)v̇=1M(Fd-Cav2),Fḋ=1T(C1u(t-τ)-Fd).
Same procedure as before, the nonlinearity functions need to be converted to the linear function. Therefore, (10) above were differentiated to obtain (11) as below:(11)ddtv̇=1M(-2Cavδv+δFd),ddtḞd=1T(C1δu(t-τ)-δFd).
Then, taking inverse Laplace Transform of (11):(12)sΔV(s)-v(0)=1M(-2CavΔV(s)+ΔFd(s)),sΔFd(s)-Fd(0)=1T(C1ΔU(s)e-τs-Fd(s)).
By setting all initial conditions to zero, the transfer function is as follow:(13)sΔV(s)=1M(-2CavΔV(s)+ΔFd(s)),sΔFd(s)=1T(C1ΔU(s)e-τs-ΔFd(s)).
The transfer function can be obtained by eliminating ΔFd(s) and solving above equations for the ratio of ΔV(s)/ΔU(s).(14)ΔV(s)ΔU(s)=(C1/MT)(1/τ)(s+2Cav/M)(s+1/T)(s+1/τ)
All mathematical equations for nonlinear model and linear model at which were obtained above were modeled in SIMULINK model. This can be illustrated by Figures 3 and 4, respectively.Figure 3
MATLAB SIMULINK block diagram for the nonlinear model of cruise control system using PID controller.Figure 4
MATLAB SIMULINK block diagram for the linear model of cruise control system using PID controller.Figure 5
Comparison of metamodel and actual simulation output for nonlinear model.Figure 6
Comparison of metamodel and actual simulation output for linear model.Note that, the PID controller parameters used in this study areKp1, Ki1, and Kd1 and the performance measure that was used in this case was the Integral Square Error (ISE) given by:(15)ISE=∫(yd(t)-y(t))2dt,
where yd is the desired output speed (set point) while y is the actual output speed.


## 5. Simulation Results

The Taylor Series Expansion is utilized to check the system’s stability. It should be done before the tuning process started. Referring to the eigenvalues obtained, it shows that the system is indeed stable and hence the control of the system should be possible.The tuning procedures for Metamodeling technique are listed below:(1)
Define the input design space,D, which consists of a set of initial values of the controller  parameters.(2)
Obtain the ISE for speed parameter for all the design space defined in 1.(3)
Create the target data set,T, which consists of the ISE for speed (Es̅).(4)
Fit the RBF NN usingD and T.(5)
Evaluate the RBF NN on a larger input space,D′.(6)
Find the minimum of the RBF NN output (estimatedE̅). The corresponding controller gains that minimized the RBF output will be the gains to be verified in actual model simulation.(7)
Repeat step 1 to 6 should the controller parameter gains are not satisfactory.In this case,D and D′ are the sets of discrete values given in Table 2. The parameters for the RBF NN used to fit the data D is summarized as:Table 2
Initial and large data sets.
Initial and Large Data SetsModel typeNonlinearLinearKp1{1.5,0.1,…,2.0}{1.525,0.1,…,2.0}DKi1{0.0,0.15,…,0.3}{0.0,0.15,…,0.3}Kd1{0.0,0.25,…,1.0}{0.0,0.055,…,1.0}Total number of data configuration90285Kp1{1.5,0.025,…,2.0}{1.5,0.025,…,2.0}D′Ki1{0.0,0.01,…,0.3}{0.0,0.01,…,0.3}Kd1{0.0,0.025,…,1.0}{0.0,0.025,…,1.0}Total number of data configuration2669126691(i)
16 RBF centers are used. Centers are added one by one until the RBF NN reaches an error goal of 0.1.(ii)
β=150.The limitation of this study is the use of MATLAB on an INTEL PENTIUM M PC to simulate the whole process of optimization. For verification purpose, the actual simulation had been done onD′, which consist of 26691 data. The result of actual simulation is then compared with the Metamodeling techniques for each model as illustrated in Figures 5 and 6.The best controller gain that minimized the error or noted as ISE(E̅) for both approaches are given in Table 3. Meanwhile, the time taken to complete the tuning process is noted down as presented in Table 4.Table 3
Best gains for the cruise control system.
ProcessMetamodelActualModel typeNonlinearLinearNonlinearLinearKp11.51.51.51.5Ki10.230.220.30.09Kd10.750.650.750.55Table 4
Simulated time for tuning process.
ProcessMetamodelActualModel typeNonlinearLinearNonlinearLinearTime taken0.4172 min0.57318 min52.6874 min40.8492 minUsing the optimized PID gains obtained by Metamodeling technique, the results of the system output response are sketched in Figures7 and 8.Figure 7
Response of speed for nonlinear model.Figure 8
Response of speed for linear model.


## 6. Discussion

Tables5 and 6 show a comparison of the results in terms of system characteristics. From the results obtained, it can be observed that the adoption of PID controller using the Metamodeling tuning technique can give an almost similar and good response to the system. The effect of each controller Kp, Ki and Kd on a closed-loop system will make that system more stable than the original one. For the case of nonlinear model, the optimized PID controller has proven it can attenuate the disturbances signal that appeared to its system.Table 5
System response characteristics for nonlinear model.
Disturbances typeCharacteristicsActualMetamodelWind forceTp103s–203s103s–203sTs110s–214s111s–219s%OS−1.93%–1.93%−1.58%–1.86%Gravity forceTp303s–403s303s–403sTs317s–418s332s–434s%OS−31.02%–30.99%−31.11%–31.12%Table 6
System response characteristics for linear model.
CharacteristicsActualMetamodelTp5s5sTs32s32s%OS26.9%32.92%As referred to Figures5 and 6, the best controller gain that minimizes the ISE (E̅) for the actual simulation is given in Table 7. Meanwhile, the time taken to complete the actual process for each model is given in Table 8.Table 7
Best PID controller parameter using actual simulation.
Best gains based on actual simulationModel typeNonlinearLinearKp11.51.5Ki10.30.09Kd10.750.55Table 8
Time taken to optimize PID controller parameter using actual simulation.
Simulated time based on Actual SimulationModel typeNonlinearLinear52.6874 minutes40.8492 minutesNext, the comparison of the minimum errors between the actual process and Metamodel is done and implied in Table9. Although the results are slightly differed between each others, it can be observed that the Metamodel managed to approximate the global minimum of the error curve fairly well.Table 9
Metamodel and Actual Result Comparison for PID Controller.
Model typeNonlinearLinearCategoryMetamodelActualMetamodelActualmin (E̅)1651157310631031


## 7. Conclusion

In this study, the initial data set,D was created based on the background knowledge of the problem. The data contained in the initial data set, D need to be determined carefully, as the data that mismatch much points in the large space, D′ will not run the Metamodeling process efficiently. Hence, there is a need of improvement for Metamodeling techniques. An investigation on the possible use of the Worst Case Approach [21] and the Cross Validation technique [22] in data sampling would seems be the appropriate next step forward. It can be simplified that more strategic data location will allow the creation of a more accurate Metamodel using less data, and therefore, less time is required to estimate the best controller parameters.



---

*Source: 234529-2010-02-23.xml*