Startup with Weight

Problem
There is some stuff on using the odrive with friction load, but I haven’t seen anything about gravity load. How do I turn the odrive on and have it immediately resist torque from gravity?

Context

  • odrive board V 3.6
  • 8192 CPR Encoder with ODrive Cable
  • ODrive Robotics D6374 - 150kv
  • brake wrapped around spindle
  • spindle attached to motor
  • cable wrapped around spindle
    motor, brake, encoder, power source are fixed to a rack 5 ft off the ground
    weight is attached to the end of the cable hanging down

Desired Goal

  1. weight is on ground
  2. system turns on
  3. brake disengages
  4. odrive is precalibrated
  5. request state AXIS_STATE_ENCODER_INDEX_SEARCH
  6. request state AXIS_STATE_MOTOR_CALIBRATION (for some reason)
  7. request state AXIS_STATE_CLOSED_LOOP_CONTROL
  8. motor can pick up weight and move it up and down
  9. power shuts off
  10. brake engages and holds weight :white_check_mark:
    The problem comes in the following steps
  11. power comes on
  12. brake releases
  13. weight falls to ground immediately :frowning_face:

Work Done Before Procedure Above

  1. went through a bunch of calibration for the motor and encoder and saved everything to the odrive

  2. went through the tuning with load process so it can accurately move the weight around
    odrv0.axis0.controller.config.vel_gain => 0.6525
    odrv0.axis0.controller.input_pos => 6.0
    settling time of 50ms
    vel_integrator_gain = 0.5 * odrv0.axis0.controller.config.vel_gain * 20

  3. set the calibration current high enough that it can pickup the weight from the ground
    odrv0.axis0.motor.config.calibration_current = 10
    pickupweight

Please help!! I don’t see anyway out of this.

Can you release the brake AFTER you go into position-control mode? Maybe have the brake as an independent output?

Also you will need to upgrade your encoder for this. An incremental encoder is not suitable for this application because it requires the calibration / index search step, where the motor needs to be able to move, but cannot produce hardly any torque, because the commutation is not initialised.

Use an absolute encoder such as AS5047p and then you don’t have to do any calibration on start-up

1 Like

@towen thanks for the feedback.

I ran the following tests using a chair to temporarily simulate the brake staying on after the system powers up so we have a couple seconds to do motor calibration and closed loop mode.

Test Case 1

  1. weight held up by motor off ground
  2. power off
  3. weight on chair. cable slack
  4. power on
  5. odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION
  6. odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
  7. remove chair
  8. weight falls

Test Case 2

  1. weight held up by motor off ground
  2. power off
  3. weight on chair. cable slack
  4. power on
  5. odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION
  6. odrv0.axis0.requested_state = AXIS_STATE_ENCODER_INDEX_SEARCH
  7. odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
  8. remove chair
  9. held weight

If I understand what benefit the absolute encoder would give, is that the first test case will work like the second one did since we won’t have to do the encoder index search step.

Yes indeed.
Also note that you don’t need to do the motor calibration on every boot-up either. absolute encoder or not. You just need to do index search (with inc. encoder) or (with absolute encoder) go directly to closed loop.

2 Likes