Tuning of Two-Degrees-of-Freedom PID Controllers via the Multiobjective Genetic Algorithm NSGA-II Rubén Lagunas-Jiménez, Guillermo Fernández-Anaya J. Carlos Martínez-García Universidad Autónoma de Campeche, México Universidad Iberoamericana, México CINVESTAV-IPN, México
[email protected],
[email protected] and
[email protected] Abstract In this paper a procedure is used to tuner two degrees of freedom controllers (PID-ISA) raised as a multiobjective optimization problem (MOP), applying the multiobjective genetic algorithm NSGA-II (MOGA NSGA-II). The objective functions are deployed considering, setpoint response, load disturbances, measurement noises and robustness to model uncertainty.
1. Introduction The evolutionary algorithms are inspired by the processes of natural evolution. At present, the evolutionary approach includes a group of computational strategies, which are: the Genetic Algorithms (GAs), the Evolutionary Programming, the Genetic Programming and the Evolutionary Strategies. These strategies turn out to be powerful tools, to solve optimization problems. The MOGA is an alternative to solve control problems raised as a multiobjective optimization problem with constraints, which allows it to be applied in problems of automatic control [3-5]. For the tuning of the PID-ISA controllers, the feedback control problem appears as a multiobjective optimization problem, of a set of functions, where the controller parameters are included. The design specifications, can be formulated as objective functions, subject to certain constraints, which are measured by different norms of the closed-loop transfer functions, towards the considered control system. The NSGA-II (nondominated sorting genetic algorithm-II), is used in this work. This algorithm is classified as a second generation of multiobjective genetic algorithm announced by
Deb [7] and his investigators group in the year 2002. This work is based on the results published by A. Herreros [8] in his doctoral dissertation on design of multiobjective robust controllers by means of genetic algorithms.
2. Basic concepts As a consequence of applying the multiobjective genetic algorithm to the optimization problem, this one gives, a set of ideal solutions, called Pareto Optimal Set; from this set, the person who plants the optimization problem (user), can select some solutions, in accordance with his preferences, since in the majority of the practical problems it is not possible to find out a unique solution that whether minimizes or maximizes all objectives simultaneously. Next, the basic definitions related to the ideal solutions or non-dominated solutions (In the Pareto sense) are presented. The non-dominated solutions means that does not exist other solutions which are better than those ones, considering all the objective functions (For instance see [5]). Definition 1 (General MOP): Find the vector
[
]
T
x * = x1* , x 2* ,..., x n* which will satisfy the m inequality constraints: (1) g i ( x ) ≥ 0 i = 1,2,..., m the p equality constraints (2) hi ( x ) ≥ 0 i = 1,2,..., p and will optimize the vector function
f ( x ) = [ f 1 ( x ), f 2 ( x ),..., f k ( x )]T
(3)
where x = [x1 , x 2 ,...x n ]T is the vector of decision variables. Definition 2 (Pareto Dominance): A vector u = (u1 ,..., u k ) is said to dominate v = (v1 ,..., v k ) (denoted by u≺v ) if and only if u is partially less than v, i.e., ∀i ∈ {1,2,..., k}, ui ≤ vi ∧ ∃i ∈ {1,2,..., k } : u i < vi Definition 3 (Pareto Optimality): A point x * ∈ Ω is Pareto optimal, if for every x ∈ Ω and I = {1,2,..., k} either;
∀ i∈I ( f i ( x ) = f i ( x * ))
(4)
or; there is at least one i ∈ I such that f i (x) > f i (x * ) (5) (Ω is the feasible region). In words, this definition says that x * is Pareto optimal if there exists no feasible vector x which would decrease some criterion without causing a simultaneous increase in at least one other criterion. Definition 4 (Pareto Optimal Set): For a given MOP f (x ) , the Pareto optimal set ( P ∗ ) is defined as: P ∗ := {x ∈ Ω ¬∃x´∈ Ωf ( x´)≺ f ( x)} (6) Definition 5 (Pareto Front): For a given MOP f (x ) , and Pareto optimal set ( P ∗ ) , the Pareto front ( FP ∗ ) is defined as: PF ∗ := {u = f = ( f1 ( x ),..., f k ( x )) x ∈ P∗
}
(7)
In contrast to the simple genetic algorithms that look for the unique solution, the multiobjective genetic algorithm tries to find as many elements of the Pareto set as possible. For the case of the NSGA-II, this one is provided with operators who allow it to know the level of not-dominance of every solution as well as the grade of closeness with other solutions; which allows it to explore widely inside the feasible region. Non-dominated Sorting -
Crowding distance sorting
F1 Pt
F2 F3
Qt
Rejected Rt
Figure 1. The NSGA-II procedure
Pt+1
In a brief form, the functioning of the MOGA NSGA-II can be described through the following steps: -Fast-non-dominated-sort. A very efficient procedure, is used to arrange the solutions in fronts (non-dominated arranging), in accordance with their aptitude values. This is achieved, creating two entities for each of the solutions. A domination count np, the number of solutions which dominates the solution p, and a set (Sp), that contains the solutions that are dominated for p. The solutions of the first front have the higher status of not-dominance in the Pareto sense. -Diversity Preservation. This is achieved, by means of the calculation of the crowding degree or closeness for each of the solutions inside the population. This quantity is obtained, by calculating the average distance of two points on either side of a particular solution along each of the objectives. This quantity serves as an estimate of the cuboid perimeter, formed by using the nearest neighbors as the vertices. There is also, an operator called Crowded-Comparison ( ≺ n ), which guides to the genetic algorithm, towards the Pareto optimal front, in accordance with the following criterion: i ≺ n j if (i rank < j rank ) or (i rank = j rank ) and(i dis tan ce > j dis tan ce )
In accordance with the previous criterion, between two non-dominated solutions, we prefer the solution with the better rank. Otherwise, if both solutions belong to the same front, then, we prefer the solution that is located in a lesser crowded region. -Initial Loop. Initially, a random parent population (Po) of size N is created. Later this one is ordained, using the procedure of nondominated arranging. Then the usual binary tournament selection, recombination and mutation operators are used to create a new population (Q0), of size N. -Main Loop. The NSGA-II procedure can be explained, by describing the th generation just as it is showed in the Figure 1. The procedure begins with the combination of Pt and Qt forming a new population called Rt, then the population Rt is sorted using the non-domination criterion. Since all previous and current population members are included in Rt, elitism is ensure [7]. The population Rt has a size of 2N, later, the different fronts of non-dominated solutions are created, being F1 the front that contains the better rank solutions. Figure 1 shows that, during the process of forming the new population Pt+1, the algorithm takes all members of the fronts F1 and F2, and some elements of the front F3; this is, because N
solutions are needed exactly for the new population Pt+1. to find them exactly N solutions, the last front is ordained, which for this description is the number 3, arranging the solutions in descending order by means of the crowded comparison ( ≺ n ), and selecting the best solutions needed to fill all population slots. After having the population Pt+1, the genetic operators of selection, crossing and mutation, are used to create the new population Qt+1 of size N. Finally it is mentioned that the selection process, the crowded comparison operator is used.
e p ( s) = br ( s) − ~ y (s ) = be(s ) + (b − 1) ~ y (s ) ed ( s) = cr ( s) − ~ y ( s) = ce( s) + (c − 1) ~ y (s ) Also, the PID-ISA controller can be represented as the Figure 3 r Cr(s)
u Cy(s)
+
ỹ -1
3. PID-ISA controller
Figure 3. PID-ISA
The Proportional-Integral-Derivative (PID) controller that is proposed in this work is a twodegrees-of-freedom PID-ISA controller (Instrument Society of America), which contains seven parameters and is tuned by means of the multiobjective genetic algorithm, the NSGA-II. This structure was selected, because of, it is widely used in industrial control. The control scheme proposed in this work is shown in Fig. 2. l r
d
e u _
y
PID(s)
G(s)
~y
F(s)
Figure 2. Control scheme
r denotes the reference input signal; e denotes the error signal; ỹ denotes the filtered output signal; u denotes the control signal; l denotes the load disturbance signal; d denotes the noise signal; y denotes the output signal; G(s) denotes a Linear Time-Invariant (LTI) Single-Input Single-Output (SISO) plant; PID(s) denotes the PID-ISA Controller. The filter F(s) is used to reduce the noise effect of high frequency in the output signal, where Tf is the filter time constant. F ( s) =
1 1 + sT f
(8)
and the PID-ISA model controller: u (s) = k (e p (s ) +
1 Td s e (s ) + ed ( s)) Ti s 1 + Td s N
e( s ) = r ( s ) − ~ y (s )
(9)
C r ( s) = k (b +
cTd s 1 ) + Ti s 1 + Td s N
(10)
C y ( s) = k (1 +
Td s 1 ) + Ti s 1 + Td s N
(11)
From the previous equations: k, Ti and Td correspond to the controller gain, the integral time and the derivative time respectively. The parameters b and c are the weightings that influence the setpoint response, without altering the response of the controller to the load disturbances and measurement noises. Also the high frequency gain of the derivative term sTd/(1 sTd/N), is limited to avoid noise amplification [2]. The gain limitation can be parameterized in terms of the parameter N. The control scheme, can be represented by means of nine transfer functions, Equation 12 (see for instance [8]), where each close-loop transfer function (Tzw(s)), denotes the relationship between the output signal z and the input signal w. e(s ) r (s ) Ter ( s) Tel ( s) Ted (s ) r ( s ) y (s ) = T ( s ) l ( s) = T ( s) T ( s) T (s ) l (s ) yl yd yr u (s ) d (s ) Tur ( s ) Tul ( s ) Tud ( s ) d ( s )
(12)
4. PID-ISA tuning procedure The design of the PID-ISA controllers is formulated as an optimization problem, of a series of norms of certain transfer functions that evaluates the control process specifications. The wished specifications of the control system, (showed in Fig. 2), can be formulated in terms of the minimization of the following H 2 , H ∞ y L1 norms. The objective functions are proposed considering: Setpoint response, load disturbances, measurement noises and robustness to model uncertainty. Then, the objective functions are formulated.
in this case p=2.
4.1. Attenuation of load disturbance
4.3. The sensitivity to modeling errors
This effect is measured by the integral of the output signal for an input step, applied in the signal control u. Applying the principle of superposition, i.e., making zero the values of the reference signal and the measurement noise signal: J1 =
∫
∞
0
p
y (t ) dt , p ∈ ℵ
(13)
Normally 1 or 2 is selected for p. Since y(t) in (3), can be expressed by the inverse Laplace transform of T yl ( s) 1s t, where T yl (s) , is the transfer function between the
perturbation signal l and the output signal y, the Equation 3 can be expressed as: J
Where
⋅
p
= T
1
1 s
yl
1 p
(14)
denotes the p-norm. In this case,
p=1 (L1 norm), which allows us to minimize the changes of the output signal y, in the temporary domain, in presence of the disturbance signal. This objective is defined in [3, 10]: J
=
1
T
yl
1 s
(15) 1
4.2. Set point response It is important to have a good response to setpoint changes, being considered among the most important points: the raise time, the settling time, the decay ratio, the overshoot and the steady-state error. To characterize the temporary response of the control system to a reference signal, the following index performance [9] is used:
∫
)
Index J 2 is equivalent to: J
2
=
L(s) is the loop transfer function of the control system, showed in the Figure 2. L (s) is given by: L( s) = F (s )C ( s)G (s ) Td s 1 + ) Ti s 1 + Td s N Also S(s) is given by the closed-loop transfer The maximum function T yd ( s ) = 1+ L1( s ) . = F (s )G ( s )k (1 +
sensitivity (frequency response) is then given by M s = max S (iw) . Therefore Ms is given by M
s
= T
yd
(s)
∞
. On the other hand, it is
known that the quantity Ms, is the inverse of the shortest distance from the Nyquist curve of loop transfer function to the critical point -1 [1]. Typical values of Ms are in the range from 1.2 to 2.0. This way, the Third Objective is given by:
J 3 = T yd
(18)
∞
The Objective Function 1 (15) measures the effect of the load disturbance (l); the Objective Function 2 (17) assures a good response to the setpoint changes, and finally, the Objective Function 3 (18) measures the effect of robustness from the model uncertainties. The constraints given by (19) and (20) define the feasible region (Ω).The first constraint (19), guides the algorithm towards the solutions that make stable the control system. The second constraint (20), limits the size of the signal control (u) for pre-established values: polos(real (T yd )) < 0 r1 =
T
ur
(s)
∞
(19) < γ
(20)
4.4. Test plants and tuning procedure
1 p
∞ p J2 = te (t ) dt (16) 0 Where e(t) is the output signal, corresponding to a step input in r(t). On the other hand, if e(t) is the impulse response of a system, with a transfer function Ter ( s) 1s , then te(t), is the impulse response to a control system with a transfer d function ds Ter ( s ) 1s . Therefore the performance
(
They can be expressed in terms of the largest value of sensitivity function S ( s) = 1+ L1( s ) , where
d 1 T er ds s
(17) p
The test plants used in this article were selected from a set of plants presented by Åström [1], which are representative of the automatic control literature. The test plants are showed in the Table 1. Table 1. Test plants
G1 ( s ) =
e −15 s ( s +1) 3
G 2 (s ) =
e−s s
G3 ( s) =
4 ( s + 4)( s −1)
The process tuning of two-degrees-of-freedom PID-ISA controllers, used in this article, is showed by Figure 4, where it shows that the genetic algorithm NSGA-II (Nsga2u.exe), interacts with MATLABTM, so that, in this software, the objective functions and the optimization problem constraints should be evaluated. Objective functions and constraints were written as MATLAB functions (f.m). In the same figure it is observed that exists a called script Sel_pareto.m, which allows to select four solutions of the Pareto optimal set (after applying the NSGA-II), Sel_pareto.m presents to the user two different options: 1. Better setpoint response and 2. Better load disturbance attenuation. The Block mlb.txt contains the genetic algorithm parameters. begin mlb.txt Nsga2v.e
f.m
Results Control scheme simulink
Sel_pareto.m
Table 2. Controller parameters C(s)
PID11
PID12
PID21
PID22
PID31
PID32
Ti
8.18
8.41
8.22
7.05
0.44
2.27
Tf
0.019
0.035
0.009
0.035
0.008
0.005
Td
1.92
1.85
0.046
0.041
0.156
0.195
N
10.9
10.4
1.01
1.30
33.8
5.76
k
0.397
0.416
0.391
0.531
22.11
5.42
b
0.073
0.86
0.598
0.6538
0.183
0.607
c
0.0002
0.0005
0.8740
0.99
0.00014
0.428
Obj 1
26.1
25.6
21.14
13.43
0.021
0.417
Obj 2
67.8
42.3
2.89
1.73
0.11
0.15
Obj 3
1.56
1.60
1.44
1.68
1.16
1.16
Figure 5 shows the Pareto Front of the multiobjective optimization problem, used to determine the PID controller parameters, applied to the Plant 1. The dots in the Figure 5 indicate the solutions obtained from the final population. The Plant 1 has a long dead time delay (table 1). Dead time can be approximate with a first-order Padé approximation; that conduce to a nonminimal phase model. The Figure 6 shows the simulation result, which illustrates the resulting closed-loop system responses to unit-step followed by a load disturbance, corresponding to the Plant 1.
4 better solutions
End
Figure 4. PID tuning
5. Results In order to asses the performance of the proposed controller, we carried out some simulations using MATLAB-Simulink. The PID’s controllers, tuned in this work, were compared against PID’s controllers obtained by Herreros [8]. The main parameter values of the NSGA-II were the following ones: • Population size: 100. • Number of generation: 200 • Crossover probability: 0.80 • Mutation Probability: 0.09 Table 2 presents, the obtained controllers in this work, which are named like PID11, PID21 and PID31 corresponding to the plants G1(s), G2(s) and G3(s) respectively. The controllers PID12, PID22 and PID32 were obtained by Herreros [8].
Figure 5. Pareto front of plant 1
Figure 6. Plant 1
Plant 2 is a pure integrator with a time delay model. The Figure 7 presents the resulting closedloop system responses to unit-step followed by a load disturbance, corresponding to the Plant 1. The design procedure gives de controller parameters, which can be found in the Table 2.
practice there is no way of knowing if it has gone over or not to the real Pareto Front (that applies any MOP). A possible criterion of ending is when there are not already solutions that dominate the ones which are better up to the moment. If there is no progress after a certain number of iterations it is possible to presuppose that the algorithm converged already but obviously there is no guarantee of that. This is the biggest weakness of the heuristic strategies, since; when they stop there is no guarantee that it has reached the ideal solution.
7. References
Figure 7. Plant 2
Finally, the Figure 8 shows the set-point and load disturbance response for the closed-loop system of Process 3, which corresponds to an unstable system.
Figure 8. Plant 3
6. Conclusions The NSGA-II was selected by being a tool of public domain and quoted in multiple reports of evolutionary multiobjective investigation. It is a robust algorithm, of general application and that can be executed in different platforms. Comparing the obtained results of 3 test plants with the obtained ones by Herreros, they turn outto be very good, especially thinking that an algorithm of general application is used. Also, the results of the Pareto Front were filtered, so that only it gives the best four results in accordance with the following two criteria: 1. Better setpoint response and 2. Better load disturbance attenuation. On the other hand, with regard to the convergence of the genetic evolutionary algorithm NSGA-II, it is known that in the
[1] K.J. Åström, H. Panagopoulos and T. Hägglund, “Design of PI Controllers based on Non-Convex Optimization”, Automatica, Vol. 34, No. 5, 1998, pp. 585-601. [2] Åström, K.J. and T. Hägglund, PID Controllers: Theory, Design, and Tuning. Second Edition, Instrument Society of America, Research Triangle Park, NC, 1995. [3] Daniel U. Campos-Delgado, and Kemin Zhou. “Mixed L1/H2/H∞ control design: numerical optimization approaches”, International Journal of Control, Vol 76, 2003 no. 7, pp. 687-697. [4] Coello-Coello Carlos A., David A. Van Veldhuizen, and Gary B. Lamont, Evolutionary Algorithms for Solving Multi-Objective Problems, Kluwer Academic Publishers, 2002. [5] Carlos A. Coello-Coello, “An Update Survey of Evolutionary-Based Multiobjective Optimization Techniques: State of the Art and Future Trends”. In 1999 Congress on Evolutionary Computation. Washington, D.C. IEEE Service Center, 1999, pp. 313. [6] Coello-Coello Carlos A. and Ricardo Landa Becerra, “Evolutionary Multiobjective using a Cultural Algorithm”, In 2003 IEEE Swarm Intelligence Symposium, IEEE Service Center, Indianapolis, Indiana, USA, April 2003, pp. 6-13. [7] Deb Kalyanmoy, Amrit Pratap, Sameer Agarwal, and T. Meyarivan, “A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II”, IEEE Transactions on Evolutionary Computation, Vol. 6, No. 2 April, 2002, pp. 182-197. [8] Jhon C Doyle, Bruce A. Francis and Allen R. Tannenbaum, Feedback Control Theory, Macmillan Publishing Company, 1992. [9] Alberto Herreros López, Diseño de controladores Robustos Multiobjetivo por medio de Algoritmos Genéticos, Tesis Doctoral, Departamento de Ingeniería de Sistemas y Automática, Universidad de Valladolid, España, 2000. [10] Kemin Zhou and John C. Doyle, Essentials of Robust Control, Prentice Hall, 1998.