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
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
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.
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.
Twisting your motor wires, and tidying your encoder wires, should help a lot, as well as using a ferrite choke as Wetmelon suggests.