Restore-config not able to bring back some parameters

I’m using odrivetool and firmware 0.5.2

While experimenting, I managed to erase pre-existing configuration accidentally. Thankfully I had done a backup pretty recently. However, when I restore, it mentions some parameters could not restore:

Restoring configuration from my_config.json...
Could not restore axis0.controller.config.anticogging.calib_anticogging: 'anonymous_interface_139794408369920' object has no attribute 'exchange'
Could not restore axis0.controller.config.anticogging.cogging_ratio: 'anonymous_interface_139794408364816' object has no attribute 'exchange'
Could not restore axis0.controller.config.anticogging.index: 'anonymous_interface_139794408372448' object has no attribute 'exchange'
Could not restore axis1.controller.config.anticogging.calib_anticogging: 'anonymous_interface_139794408369920' object has no attribute 'exchange'
Could not restore axis1.controller.config.anticogging.cogging_ratio: 'anonymous_interface_139794408364816' object has no attribute 'exchange'
Could not restore axis1.controller.config.anticogging.index: 'anonymous_interface_139794408372448' object has no attribute 'exchange'
Could not restore config.gpio3_pwm_mapping.endpoint: Expected value of type RemoteObject or None but got 'str'. An example for a RemoteObject is this expression: odrv0.axis0.controller._input_pos_property
Could not restore config.gpio4_pwm_mapping.endpoint: Expected value of type RemoteObject or None but got 'str'. An example for a RemoteObject is this expression: odrv0.axis0.controller._input_pos_property
Some of the configuration could not be restored.
Configuration restored.

Checking my current controller.config:

odrv0.axis0.controller.config
Out[3]: 
anticogging:
  anticogging_enabled: True (bool)
  calib_anticogging: False (bool)
  calib_pos_threshold: 1.0 (float)
  calib_vel_threshold: 1.0 (float)
  cogging_ratio: 1.0 (float)
  index: 0 (uint32)
  pre_calibrated: False (bool)

I do not know what my previous anticogging was set to, should have been defaults.

And my current gpio’s:

gpio3_pwm_mapping:
  endpoint: None (object_ref)
  max: 4.0 (float)
  min: -4.0 (float)
gpio4_analog_mapping:
  endpoint: None (object_ref)
  max: 0.0 (float)
  min: 0.0 (float)
gpio4_mode: 10 (uint8)
gpio4_pwm_mapping:
  endpoint: None (object_ref)
  max: 4.0 (float)
  min: -4.0 (float)

The endpoints in my backup were mapped to odrv0.axis0.controller._input_vel_property
and
odrv0.axis1.controller._input_vel_property

It seems something else is messed up with my config now, because I get these errors:

dump_errors(odrv0)
system: no error
axis0
  axis: no error
  motor: Error(s):
    MOTOR_ERROR_UNKNOWN_PHASE_ESTIMATE
  sensorless_estimator: no error
  encoder: no error
  controller: no error
axis1
  axis: no error
  motor: Error(s):
    MOTOR_ERROR_UNKNOWN_PHASE_ESTIMATE
  sensorless_estimator: no error
  encoder: no error
  controller: no error

Are these caused just by wrong anticogging settings or something else?

Well, after another day of googling, It appears backup/restore may be broken on 0.5.2 due to incorrect version reporting.

Found this on Gitmemory:
https://gitmemory.com/issue/odriverobotics/ODrive/575/853819167

I will be starting over on configuration. Maybe this time I’ll magically fix the spinout error I’m getting!

2 Likes

Were you able to resolve this issue? I am experiencing something similar. I went step by step through the “getting started” tutorial and I got both motors to spin. After a few days, I tried to set the velocity for the motors and I get the “MOTOR_ERROR_UNKNOWN_PHASE_ESTIMATE” error when I call “odrv0.axis1.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL”.

Did you also try to restore the config? After restoring the config I get the same error.

E:
If I use

odrv0.axis0.motor.config.pre_calibrated=False

and start a calibration sequence, I can go into closed loop and everything works fine. Once I turn the parameter on again, save it and restart the odrive, I get the phase estimate error again.

E2:
I’m not sure if I made a mistake or it fail to restore but the encoder was not calibrated anymore. I did the following

odrv0.axis0.encoder.config.pre_calibrated=False
odriv0.axis0.motor.config.pre_calibrated=False
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis0.encoder.config.pre_calibrated=True
odriv0.axis0.motor.config.pre_calibrated=True

Now it works again from startup

2 Likes

Thank you so much! This fix worked for me.

2 Likes