Cyber-Physical Systems Feedback Control ICEN 553/453– Fall 2018 Prof. Dola Saha 1
Control System in Action Honeywell Thermostat, 1953 Chrysler cruise control, 1958 Feedback Systems: An Introduction for Scientists and Engineers 2
Closed Loop Control Disturbing forces Noise Real state variables Driving forces Noise Sensors Plant X(t) Actuators Sensor Y(t) D(t) outputs Desired state variables –X*(t) State estimator Control U(t) commands Analog Interface Control Errors X’(t) ADC or Compare Software Software input compare E(t)=X*(t)-X(t) Estimated state variables 3
Open Loop Control Ø Control Action is independent of the output of the system Noise Desired state variables –X*(t) Disturbing forces Control Driving forces commands Real state variables Controller Actuators Plant X(t) U(t) D(t) 4
Open Loop Control Ø state estimator eliminated § not well suited for a complex plant Ø assumes disturbing forces have little effect on the plant Ø less expensive than closed-loop control § example: electric toaster 5
Example Problem: Bike in straight Line Ø Steer the bike in a straight line blindfolded Ø Open loop à no sensor feedback Ø What if you hit a rock? Ø What if the handle bars aren’t perpendicular to the wheels? 6
Control Systems Strategy Ø Strategy § plant is a system that is intended to be controlled § collect information concerning the plant – data acquisition system (DAS) § compare with desired performance § generate outputs to bring plant closer to desired performance Ø You can’t control what you can’t measure 7
Control Systems Ø Microcomputers are widely employed in control systems: § automotive ABS, ignition and fuel systems § household appliances § smart things § industrial robots § pacemakers Ø Why are we interested in Feedback Systems in CPS course? 8
Control Systems – Closed loop Ø Closed-loop control § feedback loop implementation o suitable for complex plant § sensors and state estimator produce representation/estimation of state variables § these values are compared to desired values § control software generates control commands based upon the differences between estimated and desired values 9
Closed Loop Control Ø Control action depends on the output of the system Noise Desired state variables –X*(t) Disturbing forces Control Driving forces commands Real state variables Controller Actuators Plant X(t) U(t) D(t) Sensors 10
Example Problem: Bike in straight Line Ø If you can see the pavement à Closed Loop Approach Ø Control based on error: PID Ø Proportional : Change handle angle proportional to the current error Ø Derivative : Large handle corrections when error is changing slowly, and small handle corrections when error is changing quickly Ø Integral : Handle corrections based on the cumulative error 11
Problem: Set Motor Velocity Ø Open Loop Controller § Use trial and error to create relationship between velocity and voltage § Problems o Supply voltage change o Bumps in carpet o Motor Transients Desired Velocity Actual Motor Velocity Velocity To Volts 12
Problem: Set Motor Velocity Ø Closed Loop Controller § Feedback is used so that the actual velocity equals the desired velocity § Can use an optical encoder to measure actual velocity Desired Actual Controller Motor Velocity Velocity err Adjusted Voltage 13
Step Response with No Controller Desired Velocity Actual Motor Velocity Velocity To Volts Ø Naive velocity to volts Velocity Ø Model motor with several differential equations Ø Slow rise time Ø Stead-state offset Time (sec) 14
Step Response with Proportional Controller Desired Actual Velocity Controller Motor Velocity (V des ) err Adjusted Volts (V act ) (X) ( ) = + × - X V K V V des P des act Ø Big error big = big adj Velocity Ø Faster rise time Ø Overshoot Ø Stead-state offset (there is still an error but it is not changing!) Time (sec) 15
Step Response with PD Controller Desired Actual Velocity Controller Motor Velocity (V des ) err Adjusted Volts (V act ) (X) de ( t ) = + - X V K e ( t ) K des P D dt Ø When approaching desired velocity Velocity quickly, de/dt term counteracts proportional term slowing adjustment Ø Faster rise time Ø Reduces overshoot Time (sec) 16
Step Response with PI Controller Desired Actual Velocity Controller Motor Velocity (V des ) err Adjusted Volts (V act ) (X) ò = + - X V K e ( t ) K e ( t ) dt des P I Ø Integral term eliminates Velocity accumulated error Ø Increases overshoot Time (sec) 17
Step Response with PID Controller Desired Actual Velocity Controller Motor Velocity (V des ) err Adjusted Volts (V act ) (X) = + X V K e ( t ) des P Ø Combined Velocity ò + K e ( t ) dt benefits of PI I de ( t ) and PD - K D dt Time (sec) 18
Control Systems – Performance Ø Performance metrics § steady-state controller error o an average value of the difference between desired and actual performance § transient response o how quickly the system responds to change § stability o system output changes smoothly – without oscillation or unlimited excursions 19
General Approach to PID t dE ( t ) ò = + t t + U ( t ) K E ( t ) K E ( ) d K p i d dt 0 U p = K p E Ø Proportional U i = U i + K i E ∆t Ø Integral U d = K d (E(n)-E(n-1))/ ∆t Ø Derivative U = U p + U i + U d Ø PID 20
PID – Performance Measure Ø Accuracy underdamped § Magnitude of the Error = Desired– Actual Ø Stability t response § No oscillations Ø Overshoot (underdamped, overdamped) § Ringing, slow Ø Response Time to new steady state after § Change in desired setpoint § Change in load 21
Comparison Controller Response time Overshoot Error Open-Loop Smallest Highest Large Proportional Small Large Small Integral Decreases Increases Zero Derivative Increases Decreases Small change 22
Parameter Tuning Ø Manual Tuning Ø Ziegler–Nichols’ Tuning § Time Domain Method § Frequency Domain Method Ø Relay Feedback Ø Integrator Windup 23
PID Controller in Software Ø Wait for clock interrupt Ø Read input from sensor Ø Compute control signal Ø Send output to the actuator Ø Update controller variables Ø Repeat 24
PID Controller Pseudocode 25
Proportional Controller to Helicopter Problem error signal net torque desired angular velocity 26
Controller Summary Ø Controller only as good as its sensor Ø Observe everything “What was it thinking?” Ø Change one parameter at a time Ø Choose stability over responsiveness 27
Recommend
More recommend