Simplify the gradual braking formula
Add a TODO
Correct and shift the comment about three-part linear accel
Minor cleanup
Reword comments in advance of a code change
Destubbify!
Add a test track file (for redirection - ugly file but easy to parse)
Add a blank line for tidier display
Lengthen the test track
Fix var name (oops!) and add debugging info
Destubbify derailment
Change the LEEWAY from being a fixed 1.0m/s to being one second's action (cruise or power)
Bugfix speed calculation - wrong variable used
Cruise between brake and power, same as between power and brake
With brakes on, estimate on the basis of removing them, to guarantee safety
Reinstate LEEWAY for safety against FP error
Add some more debug info
Apply power only if we can do so for ten seconds (ish)
Refactor residual_speed into a function (no change bar the debug line)
Once the brakes are applied, keep them on until we're below the limit