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):
ODRIVE_ERROR_DC_BUS_OVER_REGEN_CURRENT
axis0
motor: Error(s):
MOTOR_ERROR_SYSTEM_LEVEL
MOTOR_ERROR_UNKNOWN_TORQUE
MOTOR_ERROR_UNKNOWN_VOLTAGE_COMMAND
sensorless_estimator: no error
encoder: no error
controller: Error(s):
CONTROLLER_ERROR_OVERSPEED
axis1
axis: no error
motor: Error(s):
MOTOR_ERROR_SYSTEM_LEVEL
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.
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.
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.erase_configuration()
odrv0.reboot()
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.
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 ?