ODrive makes other USB devices go haywire if keyboard is plugged in

Hi all,

So this is the weirdest issue and I’m not entirely sure what I did to cause it, but I’m wondering if anyone else has had anything like this happen.

Basically, if I have a USB keyboard plugged into my laptop (Lenovo Thinkpad T450 running Windows x64, all drivers up to date) while I’m playing with my ODrive (56V version 3.6 connected to a D5065-KV270 motor and a CUI AMT-102 encoder) via odrivetool for long enough, all other USB devices will start acting up. Specifically, they’ll start intermittently becoming unresponsive (e.g. for the mouse the cursor will stop moving and it’ll stop registering clicks for a second or two, then come back for a second or two, ad nauseam; similar for the keyboard). This persists even after unplugging the ODrive, but stops if I unplug the keyboard. If I open device manager while this is happening, it looks like it’s repeatedly scanning for new hardware. This happens with multiple different USB keyboards and it doesn’t seem to matter whether the ODrive or the keyboard is plugged into a powered or unpowered USB port. Built-in input devices on the laptop work fine while this is all happening. Just having a USB mouse plugged in by itself doesn’t seem to cause problems, it’s specifically keyboards (although I haven’t tried USB keyboard with no mouse). All turn off this USB device to save power type options are turned off and the latop is in high performance power mode, plugged into the mains.

So yeah, it’s weird. Anyone any ideas what’s causing it, please? If you need any more info let me know. Not super high priority as I can make do with just the built-in keyboard and a USB mouse while I’m using the ODrive, but honestly just curious more than anything.

I have the same version odrive 3.6 and 56 volts
On Ubuntu 18.4 it locks up the mouse and keyboard, until saw your problem I was thinking it is Ubuntu 18.4 but now if it is happening in windows then there could be a bug, I am not sure.
I have tried increasing the swap file size, verified and got the latest video drivers but it still locks up after 10 mins usage if I keep the browser open.
I thought it was only my machine but looks like others are also having this problems.
I have no solution sorry

Hi both,

I’ve not seen this (yet) but someone else I’ve been talking to has been seeing noise on the UART port and I’m wondering if these issues may be linked. Do you have any way of scoping the board? I wonder if there’s noise being injected on to the ground that is working its way back on to the USB.

Cheers
Simon

Hi,

Thanks for the response. Was finally allowed back into work today so I have access to my electronics workshop again, which pins should I be scoping? Attached photos show the signal with my oscilloscope connected to the two ground pins on the inner edge of J3 (just past the GPIO pins). The top, noisier one is with the requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL, control_mode = CTRL_MODE_CURRENT_CONTROL, and current_setpoint = 0.0. The bottom, cleaner one is with requested_state = AXIS_STATE_IDLE. So looks like there is some noise on the ground.

I don’t know if this is related to the problem, but I happened to set up a load cell through an AD620 instrumentation amplifier next to the drive and I see similar noise on the output of that if the motor is in closed loop control mode, regardless of how I read the AD620 output (ODrive ADC, Arduino ADC, oscilloscope) or whether there’s any direct electrical connection between the motor and the load cell circuit (i.e. if I have a completely separate power suppy for the load cell/amp and no wires connecting the ODrive to the breadboard with the load cell & amp I still see the noise).

EDIT: in my searching with regards the load cell noise, I did come across this thread: Electrical noise However, my load cells are nowhere near as big as theirs (mine is this guy from SparkFun: https://www.sparkfun.com/products/14728) and they were able to solve the problem by electrically isolating the load cell from the drive, but like I say, I see the noise even if the ODrive and the load cell are on completely separate circuits (just in physical proximity to each other). I also found this thread: Encoder error ERROR_ILLEGAL_HALL_STATE, but I dunno if it’s the same issue as like I say I see the noise just connecting the oscilloscope to the ODrive ground.

Can you show us a picture of your setup?

From what I’ve seen with other people, and experiences of my own, this is usually caused by coupling/leaking between the motor currents and ground. I believe this coincides with the difference you are seeing between states IDLE and CLOSED_LOOP.

I solved this issue by changing my motor mounts from aluminum to plastic. The coils were leaking current into the can of the motor, and this was reaching the earth of my board somehow.

It could also be that your motor wires are running parallel to other cables.

Like Wetmelon says, send us a picture of your setup.

Thanks for your replies. I disconnected a few things last night while I was tidying up, so I just double checked that I still see the noise (I do) and then took a picture of the setup as it is at the moment. The BNC cable goes to the oscilloscope. There are no wires going from the breadboard to the ODrive right now. The housing is from this post: NEMA Enclosures for D5065 and D6374 motors, the face plate is this one: https://odriverobotics.com/shop/nema23-faceplate-for-d5065-motor. Power supply is a Meanwell LRS-200-36 turned down to ~30V.

I will try with a plastic face plate and see if that helps. Please let me know if you need more info/pictures.

Update: replaced the face plate with a plastic one (see picture). The noise is still there, although at maybe half the amplitude compared to yesterday. The screws are still metal as I don’t have any plastic M3 or M4 screws on hand, but I can order some if it would help.

Some other things to try:

  1. create electrical isolation between your power supply and the table.
  2. There might have been some electricity leaking through your pull wire. Try a plastic wire, or see if the noise reduces when the wire isn’t connected.
  3. Creating twisted pairs of wires going from your loadcell.
  4. It looks like you’ve properly grounded your amplier, but just in case take a look at these two pictures for proper wiring reference for op-amps with Wheatstone bridges.

It’s really just trial and error at this point, to minimize the noise you are seeing.

image
image

Thanks again! I decided to start with the twisted pair idea (plus trimming the wiring on the breadboard as much as possible, the long wires were only because I was working from home with limited tools) and that alone has made a huge difference. In particular, if I’m powering the load cell off the ODrive, twisting the ground and power wires together (without any additional shielding) reduces the switching noise on the amplified load cell signal to almost negligible levels (much smaller than the signals I’m interested in). If I need to reduce it further for any reason I’ll keep your other tips in mind. Cheers!

No idea whether this solves the original problem with the keyboard disconnecting (it’s hard to diagnose as it’s something of an intermittent problem), but I’ll see I guess.

2 Likes