[solved] INDEX_SEARCH not 100% success?

my motor can run well AXIS_STATE_ENCODER_OFFSET_CALIBRATION, after powerup.

but if i call AXIS_STATE_ENCODER_INDEX_SEARCH, it said index found immediately, no motor move.

Oh no odrv0 disappeared

Reconnected to ODrive 345A36503037 as odrv0
In [96]: odrv0.axis0.requested_state = AXIS_STATE_ENCODER_INDEX_SEARCH

In [97]: odrv0.axis0.encoder.index_found
Out[97]: True

then, if I switch to CLOSED_LOOP control, motor will run suddenly, then falut like this:

In [99]: dump_errors(odrv0, True)
system: no error
axis0
axis: no error
motor: Error(s):
MOTOR_ERROR_UNKNOWN_TORQUE
MOTOR_ERROR_UNKNOWN_VOLTAGE_COMMAND
sensorless_estimator: no error
encoder: no error
controller: Error(s):
CONTROLLER_ERROR_SPINOUT_DETECTED

???

my cali config:

In [108]: odrv0.axis0.config.calibration_lockin
Out[108]:
accel: 20.0 (float)
current: 10.0 (float)
ramp_distance: 3.1415927410125732 (float)
ramp_time: 0.4000000059604645 (float)
vel: 40.0 (float)

i can view the INDEX active high pulse signal on scope when i rotate motor by hand.

what’s wrong?

Try adding a pull-down resistor to the index pin

1 Like

i add a pull-down 1K resistor to index pin, but no help…

then i use a 22nF cap to the index pin, it almostly work, at least, when i run AXIS_STATE_ENCODER_INDEX_SEARCH, motor run, and stop to a same place, should be real index found.

then do some recai, and unset/set encoder.config.pre_calibrated,

IT WORKED!!

in osc, i can view a very little niose on index signal when motor start, top voltage less than 0.5v i think.
Maybe need better shield cable for my encoder, or add a small series-resistor and/or a small cap(10n/22nF).

Thank thee!!

Are you using the ferrite rings? They help a LOT with noise.

will try it

thanks very much!