The data from UART gets a garbled character every 5-10 message
I should get 0 0 0 0 0 0
But sometimes I get: 0 0(0?3NNNN???0
I don’t think this is the ODrive, but could be either noise from cables or the USB reciever I’m using?
UPDATE1: Looks like it is getting interferance from the power cables. I’m switching to shielded cable to see if it fixes it::
UPDATE2: I’ve switched to a sheilded cable and have grounded it, it has reduced interferance by 90% but the noise is still very high. Does anyone know why or how I might fix it?
As for specs, I’m running it at 5 volts, the wire length is ~1.5 meters, and the UART connection is a cheap USB dongle (DSD TECH).
If anyone has any pointers that would be fantastic
Alright, so I have installed a whole bunch of features and still no luck.
I’ve shielded and grounded the signal cable.
I’ve separated the power lines and the signal lines
I’ve grounded the enclosure, case, power supply, and everything else imaginable
I’ve disabled unnecessary electronics
I’ve tried a different power supply
When the motors are off, everything is fine, when the motor is drawing power (calibrating or holding position) it interfers with the UART.
I’m running 42 volts on a 52V board. Is this a board problem or a me problem?
UPDATE: I saw a post from 2017 about problems with a ground pin so I decided to switch ground pins and it is much improved. It is not totally cleared up but I will continue to experiment tomorrow. Any recommendations on why this might be or how I might fix it?
The new port helped with the noise but it is still missing a packet every 10-20 messages.
What was interesting is when I move it when it is in closed loop mode the noise almost goes away entirely.
Any thoughts or ideas would be worth its weight in gold at this point… lol
Are your gains really high? It could be vibrating at a bad frequency when trying to hold position.
I’ll try reducing them. I had turned the gains down when I first set it up because it was vibrating, however when I hold the motor I can’t feel any movement.
Have you scoped the signal lines, if so can you post a picture of what they look like?
A dumb question but can catch you out, can you confirm your parity and stop bit count?
Thanks for the feedback and help!
I don’t have a oscilloscope so I can’t check the lines.
As for the dumb question, I may have a dumb answer. I’m not using a parity or stop bit. When the motor isn’t running, the data comes through with 100% accuracy, it’s only when it is calibrating or turned on does it go wonky.
As an update:
-I’ve tried out a different board and still have the same issues.
-It is worth noting it is running in a metal frame that houses the AC->DC power supply at 42volts.
-I reverted back to the sheilded (and grounded) cable which increased the noise over the unsheilded cable.
I’m drawing blanks here. I think my next step is to run a usb extension cable to reduce the length of the UART cables in the hopes it reduces noise. Worth a shot, but doesn’t seem to be fixing the underlying cause. Wish me luck Simon and Wetmelon
How did you get on?
Looking at your previous post, I’m wondering if you’re seeing a ground loop. It may be worth running a uart to 422 converter and back again. being differential, you should be able to separate the grounds (and go further).
Good luck and keep us up to date!
Thanks for checking, it is much appreciated. I’ve never worked with noise in electronics before so I’m stumbling my way through it. I’ve looked for videos/resources to get a better understanding so if there is anything that might be helpful I’m all ears.
As an update, I wanted to reduce the length of cable as I figured that was where the noise was getting picked up.
So I replaced the 2 meter shielded UART cable with a usb extension cable so the UART cable was ~10cm. This completely reduced the noise (great!), however now the Odrive locks up once the motors turn on (not so great and weird behavior which I haven’t encountered).
I’m pretty sure now that I’m running into some kind of grounding problem but I don’t know enough about it to solve it. I’m running in an all aluminium frame which I can’t remove so my next step is to isolate the brushless motor from the frame (via rubber washers) and as a backup have some ferrite loops on the way. I’ll also check that the PC case is properly grounded also.
Thanks for the info about the 422 convertor. I was actually thinking of a way I could bypass this so we seem to be on the same track. I was thinking wireless sending/recievieng with hobby grade RC interfaces but haven’t finished my research yet as I want to be able to send data and not just a variety of PWM signals.
- Any resources for learning about grounding properly?
- Sending serial data via hobby grade RC senders/recievers?
- Any grounding tips or things I might be missing?
When it comes to grounding, you ideally want a ground for each subset of components, ie Power, Analog, Digital and sometimes even comms ground. You then should bring the grounds together at a single point usually a star point and you might have some filtering to reduce noise transfer. If you connect your grounds in multiple points, you can have ground loops that introduce noise. So ideally you want to plan your grounds before hand, draw up a connection diagram even.
Your motor noise may be back feeding and messing up the ground used by the communications devices, or you may find your PC is floating and when you tie the grounds together (when you connect up your UART cable) you’re grounding it and again causing noise. without some equipment to scope it, its very hard to tell.
You can try a radio bridge (there are many many many to chose from) but you may find the UART going in to the radio is noisy or the radio signal itself is getting trashed. Ideally you need to find the source of the noise otherwise you might be throwing money at the problem.
- Invest in test equipment. i.e. scope
- There are many articles about grounding but rule of thumb is have a separate ground for each distinct segment of your project (power, analog, digital, comms) and connect them once preferably near the power supply. Comms ground is an exception as it is used as a reference.
- There are many ‘transparent’ transceivers but you ideally need to identify the noise source first.
- Ground your motors to the chassis, ground the chassis to the PCB near the power supply in, use separate ground wire for the comms and twist the tx, tx and gnd wires. I use a drill to make twisted cables.
I hope this helps
Incredible, thank you for all the feedback Simon.
Based on your comment, I think it is likely I’ve created a ground loop as I’ve grounded everything (without order).
I’ll order a oscilloscope and start going through your recommendations and hopefully report back with some success!