How to tune the velocity controller - Heavy mobile robot

Hello,

I have an ODrive with firmware version 0.5.4, and I am using it to control a differential drive robot weighing about 100 lbs. The robot’s casters introduce disturbance, and if they are not aligned with the driving wheels, the robot turns before it goes forward, even if a solely forward command is given. Tuning the ODrive velocity controller might be the solution.

I have seen the documentation for tuning, but I have two questions.

First, I show you what I have found in the documentations here: Control Structure and Tuning — ODrive Documentation 0.5.4 documentation

"An upcoming feature will enable automatic tuning. Until then, here is a rough tuning procedure:

  1. Set vel_integrator_gain to 0
  2. Make sure you have a stable system. If it is not, decrease all gains until you have one.
  3. Increase vel_gain by around 30% per iteration until the motor exhibits some vibration.
  4. Back down vel_gain to 50% of the vibrating value.
  5. Increase pos_gain by around 30% per iteration until you see some overshoot.
  6. Back down pos_gain until you do not have overshoot anymore.
  7. The integrator can be set to 0.5 * bandwidth * vel_gain, where bandwidth is the overall resulting tracking bandwidth of your system."

Now, here are the questions:

  1. Do I try this tuning when the robot is raised and the wheels are off the ground? I hope this is the case, otherwise, it is scary to tune the controller while the robot is sitting on the ground.

  2. Does the above procedure apply to tuning the velocity controller? I am not using the position controller.

Any help is appreciated.

Thanks,
F.F.

Yeah, differential drive robot works best with velocity mode. Then the torque will do whatever it needs to and the kinematics work out properly (assuming no slip)

No, you’ll need to tune the motors with the machine on the ground. You can tune them very stiff with the wheels off the ground to get closer, but final tuning has to be done with the machine weight.

Yes. Disregard the position controller, set vel_integrator_gain = 0, then turn the vel_gain up until the robot vibrates uncomfortably. Then reduce the gain by ~1/3 to 1/2, and then increase vel_integrator_gain as desired to hit zero steady state error.