So I finally got around to implementing this and it works. I initially=20 used the Arduino PID library, got it working/tuned and then wrote my own=20 PID code for a PIC18F. I used integer math, then scaled down to get the=20 appropriate range. In my final tuning, I used (what I believe is=20 feed-forward) an offset -- I experimentally determined what constant=20 output value would just counteract the spring pulling on the servo and=20 added that to my PID output result. Works pretty nicely. Much thanks, -Neil. On 1/1/2015 7:36 PM, Neil wrote: > I was continuously spitting out the raw A/D value from the control and > feedback pots and can see that I have the resolution, and there there is > some discrepancy between those two. Range is ~113 to ~870 (raw A/D > values), and the difference is sometimes around 30 when the motor > "stalls" for a bit . It seems like it wants to correct it, but can't, > then every so often it gets enough oomph (I expect from the Integral > component building up) to move, overshoots a bit and then repeats in the > other direction. > > I am seeing (on the continuous serial dump) the LSB (in decimal) > toggling by one digit, so I don't think it's noise (since the > discrepancy is ~30). But I can add some IIR filtering easily anyway. > > Cheers, > -Neil. > > > > On 1/1/2015 4:42 PM, Ruben J=F6nsson wrote: >>> *Basic* tuning (ie: no oscillation, chatter and getting pretty close to >>> setpoint) with the Ziegler-Nichols method was relatively easy, but it >>> seems a bit "sticky" -- ie: very small changes to my control pot don't >>> immediately take effect, and continuing to change the pot a bit more >>> suddenly makes it "jump" to the correct position. >> Could it be that you have too low resolution so very small changes to th= e pot >> isn't registered? When you move it a bit more, you will get a step chang= e. >> >> >>> Also, just sitting >>> with a fixed setpoint, it will move a bit every once in a while (like >>> 5-10 seconds). >> Could be noise in the signal from the motor position and/or pot. You nor= mally >> will get one to a couple of bits jitter from the A/D converter if your a= nalog >> circuit isn't well filtered and separated from the digital circuit. Perh= aps >> digital filtering could help. >> >> /Ruben --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .