150 likes | 308 Views
Intelligent Steering Using PID controllers. Don DeLorenzo. Euan Forrester – Electronic Arts, Black Box. Need For Speed Hot Pursuit 2 Need For Speed Underground Semi-realistic driving physics on multiple surfaces. What are PID controllers?.
E N D
Intelligent Steering Using PID controllers Don DeLorenzo
Euan Forrester – Electronic Arts, Black Box • Need For Speed Hot Pursuit 2 • Need For Speed Underground • Semi-realistic driving physics on multiple surfaces
What are PID controllers? • Feedback-based algorithms used to minimize difference between measured output variable and a particular target • First term proportional to current error • Second term proportional to integral of current error • Third term proportional to derivative of current error
Background • Engineering Algorithm • In use for more than 50 years – thermostats, cruise control, etc. • Integral and Derivative terms are estimates
Equations • Difficulty lies in choosing coefficient weights
Example • Missile will have lift, drag, crosswinds, etc. that will affect its path • Position in space missile is targeted towards is ‘steer-to point’ Velocity Error Desired Angle
Example Continued • Steer-to point must be sufficiently far from missile to avoid exaggerating error • Direction of velocity is used rather than direction missile is facing Velocity Error Desired Angle
Proportional-Only Controller • Asymptotic behavior • If proportional coefficient is small, missile will follow lazy, asymptotic path back towards desired course • Positive Feedback • If proportional coefficient is large, missile will overshoot target and oscillate wildly • Steady State Error • If there is a crosswind, missile’s course will be parallel to desired course but will never reach it
Solutions • Integral term: • Deals with steady state and asymptotic errors because sum of errors will continue to increase until missile is back on course • Derivative term: • Deals with positive feedback, because as missile turns sharply towards target, derivative of error becomes negative, serving as a damper • Derivative term also increases to ‘kick start’ system if target moves
Tuning PID Controller • Proportional coefficient first • Vary one coefficient at a time • Real-time tuning • No ‘perfect’ solution, engineering tradeoffs
Extensions to PID Algorithm • Variable coefficients • Missile may handle differently at high than low speeds • Switching PID controllers based on object state • Car on snow vs. mud vs. asphalt • More complex P, I, D functions • Capping functions to avoid spikes, or more complex functions • Filtering input data • Noisy input data will give jumpy D value • Smoothes path at cost of responsiveness
Other Applications • Any problem expressible in terms of minimizing error of single variable, occurring over a length of time while corrective efforts are applied • Steering • Thrust • Braking • Temperature
Conclusion • PID: Proportional, Integral, Derivative components • Robust, easy to implement solution • Can be used for any problem minimizing error in a single variable over time