Pos_setpoint not working AGAIN :/

Hi All,

Odrive D6374 motor + AS5047p (AB, no I).

I went throught the following steps:
odrv0.axis0.motor.config.current_lim = 20
odrv0.axis0.motor.config.pole_pairs = 7
odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
odrv0.axis0.motor.config.current_lim_tolerance = 5
odrv0.config.brake_resistance = 2
odrv0.axis0.controller.config.control_mode = CTRL_MODE_POSITION_CONTROL
odrv0.axis0.encoder.config.cpr = 4000
odrv0.axis0.encoder.config.use_index = False
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.encoder.config.pre_calibrated = True
odrv0.axis0.motor.config.pre_calibrated = True
odrv0.axis0.config.startup_encoder_index_search = False
odrv0.axis0.config.startup_closed_loop_control = True
odrv0.axis0.config.startup_sensorless_control = False

during FULL_CALIBRATION_SEQUENCE motor turns one direction, stops, then turns the opposite direction.
during CLOSED_LOOP_CONTROL motor holds its shaft.
no dump errors.
However,
when I try odrv0.axis0.controller.pos_setpoint = 100000 nothing happens.

Any idea what is wrong?

Thx.

If you’re running a newer firmware now, then pos_setpoint is readonly. Use input_pos if you have it.

Ok. I’ll try. Thank you :+1:

I just tried.

ODrive tool v0.4.12

odrv0.axis0.controller.input_pos = 10000

“not found”

for all new guys:

when you try to rotate your motor IT HAS TO BE IN CLOSED LOOP
im new in ODrive and I didnt know that.

so, after AXIS_STATE_FULL_CALIBRATION_SEQUENCE
switch to AXIS_STATE_CLOSED_LOOP_CONTROL
and now try
odrv0.axis0.controller.pos_setpoint = 100000

big thanks to WETMELON

2 Likes

Is That supposed to be pos_setpoint ?

No, the new version of the software no longer allows you to write to pos_setpoint (it’s read-only). All commands have to go through input_pos, input_vel, or input_torque (except a couple of functions, but they ultimately write to those also)

1 Like