Left Half-Plane
Game 02 · feedforward · preview control

Preview

Draw your racing line on today's road. Pick a speed and how far ahead the steering looks. The car has a lag it does not tell you about, and gates that the centre line misses.

world runs today 0best today centre line, no preview
Where you stand today

Cost is in seconds: lap time, plus three for every second off the road, plus two per missed gate. The steering is a feedback controller on your line plus a feedforward term from the line's curvature a distance L ahead. With L = 0 the feedforward arrives late by exactly the lag; the faint ghost drives your line that way. Lateral grip is finite, so a tight line at high speed slides wide. Your hand-drawn line is the controller here.

What is going on

Feedback is always late

A controller that reacts to error can only act once the error exists. That is the price of feedback, and usually it is worth paying, because feedback works without knowing much about the world. But add a lag between the command and the wheels, and the reaction lands later still. Every corner is entered a beat too late, and at speed a beat is a metre of gravel.

Feedforward, and looking ahead

If you know the road, you can compute the steering the road will demand before the error appears: a curve of curvature κ taken at speed v needs a lateral acceleration of v²κ, so command it now. That is feedforward. Preview control goes one step further and reads the reference a little into the future, so that a command which takes a lag τ to take effect is issued a lag early. In distance, the right look-ahead is about speed times lag, which is why the slider has a sweet spot that moves with the speed, and why the hidden lag matters.

a = kp(r − y) + kd(ṙ − ẏ) + v² r″(x + L)feedback on the error, plus feedforward from the curvature L ahead

Walking robots do this with the ground reaction point, using a preview of the next few footsteps. Machine tools do it with the toolpath. Autonomous cars do it with the map. The idea is the same each time: the future you can see is worth more than any amount of gain on the present.

The racing line

Tyres have a limit. The lateral acceleration v²κ must stay under it or the car slides, and in this game it slides wide and loses time off the road. The centre line has the road's curvature; a good line uses the width of the road to make the curvature smaller, cutting each apex and letting the car run wide on the exit. That is why racing drivers do not drive down the middle, and why your hand-drawn line can beat the geometry. A smooth line is a feasible line. The controller can only track what the tyres allow.