Electromagnetic Interference (EMI)#
Disclaimer: I am not an electrical engineer. Everything you read on this page is bits and pieces I’ve collected over the years that seem sensible. They could be incomplete, totally wrong, or simply a case of cargo cult (magic ferrite beans, really?).
Consult with other more reputable sources before making drastic changes to your equipment.
Electromagnetic interference is the bane of all electronics.
CNC machines are especially susceptible to it for three reasons.
First, they operate in environments that generate a lot of EMI. The cables for a VFD spindle emit high-energy and high-frequency magnetic field. Sawdust moving through a dust collection hose accumulates a lot of static electricity.
Second, they use sensitive electronic components with long cables that carry low-power signals that are especially prone to interference. Often those signal cables sit right next to the very cables that generate the EMI.
And third, the stakes are higher when operating a CNC. A single glitch can in the best case ruin a project, but could also lead to damage or injury.
EMI symptoms#
EMI can manifest in different ways.
-
You may get random G-code errors that happen at different times on every run. This could indicate that the USB cable is corrupting the G-code stream.
It could also mean that you have a PC and an offline controller connected at the same time. Don’t do that. -
You may get stepper motors misbehaving at random. Either stopping, reversing direction, or shooting off to the side. This could indicate there is some interference with the motor cables. Closed-loop motors are especially prone to interference.
This could also be caused by G-code stream corruption over the USB cable, same as the point above. -
You may get errors about a limit switch being tripped, while you are nowhere near it. This could indicate there is some interference with the limit switch cables.
There are a few things you can do to reduce the EMI and its effects.
Ground the CNC#
The metal frame of the CNC machine should be connected to the ground pin on the AC plug.
Same for the metal body of the control box.
Ground Loops Avoid creating the so-called “ground loops”. Every metal part should have a single electrical path to ground. Multiple paths will create an electrical loop that can amplify the EMI.
For the same reason the shield on shielded cables should only be grounded at one end, typically at the start.
Ground the dust collection hose#
A good way to ground a hose is to insert a piece of copper mesh wire along the inside of the hose. Connect the wire to ground.
There are special “grounded” hoses that already include some sort of dedicated wire. Read the instructions for how to properly wire them.
Use grounded and shielded VFD cable#
The VFD spindle and its cable are great sources of EMI.
A proper spindle cable will have an extra wire to be used for grounding the spindle body, and also a flexible metal shielding around the wires. Both the grounding wire and the shielding need to be connected to ground.
The cable is usually connected to the spindle with a large 4-pin connector. There are three pins for the power and one for grounding. However, some cheap spindles do not actually have the 4th pin connected to anything internally. Use a multimeter to ensure that the pin connects to the body.
Good cables aren't cheap and cheap cables aren't good. A VFD cable has a few competing requirements. It needs thick conductor wires to handle the high currents necessary for a powerful spindle. It needs to have metal shielding around the wires. And at the same time it needs to be flexible enough to bend with the drag chains.
Such a combination of qualities is hard to find and can be expensive.
Protect the signal cables#
A CNC machine contains multiple low-voltage cables that can be affected by external interference.
- The USB cable from the PC to the control box
- The motor signal cables for closed-loop motors
- Sensor cables for the limit switches
It is a good practice to use cables with flexible metal shielding, and have that shielding connected to ground.
You may also consider adding ferrite beads to both ends of those cables.
Separate the spindle cable from the signal cables#
Oftentimes the spindle cable shares the same drag chain or conduit with the signal cables. This is certainly neater, but increases the likelihood of interference.
You may consider having the spindle cable hanging from above. This is a good thing to test if you are experiencing glitches.
Note: This only applies if you are using a VFD spindle or a trim router, since they use high-voltage AC cables. A DC spindle cable is less likely to cause problems.