Hi Neil, What you describe is a textbook case of a problem which integral control solves. PID or still possibly just PI should work well for your application, without special gain switching or anything. I would still recommend a very simple feedforward control input to reduce the burden on the integrator. Sean On Wed, Dec 31, 2014 at 1:36 AM, Neil wrote: > Meaning that if the motor is say in the center of its travel and I set > the speed to zero, it won't stay there. I need to keep some power on it > to counter the spring pulling it off to one side. This raised the > question of whether once I tune P,I (and possibly D), would it work for > both directions, or would the difference in control input to the motor > mean tuning differently for each direction. I don't have access to the > system again for a bit, but I'll setup a similar test system so I can > experiment. > > Cheers, > -Neil. > > > > > > On 12/31/2014 12:20 AM, Sean Breheny wrote: > > Neil, > > > > I don't understand what you mean by "with the spring force acting only > one > > way, the PID > > parameters would be different from one side to the next. Essentially t= o > > stay in a fixed position, I'd need a continuous non-zero speed on the > > motor." > > > > > > Can you please explain more about the setup? > > > > It is a standard technique, which works very well, to begin with a basi= c > > model of your system and predict the control effort needed to achieve t= he > > trajectory you desire, and then apply this pre-programmed control profi= le > > and perform PID only on the deviation of the actual device from the > planned > > trajectory. This is called feedforward control can allow you to use > higher > > PID gains for more precise control without the large amount of overshoo= t > > you would get otherwise. > > > > Based on your description, I suspect that this can be done with > feedforward > > and a simple PI controller (no D term needed). If so, tuning it is almo= st > > trivial (iterative process where you first determine the highest integr= al > > gain you can tolerate with P=3D0, then back off on that and increase P = to > > gain response speed). > > > > Sean > > > > --=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 .