Ground loops are often discussed but less often understood (I am far from being an expert in this). I have seen several cases where a robot malfunctioned or a sensor did not work due to bad grounding. For example if you have a 0-5V signal and also have a “noisy” ground then the signal can be 0V± some-noise-value, and 5V± some-noise-value, and cause troubles with your circuit operating. A (bad) ground loop occurs when there are two ground paths and a difference in potential (ie voltage) between them. Ground loops can be formed by having impedance differences between ground points in the system be different from each other. These differences can be both from the design of the system as well as from small subtle real world differences. You can get a ground loop even if you are unaware of any mismatch between ground paths. Often when we say we have a “noisy” system it is because we did a bad job minimizing current loops. Remember every current loop is an antennae that both radiates and receives “noise”. In addition to having “bad” logic levels you can also have a persistent voltage across your various ground points, that will induce a current to flow continuously. This can also cause problems.
Ground loop are often very hard to diagnose. Often if you are having weird behaviors, computers glitching, erratic communications, random restarting hardware, smoking cables or even hardware failure you might have a ground loop.
Grounding in a mobile robot can be both easier and harder to deal with then in a fixed installation of a machine or house since it is generally a “floating ground” and not connected to the earth. You could drag a metal chain or have metal wheels that *might* connect the robot to earth, but that is probably not the most reliable grounding connection. By having a floating ground you have the complete control and responsibility to make sure your grounds are the same potential (ie voltage) and that there are no loops (two current paths for the same device).
Current does not follow the path of least resistance, current follows the path of least impedance. What this means is that we want to keep corresponding wires, cables, and PCB traces as close to each other as possible, as short as possible, and with as little “looping” as possible.
Sometimes you can not avoid having a ground loop in your system. So how do you prevent issues? You need to avoid having current loops of a different impedance going back to ground. Ground wires should usually be in a star topology with each leg being the same length. Putting ground wires as a bus (almost) guarantees that you will have varying impedance between each ground return wire (which is a bad thing). Keeping power and return wires close to each other helps to minimize the impedance of the loop. You should try to keep high current systems (battery, motor, etc…) grounds separate from low current grounds (logic, computers, etc..) to avoid placing “noise” on the low current systems. All of the low current grounds can/should be tied together. On the power side if you have multiple DC<>DC converters the output grounds should be tied together. One way to avoid ground loop problems is by keeping things isolated. For power this can mean isolation transformers and for signals this can mean using opto-isolators. When possible using differential communications can also help. For example rather than using RS-232 which is relative to a common ground wire, you can use RS-485 which uses differential pairs for transmitting the data.
Update:I recently was asked to consult on a robot where various devices (radios, motor controllers, etc..) were failing. The robot had all of the DC-DC converter outputs isolated from each other as well as the battery output. Inadvertently via the computer case the robot became grounded to the chassis (from one of the DC-DC converters). We determined that there was a voltage differential between various parts of the robot, and in certain situations it was shorting these different components together causing the components to die. After tying all of the grounds together the problems went away and components stopped failing.
I once had a computer in a robot that connected to a programmable power supply via RS-232. When we tried to boot the computer with the power supply serial cable connected the computer would just hang and not boot. If we removed that serial cable, the computer would boot just fine. The way we “fixed” this was by putting a USB<>RS-232 converter that isolated the signals. Once we had the converter in place all of our random boot failures went away.
To make sure that only one ground path is at each location you need to think how your signals are shielded. For a cable that means only grounding it at one end. Usually you want cables grounded on the power source side and leave it ungrounded on the device side. Having the cable shield connected to ground will prevent the electrical fields from penetrating the shield and affecting the wires inside. (One dirty way that can often fix a ground loop problem is to cut an existing shield that is causing the problem.)
To ground a robot chassis or not is an interesting question. If it is grounded you benefit from the added shielding and maybe help reduce static electric discharge to other components. If it is not grounded then you have less chance of shorting a wire when you are working on something. If you do ground the rover chassis then it should only be at one point.
One other quick note is about the classic case of ground loops and oscilloscopes. Scope outputs are typically connected direct to earth ground. So if you try measuring something else that is earth grounded you can blow up your scope or probes. If you want to measure something that is also earth grounded you either use an isolation transformer to power your scope or device, or better yet (since it is safer) you can use isolated differential probes (they are expensive) for your scope!
Grounding can be tricky. If you have more advice or stories please leave them in the comments below!
Just a small reminder about impedance.Impedance is the effective resistance when you combine resistance and reactance. Essentially this means that you combine the resistance (typically not frequency dependent) and the “resistance” from capacitors and inductors that are frequency dependent.
Capacitor: XC= 1 / (2πfC)
Series Inductor and Resistor: Z=sqrt(R2 + XL2)
Series Capacitor and Resistor: Z=sqrt(R2 + XC2)
Series Inductor, Capacitor and Resistor: Z=sqrt(R2 + (XL – XC)2)
I would like to thank Edward for the idea to write this post.