I wrote a jsfiddle sample as a demo for my brother’s control systems class at NAIT to show the differences between closed-loop feedback controllers – the tiny algorithms behind cruise-control autopilots, and autofocus in your camera.
I have to generalize it to a PID object and so on, but it is fun to play with the coefficients – and I learned a thing or two I’d forgotten about digital controller behaviour, like sampling error and sampling bandwidth. And as all Control Systems engineers are warned: Turn up your Gains slowly!
Ideas for feedback loop tuning games? The unicyclist? better cruise control, Autopilot lander? Fill the acid vat?