Motor Error, Gimbal Motor, Modulation Magnitude

OS: Windows 10
Python 3.7


  • Odrive board version 3.5, Firmware 0.4.1
  • Motor: iPower Gimbal BL Motor GBM5208H-200T
    • Configuration: 12N14P
    • Resistance: 15.5 Ohm
    • 200 Turns pre-wound, hollow shaft
    • Max Voltage 22.2V
    • Max Current: 10A
  • Encoder: Signswise 600p/r Incremental Rotary Encoder
  • Stock Brake Resistor (0.47Ohm)
  • Power Supply: 4-cell Li-Ion

Physical Configuration:

  • Axis 0: in use.
  • Axis 1: unused.
  • Brake Resistor: In use

Board Configuration:
odrv0.axis0.controller.config.vel_limit = 3000
odrv0.axis0.motor.config.calibration_current= 10
odrv0.config.brake_resistance = 0.47
odrv0.axis0.motor.config.pole_pairs = 14 (We have tried 7 as well)
odrv0.axis0.motor.config.motor_type = 2 = MOTOR_TYPE_GIMBAL
odrv0.axis0.encoder.config.cpr = 600
odrv0.axis0.motor.config.resistance_calib_max_voltage = 14.8 (This resets to 1 after board reboot)

Upon executing odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE motor moves slightly and stops. Subsequent attempts fail to move the motor.

hex(odrv0.axis0.error) = ‘0x41’ (ERROR_MOTOR_FAILED, ERROR_INVALID_STATE)

What did we do wrong, or what additional options must we set to get a proper full calibration?

Thanks in advance. Any help is much appreciated.

EDIT: When launching odrivetool, it takes about 30 seconds to connect tothe odrive board. Is this normal? This is the readout after that ~30 seconds:
ODrive control utility v0.4.1
Please connect your ODrive.
You can also type help() or quit().

Connected to ODrive 207537AC3548 as odrv0
In [1]:

Please set
odrv0.axis0.encoder.config.cpr = 2400 (4x your encoder ppr)

Count the # of magnets in the motor and divide by two. That should be your Pole Pair value (odrv0.axis0.motor.config.pole_pairs). If you count 28 magnets, use 14. If you count 14 magnets, use 7.

Thanks for providing a detailed readout of your setup and configuration, it’s very helpful.

A high resistance motor (which gimbal motors are) together with ERROR_MODULATION_MAGNITUDE usually means that the resistance measurement failed because the motor was too high resistance to push calibration_current = 10A through it. However when motor type is MOTOR_TYPE_GIMBAL, this measurement should be skipped, because we know it will likely fail, and in gimbal motor mode we don’t use the motor resistance/inductance. See here.
So my primary suggestion would be to double check that you have written odrv0.axis0.motor.config.motor_type = 2 = MOTOR_TYPE_GIMBAL before you call odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE.

Let me know if this helps. Cheers.

1 Like

Hi, sorry we didn’t get back to you right away.

I am certain we set odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_GIMBAL. We attempted to set odrv0.axis0.encoder.config.cpr = 2400 but we had a motor error before we set it. We couldn’t seem to clear the axis error (it always sets to 1 even we say 0) and when this happens I usually just quit odrivetool, unplug the board, reconnect it, and try again. Wanting to start fresh, I did an odrv0.erase_configuration() before unplugging the board and now I can no longer connect to the board. The computer doesn’t even see it (doesn’t make the normal sound when a USB device is plugged in). I can’t select it in the zadig utility and so right now we’re a bit stuck. I’m hesitant to say the board is bricked, but it sure seems that way.

I can’t see the magnets in the motor, but if I spin it manually, it likes to rest in certain positions due to the magnets. I count 14 different rest positions per revolution. I would suspect that that’s 14 magnets and thus 7 pairs. Correct me if I’m wrong.


You may have to reflash it with the most up to date firmware via STLinkV2, unfortunately.

Yeah, the “cogging” positions. 14 magnet / 7 pole pairs is common. I would use 7 for that value and see what you get.

I’m not familiar with STLink at all. Any resources or a walk through that you could point me to that would help?

You’ll need the ODrive Firmware Developers Guide:

With ODrive v3.5 and newer you don’t need an ST-Link to flash it, you can do it over USB in DFU Mode (@wetmelon FYI). With a bricked ODrive you will need to do the step that says “How to force DFU mode (ODrive v3.5)”.

If you get issues or get stuck, you can find me on the #support channel on the ODrive discord.