Meaning that if the motor is say in the center of its travel and I set=20 the speed to zero, it won't stay there. I need to keep some power on it=20 to counter the spring pulling it off to one side. This raised the=20 question of whether once I tune P,I (and possibly D), would it work for=20 both directions, or would the difference in control input to the motor=20 mean tuning differently for each direction. I don't have access to the=20 system again for a bit, but I'll setup a similar test system so I can=20 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 on= e > way, the PID > parameters would be different from one side to the next. Essentially to > 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 basic > model of your system and predict the control effort needed to achieve the > trajectory you desire, and then apply this pre-programmed control profile > and perform PID only on the deviation of the actual device from the plann= ed > trajectory. This is called feedforward control can allow you to use highe= r > PID gains for more precise control without the large amount of overshoot > you would get otherwise. > > Based on your description, I suspect that this can be done with feedforwa= rd > and a simple PI controller (no D term needed). If so, tuning it is almost > trivial (iterative process where you first determine the highest integral > gain you can tolerate with P=3D0, then back off on that and increase P to > gain response speed). > > Sean > > > On Tue, Dec 30, 2014 at 9:37 PM, Neil wrote: > >> Hi all, >> >> I'm trying to make what is essentially a servo for a one-off project for >> a friend... I'm driving a window motor (I can control speed >> bidirectionally) with a controller/driver and there's a potentiometer >> attached for feedback. For now, I'm using an Arduino to get it running, >> but I'll get a custom PCB made for a PIC-based circuit later. BUT... >> there's a one-sided force (spring) on the load the motor is moving. >> >> For an initial test I tried setting the motor speed proportional to how >> far off it was from it's target, but when it gets close, the spring load >> is too much for it. Changing the force so it's a bit more at close to >> target position helps, but I think I'm just going to use PID. My >> concern is that with the spring force acting only one way, the PID >> parameters would be different from one side to the next. Essentially to >> stay in a fixed position, I'd need a continuous non-zero speed on the >> motor. >> >> How is this (easily) handled? Do I do separate cases for one direction >> vs. the other? Or do I empirically determine how much speed to send it >> to counter the spring force and add that value before sending to the >> motor controller? Of course, this would assume the spring it mostly >> constant force for the full range of movement. But what if it's not? >> >> Cheers, >> -Neil >> >> -- >> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive >> View/change your membership options at >> http://mailman.mit.edu/mailman/listinfo/piclist >> --=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 .