IVR: Introduction to Control (IV) 16/11/2010
Proportional error control (P) Example Control law: V B = M k 2 R ds dt + k 1s V B = K ( ) s goal s Convenient, simple, powerful (fast and proportional reaction to errors) No need for modelling (sign and the order of magnitude of K p must be known) Problems: Steady state error, load droop, oscillations about the goal state (ringing)
Example: Motor with gears Modifying the dynamics by altering the robot morphology Thus: V B = 1 γ MR k 2 Gear ratio γ where more gear-teeth near output means γ > 1. smotor = γ sout: for γ > 1, output velocity is slower torque motor = γ 1 torque out : for γ > 1, output torque is higher ds dt + γk 1s Same form, but dierent steady-state, time-constant (half-life): s = V B γk 1 τ 1/2 = 0.7 MR γ 2 k 1 k 2 i.e. for γ > 1, reach lower speed in faster time, robot is more responsive, though slower. (Note: we've ignored that spur gears reduce eciency by 10%)
Example: Motor with gears Steady state error (P-control) K ( ) s goal s = M R ds γk 2 dt +γk 1s i.e. Ks goal = M R ds γk 2 dt +(K + γk 1) s Steady state s = K K + γk 1 s goal For K < : Steady state error increases for γ > 1 s goal s = s goal K K + γk 1 s goal = γk 1 K + γk 1 s goal
Proportional Integral (PI) Control Example: ) V B = K p (s goal s + ε = M R ds k 2 dt + k 1s Integrate the error over time Control law (P and PI): V B = K p (s goal s ε = ( s goal s ) dt ) ( ) + K i s goal s dt Reacts to small systematic errors; choosing K p and K i appropriately steady state error can be eliminated Problems: slow (K i usually small), oscillation about the goal state, wind-up (accumulation of large errors) Solutions: Freezing at disturbances, using model information to compensate large errors
Proportional derivative (PD) control Example Control law (P and PD): T = J d 2 θ dt 2 + F dθ dt ) dθ T = K p (θ goal θ + K d dt Dampens oscillations, improves stability Useful for large inertia & small friction (adds articial friction) Often: derivative of error θ goal θ ( K d has opposite sign), but derivative of θ gives better stability when θ goal changes Possible problems: Derivative is sensitive to measurement noise Tends to slow down the control action Does not know the (constant) goal state usually in combination with other control signals
PD, PI,... single-letter controllers are less often used P-controller: Possible if goal state can be kept with zero action and if the system is self-damping I-controller: Possible if overshoots and wind-up can be dealt with, e.g. by `leaky' integration D-controller: Does not know the (constant!) goal state useful only in combination with other control signals or as a fall-back controller PD or PI controllers are fairly common PD: Possible if goal state can be kept with zero action PI: Possible if the system is self-damping
Combine as PID control (Three mode control) Black sectors denote negation ) t T = K p (θ goal θ + K i How to choose K p, K i, K d? 0 ( θ goal θ ( t )) dt dθ + K d dt PID controllers are used in more than 95% of feedback control applications (as of 1995)
Characterising the behaviour of a control system 1 Rise Time: time it takes for the plant output to rise beyond 90% of the desired level for the rst time 2 Settling Time: time it takes for the system to converge to its steady state. Settling time may be long in the case of on-going oscillations Rise time and settling time replace half time (which was for non-oscillatory exponential convergence) 3 Overshoot: how much the the peak level is higher than the steady state, normalized against the steady state. 4 Steady-state Error: the dierence between the steady-state output and the desired output. Jinghua Zhong: PID Controller Tuning: A Short Tutorial (saba.kntu.ac.ir/eecd/pcl/download/pidtutorial.pdf)
A remark on linear dierential equations Second-order system Dene ρ = dθ dt d 2 θ and insert ( dρ dt dθ dt dt 2 = A 1 dρ dt = A 1 dθ dt + A 0θ + C dθ dt + A 0θ + C We get an equivalent two-dimensional rst-order system ) ( ) ( ) ( ) A1 A = 0 ρ C + 1 0 θ 0 Diagonalize: R dρ dt dθ dt! «««A0 A1 = R R 1 ρ C R + R θ 1 0 0 such that R «A0 A1 R 1 = 1 0 «λ1 0 0 λ 2 Transform to the new coordinates, solve two simple di-eqs with constant terms, transform back to ρ,θ, insert initial conditions, done
PID control example Second-order system T (t) = J d 2 θ dt 2 + F dθ dt Controller ) ( ) dθ K p (θ goal θ (t) + K i θ goal θ (t) dt + K d dt = T (t) Numerical solution with: A 1 = K d F, A J 0 = Kp J, C = K i J t 0 ( ) θ goal θ (t) dt + Kp θ J goal d 2 θ dt 2 = A 1 dθ dt + A 0θ + C
PID control example 1 Behaviour at K p = K i = K d = 0: Overdamped (see lect. 14) 2 Start with proportional control: K i = K d = 0, θ goal = 1 θ 1.8 1.6 Kp=5.0 1.4 1.2 1 0.8 Kp=1.0 Kp=0.5 0.6 Kp=0.1 0.4 0.2 Ki=0 Kd=0 0 0 1 2 3 4 5 6 7 8 9 10 t
PID control example 3 K p = 1, K i 0: Similar eect as further increasing K p θ 1.8 1.6 1.4 1.2 1 0.8 0.6 Ki=0.5 Ki=0.3 Ki=0.1 Ki=0 0.4 0.2 Kd=0 Kp=1 0 0 1 2 3 4 5 6 7 8 9 10 t
PID control example Note, that the negative sign of K d is for consistency with the equation two slides back. Considered as articial friction, the used dierential term is clearly damping. 4 K p = 1, K d 0: Reduce oscillations but keep rise time low θ 1.8 1.6 1.4 1.2 Kd=0 1 0.8 0.6 0.4 0.2 Kd=-0.2 Kd=-0.5 Kd=-1.0 Ki=0 Kp=1 0 0 1 2 3 4 5 6 7 8 9 10 t
PID control example: Evaluation Often PD control is sucient Integral term needed only if steady state error is expected Consider priorities when determining overshoot: When catching a ball: fast rise time is essential (set goal state to a lower value and make sure that the ball arrives at the overshoot) When moving towards a position near an obstacle: slow rise time, overdamped movement no overshoot General case: adjust K d to realise critical damping
Eects of increasing a parameter independently Parameter Rise time Overshoot K p Decrease Increase Settling time Small change K i Decrease Increase Increase K d Minor increase Minor decrease Minor change Steadystate error Decrease Decrease signicantly No eect in theory Stability Degrade Degrade Improve if K d is small http://en.wikipedia.org/wiki/pid_controller (except red entries)
Control with changing set points In tracking tasks the set point changes continuously: goal trajectory Rise time and settling time appear as delays (phase shifts) which depend on the rate of change of the goal trajectory Delays can be reduced by high-gain proportional control θ 2 1.5 Kp=5 Kp=1 goal trajectory 1 0.5 0-0.5-1 -1.5 Ki=0 Kd=0-2 0 2 4 6 8 10 12 14 16 18 20 t
Control with changing set points Dierential feedback can reduce the overshoot, but tends to increases phase shift Integral feedback will not improve the situation Solution: Forward models, θ 1.5 Kd=0 Kd=-1.6 goal trajectory 1 0.5 0-0.5-1 Kp=5 Ki=0-1.5 0 2 4 6 8 10 12 14 16 18 20 t
Changing set-points: Improvements Set-point switching: Change the set point in a ramp-like way Initializing the integral term at a suitable value Disabling the integral function until the state has entered the controllable region Limiting the time period over which the integral error is calculated Preventing the integral term from accumulating above or below pre-determined bounds http://en.wikipedia.org/wiki/pid_controller
Typical steps for designing a PID controller Determine what characteristics of the system needs to be improved. Use K p to decrease the rise time. Use K d Use K i to reduce the overshoot and settling time. to eliminate the steady-state error. This works in many cases
Ziegler-Nichols tuning rule (reaction curve method) Practical control method, i.e. the controlled system can only be accessed experimentally 1 Set I and D gains to zero. 2 Check sign of gain (say positive) 3 Increase P gain (from zero) until until output starts to oscillate `ultimate gain' K u and oscillation period T u 4 Use K u and T u to set K p, K i and K d based on heuristic values: K p = 0.65K u, K i = 2K p /T u and K d = K p T u /8 May create some overshoot Stable to disturbances Not very good in tracking tasks Not equally good in all applications
Ziegler-Nichols rule tested Second order system (F = 0.5, J = 0.5) K u 1: one full oscillation period visible T u = 5 K p = 0.65, K d = 1.25, K i = 0.26 (scaled by time step!) θ 1.2 1 0.8 0.6 0.4 0.2 0 0 2 4 6 8 10 12 14 16 18 20 t Performance similar as tuned by hand (Z-N rule works best for rst-order systems!) Why Do We Keep Hinting That Results are Lousy? (http://www.mstarlabs.com/control/znrule.html)
Limitations of PID control PID control is the best controller with no model of the process (PID can be used on top of model-based control) Does not provide optimal control Is only reactive and needs errors to be able to react (combine with feed-forward control or forward models) D-term may suer from intrinsic or measurement noise ( use low-pass lter) D-term (error derivative) and I-term may suer from sudden set-point changes ( use set-point ramping) Is tuned to a particular working regime ( gain scheduling) Is linear and symmetric (e.g. usually a heating system does not involve symmetric cooling)
An example of D-only control in robotics Minimize changes of sensor values (this is achieved by D term) Use for control of direction (makes sense only with a persistent driving force, i.e. forward speed, and initialization) Generate useful behaviours (without re-programming): Obstacle avoidance (obstacle causes changes of sensor values) Following a wall or corridor based on distance sensor Stabilizing an image on a camera If not even sign of gain is know: Performing small probing movements provides information about (presently) correct sign
Further reading Most standard control textbooks discuss PID control, e.g.: Andrew D. Lewis: A Mathematical Approach to Classical Control. 2003. www.mast.queensu.ca/~andrew/teaching/math332/notes.shtml igor.chudov.com/manuals/servo-tuning/pid-without-a-phd.pdf For the research on robot juggling see: Rizzi, A.A. & Koditschek, D.E. (1994) Further progress in robot juggling: Solvable mirror laws. IEEE International Conference on Robotics and Automation2935-2940 S. Schaal and C.G. Atkeson. Open Loop Stable Control Strategies for Robot Juggling. In Proc. IEEE Conf. Robotics and Automation, pages 913 918, Atlanta, Georgia, 1993.
Classical Control Paradigm: SPA SPA is SPA lacks: serial speed and eciency ad hoc exibility and adaptivity analytical modularity and scalability assumptious errortolerance and robustness
Rodney Brooks: fast, cheap, and out of control Planning is just a way of avoiding guring out what to do next. The world is its own best model Complex behavior need not necessarily be the product of a complex control system Simplicity is a virtue Robots should be cheap All on-board computation is important Systems should be build incrementally Intelligence is in the eye of the observer No representation, no calibration, no complex computers Some objections that can be misleading: In a dierent environment the robot will fail! A function that deals with this problem will create more problems The system cannot be debugged! Bugs, too, are in the eye of the observer It's not scalable! Elephants don't play chess
Subsumption Architecture
Evaluation of the Subsumption Architecture I wouldn't want one to be my chaueur (C. Torpe) Modications at low-levels aect higher levels Often there the hierarchy is not strict Priorities rather than inhibition Representations, plans, and models do help Reproducibility is a virtue SPA is top-down, Subsumption Architecture is bottom-up neats vs. scrues
Modular architectures Schemas (M. Arbib) Circuit architecture: Situated automata (L. Kaelbling) Action selection (P. Maes), behavior-based robotics (R. Arkin) Dynamical systems and ant colonies Cognitive architectures
Three-layer architecture (TLA) Elementary behaviours Competition, scheduling, and adaptation of behaviours Planning, search, reasoning standard programming Erann Gat, 1998
Architectures summary 1 Simplicity is a virtue 2 The subsumption architecture is simple and extendable and makes often a good start 3 The ultimate goal is to interface automatic reasoning with the real world 4 Limited resources, sensor noise, unpredictability and complexity of the environment are problems in any approach to robot control