My motors work on all calibrations(no errors) but don't work with any other command

So I am trying to build a 6 DOF robot and I started with 1 odrive -2 motors. All good and well in the calibration stages, both motor and encoder with no errors, BUT neither position or velocity control seems to do anything. The motor used is high quality 200w 24v bldc motor with brake with encoder China Manufacturer

The commands I inserted are:

odrv0.axis0.motor.config.current_lim=20
odrv0.axis0.controller.config.vel_limit=15
odrv0.axis0.motor.config.pole_pairs=5
odrv0.axis0.motor.config.torque_constant=0.17
odrv0.config.brake_resistance=0.5
odrv0.axis0.motor.config.motor_type=MOTOR_TYPE_HIGH_CURRENT
odrv0.axis0.encoder.config.cpr=10000
odrv0.axis0.encoder.config.mode=ENCODER_MODE_INCREMENTAL

“I did all the calibrations here and saved them”

odrv0.axis0.controller.config.control_mode=CONTROL_MODE_POSITION_CONTROL
odrv0.axis0.requested_state=AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.input_pos=1
odrv0.axis0.controller.config.control_mode=CONTROL_MODE_VELOCITY_CONTROL
odrv0.axis0.controller.input_vel=1.5

The last commands don’t do anything. Can you tell me what I am missing? Also If I have made an error in the “starting up” configurations, please correct me.

Hi Natalia,

Can you check the output of the dump_errors command? you say no errors, so i guess you’ve done this already
i.e. dump_errors(odrv0, True) to display errors and clear them.

Was the calibration successful? (did the motor move forwards and then backwards, or did it move forwards and stop?)

Check that the encoder is working: this would cause an error so I guess you’ve solved this
Check odrv0.axis0.encoder.pos_estimate and turn the shaft a little by hand, it should change.
If it isn’t working, it may be that this encoder needs pullup resistors for example.
Actually it has a differential output, you need to convert it to single-ended signalling - either by grounding the negative outputs, or if that doesn’t work, use a RS-422 receiver e.g. MAX14891E.

The motor doesn’t have a brake on it, does it? :stuck_out_tongue: also would cause an error in calibration

Also make sure you have set
odrv0.axis0.controller.config.input_mode = INPUT_MODE_PASSTHROUGH
(it should be default, but worth checking)

ALSO, since this encoder is incremental without an index pulse, it means you will have to do the encoder calibration on each start up. Saving the config resets the controller, which in your case is not helpful. :frowning:

Try your commands as above but without saving the config. At a minimum you need to run
odrv0.axis0.requested_state=AXIS_STATE_ENCODER_OFFSET_CALIBRATION before you go to closed loop.

This is because an incremental encoder only sends the change in position, not the absolute position.
You could fit an absolute encoder e.g. MA732 in place of the existing encoder.

Hello Towen,

Sorry for the late reply, I have access to the motors only on Wednesday and Thursday.

So IT WORKED!!!

It seemed that the command odrv0.axis0.controller.config.input_mode = INPUT_MODE_PASSTHROUGH was the one missing.

I already have an rs-422 receiver in place. Now that it worked I noticed that sometimes it gets stuck (i.e moves in the first command and then not on the second one). Don’t know why is this happening. More testing is in need.

For the time being thank you a lot for your help, couldn’t find anything else on the net to solve my question. :smiley:

2 Likes