[SOLVED] axis and motor error after ENCODER_INDEX_SEARCH

HI,

I just ended up the “getting tarted” guide.
But when I follow the procedure to bypass encoder calibration " Encoder with index signal" I have some error .
From my tests axis error seems to come from the <axis>.requested_state = AXIS_STATE_ENCODER_INDEX_SEARCH

as you can see here :

In [1]: odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE                            

In [2]: odrv0.axis0.error                                                                             
Out[2]: 0

In [3]: odrv0.axis0.encoder.config.offset                                                             
Out[3]: 8516

In [4]: odrv0.axis0.encoder.config.use_index=True                                                     

In [5]: odrv0.axis0.requested_state = AXIS_STATE_ENCODER_INDEX_SEARCH                                 

In [6]: odrv0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION                           

In [7]: odrv0.axis0.error                                                                             
Out[7]: 352

In [8]: odrv0.axis0.encoder.config.offset                                                             
Out[8]: 8516

I notice , that compare to the full calibration sequence, the encoder index search is go very very fast .
I tried to reduce the calibration_current but it doen’t helped.

I also notice EACH time I ran the encoder search index command the Odrive disangage the motor, and no command respond . I have to reboot .
Btw it’s the same if I force by hand the motor shaft in close_loop control or other situations.

Any advice ?

Same with more info.

Connected to ODrive 2064396C4D4D as odrv0
In [1]: odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE                                                 

In [2]: odrv0.axis0.error                                                                                                  
Out[2]: 0

In [3]: dump_errors(odrv0)                                                                                                 
axis0
  axis: no error
  motor: no error
  encoder: no error
  controller: no error
axis1
  axis: no error
  motor: no error
  encoder: no error
  controller: no error

In [4]: odrv0.axis0.encoder.config.use_index=True                                                                           

In [5]: odrv0.axis0.requested_state = AXIS_STATE_ENCODER_INDEX_SEARCH                                                       

In [6]: odrv0.axis0.error                                                                                                   
Out[6]: 96

In [7]: dump_errors(odrv0)                                                                                                  
axis0
  axis: Error(s):
    ERROR_MOTOR_DISARMED
    ERROR_MOTOR_FAILED
  motor: Error(s):
    ERROR_CURRENT_UNSTABLE
  encoder: no error
  controller: no error
axis1
  axis: no error
  motor: no error
  encoder: no error
  controller: no error

Does odrv0.axis0.requested_state = AXIS_STATE_ENCODER_INDEX_SEARCH need odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL before it ? or any other command ?

Finally solve my probleme after reading again and again the “getting started” page.
My motor is not a GIMBAL one but try it solve the issue shown by:

In [2]: odrv0.axis0.error                                                                             
Out[2]: 0

or

In [7]: dump_errors(odrv0)                                                                                                  
axis0
  axis: Error(s):
    ERROR_MOTOR_DISARMED
    ERROR_MOTOR_FAILED
  motor: Error(s):
    ERROR_CURRENT_UNSTABLE
  encoder: no error
  controller: no error

As you can see:

Connected to ODrive 2064396C4D4D as odrv0
In [1]: odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE      

In [2]: odrv0.axis0.motor.config.motor_type=MOTOR_TYPE_GIMBAL                   

In [3]: dump_errors(odrv0)                                                                                                      
axis0
  axis: no error
  motor: no error
  encoder: no error
  controller: no error
axis1
  axis: no error
  motor: no error
  encoder: no error
  controller: no error

In [4]: odrv0.axis0.encoder.config.use_index=True                                                                               

In [5]: odrv0.axis0.requested_state = AXIS_STATE_ENCODER_INDEX_SEARCH                                                           

In [6]: dump_errors(odrv0)                                                                                                      
axis0
  axis: no error
  motor: no error
  encoder: no error
  controller: no error
axis1
  axis: no error
  motor: no error
  encoder: no error
  controller: no error
1 Like

out of curiosity, what do motor.config.phase_resistance and motor.config.phase_inductance read?

In [7]: odrv0.axis0.motor.config.phase_resistance                                                                   
Out[7]: 0.40172049403190613

In [8]: odrv0.axis0.motor.config.phase_inductance                                                                   
Out[8]: 0.00036134623223915696

Btw , I’m very noob about code, I can’t find where I saw somewhere a python command to make the motor going to a point then back to it’s original position then to the point… infinitly in only one command. It was looking from far to something like odrv0.axis0.controller.pos=(xxx,y)
If you see what I mean it could be very helpful for my real tests and tuning :slight_smile: