I am trying to set up a motor with a potentiometer to act like a servo. I have another potent controlling the desired location. I can make the motor turn one way correctly but it jitters when going the other direction.
The potentiometer on the motor in magnetic and have infinite rotation, the controller in a normal potent.
My algorithm goes as follows.
PHP Code:
pot_0 = controller potentiometer
pot_1 = on motor
mot_0 = motor
mot_0.Set( 10 * int( (pot_0.value() - pot_1.value())/10 )/1024)
the 10's allow for error. 1024 is potentiometer max.