Hi Neil, Either use a different multiplier for your integral term or different limits for integral growth, based on polarity. Cheerful regards, Bob On Tue, Dec 30, 2014, at 06:37 PM, Neil wrote: > Hi all, >=20 > I'm trying to make what is essentially a servo for a one-off project for= =20 > a friend... I'm driving a window motor (I can control speed=20 > bidirectionally) with a controller/driver and there's a potentiometer=20 > attached for feedback. For now, I'm using an Arduino to get it running,= =20 > but I'll get a custom PCB made for a PIC-based circuit later. BUT...=20 > there's a one-sided force (spring) on the load the motor is moving. >=20 > For an initial test I tried setting the motor speed proportional to how=20 > far off it was from it's target, but when it gets close, the spring load= =20 > is too much for it. Changing the force so it's a bit more at close to=20 > target position helps, but I think I'm just going to use PID. My=20 > concern is that with the spring force acting only one way, the PID=20 > parameters would be different from one side to the next. Essentially to= =20 > stay in a fixed position, I'd need a continuous non-zero speed on the > motor. >=20 > How is this (easily) handled? Do I do separate cases for one direction=20 > vs. the other? Or do I empirically determine how much speed to send it=20 > to counter the spring force and add that value before sending to the=20 > motor controller? Of course, this would assume the spring it mostly=20 > constant force for the full range of movement. But what if it's not? >=20 > Cheers, > -Neil --=20 http://www.fastmail.com - Same, same, but different... --=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 .