Low frequency noise with hall encoders, ODrive 3.6

Hello! We have an ODrive 3.6 setup with hall sensors (5 pole pairs on the motor) and chain transmission between the drive and the wheel (it is a ground vehicle). In velocity mode we observe the following unpleasant effect: with target velocity 0 sometimes giving the wheel a small disturbance (pushing it quickly) results in the drive train entering an oscillating behaviour, clearly audible because of the metal chain (wheels don’t move).

Inspecting the graphs shows a clear picture:


(here red line is encoder.vel_estimate, blue line is motor.current_control.Iq_setpoint)

So basically the push results in an encoder step, which results in a sizeable velocity estimate (because hall sensors are very crude), which controller tries to counter, resulting in an encoder step in the other direction, and the process repeats. Should there be inertia of the system it would dampen this, but it moves within metal chain backlash limits almost without resistance.

So the big question is what can we do about it? I tried decreasing the encoder.config.bandwidth and it decreases the vel_estimate amplitude, but doesn’t remove the effect. Reducing encoder.config.bandwidth too much leads to adverse effects, there is probably a limit for a given encoder resolution.

Here are some of our config values for the reference:

pole_pairs = 5
kv = 30

ax.motor.config.pole_pairs = pole_pairs
ax.motor.config.current_lim = 25 
ax.motor.config.current_lim_margin = 15
ax.motor.config.torque_constant = 8.27 / kv
ax.motor.config.current_control_bandwidth = 100
ax.encoder.config.mode = ENCODER_MODE_HALL
ax.encoder.config.cpr = pole_pairs * 6
ax.encoder.config.bandwidth = 100
ax.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
ax.controller.config.vel_limit = 15

I also found the following flag introduced in 0.4.8:

  • encoder.config.enable_phase_interpolation option. Setting to false may reduce jerky pulsations at low speed when using hall sensor feedback.

It seemed like the problem described there is very similar to mine. Unfortunately experiments showed that setting the flag to false made my problem worse.