Lawrence Lile wrote: > > I've been struggling a little with a PID control scheme (actually it's just > PI, I've been warned that D terms promote instability!) I've got a > proportional scheme that looks like this: The I term is great for forcing the system to equilibrium, but also great for inducing unwanted oscillations. You *have* to make provision for a I term multiplication factor that can be fine-tuned on the actual system. This factor is usually much, much lower than the P-factor (and the D factor if you use it). A good starting point for you experiments, is 0.1 . You can handle this horrible math (in PIC terms) by not adding the difference to your accumulator on every sample, but only on every tenth (hence 0.1) sample. If you want almost zero oscillation, you can set one or two lower set-points where the I-factor is reduced even further. > PS yes this is with a PIC. Of course! I did a PID controller for a linear motor as my very first PIC project (ever). I worked my butt off, and it worked. I was sooooooo proud of it! I never got paid for it, but it did land me a good job ;) -- Friendly Regards /"\ \ / Tjaart van der Walt X ASCII RIBBON CAMPAIGN mailto:tjaart@wasp.co.za / \ AGAINST HTML MAIL |--------------------------------------------------| | WASP International | |R&D Engineer : GSM peripheral services development| |--------------------------------------------------| | Mobile : tjaart@sms.wasp.co.za (160 text chars) | | http://www.wasp.co.za/~tjaart/index.html | |Voice: +27-(0)11-622-8686 Fax: +27-(0)11-622-8973| | WGS-84 : 26¡10.52'S 28¡06.19'E | |--------------------------------------------------|