Oh well that sounds nice. I don't have any PID yet (just my crude P),=20 but am working on that now. From what I read though, it seems like each=20 time I move it back it would take a handful of cycles for the I term to=20 grow enough to move the motor where it needs to be, so would that=20 introduce a noticeable delay to get the motor into position? While I'm here, what's a good method to tune? From Wikipedia's info=20 here ( http://en.wikipedia.org/wiki/PID_controller ), I'm going to try=20 the Ziegler-Nichols method, but is there anything else you'd recommend? Thanks, -Neil. On 12/30/2014 9:56 PM, Randy Dawson wrote: > Hi Niel, > > If you have integral working in your algorithm, this will take care of it= .. > > As long as a position error exists, the I term will increase in value for= each timestep and increase the PID output to turn on your motor against th= e spring. > > In the other direction, without the spring opposing, the I term is 'out o= f the loop', and the proportional term does it all by itself (or maybe not,= for a tight seal) > > What you are going to see, is P slew the motor until resistance is met, t= he longer its not at the desired position, output increases, closing agains= t the resistance. > > I have used this on servo valves with rubber seats, where I always have t= o give the output term an increase, the longer it remains out of position. > > Randy > >> Date: Tue, 30 Dec 2014 21:37:48 -0500 >> From: picdude3@narwani.org >> To: piclist@mit.edu >> Subject: [EE] Asymmetrical motor/servo PID control? >> >> 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 mo= tor. >> >> 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 >> >> --=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 > =09 --=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 .