i have a project with odrive moving a robot arm . Everything looks great . However i have a problem .
After i attach some load to the robotic arm ( like 100 grams or so ) calibration sequence runs ok . and after that moving the arm to a position works for 1 second or 2 seconds and exists AXIS_STATE_CLOSED_LOOP_CONTROL

Any idea what might be wrong ?
In [65]: odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
In [66]: odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
In [67]: odrv0.axis0.controller.input_pos = -40000
In [68]: dump_errors(odrv0)

system: Error(s):
motor: Error(s):
sensorless_estimator: no error
encoder: no error
controller: Error(s):
axis: no error
motor: Error(s):
sensorless_estimator: no error
encoder: no error
controller: no error

If you are using incremental encoders, you need to run the calibration WITHOUT load attached. If the calibration has a load, it will not calibrate properly.
If this is a problem for you, then you need to set up index search or use absolute encoders.

I don’t think it’s doable to reconnect the robot arm after each calibration.

i made a video with the behaviour:

The overspeed error may be just that - have you checked that the controller.config.vel_limit is set high enough for the movement you are trying?
Also, are you using any ferrite rings for the motor? If not, then noise from the motor cable can cause spurious encoder counts that could trigger the overspeed error, and it can also cause spurious regen current errors.

What are your brake resistor settings?
You could set it up to allow a small amount of regen current, but set the overvoltage ramp mode on the brake resistor to clamp just above your power supply voltage - this should be more robust to spurious errors caused by noise.

1 Like

First, towen’s recommendations are all good.

Then you’ll have to use the Index pin or an absolute encoder instead.

I think you’ll be fine once you get your settings correct. My arm looks substantially heavier and I can calibrate at the shoulder.

ok .
i played with different parameters . nothing worked. So i disassembled the arm
tried with just the motor on the table , encoder and odrive. Now the problem changed

i did:
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
( it performs the calibration normally )
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.input_pos = 10
( at this point it tries to move the motor just a bit and exits the closed loop control )
and at this point i’m stuck . Don’t know how to recover from this or what’s wrong.

What do you mean, “it exits closed loop control”? Are there no errors reported?
If there are no errors, then possibly it is still in closed-loop control, but unable to produce torque due to a commutation problem.
Can you please try putting it into torque control mode, and verify that the torque feels even around one rotation of the motor. If it is able to produce torque in some positions but not others, then it is not commutating properly, probably due to EM noise affecting the encoder signals as I mentioned earlier. Please try using the ferrite rings. They really make a lot of difference.
It could also be caused by the encoder not being mounted tightly enough and slipping.

Ok . i think i started this in the wrong way . So from start to end:

My setup is:

  • ODrive v3.6 ODv36-24V
  • Dual Shaft Motor - D5065 270kv
  • 8192 CPR Encoder with Cable - CUIAMT102
  • 50WR5J resistor

I don’t have any the ferrite rings (yet) . I’m going to place an order for those tonight.

All assembled based on information provided on website. 3d printed the case for motor / encoder

i managed to find out that after resetting the configuration i needed to add:
odrv0.config.enable_brake_resistor = True
and save configuration

So at this point I’m back where i started.
I was told to try to set up index search or absolute encoders. Can you recommend a place i should look for that ?


See: Encoder with index signal.