Intelligent Steering Using PID controllers Don DeLorenzo.

14
Intelligent Intelligent Steering Using PID Steering Using PID controllers controllers Don DeLorenzo Don DeLorenzo

Transcript of Intelligent Steering Using PID controllers Don DeLorenzo.

Intelligent Steering Intelligent Steering Using PID controllersUsing PID controllers

Don DeLorenzoDon DeLorenzo

Euan Forrester – Electronic Arts, Euan Forrester – Electronic Arts, Black BoxBlack Box

►Need For Speed Hot Pursuit 2Need For Speed Hot Pursuit 2►Need For Speed UndergroundNeed For Speed Underground

►Semi-realistic driving physics on Semi-realistic driving physics on multiple surfacesmultiple surfaces

What are PID controllers?What are PID controllers?

►Feedback-based algorithms used to Feedback-based algorithms used to minimize difference between minimize difference between measured output variable and a measured output variable and a particular targetparticular target First term proportional to current errorFirst term proportional to current error Second term proportional to integral of Second term proportional to integral of

current errorcurrent error Third term proportional to derivative of Third term proportional to derivative of

current errorcurrent error

BackgroundBackground

►Engineering AlgorithmEngineering Algorithm► In use for more than 50 years – In use for more than 50 years –

thermostats, cruise control, etc.thermostats, cruise control, etc.► Integral and Derivative terms are Integral and Derivative terms are

estimatesestimates

EquationsEquations

)()()( tdesiredtmeasuredterror

)(*)(*)(*)1( terrordt

dcdtterrorcterrorctoutput dip

► Difficulty lies in choosing coefficient weightsDifficulty lies in choosing coefficient weights

ExampleExample

► Missile will have lift, drag, crosswinds, etc. Missile will have lift, drag, crosswinds, etc. that will affect its paththat will affect its path

► Position in space missile is targeted towards Position in space missile is targeted towards is ‘steer-to point’is ‘steer-to point’

Velocit

y

Desired Angle

Error

Example ContinuedExample Continued

► Steer-to point must be sufficiently far from Steer-to point must be sufficiently far from missile to avoid exaggerating errormissile to avoid exaggerating error

► Direction of velocity is used rather than Direction of velocity is used rather than direction missile is facingdirection missile is facing

Velocit

y

Desired Angle

Error

Proportional-Only ControllerProportional-Only Controller

► Asymptotic behaviorAsymptotic behavior If proportional coefficient is small, missile will If proportional coefficient is small, missile will

follow lazy, asymptotic path back towards follow lazy, asymptotic path back towards desired coursedesired course

► Positive FeedbackPositive Feedback If proportional coefficient is large, missile will If proportional coefficient is large, missile will

overshoot target and oscillate wildlyovershoot target and oscillate wildly

► Steady State ErrorSteady State Error If there is a crosswind, missile’s course will be If there is a crosswind, missile’s course will be

parallel to desired course but will never reach itparallel to desired course but will never reach it

SolutionsSolutions

► Integral term:Integral term: Deals with steady state and asymptotic errors Deals with steady state and asymptotic errors

because sum of errors will continue to increase because sum of errors will continue to increase until missile is back on courseuntil missile is back on course

► Derivative term:Derivative term: Deals with positive feedback, because as missile Deals with positive feedback, because as missile

turns sharply towards target, derivative of error turns sharply towards target, derivative of error becomes negative, serving as a damperbecomes negative, serving as a damper

Derivative term also increases to ‘kick start’ Derivative term also increases to ‘kick start’ system if target movessystem if target moves

Tuning PID ControllerTuning PID Controller

►Proportional coefficient firstProportional coefficient first►Vary one coefficient at a timeVary one coefficient at a time►Real-time tuningReal-time tuning►No ‘perfect’ solution, engineering No ‘perfect’ solution, engineering

tradeoffstradeoffs

Extensions to PID AlgorithmExtensions to PID Algorithm

► Variable coefficientsVariable coefficients Missile may handle differently at high than low Missile may handle differently at high than low

speedsspeeds► Switching PID controllers based on object stateSwitching PID controllers based on object state

Car on snow vs. mud vs. asphaltCar on snow vs. mud vs. asphalt► More complex P, I, D functionsMore complex P, I, D functions

Capping functions to avoid spikes, or more complex Capping functions to avoid spikes, or more complex functionsfunctions

► Filtering input dataFiltering input data Noisy input data will give jumpy D valueNoisy input data will give jumpy D value Smoothes path at cost of responsivenessSmoothes path at cost of responsiveness

Other ApplicationsOther Applications

►Any problem expressible in terms of Any problem expressible in terms of minimizing error of single variable, minimizing error of single variable, occurring over a length of time while occurring over a length of time while corrective efforts are appliedcorrective efforts are applied

►SteeringSteering►ThrustThrust►BrakingBraking►TemperatureTemperature

Need For SpeedNeed For Speed

ConclusionConclusion

►PID: Proportional, Integral, Derivative PID: Proportional, Integral, Derivative componentscomponents

►Robust, easy to implement solutionRobust, easy to implement solution►Can be used for any problem Can be used for any problem

minimizing error in a single variable minimizing error in a single variable over timeover time