|
Re: PID loop speeds up as it gets closer to target?
What motor controller are you using?
Verify that your motor controller and sensor are in-phase. In-phase means that if you apply a positive throttle to the motor controller, the sensor moves in a positive direction.
If the motor controller and sensor are not in-phase, then you might want to go to setPoint = 500, but the sensor is reading -250, and when you try to go forward, the sensor shows that you are going backwards, i.e. towards -500. That could cause the PID loop to accelerate towards your setPoint, because as far as the PID loop knows, you are getting further away from the setPoint.
Good luck!
-Tyler
|