Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... ·...

23
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

Transcript of Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... ·...

Page 1: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

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

Page 2: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

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

Page 3: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

Overview of the Fuzzy Logic Technology

Closed-Loop Set-Point Tracking System

Consider the typical set-point tracking system:

r(reference

Controllere(error

+

u(control

signal)signal)

Plant y

(outputsignal)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 Defuzzificatione ucontrollerinput

controlleroutput

Fuzzy Logic Controller (FLC)

Figure 2 General structure of a fuzzy logic controller

Page 4: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

temperature

t0

r = 45 oy 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 = yyr &&& −=− 0 or 0>y& (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 AND &e > 0 THEN u(t+) = u(t) R4: IF e > 0 AND &e > 0 THEN u(t+) = − u(t)

Page 5: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

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

0H

µ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+) = µPL(e) . u(t) R2: IF e = PS AND &e < 0 THEN u(t+) = (1−µPS(e)) . u(t) R3: IF e = NL AND &e < 0 THEN u(t+) = −µNL(e) . u(t) R4: IF e = NS AND &e < 0 THEN u(t+) = −(1−µNS(e)) . u(t) R5: IF e = NL AND &e > 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 AND &e > 0 THEN u(t+) = −µPL(e) . u(t) R8: IF e = PS AND &e > 0 THEN u(t+1) = −(1−µPS(e)) . u(t)

Page 6: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

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) < 0 THEN u((k+1)T ) = µPL(e(kT)) . u(kT) R2: IF e(kT) = PS AND &e (kT) < 0 THEN u((k+1)T) = (1−µPS(e(kT))) . u(kT) R3: IF e(kT) = NL AND &e (kT) < 0 THEN u((k+1)T ) = −µNL(e(kT)) . u(kT) R4: IF e(kT) = NS AND &e (kT) < 0 THEN u((k+1)T ) = −(1−µNS(e(kT))) . u(kT) R5: IF e(kT) = NL AND &e (kT) > 0 THEN u((k+1)T ) = µNL(e(kT)) . u(kT) R6: IF e(kT) = NS AND &e (kT) > 0 THEN u((k+1)T ) = (1−µNS(e(kT))) . u(kT) R7: IF e(kT) = PL AND &e (kT) > 0 THEN u((k+1)T ) = −µPL(e(kT)) . u(kT) R8: IF e(kT) = PS AND &e (kT) > 0 THEN u((k+1)T) = −(1−µPS(e(kT))) . u(kT) where &e (kT) ≈ 1

T [e(kT) − e((k−1)T)], with initial conditions y(0) = 0, e(−T) = e(0) = r − y(0), &e (0) = 1

T [e(0) − e(−T)] = 0

Page 7: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

C. Defuzzification Select membership functions for the different control outputs from the rule base

µZO µP µN

–H H 0 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

ii

N

iii kTu

1

1

)(

µ

µ

, (µi ≥ 0, ∑=

N

ii

1

µ > 0)

where control outputs ui(kT), i = 1, ..., N=8 are from the rule base.

Page 8: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

Overview of Conventional PID Controllers

In the time domain: (i) P-controller u(t) = KP e(t)

(ii) I-controller u(t) = KI ∫ τt

e0

)( dτ

(iii) D-controller u(t) = KD dtd

e(t)

Control gains, KP, KI, and KD, are constants to be determined in the design for set-point tracking and stability consideration.

KP systemr e u y+

(a) Proportional controller

KI ∫t

0

systemr e u y+

(b) Integral controller

KDdtd

systemr e u y+

(c) Derivative controller

Figure 6. Conventional PID controllers

Page 9: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

In the frequency domain: (i) P-controller U(s) = KP E(s)

(ii) I-controller U(s) = sK I 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.

Page 10: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

KP

system r e u y +

(a) PI controller

KI∫t

0

+

+

KP

system r e u y +

(b) PD controller

+

+

KDdtd

KP

system r e u y +

(c) PID controller

+

+ KD dt

d

KI∫t

0 +

KP

system r e u y +

(d) PI+D controller

KI∫t

0 +

+

+

KD dtd

Figure 7 Some typical combination of P, I, D controllers.

Page 11: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

Introduction to Fuzzy PID Controllers A. Discretization of Convetional PID Controllers First, digitize the conventional analog PID controllers by

S = 112

+−

zz

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)

PK~

e(nT)

+

v(nT)

T

T1

z−1

T1

IK~

∆u(nT) +

+

+ u(nT)

u(nT−T) z−1

+

Figure 8. The digital PI controller

Page 12: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

Similarly, for the PD controller:

∆u(nT) = P~K d(nT) + D

~K v(nT)

where

d(nT) = TTnTenTe )()( −+

v(nT) = TTnTenTe )()( −−

u(nT−T)

PK~

e(nT)

+

− v(nT)

T

T1

z−1

DK~

z−1

∆u(nT)

+

+

+

u(nT)

z−1

T1

d(nT)

+

+

Figure 9. The digital PD controller

Page 13: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

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 ( )nTuPI∆

Figure 11. Output membership functions

Page 14: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

IC18 IC12 L IC11 IC17 IC4 IC3 IC13 IC10 IC5 IC2 ( )nTdK i

-L L

IC6 IC1 IC14 IC9 IC7 IC8 -L IC19 IC15 IC16 IC20 Figure 13. IC regions for the fuzzy PI controller

( )nTuPI∆ = [ ]

( ))(22

)()(

nTdKL

nTeKnTdKL

i

vpi

+, in IC1, IC2, IC5, IC6

= [ ]

( ))(22

)()(

nTeKL

nTeKnTdKL

vp

vpi

+, in IC3, IC4, IC7, IC8

= [ ])(21

nTeKL vp+ , in IC9, IC10

= [ ])(21

nTdKL i+ , in IC11, IC12

= [ ])(21

nTeKL vp+− , in IC13, IC14

= [ ])(21

nTdKL i+− , in IC15, IC16

= 0, in IC18, IC20 = L− , in IC17 = L , in IC19 Note: Rigorous stability can be guaranteed

( )nTeK vp

Page 15: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

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

Page 16: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

* 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

Page 17: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

* 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 … …

Page 18: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

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 theset-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 Icomponent, 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 ofmass” formula is employed to defuzzify the incrementalcontrol of the fuzzy control law, (15) as shown in (17)

input membership value membership value of outputmembership value of output

(17)

For the fuzzy PD controller, the value-ranges of the twoinputs, the error and the rate of change of the error, areactually decomposed into ten adjacent input-combination (IC)regions, as shown in Fig. 7. The control rules for the fuzzyPD controller (R1)–(R4), with membership functions and ICregions together, are used to evaluate appropriate fuzzy controllaw’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 followsthe same procedure as described above for the PD component,except that the input signals in this case are different. The

Page 19: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

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, andthe gravityconstant.

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 twocontrol methods: using the conventional digital PID controllerand the fuzzy PID controller, respectively, both based onthe same configuration and under the same conditions. Theconventional digital PID controller was unable to satisfactorilyrun the robot arm system (with a nonlinear load) no matterwhat combinations of control gains were used. Plots of the

system output with the tuned PID gains that achieved the bestresults by trial-and-error are shown in Fig. 9, where and below

s. The fuzzy PID controller, in contrast, controlledthe robot arm system with reasonably good results, obtainedalso by trial-and-error, as shown in Fig. 10. In this and theother fuzzily controlled simulation figures, , ,

, and and are fuzzy gains defined inSection II-B (see Fig. 2). In Figs. 9 and 10, the robot arm wasnot 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 springadded to the arm, is shown in Figs. 11 and 12, where the unitsused are voltage (1 V 400 r/min) versus s in Fig. 11 whileversus second in Fig. 12. In these experiments, parametersfor the fuzzy PID control gains were found such that there

Page 20: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview
Page 21: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview
Page 22: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview
Page 23: Fuzzy PID Controllers Slides - pudn.comread.pudn.com/downloads161/ebook/732022/PID motor... · Outline of the Presentation • Overview of the Fuzzy Logic Technology • Overview

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