M1 request_state causes odrivetool to freeze and disconnect

I’m using a v3.6 56 V board with the official oDrive 150 KV motors and encoders on M0 & M1 purchased from the oDrive shop.

Up until now, I’ve just been using M0 with M1 disconnected, which has worked fine. I’m controlling it over a USB connection via oDrivetool.

This morning I added, and successfully calibrated M1. I’m experiencing odrivetool freezing and ChannelBrokenException when I issue the command odrv0.axis1.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL. After issuing the command, M1 is stiff when I try to turn it, so it feels like closed loop control is working. Once I get ChannelBrokenException, I can no longer send commands to oDrive and have to reboot oDrive and restart odrivetool.

If I issue command odrv0.axis1.requested_state = AXIS_STATE_ENCODER_INDEX_SEARCH, M1 turns and odrivetool says ‘Reconnected to oDrive…’. It doesn’t throw a ChannelBrokenException.

I’ve checked axis0 & axis1 errors and they are all zero on startup. All setting seem sensible. I’m using encoders, not Hall sensors, but have still taken the precaution of setting ignore_illegal_hall_state = true.

I’ve reviewed threads which discuss similar problems (#2269, #1049), but it appears they are using Hall sensors and 22 nF caps solved the issue. I’m using encoders, so I don’t think this applies to my issue. I’m also using the official oDrive USB cable which has a ferrite on it to reduce EMI.

I’ve just been playing around with a piece of aluminium kitchen foil connected to the odrive dc negative and wrapped around the usb cable and the M1 phase cables nearest the odrive pcb and I can now issue request_state closed loop, but I get ChannelBrokenException when I cmd move_to_pos. So it looks like this is an EMI issue affecting USB.

Please can I clarify the steps I can/should take to eliminate this:

  1. I’ve tried a couple of different USB cables, but little difference.
  2. Do I need to get metal braided cable sleeves for the motor phases? and do I connect them to oDrive GND or supply -ve?
  3. Do I need to put the odrive pcb in a metal box? Do I connect it to mains GND or what? I’m using a server power supply which is connected to mains and provides 42 V DC output at lots of Amps.
  4. The USB cable is connected to my laptop which is connected to it’s mains charger.

I connected odrive power supply V- to the metal chassis where M1 is mounted and also connected V- to mains GND (as the power supply is mains powered). Command move_to_pos now works, but after 20 mins odrivetool freezes but doesn’t throw ChannelBrokenException. Does anyone have any further ideas?

Try a different USB cable