feedback control
DESCRIPTION
Feedback Control. A Simple Abstraction. An open loop control system Goal/desired state. Process output. Desired output. Process input. Controller. The process Under control. Open Loop Control. Only for static environment Accurate manipulation needed Problem: - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/1.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Feedback ControlFeedback Control
![Page 2: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/2.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
A Simple AbstractionA Simple Abstraction
• An open loop control system• Goal/desired state
ControllerThe process
Under control
Desired output
Process outputProces
s input
![Page 3: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/3.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Open Loop ControlOpen Loop Control
• Only for static environment• Accurate manipulation needed• Problem:
– Noisy environment (disturbance)– Inaccurate effector
ControllerThe process
Under control
Desired output
Process output
Process input
Disturbance
![Page 4: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/4.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Open Loop ControlOpen Loop Control• May use expected disturbance
– Static environment
ControllerThe process
Under control
Desired output
Process output
Process input
Disturbance
Predicted disturbance
![Page 5: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/5.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
ExamplesExamples
• Putting book on a desk
• Activating an event– Start a sensor– Play a sound– Conduct a scripted movement
• Question: What about inserting a light bulb?
![Page 6: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/6.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Feed Forward ControlFeed Forward Control• Disturbance measured on the fly• Problems?
– May not include all the parameters
ControllerThe process
Under control
Desired output
Process output
Process input
DisturbanceMeasured disturbance Sensors
![Page 7: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/7.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Feedback Control (Closed Loop)Feedback Control (Closed Loop)
• Include all the parameters as included into the output.
ControllerThe process
Under control
Desired output
Process output
Process input
Disturbance
Sensors
![Page 8: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/8.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Feedback Control Feedback Control
• Another diagram
ControllerThe process
Under control
Desired
output
Process output
Process input
Sensors
Σ+-
![Page 9: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/9.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
ExampleExample
![Page 10: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/10.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
ErrorsErrors
• Direction (sign)• Magnitude (distance)
• Frequent feedback is needed– Sensor rates can effect response
• Control may not be immediate– May be a delay from when you
decide to change, and when a change actually occurs!
![Page 11: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/11.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
A Wall Following RobotA Wall Following Robot
• How would you use feedback control to implement a wall-following behavior in a robot?
• What sensors would you use?• Would they provide magnitude and direction of the error?
• What will this robot's behavior look like?
![Page 12: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/12.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Oscillation and the Set PointOscillation and the Set Point• Desired state is called the set point• Can we decrease oscillation?
– A range rather than a single value– Slower change
• Wall following example:– Larger turning angle– A range rather than fix distance
![Page 13: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/13.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Sensor NoiseSensor Noise
• What happens when there is sensor noise in the system? • Example:
– Sensor tells the robot it is far from a wall, when it is close? – vice versa?
• How might we fix these problems?
![Page 14: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/14.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Control TheoryControl Theory
• Studies the behavior of control systems
• Major basic controllers: – P: proportional control– PD: proportional derivative control– PID: proportional integral derivative control
![Page 15: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/15.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
P: Proportional ControlP: Proportional Control
• Error = measurement – setpoint– Setpoint = desired output
• Process input = Gain * error + bias – bias: manual reset (to fix any offset)
ControllerThe process
Under control
Desired
output
Process output
Process input
Sensors
Σ+-
![Page 16: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/16.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
P:P: Proportional ControlProportional Control
• Q: What happens if the gain is increased?• A: Loop may go unstable
• Q: What if the gain is decreased?• A: It takes along time to get close enough to the setpoint.
• Determining the gain: hard problem– analytically (mathematics)– empirically (trial and error)
![Page 17: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/17.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Setting GainSetting Gain• Determining the gain depends on the physics of the system:
• Analytical approaches:– System should be understood well– System should be characterized mathematically.
• Trial and error (ad hoc, system-specific):– System should be tested extensively.– Can be done
• manually • Automatically by the system
• Wrong gain may put the system into oscillation!
![Page 18: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/18.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
OscillationOscillation
• Wrong gain may put the system into oscillation
![Page 19: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/19.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
DampingDamping• The process of systematically decreasing oscillation• Properly damped: Reduces and removes oscillation in a reasonable
amount of time.
![Page 20: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/20.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
P:P: Proportional ControlProportional Control
• Q: What happens if the system is very dynamic? – Example: Following another robot
• A: P control does not work well.– It senses the present time.
• Q: What happens close to the setpoint?• A:
– If gain is fixed: May not work for low errors• Leaves some offset
– If gain is high: Tends to overshoot
![Page 21: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/21.jpg)
ExampleExample
Kp = 20
Kp = 200
Kp = 50
Kp = 500
![Page 22: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/22.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Example: Analysis Example: Analysis
steady-state error
settling time
rise time
overshoot
overshoot -- % of final value exceeded at first oscillation
rise time -- time to span from 10% to 90% of the final value
settling time -- time to reach within 2% of the final value
ss error -- difference from the system’s desired value
![Page 23: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/23.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
D: Derivative ControlD: Derivative Control
• Predict the future:
• Adjust based on the rate of change– The speed of change
• Example: wall following robot– High derivative: Very fast toward the wall– Low derivative: Very slow toward the wall
• Output:– o = Kd * di/dt
![Page 24: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/24.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Momentum of CorrectionMomentum of Correction
• Momentum of correction results in oscillation and instability– A result of a slow reaction time to the controller
• Momentum = mass * velocity • D to overcome oscillation
• Output = error * Gp + d(error)/dt * Gk– Example: Wall following:P and D are opposite each other– PD: Mostly used for industrial plants
![Page 25: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/25.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
PD ControlPD Control
Kd = 300
Kd = 3
Kd = 30
![Page 26: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/26.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Integral ControlIntegral Control
• The controller output is proportional to the amount of time the error is present.
– Integrate all previous values.
• To overcome (eliminate) the offset– The longer the offset hangs around, the larger the I component becomes
• Output o = Kf * int i(t)dt
![Page 27: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/27.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Example: PIExample: PI• SS error (offset) has been removed
Ki = 0 Ki = 2
![Page 28: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/28.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
PI Example: Draw backsPI Example: Draw backsKi = 20
Ki = 90
Ki = 200
![Page 29: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/29.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
PID ControllerPID Controller
• Proportional Integral Derivative Control is a combination of proportional, integral, and derivative control:
• output = Kp * i + Kd * di/dt + Kf * int i(t) dt
![Page 30: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/30.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
PID ControllerPID Controller
![Page 31: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/31.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
PID resultsKp = 100 Ki = 200
Kd = 2
Kd = 10 Kd = 20
Kd = 5
![Page 32: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/32.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
SimulationSimulation
http://newton.ex.ac.uk/cgi-bin/metaform?http://newton.ex.ac.uk/teaching/CDHW/Feedback/OvSimForm-gen.html
![Page 33: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/33.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Choosing ParametersChoosing ParametersZiegler-Nichols Method
1. Adjust the set-point value, Ts, to a typical value for the system and turn off the derivative and integral actions (0). Select a safe value for the maximum power M and set the proportional gain to minimum.
2. Progressively increase the gain until suddenly decreasing or increasing Ts by about 5% induces oscillations that are just self-sustaining.
3. Call the gain at this stage Gu, and the period of the oscillations tu. Note the values of each quantity.
4. Set the controller parameters as follows:– P-Control: P=0.50*Gu, I=0, D=0. – PI-Control: P=0.45*Gu, I=1.2/tu, D=0. – PID-Control: P=0.60*Gu, I=2/tu, D=tu/8.
5. Check the overall performance of system is satisfactory under all normal conditions.
![Page 34: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/34.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Is it Set Well?Is it Set Well?How do we measure system accuracy?• Elementary: The plant didn’t blow up• Informal:
– Optimum decay ratio (1/4 wave decay)
– Minimum Overshoot
– Maximum Disturbance Rejection
![Page 35: Feedback Control](https://reader036.vdocuments.site/reader036/viewer/2022070416/568151be550346895dbff157/html5/thumbnails/35.jpg)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Is it Set Well?Is it Set Well?
• Mathematical:– Various integral definitions, such as:
• IAE - Integral of absolute value of error • ISE - Integral of error squared
– Mostly reserved for “academic” purposes