Your PID Controller is steadying to a 180-degree offset of where you put your setpoint (i.e. the 'back-end' of your robot is facing your target), e.g. -56 + 180 = 124, within the 2 degree tolerance you set
Before passing your setpoint to the PID controller, use "setpoint - 180" instead of just "setpoint", or find a way to reverse the angle (angle - 180) the NavX passes to the PIDController
Quote:
|
Try negating the power before applying it to your motors to see if that fixes the problem.
|
This won't work as it doesn't fix the value the NavX is reporting. PID is relative