Flush the velocity PID loop to prevent unwanted yaw correction

I’m using CONTROL_MODE_VELOCITY_CONTROL. My robot is differential drive, and heavy. After some aggressive driving, the robot will yaw even if the velocity commands for both motors is equal. But only for a very short period of time.

My guess is that the velocity PI loop expects the motors to be in a certain position, but they aren’t, so when the input_vel is high enough, the PI loop will try to take the wheels to a certain position, which causes the intial yaw movement.

  1. Opinions on my guess?
  2. Work arounds?

Yeah that tends to be a problem. You can remove the integrator gain.

1 Like