Fuzzy PID Controllers for Industrial Applications
G. Ron Chen
Lecture for EE 6452
City University of Hong Kong
Summary
• Proportional-Integral-Derivative (PID) controllers are the most widely used controllers in industries today
• Statistics: > 90% controllers in industries are PID or PID- type of controllers (the rest are programmable logical controllers (PLC))
• Merits of PID controllers: simple, cheap, reliable, and effective
• For lower-order linear time-invariant systems and processes, PID controllers have good set-point tracking performance with guaranteed stability
• Fuzzy logic provides a certain level of artificial intelligence to the conventional PID controllers
• Fuzzy PID controllers have self-tuning ability and on-line adaptation to nonlinear, time -varying, and uncertain systems
• Fuzzy PID controllers provide a promising option for industrial applications with many desirable features
Outline of the Presentation
• Overview of the Fuzzy Logic Technology
• Overview of Conventional PID Controllers
• Introduction to Fuzzy PID Controllers
• Some Successful Examples of Applications
• Concluding Remarks
Overview of the Fuzzy Logic Technology
Closed-Loop Set-Point Tracking System
Consider the typical set-point tracking system:
r
(reference
Controller e
(error +
−
u (control
signal) signal)
Plant y
(output signal) signal)
Σ
Figure 1 A typical closed-loop set-point tracking system
Objective:
e(t) := r(t) − y(t) → 0 (t→∞) Approach: Design a fuzzy logic controller (FLC)
Fuzzification Fuzzy Rule Base Defuzzification
e u
controller input
controller output Fuzzy Logic Controller (FLC)
Figure 2 General structure of a fuzzy logic controller
temperature
0 t r = 45o
y t( )
e t( ) a
b c
d
Figure 3 Temperature set-point tracking example
(i) If e > 0 then
e = r − y > 0 or r > y the output y is at position a or d
(ii) Furthermore, if
e &
< 0 then&
e
=r & − y & = 0 − y &
ory & > 0
(iii) Therefore, the output y is at position a
Fuzzy Logic Rule Base:
R1: IF e > 0 AND
e &
< 0 THEN u(t+) = u(t)R2: IF e < 0 AND
e &
< 0 THEN u(t+) = − u(t) R3: IF e < 0 ANDe &
> 0 THEN u(t+) = u(t) R4: IF e > 0 ANDe &
> 0 THEN u(t+) = − u(t)Fuzzy Controller Design
A. Fuzzification
Purpose: Enable the input physical signal to use the rule base Approach: Use membership functions
1
0 H
µPL µPS
e e. ,
1
0 H
µNL
µNS
e e.
− ,
(a) (b)
Figure 4 Four membership functions for signals e and e&
B. Programmable Rule Base
R1: IF e = PL AND
e &
< 0 THEN u(t+) = µP L(e) . u(t) R2: IF e = PS ANDe &
< 0 THEN u(t+) = (1−µPS(e)) . u(t) R3: IF e = NL ANDe &
< 0 THEN u(t+) = −µNL(e) . u(t) R4: IF e = NS ANDe &
< 0 THEN u(t+) = −(1−µNS(e)) . u(t) R5: IF e = NL ANDe &
> 0 THEN u(t+) = µNL(e) . u(t)R6: IF e = NS AND
e &
> 0 THEN u(t+) = (1−µNS(e)) . u(t) R7: IF e = PL ANDe &
> 0 THEN u(t+) = −µPL(e) . u(t)R8: IF e = PS AND
e &
> 0 THEN u(t+1) = −(1−µPS(e)) . u(t)To implement the FLC on a digital computer:
u(t) = u(kT) and u(t+) = u((k+1)T) where T is the sampling time.
R1: IF e(kT) = PL AND
e &
(kT) < 0THEN u((k+1)T ) = µPL(e(kT)) . u(kT) R2: IF e(kT) = PS AND
e &
(kT) < 0THEN u((k+1)T) = (1−µPS(e(kT))) . u(kT)
R3: IF e(kT) = NL AND
e &
(kT) < 0THEN u((k+1)T ) = −µNL(e(kT)) . u(kT) R4: IF e(kT) = NS AND
e &
(kT) < 0THEN u((k+1)T ) = −(1−µNS(e(kT))) . u(kT) R5: IF e(kT) = NL AND
e &
(kT) > 0THEN u((k+1)T ) = µNL(e(kT)) . u(kT) R6: IF e(kT) = NS AND
e &
(kT) > 0THEN u((k+1)T ) = (1−µNS(e(kT))) . u(kT) R7: IF e(kT) = PL AND
e &
(kT) > 0THEN u((k+1)T ) = −µP L(e(kT)) . u(kT) R8: IF e(kT) = PS AND
e &
(kT) > 0THEN u((k+1)T) = −(1−µPS(e(kT))) . u(kT)
where
e &
(kT) ≈ T1[e(kT) − e((k−1)T)], with initial conditionsy(0) = 0, e(−T) = e(0) = r −y(0),
e &
(0) = T1[e(0) − e(−T)] = 0C. Defuzzification
Select membership functions for the different control outputs from the rule base
µZO µP
µN
–H 0 H u
1
Figure 5 Typical membership functions for u
Then, the overall control signal, u, is generated by a weighted average formula:
u((k+1)T) =
∑
∑
=
= N
i i N
i
i iu kT
1 1
) ( µ µ
, (µi ≥ 0,
∑
= N
i i 1
µ > 0)
where control outputs ui(kT), i = 1, ..., N=8 are from the rule base.
Overview of Conventional PID Controllers
In the time domain:
(i) P-controller u(t) = KP e(t) (ii) I-controller u(t) = KI
∫
t e τ0
) ( dτ (iii) D-controller u(t) = KD dt
d e(t)
Control gains, KP, KI, and KD, are constants to be determined in the design for set-point tracking and stability consideration.
KP system
r + e u y
–
(a) Proportional controller
KI
∫
t0
system
r + e u y
–
(b) Integral controller
KD dt
d system
r + e u y
–
(c) Derivative controller Figure 6. Conventional PID controllers
In the frequency domain:
(i) P-controller U(s) = KP E(s) (ii) I-controller U(s) = KsI E(s) (iii) D-controller U(s) = KD s E(s)
Use Laplace transform L{⋅} for continuous-time signals:
U(s) = L{ u(t) } and E(s) = L{ e(t) } Use z-transform Z{⋅} for discrete-time signals.
KP
system
r + e u y
− (a) PI controller
KI
∫
0t+ +
KP
system
r + e u y
− (b) PD controller
+ + KDdtd
KP
system
r + e u y
−
(c) PID controller
+ + KDdt
d
KI
∫
0t +KP
system
r + e u y
−
(d) PI+D controller
KI
∫
0t+ +
+
KDdtd
−
Figure 7 Some typical combination of P, I, D controllers.
Introduction to Fuzzy PID Controllers
A. Discretization of Convetional PID Controllers
First, digitize the conventional analog PID controllers by
S = 1 1 2
+
− z z
T where T > 0 is the sampling time.
For the PI controller:
u(nT) = u(nT–T) + T∆u(nT)
∆u(nT) = P
K~ v(nT) + T K~I
e(nT)
K~P
e(nT)
+
−
v(nT)
T
T 1
z−1
T 1
K~I
∆u(nT) +
+
+ u(nT)
u(nT−T) z−1 +
Figure 8. The digital PI controller
Similarly, for the PD controller:
∆u(nT) = K~Pd(nT) + ~D
K v(nT)
where
d(nT) =
T
T nT e nT
e( )+ ( − )
v(nT) =
T
T nT e nT
e( )− ( − )
u(nT−T) K~P
e(nT) +
− v(nT)
T
T 1
z−1
K~D
z−1
∆u(nT) +
+
+
−
u(nT) z−1
T 1
d(nT)
+ +
Figure 9. The digital PD controller
B. Example: Designing the Fuzzy PI Controller
Fuzzification and Defuzzification fuzzy membership functions
d(nT) r(nT) e(nT) 1
T
1 T
Ki
Kp
z-1 + -
+ -
ev(nT
Fuzzy PI Controller
KuPI + -
z-1
u(nT) y(nT)
Process
Figure 10. The Fuzzy PI control system
negative positive
1
0.5
-L 0 L ep, ev
Figure 12. Input membership functions
negative positive
1
0.5
-L 0 L ∆uPI( )nT
Figure 11. Output membership functions
IC18 IC12 L IC11 IC17 IC4 IC3
IC13 IC10
IC5 IC2 Kid
( )
nT-L L
IC6 IC1
IC14 IC9
IC7 IC8 -L
IC19 IC15 IC16 IC20
Figure 13. IC regions for the fuzzy PI controller
( )
nTuPI
∆ =
[ ]
(
2 ( ))
2
) ( )
(
nT d K L
nT e K nT d K L
i v p i
−
+ , in IC1, IC2, IC5, IC6
=
[ ]
(
2 ( ))
2
) ( )
(
nT e K L
nT e K nT d K L
v p
v p i
−
+ , in IC3, IC4, IC7, IC8
=
[
( )]
2
1 L+Kpev nT , in IC9, IC10
= [ ( )]
2
1 L+Kid nT , in IC11, IC12
=
[
( )]
2
1 −L+Kpev nT , in IC13, IC14
= [ ( )]
2
1 − L+Kid nT , in IC15, IC16
= 0, in IC18, IC20
= − L, in IC17
= L, in IC19
Note: Rigorous stability can be guaranteed
( )
nTe Kp v
Some Successful Examples of Applications
There are many successful examples of fuzzy PID controllers.
1. Robotics
* Six-legged Insect Robot
(Dr. P. Sooraksa, G. R. Chen, and students)
King Mongkut’s Institute of Technology, Bangkok, Thailand
* Multi-purpose Autonomous Robust Carrier for Hospitals (MARCH)
(Dr. P. Sooraska, Prof. S. K. Tso, Dr. B. L. Luk, G. R. Chen, and students) Centre for Intelligent Design, Automation and Manufacturing
City University of Hong Kong
* Uncertain Robot-Arm Control (next page)
(G. R. Chen and students)
University of Houston, Texas, USA
* Uncertain Double-Pendulum Control (DEMO)
(Prof. Edgar Sanchez, G. R. Chen, and students) CINVESTAV, Mexico
2. Temperature Control (next page)
(G. R. Chen and students)
University of Houston, Texas, USA
Other Application Examples
A. Process Control (temperature, flow rate, injection)
B. Vehicles Control (parking, docking, backing truck-trailers)
C. Electronic Appliances (washer, dryer, camcorder-camera)
D. Life-Support Systems (space shuttle, submarine)
E. … … many more … …
374 IEEE TRANSACTIONS ON CONTROL SYSTEMS TECHNOLOGY, VOL. 5, NO. 3, MAY 1997
Fig. 6. The output membership functions for the I component.
(R4) IF AND Then PD-output .
In these rules, is the error, where is the set-point, is the rate of the change of the error,
“PD-output” is the fuzzy PD control output , “ ” means “error positive” and “ ” means “output positive,”
etc. Finally, “AND” is the Zadeh’s logical “AND” defined by .
Similarly, from the membership functions of the fuzzy I controller, the following control rules are used for the I component, where is the delayed error signal.
(R5) IF AND THEN I-output
.
(R6) IF AND THEN I-output
.
(R7) IF AND THEN I-output
.
(R8) IF AND THEN I-output
.
In the above rules, “I-output” is the fuzzy I control output , and the other terms are defined similarly to the PD component.
These eight rules altogether yield the control actions for the fuzzy PD I control law.
3) Defuzzification: In the defuzzification step, for both fuzzy PD and I controllers, the commonly used “center of mass” formula is employed to defuzzify the incremental control of the fuzzy control law, (15) as shown in (17)
input membership value membership value of output membership value of output
(17)
For the fuzzy PD controller, the value-ranges of the two inputs, the error and the rate of change of the error, are actually decomposed into ten adjacent input-combination (IC) regions, as shown in Fig. 7. The control rules for the fuzzy PD controller (R1)–(R4), with membership functions and IC regions together, are used to evaluate appropriate fuzzy control law’s for each region.
Now, by applying the values , , ,
and the following straight line formulas obtained from the
Fig. 7. Regions of the fuzzy PD and I controllers’ input-combination values.
Fig. 8. Block diagram and physical setup for the robot arm experiment.
geometry of Fig. 7:
we obtain the following nine formulas for the ten IC regions:
in IC A
in IC B in IC C in IC D in IC E in IC F in IC G, J in IC H in IC I
(18)
(19) (20) (21) (22) (23) (24) (25) (26) Similarly, defuzzification of the fuzzy I controller follows the same procedure as described above for the PD component, except that the input signals in this case are different. The
376 IEEE TRANSACTIONS ON CONTROL SYSTEMS TECHNOLOGY, VOL. 5, NO. 3, MAY 1997
Fig. 10. Tracking performance of the fuzzy PID-controlled system (I).
Fig. 11. Tracking performance of the conventional PID-controlled system (II).
the mass-center of the axis of rotation, and the gravity constant.
The actual data that we used in the experiment were:
(kgm ), (kgm ), (Nm),
(Nm/rad).
IV. EXPERIMENT AND RESULTS
In the experiment, the robot arm system was run using two control methods: using the conventional digital PID controller and the fuzzy PID controller, respectively, both based on the same configuration and under the same conditions. The conventional digital PID controller was unable to satisfactorily run the robot arm system (with a nonlinear load) no matter what combinations of control gains were used. Plots of the
system output with the tuned PID gains that achieved the best results by trial-and-error are shown in Fig. 9, where and below s. The fuzzy PID controller, in contrast, controlled the robot arm system with reasonably good results, obtained also by trial-and-error, as shown in Fig. 10. In this and the other fuzzily controlled simulation figures, , , , and and are fuzzy gains defined in Section II-B (see Fig. 2). In Figs. 9 and 10, the robot arm was not connected to the spring, where the units used are oltage (1 V 400 r/min) versus second.
Another comparison, at a different speed and with the spring added to the arm, is shown in Figs. 11 and 12, where the units used are voltage (1 V 400 r/min) versus s in Fig. 11 while versus second in Fig. 12. In these experiments, parameters for the fuzzy PID control gains were found such that there
Concluding Remarks
• Fuzzy logic provides a certain level of artificial intelligence to the conventional PID controllers, leading to the effective fuzzy PID controllers
• Fuzzy PID controllers are easy to use (plug-and-play)
• Fuzzy PID controllers can be implemented by both o software (matured)
o hardware (pre- matured)
• Fuzzy PID controllers have strong self-tuning ability and on- line adaptation to nonlinear, time -varying, and uncertain systems.
• Fuzzy PID controllers have a promising future for various industrial applications