Facing a bunch of problems all together

Hello, I’m fairly new to the Odrive products, I was using the Odrive for hoverboard motors, I have wired everything correctly and was able to get it to work. The problem is that only one motor (M0) was spinning and the other (M1) did not, if I restart, they both spin for a little but eventually one of them stops. I have modified the setpoint ranges on the PWM controller and both motors spin, unless I move one of them, the other stops.

odrv0.config.gpio3_pwm_mapping.min = -200
odrv0.config.gpio3_pwm_mapping.max = 200
odrv0.config.gpio3_pwm_mapping.endpoint = odrv0.axis0.controller._remote_attributes['vel_setpoint']

odrv0.config.gpio4_pwm_mapping.min = -200
odrv0.config.gpio4_pwm_mapping.max = 200
odrv0.config.gpio4_pwm_mapping.endpoint = odrv0.axis1.controller._remote_attributes['vel_setpoint']

odrv0.save_configuration()
odrv0.reboot()

I have changed this into 0 instead of -200 and 100 instead of 200. That’s how I got both of them to spin on bootup.
I’m using only one 36v Battery (I have another one now) and I have read the post on the capacitors but I don’t seem to need them. I also do not know what exactly Auxiliary does, but I would like to.
Thank you for trying to help me, I appreciate it. Here is a picture of the (Messy) Setup.

odrv0.axis0.motor.config.pole_pairs = 15
odrv0.axis0.motor.config.resistance_calib_max_voltage = 5
odrv0.axis0.motor.config.calibration_current = 5
odrv0.axis0.motor.config.requested_current_range = 25 #Requires config save and reboot
odrv0.axis0.motor.config.current_control_bandwidth = 100
odrv0.axis0.motor.config.current_lim = 25
odrv0.axis0.encoder.config.mode = ENCODER_MODE_HALL
odrv0.axis0.encoder.config.cpr = 90
odrv0.axis0.encoder.config.bandwidth = 100
odrv0.axis0.encoder.config.ignore_illegal_hall_state = True
odrv0.axis0.controller.config.pos_gain = 1
odrv0.axis0.controller.config.vel_gain = 0.02
odrv0.axis0.controller.config.vel_integrator_gain = 0.1
odrv0.axis0.controller.config.vel_limit = 1000
odrv0.axis0.controller.config.control_mode = CTRL_MODE_VELOCITY_CONTROL
odrv0.save_configuration()
odrv0.reboot()

odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION
odrv0.axis0.motor.config.pre_calibrated = True
odrv0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION
odrv0.axis0.encoder.config.pre_calibrated = True
odrv0.save_configuration()
odrv0.reboot()

odrv0.axis1.motor.config.pole_pairs = 15
odrv0.axis1.motor.config.resistance_calib_max_voltage = 5
odrv0.axis1.motor.config.calibration_current = 5
odrv0.axis1.motor.config.requested_current_range = 25 #Requires config save and reboot
odrv0.axis1.motor.config.current_control_bandwidth = 100
odrv0.axis1.motor.config.current_lim = 25
odrv0.axis1.encoder.config.mode = ENCODER_MODE_HALL
odrv0.axis1.encoder.config.cpr = 90
odrv0.axis1.encoder.config.bandwidth = 100
odrv0.axis1.encoder.config.ignore_illegal_hall_state = True
odrv0.axis1.controller.config.pos_gain = 1
odrv0.axis1.controller.config.vel_gain = 0.02
odrv0.axis1.controller.config.vel_integrator_gain = 0.1
odrv0.axis1.controller.config.vel_limit = 1000
odrv0.axis1.controller.config.control_mode = CTRL_MODE_VELOCITY_CONTROL
odrv0.save_configuration()
odrv0.reboot()

odrv0.axis1.requested_state = AXIS_STATE_MOTOR_CALIBRATION
odrv0.axis1.motor.config.pre_calibrated = True
odrv0.axis1.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION
odrv0.axis1.encoder.config.pre_calibrated = True
odrv0.save_configuration()
odrv0.reboot()

odrv0.config.gpio3_pwm_mapping.min = -300
odrv0.config.gpio3_pwm_mapping.max = 300
odrv0.config.gpio3_pwm_mapping.endpoint = odrv0.axis0.controller._remote_attributes[‘vel_setpoint’]

odrv0.config.gpio4_pwm_mapping.min = -300
odrv0.config.gpio4_pwm_mapping.max = 300
odrv0.config.gpio4_pwm_mapping.endpoint = odrv0.axis1.controller._remote_attributes[‘vel_setpoint’]

odrv0.save_configuration()
odrv0.reboot()

odrv0.axis0.config.startup_closed_loop_control = True
odrv0.axis1.config.startup_closed_loop_control = True
odrv0.save_configuration()
odrv0.reboot()

1 Like

Also I had had issue with one of motor socket - contact was not good and at high current Odrive stops with error - bad motor resitance. So I just cut motor connectors and use bare wires.

1 Like

@Ahmad_Allouch Please check the error codes: https://docs.odriverobotics.com/troubleshooting

1 Like

I’ll check it out soon, thank you so much

Will do, sir! Thanks

Hello, I ran these and now they would not spin at all, what could this mean?
Note: I am using only one 36v battery, I do not know if it makes a difference to make it more.

Hi, Ahmad.
Script should be execute in this way - execute first part from begin to odrv0.reboot().

odrv0.axis0.motor.config.pole_pairs = 15
odrv0.axis0.motor.config.resistance_calib_max_voltage = 5
odrv0.axis0.motor.config.calibration_current = 5
odrv0.axis0.motor.config.requested_current_range = 25 #Requires config save and reboot
odrv0.axis0.motor.config.current_control_bandwidth = 100
odrv0.axis0.motor.config.current_lim = 25
odrv0.axis0.encoder.config.mode = ENCODER_MODE_HALL
odrv0.axis0.encoder.config.cpr = 90
odrv0.axis0.encoder.config.bandwidth = 100
odrv0.axis0.encoder.config.ignore_illegal_hall_state = True
odrv0.axis0.controller.config.pos_gain = 1
odrv0.axis0.controller.config.vel_gain = 0.02
odrv0.axis0.controller.config.vel_integrator_gain = 0.1
odrv0.axis0.controller.config.vel_limit = 1000
odrv0.axis0.controller.config.control_mode = CTRL_MODE_VELOCITY_CONTROL
odrv0.save_configuration()
odrv0.reboot()

Than wait til connect to odrive restored and execute next part till next odrv0.reboot().

odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION

Wait till odrve beeeep.

odrv0.axis0.motor.config.pre_calibrated = True

Check wheels not blocked and no load applied. Than :

odrv0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION

Wheel should slowly rotate forward and backward.

odrv0.axis0.encoder.config.pre_calibrated = True
odrv0.save_configuration()
odrv0.reboot()

Repeat 4 times in same way.

If wheel not calibrated or not rotate in calibration phase please post output of dump_error(odrv0)