56V V3.6 O drive disconnect

I have been following instructions on the hoverbot guide pretty much verbatim.

When it came time to test the the motor and input these lines
odrv0.save_configuration()
odrv0.reboot()
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.input_vel = 2

Your motor should spin here

odrv0.axis0.controller.input_vel = 0
odrv0.axis0.requested_state = AXIS_STATE_IDLE

once I do input odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
The odrive disconnects and reconnects rapidly and stops responding. It isnt the USB cable I have two.
Im using Python Anaconda

Hi @Samuel_Kearns, does the green light on the board remain lit or does it go out? Also, what happens during calibration? Does it proceed ok?

The green Light remains lit. The calibration went smoohtly I got the motors to turn back and forth with this:
odrv0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION
for both motors
Suddenly the odrive spazzes out once inputting:
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
My overall project was trying to make self balancing device with two hoverboard motors

hmmm… it sounds like noise being coupled from the motors to the communications in some way. I’ve seen this as a motor case grounding problem, messy wiring, simply long wires, etc. Can you take some pictures of your setups? And if you have an oscilloscope, you could try measuring the USB lines or the ground to see if you’re picking up noise.

Make sure your motor wiring is neat and tidy, and you can consider adding a common mode choke to the motor wires: https://odriverobotics.com/shop/n97xgxel6y0ufvunsxq70kih4p19nx


I tried to restart the configuration process to troubleshoot. I directly plugged in one motor into M0.
Whenever I do odrv0.axis0.requested_state command is when the odrive disconnects.
Thanks

Good grief, that wiring is like Spaghetti Junction. :stuck_out_tongue:
Twisting your motor wires, and tidying your encoder wires, should help a lot, as well as using a ferrite choke as Wetmelon suggests. :slight_smile:

thanks for the advice I cleaned it up and it works :slight_smile:

1 Like