Location of shunt resistors on odrive 3.6

Hello everyone,

I need to control low current motors and I can tell that the current reading is all over the place. So I want to replace the current shunts for my motor. The rated current is 2.5A so I calculated the resistance of the new shunts I installed according to this post on the forums from madcowswe.

I picked 5A for I_RANGE to ensure there is some headroom.

R = 1.6 * 0.9 / (Gain * I_Range)
    = 1.6 * 0.9 / (10 * 5)
    = 0.0288Ω

The link of the series of resistors that are recoomended no longer works so I picked one myself:
https://nl.mouser.com/ProductDetail/652-CRA2512FZR030ELF/

But the problem I’m having is that I don’t know where the shunt resistors are located on the 3.6 version of the board.

And also it’s not clear to me what exactly I need to change in the firmware. Is changing the SHUNT_RESISTANCE define enough?

They’re in the same spot as the 3.5 version, so those drawings work.

Thank you @Wetmelon. I’m running the latest devel branch of the code.

I have replaced the current shunts. But now I can no longer get calibration to work. I got the error ODRIVE_ERROR_DC_BUS_OVER_REGEN_CURRENT when running the full calibration sequence.

I set odrv0.config.dc_max_negative_current = -0.1 to ensure no floating point rounding errors and this issues disappeared. However then I get two errors.

  • MOTOR_ERROR_CURRENT_SENSE_SATURATION
  • MOTOR_ERROR_UNKNOWN_CURRENT_MEASUREMENT

Now I’m thinking I made a mistake somewhere. Do I need to change anything in the Firmware besides the SHUNT_RESISTANCE define?

I have tried both axis. And motor.I_bus always reports 0 in the liveplotter.

Not sure tbh, I think a solid chunk of this changed with @Samuel 's refactor. Maybe he knows?

Only changing SHUNT_RESISTANCE should be sufficient.

MOTOR_ERROR_CURRENT_SENSE_SATURATION means that the ADC received an input voltage outside of [0.3V, 3.0V]. The other error is a result of this error.

Maybe you need to adapt motor.config.requested_current_range so that the opamp is configured to an appropriate gain. You can inspect motor.max_allowed_current and motor.phase_current_rev_gain to find out what opamp gain was selected.
Otherwise you can find out more if you put an oscilloscope probe on the current sense line (between the opamp and the MCU).