Malcolm,

Sounds like the perfect job for a PID loop.
<br>