Configuring settings for m1 from m0

Hi im looking to laod the same settings for m0 to m1, but ive been struggling to find out how to do it.

Do you have a text editor that can pretty-print JSON? e.g. PyCharm/CLion/Notepad++?
If so, it’s pretty easy to do with odrivetool backup-config one_config.json
Then edit the JSON, pretty-print it, and collapse the axis0 and axis1 sections. Then copy the axis0 contents to axis0 and save as two_config.json, and run odrivetool restore-config two_config.json

ok, I think I followed your instructions correctly. I got the below text after attempting to restore. also i was wondering, but would some settings need to be changed i.e. the gpio pins?

(base) C:\Users\Josh>odrivetool restore-config two_config.json
Waiting for ODrive…
Restoring configuration from two_config.json…
Could not restore axis0.controller.config.anticogging.calib_anticogging: ‘anonymous_interface_1941340818416’ object has no attribute ‘exchange’
Could not restore axis0.controller.config.anticogging.cogging_ratio: ‘anonymous_interface_1941340819296’ object has no attribute ‘exchange’
Could not restore axis0.controller.config.anticogging.index: ‘anonymous_interface_1941340817712’ object has no attribute ‘exchange’
Could not restore axis1.controller.config.anticogging.calib_anticogging: ‘anonymous_interface_1941340818416’ object has no attribute ‘exchange’
Could not restore axis1.controller.config.anticogging.cogging_ratio: ‘anonymous_interface_1941340819296’ object has no attribute ‘exchange’
Could not restore axis1.controller.config.anticogging.index: ‘anonymous_interface_1941340817712’ 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.

Yes it looks like the PWM mappings and anticogging table didn’t carry over properly, you’ll have to do those manually, but they will be different for each axis anyway.

ok any suggestions for those settings. Im sorry im very new to all of this. I might just end up going through the “getting started” tutorial and changing the axis0 in each command to axis1.

Im using two hoverboard motors for refrence.

I am getting this error trying to set up thge second motor. 67108864 error

What error is that when you use dump_errors(odrv0, True)?

ok so i got it figured out besides this last step. both encoders are equal to 1 but the M0 motor is still having issues.

system: no error
axis0
axis: no error
motor: no error
sensorless_estimator: no error
encoder: Error(s):
ENCODER_ERROR_ILLEGAL_HALL_STATE
controller: no error
axis1
axis: no error
motor: no error
sensorless_estimator: no error
encoder: no error
controller: no error

Is this happening during calibration? Try setting encoder.config.hall_polarity_calibrated = True

I got things working! I’m not sure exactly what was happening, but I was able to configure both motors individually and I swapped out some wires that might have been causing the issue. Next up in controlling it with an arduino!

1 Like