370 likes | 537 Views
Fuzzy Control. Jan Jantzen jj@inference.dk www.inference.dk 2013. Summary. Configuration of controller Design choices The Takagi- Sugeno controller. End-user. Controller. Rule. Ref. Deviations. Actions. Outputs. base. Plant. Inference. engine. Direct Control Configuration.
E N D
Fuzzy Control Jan Jantzen jj@inference.dk www.inference.dk 2013
Summary • Configuration of controller • Design choices • The Takagi-Sugeno controller
End-user Controller Rule Ref Deviations Actions Outputs base Plant Inference engine Direct Control Configuration Could be a multi-input-multi-output controller
V1 Example: Tank Level Control Control valve Inlet stream Tank Outlet stream
Control Rules • If the level is low, then open V1 • If the level is high, then close V1 Actually, a single rule might be sufficient. Which?
High Level This requires a level sensor, which is able to measure how full the tank is. Ultrasound, for instance.
Choice of Rule Base 1. If error is Neg and change in error is Neg then output is NB 2. If error is Neg and change in error is Zero then output is NM 3. If error is Neg and change in error is Pos then output is Zero 4. If error is Zero and change in error is Neg then output is NM 5. If error is Zero and change in error is Zero then output is Zero 6. If error is Zero and change in error is Pos then output is PM 7. If error is Pos and change in error is Neg then output is Zero 8. If error is Pos and change in error is Zero then output is PM 9. If error is Pos and change in error is Pos then output is PB Two inputs with three values each (Neg, Zero, Pos) results in nine rules. Two inputs withtwovalueseach (Neg, Pos) results in fourrules.
Choice of Connectives minimum maximum product probabilistic sum Chooseproduct and probabilistic sum, ifyouwish to achievelinearity.
Choice Of Primary Sets Triangular Trapezoidal Universal set Classical set Singleton An input family
Inference in a Fuzzy PD Controller Sugeno type of rule base with singleton outputs Membership of input error of this set The AND of the two memberships is carried forward as a weight on the control signal singleton Membership of input change in error of this set All rules contribute, and the final control signal is the weighted average of the contributions from the rules. Input change in error enters here Input error enters here
Singleton Output 1. If error is Pos then control is 10 2. If error is Zero then control is 0 3. If error is Neg then control is -10 Equivalent to a singleton placed in the position -10 in the universe. It is simpler than a full membership function, and more intuitive too.
Sugeno Inference 1. If error is Pos then control is 10 2. If error is Zero then control is 0 3. If error is Neg then control is -10 Rule 3 Rule 2 Rule 1 The weighted average
First Order Output 1. If error is Large then control is a1*error + b1 2. If error is Small then control is a2*error + b2 The equation for a line L2, which depends on the coefficients a2 and b2.
Interpolation (Takagi-Sugeno) Interpolant Line 1 Line 2
Rule Base to Table Calculate the result for every combination of the two inputs Choose discrete values, for instance one for every 10 % Same
Look-Up Table Fivediscrete points werechosen in each input universe, resulting in 25 pre-calculatedvalues of the control signal
Control Surface Pos Neg A mesh plot of the control table If E is Neg and CE is Neg thenu = -200 If E is Neg and CE is Pos thenu = 0 If E is Pos and CE is Neg thenu = 0 If E is Pos and CE is Pos thenu = 200
Conditions For Linearity • Triangular sets, crossing at m = 0.5 • Rules: complete -combination • Define as multiplication (×) • Use conclusion singletons, positioned at sum of input peak positions • Calculate the control signal as the weighted average These five conditions settle many design choices. Very easy!
Summary Of Choices • Rule-base related choices (# of inputs and outputs, rules, universes, continuous or discrete, # of membership functions, their overlap and width, singleton conclusions) • Inference engine choices (connectives, modifiers) • Pre- and postprocessing (scaling, quantization, sampling time)
Fuzzy controller Rule Prepro-cessing Fuzzi-fication Defuzzi-fication Postpro-cessing base Inference engine Building Blocks
100 50 0 scaled input -50 -100 -5 0 5 measured input Nonlinear Input Scaling
1 0.5 0 0 50 100 Defuzzification RM LM BOA MOM COG
1 0.5 Membership 0 -1 -0.5 0 0.5 1 Input 1 0.5 Membership 0 -1 -0.5 0 0.5 1 Output FLS I/O Families Zero Neg Pos
AND a 4 a 5 Activation Defuzzification Accumulation Aggregation Inference And Terminology
Rule Based Controllers • If error is Neg then control is Neg • If error is Zero then control is Zero • If error is Pos then control is Pos
Simplification of 4 rules 1. If error is Neg and change in error is Neg then control is NB 3. If error is Neg and change in error is Pos then control is Zero 7. If error is Pos and change in error is Neg then control is Zero 9. If error is Pos and change in error is Pos then control is PB is
Simplification of 9 rules 1. If error is Neg and change in error is Neg then output is NB 2. If error is Neg and change in error is Zero then output is NM 3. If error is Neg and change in error is Pos then output is Zero 4. If error is Zero and change in error is Neg then output is NM 5. If error is Zero and change in error is Zero then output is Zero 6. If error is Zero and change in error is Pos then output is PM 7. If error is Pos and change in error is Neg then output is Zero 8. If error is Pos and change in error is Zero then output is PM 9. If error is Pos and change in error is Pos then output is PB is