470 likes | 1.54k Views
Inverted Pendulum. Emily Hamilton ECE Department, University of Minnesota Duluth December 21, 2009. ECE 5831 - Fall 2009. 1. Overview. Fuzzy sets Fuzzy operations Conventional controller Performance objectives and evaluations Fuzzy controller Defining a rule base Fuzzification
E N D
Inverted Pendulum Emily Hamilton ECE Department, University of Minnesota Duluth December 21, 2009 ECE 5831 - Fall 2009 1
Overview • Fuzzy sets • Fuzzy operations • Conventional controller • Performance objectives and evaluations • Fuzzy controller • Defining a rule base • Fuzzification • Inference engine • Defuzzification • Conclusion 2 2
Fuzzy Controller • Parts of fuzzy controller • Rule base: set of If-Then rules • Inference mechanism: combines rules to obtain the best control • Fuzzification interface: transforms linguistic inputs into fuzzy inputs • Defuzzification interface: transforms fuzzy outputs into linguistic terms 3 3
Fuzzy Sets • Fuzzy set A defined by: A = {(x, A(x)) | x is in X} • Where X is the set of elements in the set: X = {0, 1,… , n} 4
Fuzzy Sets • X is also known as the universe of a fuzzy set • A(x) is the membership function of x • Grade of membership of the set • Values in the range {0,1} 5
Fuzzy Operations Some Common Operations • Union • Intersection • Complement Take the fuzzy sets A and B for these examples. A = {{1,0.3}, {2,0.7}, {3,0.6}} B = {{1,0.4}, {2,0.1}, {3,0.9}} 6
Fuzzy Operations • Union • represented by AUB • AUB = max(A(x), B(x)) 7
Fuzzy Operations • Intersection • represented by A ∩ B • A∩B = min(A(x), B(x)) 8
Fuzzy Operations • Complement • represented by A’(x) • A’(x) = 1 – A(x) 9
Common Membership Functions • Triangular • Trapezoidal • Gaussian 10
Common Membership Functions • Bell • Sigmoid 11
Performance Objectives • Disturbance rejection properties • Insensitivity to plant parameter variations • Stability • Rise-time • Overshoot • Settling time • Steady-state error 13
Technical Constraints • Cost • Computational complexity: • Manufacturability • Reliability • Maintainability • Adaptability • Understandability • Politics 14
Performance Evaluation • Mathematical Evaluation • To prove that all performance objectives have been met • Relies on accuracy of mathematical model • Complex nonlinear mathematical models do not exist yet • Can be used to enhance confidence that control system will work properly 15
Performance Evaluation • Simulation-Based Analysis • Simulation of actual system is built and tested with the control system • Can be more accurate than the mathematical model because system constraints and changes can be applied easily • Not perfectly accurate 16
Performance Evaluation • Experimental Evaluation • Implementing the control system in the actual process • Can be helpful to find problems that would not have been found elsewhere • Can be risky 17
Fuzzy Control System 18 18
Defining a Rule Base • Choose inputs and outputs • Put knowledge into rules: • Use linguistic descriptions from experts for inputs and outputs • Relate the inputs and outputs with the experts’ knowledge • Create a table representing the rule base 19 19
Inverted Pendulum 20 20
Inverted Pendulum 21 21
Inverted Pendulum Rules • If the angle q is positive and the velocity q ' is positive, then decrease a lot. • If the angle q is positive and the velocity q ' is zero, then decrease . • If the angle q is positive and the velocity q ' is negative, then do not apply . • If the angle q is zero and the velocity q ' is positive, then decrease . • If the angle q is zero and the velocity q ' is zero, then do not apply 22 22
Inverted Pendulum Rules • If the angle q is zero and the velocity q ' is negative, then increase • If the angle q is negative and the velocity q ' is positive, then do not apply . • If the angle q is negative and the velocity q ' is zero, then increase . • If the angle q is negative and the velocity q ' is negative, then increase a lot. 23
Membership Functions • Evaluate the certainty of the linguistic values • We use the certainties of the linguistic value to create out membership functions. • Input values: • e(t) = π/4 • d/dt(e(t)) = π/16 • Membership function values: • Apossmall(e(t)) = 1 • Azero(d/dt(e(t))) = Apossmall(d/dt(e(t))) = 0.5 26 26
Fuzzification • Example: Certainty of NegAngle • Angle, θ, is 45˚. F(45 ˚) = 0 • θ = -45 ˚. F(-45 ˚) = 0.4 • θ = -95 ˚. F(-95 ˚) = 1 27 27
Inference Engine • Premise: the certainty of a rule in a situation. Ex: P(θ, d/dt(θ)) = 0.5 • A rule is “on” if its certainty is greater than zero. • The inference engine combines the recommendations of all rules that are “on” to find the control output. 31 31
Inference Engine • Determines relevance of each rule in the given situation using the premises • Draws information using the rule base and the inputs 32 32
Defuzzification transfers the fuzzy output into a crisp value. This equation is used to defuzzifiy the outputs of the inference engine in the Center of Gravity (Area) inference engine. Each inference engine has its own equation for defuzzification. Defuzzification 33 33
The crisp output value we receive using the Center of Area inference engine is -21.3063 units of force. Inverted Pendulum 34 34
Conclusion • Fuzzy sets • Control system should meet performance objectives and pass evaluations • Use expert knowledge to create inputs, outputs, and rule base. • Fuzzify crisp inputs • Inference engine uses rule base to decide control output • Defuzzify output to crisp value 35 35
References • [1] K. Passino, S. Yurkovich. Fuzzy Control. 1998. Addison Wesley Longman, Inc. • J. Jang, C. Sun. “Neuro-Fuzzy Modeling and Control.” 36 36
Questions? 37 37