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.
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.
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).