<div dir="ltr"><div>Many thanks for the feedback last night - all working now ;)</div><div><ul><li>Fixed minor code bug</li><li>turned on 'reverse' mode on PID to invert output w.r.t. input</li><li>changed update period from 100ms to 10ms<br></li><li>enabled non-zero integrator term to stabilise the feedback loop</li></ul><div>Derivative term still causes instability so might need some more tuning but now a step change settles in < 100ms with no overshoot, the output converges to less than 1% of the set target voltage without any 'magic number' hacks<br></div></div><div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Robin Gilks<div><br></div></div></div></div></div>