Michael Rigby-Jones wrote: > > > The resetting of I compensates (among other things) for > > the digital nature of the calculations. Running 16 bit > > PID values in a PIC is not feasible, so I pulled a few > > tricks out of the hat. Another, is to only accumulate > > the I value every 10-50 (settable) samples. Effectively > > this divides the I term which is always much smaller > > than the P or D terms. > > > > > I used this trick for the PID controler I wrote a few months back. I don't > understand what you mean when you say running 16 bit values is not feasable. > Most the the variables I used were 16 bit integers. Admittedly I was using > a 10bit ADC and DAC though. Running @ 3.64MHz, it was a pain in the ass to try to do all the math, PWM, serial comms, LCD, keypad and a partridge in a pear tree. That was a long time ago, though. Now I'd go straight SX for anything fast. > It seems to me that you can spend all the time in the world with Bode plots > and pages of enormous calculations, but at the end of the day, you can't > beat sitting down and tuning control loops by experimentation. Yes. You have to smell the smoke to appreciate sensible values! My control handbooks never mentioned that a big linear motor that oscillates because of the I term, doesn't look so good. -- Friendly Regards /"\ \ / Tjaart van der Walt X ASCII RIBBON CAMPAIGN mailto:tjaart@wasp.co.za / \ AGAINST HTML MAIL |--------------------------------------------------| | Cellpoint Systems SA | | http://www.cellpt.com | |--------------------------------------------------| | 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 | |--------------------------------------------------|