Knowledge-Based Control Systems (SC425) Lecture 3: Knowledge based fuzzy control Alfredo Núñez Section of Railway Engineering CiTG, Delft University of Technology The Netherlands a.a.nunezvicencio@tudelft.nl tel: 15-27 89355 Robert Babuška Delft Center for Systems and Control 3mE, Delft University of Technology The Netherlands r.babuska@tudelft.nl tel: 15-27 85117
Outline 1. Direct fuzzy control. 2. Supervisory fuzzy control. 3. Software tools for fuzzy control. 4. Overview of applications. R. Babuška, Delft Center for Systems and Control, SC481 2
Fuzzy Control: Background controller designed by using If Then rules instead of mathematical formulas (knowledge-based control), early motivation: mimic experienced operators, fuzzy reasoning: interpolation between discrete outputs, currently: also controllers designed on the basis of a fuzzy model (model-based fuzzy control), a fuzzy controller represents a nonlinear mapping (but completely deterministic!). R. Babuška, Delft Center for Systems and Control, SC481 3
Parameterization of Nonlinear Controllers Controller Process 1.5 theta.5 1 1 1.5.5 1 1.5 x.5 phi Parameterizations PL PS Z PS Z NS Z NS NL Sigmoidal Neural Networks Fuzzy Systems Radial Basis Functions Wavelets Splines R. Babuška, Delft Center for Systems and Control, SC481 4
Fuzzy System is a Nonlinear Mapping R. Babuška, Delft Center for Systems and Control, SC481 5
Basic Fuzzy Control Schemes Direct (low-level, Mamdani) fuzzy control Fuzzy supervisory (high-level, Takagi Sugeno) control Fuzzy model-based control R. Babuška, Delft Center for Systems and Control, SC481 6
Process Controlled by Operators Goal (reference) Disturbances Human operator u Process y R. Babuška, Delft Center for Systems and Control, SC481 7
Knowledge Acquisition Goal (reference) Disturbances Human operator u Process y Knowledge acquisition Fuzzy if-then rules R. Babuška, Delft Center for Systems and Control, SC481 8
Direct Fuzzy Control Goal (reference) Disturbances Fuzzy controller u Process y Implementation Fuzzy if-then rules R. Babuška, Delft Center for Systems and Control, SC481 9
Example of Operator Knowledge Case Condition Action to be taken Reason 11 BZ OK a. Decrease fuel rate slightly To raise percentage of oxygen OX low BE OK 12 BZ OK a. Reduce fuel rate To increase percentage of oxygen for action b OX low b. Reduce fan speed To lower back-end temperature and BE high maintain burning zone temperature 13 BZ OK a. Increase fan speed To raise back-end temperature OX OK b. Increase fuel rate To maintain burning zone temperature BE low Extract from Peray s textbook for kiln operators (Oestergaard, 1999) R. Babuška, Delft Center for Systems and Control, SC481 1
FLC Analogue to PID Control d r - e PID u Process y R. Babuška, Delft Center for Systems and Control, SC481 11
PID Control: Internal View u(t) =Pe(t)+I t e(τ)dτ + D de(t) dt e P I + u d dt D R. Babuška, Delft Center for Systems and Control, SC481 12
PID Control: Internal View u(t) =Pe(t)+I t e(τ)dτ + D de(t) dt e P I + u d dt dynamic filter D static mapping R. Babuška, Delft Center for Systems and Control, SC481 13
Fuzzy PID Control u(t) =f ( e(t), t e(τ)dτ, de(t) ) dt e d dt Fuzzy knowledge-based system u dynamic filter R. Babuška, Delft Center for Systems and Control, SC481 14
Fuzzy PID Control r e - Fuzzy Controller u Process y e Dynamic Pre-filter e e e Static map u Dynamic Post-filter u Fuzzifier Knowledge base Inference Defuzzifier R. Babuška, Delft Center for Systems and Control, SC481 15
Example: Proportional Control d r - e P u Process y R. Babuška, Delft Center for Systems and Control, SC481 16
Controller s Input Output Mapping u u=pe e R. Babuška, Delft Center for Systems and Control, SC481 17
Fuzzy Proportional Control: Rules If error is Negative Big then control input is Negative Big If error is Positive Big then control input is Positive Big If error is Zero then control input is Zero R. Babuška, Delft Center for Systems and Control, SC481 18
Controller s Input Output Mapping u ZE e NB PB NB ZE PB R. Babuška, Delft Center for Systems and Control, SC481 19
Example: Friction Compensation 1. DC motor with static friction. 2. Fuzzy rules to represent normal proportional control. 3. Additional rules to prevent undesirable states. R. Babuška, Delft Center for Systems and Control, SC481 2
DC Motor: Model 1 voltage Armature K(s) L.s+R Load 1 J.s+b Friction 1 s 1 angle K R. Babuška, Delft Center for Systems and Control, SC481 21
Proportional Controller Control u P Motor Mux Angle R. Babuška, Delft Center for Systems and Control, SC481 22
Linear Control.15.1 shaft angle [rad].5.5.1 5 1 15 2 25 3 time [s] 1.5 1 control input [V].5.5 1 1.5 5 1 15 2 25 3 time [s] R. Babuška, Delft Center for Systems and Control, SC481 23
Fuzzy Control Rule Base If error is Positive Big then control input is Positive Big; If error is Negative Big then control input is Negative Big; If error is Zero then control input is Zero; R. Babuška, Delft Center for Systems and Control, SC481 24
Membership Functions for Error 1 Negative Big Zero Positive Big -.2 -.15 -.1 -.5.5.1.15.2 R. Babuška, Delft Center for Systems and Control, SC481 25
Additional Rules If error is Positive Big then control input is Positive Big; If error is Negative Big then control input is Negative Big; If error is Zero then control input is Zero; If error is Negative Small then control input is not Negative Small; If error is Positive Small then control input is not Positive Small; R. Babuška, Delft Center for Systems and Control, SC481 26
Membership Functions for Error 1 Negative Big Negative Small Zero Positive Small Positive Big -.2 -.15 -.1 -.5.5.1.15.2 R. Babuška, Delft Center for Systems and Control, SC481 27
Fuzzy Control.15.1 shaft angle [rad].5.5.1 5 1 15 2 25 3 time [s] 1.5 1 control input [V].5.5 1 1.5 5 1 15 2 25 3 time [s] R. Babuška, Delft Center for Systems and Control, SC481 28
Input Output Mapping of the Controller u local nonlinearity 1.5 -.15 -.1 -.5..5.1.15 e -.5-1 R. Babuška, Delft Center for Systems and Control, SC481 29
Another Solution: Sliding Mode Control.15.1 shaft angle [rad].5.5.1 5 1 15 2 25 3 time [s] 1.5 1 control input [V].5.5 1 1.5 5 1 15 2 25 3 time [s] R. Babuška, Delft Center for Systems and Control, SC481 3
Experimental Results - Proportional Control.2 position [rad].1.1.2 2 4 6 8 1 12 14 16 18 2 time [s] 1 control input [V] 5 5 1 2 4 6 8 1 12 14 16 18 2 time [s] R. Babuška, Delft Center for Systems and Control, SC481 31
Experimental Results - Fuzzy Control.2 position [rad].1.1.2 2 4 6 8 1 12 14 16 18 2 time [s] 1 control input [V] 5 5 1 2 4 6 8 1 12 14 16 18 2 time [s] R. Babuška, Delft Center for Systems and Control, SC481 32
Membership Functions 1 membership degree.8.6.4.2 1.9.8.7.6.5.4.3.2.1 Control error 1 membership degree.8.6.4.2.1.2.3.4.5.6.7.8.9 1 Control error R. Babuška, Delft Center for Systems and Control, SC481 33
Fuzzy PD Controller: Rule Table error rate NB ZE PB error NB NB NB ZE ZE NB ZE PB PB ZE PB PB R 12 : If error is NB and error rate is ZE then control is NB R. Babuška, Delft Center for Systems and Control, SC481 34
Fuzzy PD Controller cont d.5.5 control control.5.5 1 1 1 1.5 error rate.5 1 1.5 error.5 1.5 error rate.5 1 1.5 error.5 1.5 control.5 1 1.5 error rate.5 1 1.5 error.5 1 R. Babuška, Delft Center for Systems and Control, SC481 35
Supervisory Fuzzy Control Classical controller u Process y R. Babuška, Delft Center for Systems and Control, SC481 36
Supervisory Fuzzy Control external signals Fuzzy Supervisor Classical controller u Process y R. Babuška, Delft Center for Systems and Control, SC481 37
Supervisory Control Rules: Example If process output is High then reduce proportional gain Slightly and increase derivative gain Moderately. (Supervised PD controller) R. Babuška, Delft Center for Systems and Control, SC481 38
Example: Inverted Pendulum α u (force) x R. Babuška, Delft Center for Systems and Control, SC481 39
Cascade Control Scheme Reference Position controller Angle controller Inverted pendulum R. Babuška, Delft Center for Systems and Control, SC481 4
Conventional PD controller cart position [m].5.5 1 2 3 4 5 6.2 time [s] angle [rad].1.1 control input [ ].2 1 2 3 4 5 6 1 time [s].5.5 1 1 2 3 4 5 6 time [s] R. Babuška, Delft Center for Systems and Control, SC481 41
Fuzzy Supervised PD controller cart position [m].5.5 1 2 3 4 5 6.2 time [s] angle [rad].1.1 control input [ ].2 1 2 3 4 5 6 1 time [s].5.5 1 1 2 3 4 5 6 time [s] R. Babuška, Delft Center for Systems and Control, SC481 42
Takagi Sugeno Control Takagi Sugeno PD controller: R 1 : R 2 : If r is Low then u L = P L e + D L ė If r is High then u H = P H e + D H ė u = µ L(r) u L + µ H (r) u H µ L (r)+µ H (r) = γ L (r) u L + γ H (r) u H = {γ L (r)p L + γ H (r)p H } e + {γ L (r)d L + γ H (r)d H } ė R. Babuška, Delft Center for Systems and Control, SC481 43
Takagi Sugeno Control Takagi Sugeno PD controller: R 1 : R 2 : If r is Low then u L = P L e + D L ė If r is High then u H = P H e + D H ė u = µ L(r) u L + µ H (r) u H µ L (r)+µ H (r) = γ L (r) u L + γ H (r) u H = {γ L (r)p L + γ H (r)p H } e + {γ L (r)d L + γ H (r)d H } ė R. Babuška, Delft Center for Systems and Control, SC481 44
Takagi Sugeno Control Takagi Sugeno PD controller: R 1 : R 2 : If r is Low then u L = P L e + D L ė If r is High then u H = P H e + D H ė u = µ L(r) u L + µ H (r) u H µ L (r)+µ H (r) = γ L (r) u L + γ H (r) u H = {γ L (r)p L + γ H (r)p H } e + {γ L (r)d L + γ H (r)d H } ė = P (r)e + D(r)ė, R. Babuška, Delft Center for Systems and Control, SC481 45
Takagi Sugeno Control Takagi Sugeno PD controller: R 1 : R 2 : If r is Low then u L = P L e + D L ė If r is High then u H = P H e + D H ė u = µ L(r) u L + µ H (r) u H µ L (r)+µ H (r) = γ L (r) u L + γ H (r) u H = {γ L (r)p L + γ H (r)p H } e + {γ L (r)d L + γ H (r)d H } ė = P (r)e + D(r)ė, P (r) conv(p L,P H ),... R. Babuška, Delft Center for Systems and Control, SC481 46
Takagi Sugeno Control is Gain Scheduling fuzzy scheduling Inputs Controller 2 Controller 1 Controller K Outputs R. Babuška, Delft Center for Systems and Control, SC481 47
TS Control: Input Output Mapping 2 2 1.5 1.5 1 1.5.5 1 1.5 1.5 1.5 1 1.5.5.5 1 1.5.5 2 1.5 1.5 1.5 1.5 1 1.5.5 R. Babuška, Delft Center for Systems and Control, SC481 48
TS Control: Example 1. Strongly nonlinear process (output-dependent gain). 2. Fuzzy supervisor to adjust the gain of a proportional controller. 3. Comparison with linear (fixed-gain) proportional control. R. Babuška, Delft Center for Systems and Control, SC481 49
TS Control: Example Nonlinear process: d 3 y(t) dt 3 + d2 y(t) dt 2 + dy(t) dt = y 2 (t)u(t) Problems with linear control: stability and performance depend on process output re-tuning the controller does not help nonlinear control is the only solution R. Babuška, Delft Center for Systems and Control, SC481 5
TS Control: Example Goal: Design a controller to stabilize the process for a wide range of operating points (y >): TS (proportional) control rules: If y is Small then u(k) =P Small e(k) If y is Medium then u(k) =P Medium e(k) If y is Large then u(k) =P Large e(k) R. Babuška, Delft Center for Systems and Control, SC481 51
Comparison of Performance 2 1.9 1.8 1.7 1.6 1.5 1.4 1.3 1.2 1.1 1 5 1 15 2 25 3 6 5.5 5 4.5 4 3.5 3 2.5 2 5 1 15 2 25 3 R. Babuška, Delft Center for Systems and Control, SC481 52
Typical Applications Tune parameters of low-level controllers (auto-tuning). Improve performance of classical control (response-assisted PID). Adaptation, gain scheduling (aircraft control). R. Babuška, Delft Center for Systems and Control, SC481 53
Typical Applications Tune parameters of low-level controllers (auto-tuning). Improve performance of classical control (response-assisted PID). Adaptation, gain scheduling (aircraft control). + Enhancement of classical controllers. + Interface between low-level and high-level control. Ad hoc approach, difficult analysis. R. Babuška, Delft Center for Systems and Control, SC481 54
Fuzzy Control: Design Steps control engineering approaches + heuristic knowledge 1. Determine inputs and outputs. 2. Define membership functions. 3. Design rule base. 4. Test (completeness, stability, performance). 5. Fine-tune the controller. R. Babuška, Delft Center for Systems and Control, SC481 55
Parameters in a Fuzzy Controller Fuzzification module Defuzzification module Scaling Fuzzifier Inference engine Defuzzifier Scaling Scaling factors Membership functions Rule base Membership functions Scaling factors Data base Knowledge base Data base R. Babuška, Delft Center for Systems and Control, SC481 56
Software for Fuzzy Control Siefuzzy (Siemens) FuzzyTech (Inform) AB-Flex (Allen Bradley) TDC-3 (Honeywell) many others... R. Babuška, Delft Center for Systems and Control, SC481 57
Hardware for Fuzzy Control Fuzzy logic-assisted PID controllers (Omron, Yokogawa, West Instruments). PLC coprocessors (Omron, Allen Bradley). Dedicated hardware (fuzzy logic chips). R. Babuška, Delft Center for Systems and Control, SC481 58
Dedicated Hardware R. Babuška, Delft Center for Systems and Control, SC481 59
Applications of Fuzzy Control process control (cement, chemical, glass) R. Babuška, Delft Center for Systems and Control, SC481 6
Operator Support in Process Control Production of detergents Ingredients Viscosity M No. of nozzles Quality: - liter weight - moist content Pressure Pulverization tower Heater Temperature Blend air Whirl air Conveyor R. Babuška, Delft Center for Systems and Control, SC481 61
Fuzzy Decision Support System Control Actions Process Viscosity Fuzzy decision support system Human operator Pressure Nozzles Temperature Blend air Whirl air Process DCS computer Excel δ m δ w Product Information PC SieFuzzy R. Babuška, Delft Center for Systems and Control, SC481 62
Fuzzy Rule Base Moist Dry Ok Wet R 1 R 2 R 3 R 4 No Actions R 5 R 6 R 7 R 8 R 61 R 62... R 6n6 R 71 R 72... R 7n7 Process state (Constraints) - Partitioning into error regions - Each region has an ordered set of control rules Light Ok Heavy Weight R. Babuška, Delft Center for Systems and Control, SC481 63
Implementation Distributed Control System Laboratory report Stored data Product sample Every 15-3 min. Every 1 min. PC Process DCS computer Excel SieFuzzy Every 1 sec. Every 3 sec. Every 6 sec. or on request Human operator R. Babuška, Delft Center for Systems and Control, SC481 64
Evaluation: Results Improvement [%] Improvement [%] 6 4 2 6 4 2 Improvement in moisture content mean std mean std mean std Class A Class B Class C Improvement in liter-weight mean std mean std mean std R. Babuška, Delft Center for Systems and Control, SC481 65
Applications of Fuzzy Control process control (cement, chemical, glass) supervision (security of power distribution networks) R. Babuška, Delft Center for Systems and Control, SC481 66
Security Assessment of a Power Network PEN/EBA DIEMEN 3 ENS EDON 2 2 HGL Determination of Security Class Security Class MAASV EZH EZH 2 2 3 CRAY BORSS A KRIMPEN 1 NUON 1 3 EINDH GEERT 2 3 1 3 DeltaN PNEM MEGA DOET1 DODEW MAASB GERMANY Rule base transformers Defuzzification Fuzzy decision (aggregation) Rule base transmission lines Network level Component level Rule base generators BELGIUM Network State SUBSYSTEM R. Babuška, Delft Center for Systems and Control, SC481 67
Fuzzy Decision 1 Transmission lines 1 VS NS SI VI µ µ 2 4 6 8 1 12 14 16 Load [%] Class 1 Transformers 1 VS NS SI VI µ µ 2 4 6 8 1 12 14 16 Load [%] Class µ 1 VS NS SI VI Aggregated result (using MAX operator) Class R. Babuška, Delft Center for Systems and Control, SC481 68
Applications of Fuzzy Control process control (cement, chemical, glass) supervision (security of power distribution networks) traffic management and control R. Babuška, Delft Center for Systems and Control, SC481 69
Traffic Management Data acquisition Data processing Q, v Q, v Section-oriented processing on the basis of data from neighboring cross-sections VK_Diff Trend factor Local Processing Local Processing Incident detection Fuzzy decision-making logic Output variable Probability of an incident Action Control model/display generation R. Babuška, Delft Center for Systems and Control, SC481 7
Forecasting (Siemens) Parking garage Parking Garage Marienplatz FULL Parking Garage Stachus FREE R. Babuška, Delft Center for Systems and Control, SC481 71
Knowledge-Based System Day of Week Time of Day Season Holiday Temporal Need Rule base Weather Traffic Density Temporal Need # cars driving in # cars driving out Main Rule base Temperature Rainfall Weather Rule base Capacity Special Situations Forecast Sunshine R. Babuška, Delft Center for Systems and Control, SC481 72
Applications of Fuzzy Control process control (cement, chemical, glass) supervision (security of power distribution networks) traffic management and control (prediction) consumer goods (camcoders, house appliances) R. Babuška, Delft Center for Systems and Control, SC481 73
Intelligent Thermostat R. Babuška, Delft Center for Systems and Control, SC481 74
Applications of Fuzzy Control process control (cement, chemical, glass) supervision (security of power distribution networks) traffic management and control (prediction) consumer goods (camcoders, house appliances) cars (engine management, automatic transmission) R. Babuška, Delft Center for Systems and Control, SC481 75