Electrical noise and EMI on a CNC: what it does and how to fix it
Electrical noise makes a controller stop knowing where it is: a disconnect, a freeze, a reset, a false limit trigger, a blank screen. It does not usually make a machine quietly carve in the wrong place, which is almost always mechanical. The highest value fix is free: get the spindle cable away from the signal wiring and put them on separate circuits.
What it does, and what it does not
This is the part almost everyone has backwards, and getting it right saves entire weekends.
Sienci Labs put it about as bluntly as a manufacturer can in their own documentation: "EMI does not cause the LongMill to lose position or move erratically. It is a very common misconception that grounding your machine will help prevent missed steps, stalling, or positioning issues." Carbide 3D's own troubleshooting for missed steps starts with pulley grub screws, V-wheels, rail lubrication, belt tension, wiring connectors and feeds and speeds, and treats disconnects as a separate problem with a separate cause.
The honest nuance, because Sienci's rule is architecture specific. On a machine where the step pulses are generated on the controller board and travel a few centimetres to integrated drivers, the only realistic way in is the USB link, and losing that halts the job rather than corrupting it. On a machine with external drivers and step and direction wiring running any real distance, a corrupted pulse is possible and nothing downstream can detect it. Noise can also take your position indirectly on any machine, by falsely triggering a limit switch or by resetting the controller, either of which throws away the work coordinate system. Onefinity's own EMI guidance is titled, in part, "Randomly Loosing Zeros". Both vendors are describing their own hardware accurately.
Where it comes from
| Source | What it actually does | How much it matters |
|---|---|---|
| VFD spindle | Switches hundreds of volts thousands of times a second. The drive makes the energy; the motor cable delivers it into your shop, as radiation and as current dumped into the earth system. | The dominant source by a wide margin |
| Dust collection | Not electrical noise at all. Fine dust moving fast through a plastic hose builds a static charge that eventually discharges into something. Different mechanism, different fix. | The most common cause on hobby machines |
| Brushed trim router | The commutator makes and breaks an inductive winding thousands of times a second, and every break is a small arc. Mostly conducted out of the power cord. | Real, and worse as the brushes wear |
| Stepper drivers | Chop the supply to each winding. Their cables are the longest, most flexed and most gantry adjacent on the machine, so they are both a source and a victim. | Moderate, and self inflicted through routing |
| Relays and contactors | Arc on every open. A relay switching a dust collector or a router is a repeated broadband impulse. | Occasional, easily fixed |
| Other shop loads | Compressors, fridges, welders. Mostly a shared mains problem rather than a radiated one. | Occasional |
Why the VFD is the worst offender
Two reasons, and neither is the one people assume.
- It is the rate of change that hurts you, not the voltage. Both the ways noise couples between cables scale with frequency, not with volts. A mains extension lead and a VFD output lead carry the same voltage; only the VFD slams it on and off thousands of times a second. That is why a spindle cable upsets a limit switch running alongside it and a power cord in the same tray does not.
- The motor cable is the radiator. The drive generates the energy, but the cable is the part that is long, energised and out in the open. Everything else about VFD noise control follows from that.
Why a CNC is unusually easy to upset
A table saw has no logic in it. A CNC has dozens of signals running at 3.3 or 5 volts, on long flexed cables, sharing a drag chain with the noisiest cable on the machine.
- There is a volt or two of margin. Rule of thumb The gap between a guaranteed low and a guaranteed high on a 3.3 V or 5 V logic input is on the order of a volt or two, depending on the logic family. A noise spike that size is nothing on a mains circuit and is enough to flip the input. Where a controller lets you run limit switches at 24 V instead, the same spike becomes harmless.
- Limit switch inputs are the most fragile thing on the machine. They are long, unshielded, and on GRBL boards pulled up through the microcontroller's internal resistor of roughly 47 kilohms, which is a very high impedance and therefore the worst possible case for picking up noise. Grbl's own wiki says the pins "are very vulnerable to any noise".
- The geometry is adversarial. Stepper cables, limit leads, probe leads and often the spindle cable all run the same drag chain, parallel, for the full travel of the machine. That maximises both ways noise couples at once.
Spec The published figures: Rockwell specify 76 mm between separate steel conduits and 152 mm in a cable tray; Danfoss specify 200 mm; Hitachi specify 250 mm; ABB specify 300 mm. All four also say that where power and signal cable must cross, they should cross at 90 degrees.
Fix it in this order
Ordered by return per dollar, and the first tier is free. Change one thing at a time or you will never know which one worked.
Free, and fixes most hobby cases
- Re-route. Get the spindle or router power cable out of the bundle that carries limit, probe, step and USB wiring. Cross at 90 degrees where they must cross.
- Separate the circuits. Spindle and dust collector on one branch circuit, controller and computer on another.
- Move the controller away from the VFD, and never stack them.
- Drop the VFD carrier frequency toward the bottom of its range.
- Bond everything to one point. Machine frame, spindle body, VFD earth, controller enclosure and dust collection all to a single ground point that is connected to the building safety ground. One point, not a chain.
- Scrape the paint. Anodising and paint are insulators. A bonding screw into an anodised rail is bonded to nothing.
- Turn off sleep and USB selective suspend on the computer if you stream over USB. Sienci, Inventables and OpenBuilds all document this as a cause of long job disconnects, and a Windows update can reset it.
A few dollars, and the best value on the list
- Kill every shield pigtail. See below. This is the largest measured improvement available for the money.
- Stiffen the limit switch inputs. Grbl's wiki specifies 1 k to 4.7 k pull-up resistors to 5 V plus 100 nF capacitors to ground, mounted as close to the board as possible, and normally closed switches rather than normally open. A switch fails open, so normally closed turns a failure into an error instead of a crash.
- Snub inductive loads. An RC snubber across any relay contact switching a motor or coil, and a flyback diode across DC coils. Worth knowing that Rockwell are honest that these reduce arcing rather than eliminate it.
Real money, only if the above did not clear it
- Proper spindle cable: braided tinned copper at 85 percent coverage, with a separate earth conductor, terminated all the way round at both ends.
- Ferrites, done properly. See below, because most of them are fitted in a way that cannot work.
- USB isolator, or move off USB entirely. Carbide 3D have shipped isolators to affected customers. Sienci's advice for persistent disconnects is to switch from USB to Ethernet.
- An EMI filter on the VFD input, mounted directly against bare panel metal with its input fed straight from the mains. Never fit one on an ungrounded supply.
The shield question, which almost everyone gets wrong
"Ground the shield at one end only" is the most repeated rule in CNC forums and it is not a rule. It is half of one.
| Cable | Terminate the shield | Why |
|---|---|---|
| VFD to spindle power cable | Both ends, all the way round | This is a high frequency common mode problem. The shield is the controlled return path for that current, and it needs one at each end. Rockwell: shields of motor and input cables must be bonded at both ends. Hitachi: always at both ends. |
| Low level control cable between separate boxes | One end | Here the problem is a ground loop at mains frequency, and a second connection creates one. Rockwell: connect the shields of control cables only at one end, cut back and insulate the other. |
The variable underneath is frequency. One end is the low frequency answer to a ground loop on a signal cable. Both ends is the high frequency answer to common mode current on a power cable. A spindle cable is entirely the second case, so grounding its shield at one end is simply the wrong answer to the wrong question.
Vendors do disagree at the margins, and CHIP would rather show you that than pretend otherwise. MASSO say one end, to earth and never to controller ground, on the reasoning that noise wants to reach earth and terminating to controller ground dumps it into the controller. Buildbotics say ground the RS485 shield at both ends. Both are talking about their own hardware.
Ferrites, and why most of them do nothing
A ferrite core is a common mode choke: it works by enclosing every conductor of a cable so that the signal current, which goes out on one and back on another, cancels, while the common mode current that is all flowing the same way sees an impedance. Three things follow, and most fitted ferrites break at least one.
- It must enclose the whole cable. A core around one conductor of a pair encloses no common mode path and does nothing.
- Standard cores work above about 10 MHz. Rockwell put drive common mode noise at 250 kHz to 6 MHz, which is below where an ordinary clamp-on core does much. That mismatch is why so many people report no improvement. A low frequency material is a different part.
- Turns matter enormously. Passing the cable through once gives a fraction of the impedance that three to five turns gives on the same core. Beyond about five turns the winding capacitance starts to undo the high frequency performance.
What changes with your controller
Running the file from the machine removes exactly one exposure: the continuous data link to a computer. It removes nothing else. Every field wire is as exposed as it was.
| Architecture | How it tends to fail |
|---|---|
| Streamed over USB from a PC (most GRBL machines) | Fails by stopping. The link drops, the sender loses the port, the machine idles. Position is often retained, and senders increasingly offer a resume from line. The USB link is the exposed part, not usually the G-code itself. |
| Run from the controller (Masso, Buildbotics, Redline) | Can fail by acting on a corrupted input. A false limit trigger, a spurious probe trigger, a screen reset, a lost zero. It tends to keep going rather than stop, which is not automatically safer. |
| PC over Ethernet (Centroid Acorn, LinuxCNC with an Ethernet card) | Sits between the two. The link is far harder to upset than USB, but a PC is still in the loop and a sleeping or crashing PC still ends the job. |
Neither is immune, and no vendor's own documentation claims otherwise. The quality of published guidance varies far more than price does: Centroid and LinuxCNC document this most thoroughly, OpenBuilds and Sienci are strong for hobby machines, Onefinity's guidance exists as a forum post rather than in any manual, Buildbotics cover shield termination for their own RS485 wiring and little else, and Genmitsu publish essentially nothing.
Closed loop steppers do not protect you from this
This is worth being precise about, because it is sold as reassurance and it only covers half of what people think.
A closed loop drive counts the step pulses it receives and compares that to an encoder on the motor shaft. So it catches the motor failing to reach the position it was told to reach: a stall, a jam, too much acceleration, not enough current. It cannot catch a wrong instruction. If noise adds or removes a pulse on the step line, the drive counts it as commanded, moves there, and the encoder confirms it arrived. Nothing anywhere raises an error. The machine is simply in the wrong place and everything downstream agrees it is not.
It is also worth knowing these are semi closed loop: the encoder is on the motor, not on the axis. A slipping pulley, a skipped belt tooth, a loose coupler and backlash are all invisible to it, because the motor did turn exactly as asked.
Repeated, and wrong
| You will read this | What is actually true |
|---|---|
| "Ground the shield at one end, always" | Right for low level control cable, wrong for the spindle cable, where both ends is mandatory. |
| "Lift the ground to break the loop" | Dangerous and illegal. If a fault occurs, the fault current returns through your signal cable. Isolation belongs in the signal path, never in the safety path. |
| "Drive the CNC its own ground rod" | A separate electrode that is not bonded back to the building's system is a code violation and makes the machine a collector for soil currents. |
| "Turn the carrier up, it runs quieter" | It does, and it increases RF emission and earth leakage at the same time. |
| "Clip a ferrite on it" | Only if it encloses every conductor, in a material suited to the frequency, with several turns. Most fitted ferrites meet none of those. |
| "Twisted pair always helps" | It cancels magnetic pickup by collapsing the loop area, which is real. It does nothing for common mode noise, and it only works properly when the two wires carry the signal and its return; a switch wire twisted with a ground wire is better than untwisted, not the fix the phrase implies. |
| "Grounding will stop my lost steps" | Named by Sienci as a very common misconception. Lost position is nearly always mechanical. |
| "Just take it off the GFCI" | It removes protection to hide a real leakage current, and in a garage or basement that protection is usually required by code. Do not defeat it. The legitimate routes when a VFD trips a GFCI are a lower carrier frequency, a properly terminated and shorter motor cable, an input filter, or a dedicated circuit run by an electrician. |
Sources
The figures on this page come from these, plus the vendor pages and forum threads named inline. Where they disagree, the page says so.
- Rockwell Automation, Wiring and Grounding Guidelines for PWM AC Drives
- Hitachi WJ200 Instruction Manual, CE-EMC installation guidelines
- Danfoss, Output Filters Design Guide
- NASA Langley, Effectiveness of Shield Termination Techniques
- Henry Ott and Fair-Rite, Ferrite Cores for Low Frequency EMI Cable Suppression
- Sienci Labs, Noise, EMI and Grounding
- Carbide 3D, The Disconnect Problem
- grbl wiki, Wiring Limit Switches
- MASSO, Ground Loops
- LinuxCNC, Best Wiring Practices