Fuzzy Logic in Pid Gain Scheduling
Fuzzy Logic in Pid Gain Scheduling
net/publication/265060015
Article
CITATIONS READS
27 148
2 authors, including:
Heikki Koivo
Aalto University
44 PUBLICATIONS 640 CITATIONS
SEE PROFILE
All content following this page was uploaded by Heikki Koivo on 12 May 2015.
Abstract: An approach, where fuzzy logic is used in gain scheduling of PID controller, is proposed. The PID controller
is tuned at a number of operating points with IMC tuning rules based on a simple linear model. The tunings and the oper-
ating points are collected to a fuzzy rule base. The plant output and the reference signal are used as scheduling variables
by the fuzzy logic. The proposed controller structure is used to control a very nonlinear simulation model.
1 Introduction
The most widely used controller in industrial applications is PID-controller (proportional-integral-derivative). It is easy
to tune and it has good disturbance attenuation properties. A disadvantage of the PID controller is that it is linear and can
not successfully control a plant, which has strong nonlinearities.
In fuzzy logic (FL) control [1], [2], PD-type and PI-type FL controllers are the best-known counterparts of the PID con-
troller. They are used to achieve better performance with nonlinear processes. Good experiences have been obtained espe-
cially with the PD-type FL controllers in servo applications [3], [4]. However, the standard FL controller, which has the
error and the change in the error as inputs and the control signal or its change as an output, can not react to changes in the
operating point. The FL controller needs more information to compensate nonlinearities when the operation conditions
change. When the number of the fuzzy logic inputs is increased, the dimension of the rule base increases too. Thus, the
maintenance of the rule base is more time-consuming. An other disadvantage of the FL controllers is the lack of system-
atic, effective and useful design methods, which can use a priori knowledge of the plant dynamics.
Deficiencies of the PID controller and the FL controller can be solved by combining them together. Fuzzy logic can be
used to tune the PID controller on-line if the response of the closed loop system is not acceptable [5]. In this approach, the
fuzzy logic can change the controller parameters even if the dynamics is not changed. This is not desirable.
In this paper, fuzzy logic is used to schedule off-line tuned parameters based on the system operating point. This is
closer to the conventional gain scheduling [6] than the method proposed in [5]. The fuzzy reasoning is based on the plant
output, the reference signal and a table of the off-line tuned PID parameters. Thus, the different dynamics of the system
can be taken into account in different operating conditions. However, the dimension of the rule base can be kept small,
which helps the maintenance.
2 Problem Statement
Consider a nonlinear, time-invariant, single-input single-output plant
3 IMC-Tuning of PID-Controller
In internal model control (IMC) structure, the controller is designed to act as an inverse of the model of the plant [7].
An IMC filter is used to make the controller realizable. For some linear plants the result is the PID-controller,
where K P , T I and T D are the proportional gain, integral time and derivative time, respectively, U(s) and E(s) are
Laplace transforms of the control signal and the error between the reference signal and the plant output.
Thus, the IMC approach can be used to tune PID-controller easily. For an second order transfer function model
2
kω n
Y(s) = ---------------------------------------- U(s) (4)
2 2
s + 2ζω n s + ω n
where k is the gain, ζ is the damping ratio, and ω n is the natural frequency, the IMC approach produces a PID-tuning
2ζ 2ζ 1
K P = ------------- T I = ------ T D = ------------- (5)
λkω n ωn 2ζω n
where λ is the tuning parameter which means the time constant of the closed loop system.
In this paper, a variation of the PID-controller proposed by Clarke [8] is used because of its better derivative part. The
controller is of the form
KP TD s
U(s) = K P 1 + ------- E(s) – ---------------------- Y(s)
1
(6)
Ts I
1 + aT D s
where a is the filtering constant at the interval (0,1) , and Y(s) is Laplace transform of the plant output. The implemen-
tation of the derivative part is more realistic than in (3). The low pass filter reduces the effect of the measurement noise,
and only the plant output, which is continuous, is differentiated.
The controller can be discretized with an approximation s ≈ ( 1 – d ) ⁄ h , where h is the sampling interval, and d is the
delay operator. Thus, the discretized controller is of the form
where k is a sampling time, e(k) = r(k) – y(k) is the error signal, ∆e(k) = e(k) – e(k – 1) and ∆y(k) = y(k) – y(k – 1)
are the differences. The control signal is restricted to the interval [ u min, u max ] .
FL
1
r(k)
u(k) y(k) 0
PID Plant r1 r2 r3 r
Grade of membership
1
0.5
Fig. 1. Gain scheduling with fuzzy logic. The reference signal is used as a
scheduling variable too. 0
y1 y2 y
Table 1 1
Rule base of an example fuzzy logic
rule 0.5
if r is about r 1 and y is about y 1 then θ is about p 1
0
if r is about r 1 and y is about y 2 then θ is about p 2 p1 p2 p3 p4 θ
if r is about r 2 and y is about y 1 then θ is about p 3
if r is about r 2 and y is about y 2 then θ is about p 1 Fig. 2. The form of membership functions. Trapezoids and triangles are
if r is about r 3 and y is about y 1 then θ is about p 3 used for inputs of the fuzzy logic and singletons for output of the fuzzy
logic.
if r is about r 3 and y is about y 2 then θ is about p 4
p 1 p3 p 3
pr = r 1 r 2 r3 py = y1 y2 Pθ = (8)
p 2 p1 p 4
where F(·, ·) is a fuzzifier, which computes values of all the membership functions and returns them in a column vector,
secondly relation
T
R(k) = µ y(k) µ r (k) (10)
which implements the fuzzy and-operation at the premise part of the rules with product [9], and thirdly defuzzification
n n n n n n
K P(k) = ∑ ∑ P Pi, j R i, j(k) T I( k ) = ∑ ∑ P Ii, j R i, j(k) T D(k) = ∑ ∑ PDi, j Ri, j(k) (11)
i = 1j = 1 i = 1j = 1 i = 1j = 1
which is realized by weighted sum. Here n is the number of the fuzzy sets for y and the matrices P P , P I and P D define
the rule base and the places of the singletons for K P , T I and T D (See P θ in (8)).
4 of 5
py = y0 y0 … y0 (12)
1 2 n
in the ascending order and the tuning parameters written in the matrix form
K P1 K P2 … K Pn
Θ = T I1 T I2 … T In (13)
T D1 T D2 … T Dn
in the same order. The PID-controller can be tuned by IMC-tuning rules or by any other tuning method.
The corner points of the membership functions are p y for the plant output and p r = p y for the reference signal. The
content of the rules and the places of the singletons are
P P i, j = w y Θ 1, i + w r Θ 1, j P I i, j = w y Θ 2, i + w r Θ 2, j P D i, j = w y Θ 3, i + w r Θ 3, j (14)
where w y and w r are weights of the plant output and the reference signal. Values w y ≈ 0.9 and w r = 1 – w y can be used.
6 Simulation Example
A nonlinear plant of the form
x 2(t)
x· (t) = y(t) = x 1(t) (15)
– 0.25x 1(t) – 0.70x 2(t) + ( 4.75 – 4.50x 1(t) )u(t)
T
where x(t) = x 1(t) x 2(t) and 0 ≤ u(t) ≤ 1 , is used in simulations. The plant is stable, but its dynamics change dramat-
ically over the operation range, which can be easily seen from the open loop step responses. The plant can not be controlled
successfully by any single linear controller.
The PID parameters, which should be used at each operating point can be computed from the linearized model by (5),
but the plant (15) has been assumed to be unknown in the simulations. Thus, linear models of the plant are first determined.
The model parameters have been estimated from input-output data which has been sampled with sampling interval
h = 0.5 s. The control signal has been in neighborhood of 0.05, 0.25, 0.5, 0.75 and in addition in two auxiliary points in
0.0025 and 0.025. These correspond to the following corner points of membership functions
which means that almost the whole varying interval of the plant output [ 0, 1 ] is covered.
The PID parameters tuned at these operating points are
Fig. 3. Step responses of the closed loop systems, when the change in the Fig. 4. Step responses of the closed loop systems, when the change in the
reference signal is 0.1. Parameters of the fixed PID are KP = 0.0875 , reference signal is 0.5. Parameters of the fixed PID are K P = 0.0875 ,
T I = 0.9432 and T D = 1.4286 . ( λ = 5 , a = 0.01 , h = 0.5 ) T I = 0.9432 and T D = 1.4286 . ( λ = 5 , a = 0.01 , h = 0.5 )
In Fig. 3, the reference signal covers the whole operation range with small 0.1 steps with 30 s intervals. The response
of the closed loop system is compared with the response of the fixed parameter PID controller, which is tuned based on
0
the linear model at operation point y = 0.7 . The fixed parameter PID is too tight in the lower area and too loose in the
upper area, but the response of fuzzy logic scheduled PID is consistently good.
In the second simulation, the size of the step is increased to 0.5. Without the weight of the reference signal, an overshoot
would occur in the step from 1.0 to 0.5, but the response is good, when the weight is used as can be seen in Fig. 4. The
fuzzy logic produces tight control parameters near y = 1 . Without the weight w r , a big change in the reference signal
and the tight control parameters cause the control action changed to the area where looser control parameters should be
used. But, looser tuning is used just after the plant output has moved to that area and the overshoot can not be avoided.
7 Conclusion
An approach, where fuzzy logic is used in gain scheduling of the PID controller for nonlinear systems, has been pro-
posed. The PID controller is tuned off-line at different operating points with help of IMC tuning rules. Also other tuning
methods can be used. The tuning parameters and the operating points are written to a fuzzy logic rule base. The fuzzy logic
changes PID parameters as a function of the operating point during the control. The parameters are not only a function of
the plant output, but also the reference signal is taken into account. This causes that the fuzzy logic changes the parameters
immediately after a big change in the reference signal. The control is either looser or tighter based on the next operating
point. Thus, overshoots can be avoided. The method has been tested in simulations. A second order nonlinear model was
used in the simulations. The resulting performance was much better than the performance of the fixed parameter PID con-
troller.
The gain scheduling is useful, when the plant is strongly nonlinear but time-invariant. Thus, a simple linear controller
can used successfully. When the parameters of the plant do not change in the course of time, the time-consuming tuning
task is not needed to be repeated often. The gain scheduling can be presented in clear linguistic form by the fuzzy logic.
Different scheduling variables are easy to be taken into account with the fuzzy logic.
References
[1] C. C. Lee, “Fuzzy logic in control systems: Fuzzy logic controller—part II,” IEEE Trans. Syst. Man Cybern., vol. 20, no. 2, pp. 419−435, 1990.
[2] D. Driankov, H. Hellendoorn and M. Reinfrank, An Introduction to Fuzzy Control. New York: Springer-Verlag, 1993.
[3] J. Franssila and H. N. Koivo, “Fuzzy control of an industrial robot in transputer environment,” IEEE Int. Conf. on Industrial Electronics, Control,
Instrumentation and Automation, San Diego, 1992, pp. 624−629.
[4] A. Makkonen and H. N. Koivo, “Fuzzy control of a nonlinear servomotor model,” 3rd Int. Workshop on Advanced Motion Control, Berkley, CA,
USA, March 20−23, 1994. pp. 833−841.
[5] Z. Y. Zhao, M. Tomizuka and S. Isaka, “Fuzzy gain scheduling of PID controllers,” IEEE Trans. Syst. Man Cybern., vol. 23, no. 5, 1392−1398, 1993.
[6] K. J. Åström and B. Wittenmark, Adaptive Control. Reading MA: Addison-Wesley, 1989.
[7] M. Morari and E. Zafiriou, Robust Process Control. New Jersey: Prentice-Hall, 1989.
[8] D. Clarke, “Automatic tuning of PID regulators,” Expert Systems and Optimisation in Process Control, Technical Press, Aldershot, England, 1986.
[9] M. M. Gupta and J. Qi, “Theory of T-norms and fuzzy inference methods,” Fuzzy Sets and Systems, 40, 431−450, 1991.