INSTRUCTIONS:

Check out the new MoBeam posts! To find K40 conversion information use the "INDEX", "SEARCH" or "LABELS" sections in the sidebar.

Sunday, September 30, 2018

Battling Electrical Noise in CNC builds

Practical Experiences with Eliminating Electrical Noise

I spend a lot of time in CNC forums helping fix the builder's electrical noise (eNoise) problems. These problems usually show their ugly head soon after a build is complete and the machine starts to be used in a variety of ways and under different loads.
This post attempts to capture my experience with this problem after heavily modifying a K40 and building an OX CNC.
At the risk of energizing the eNoise gods..... I have never had any noise problems with either of these machines!
I wondered why I have been so lucky when others inevitably get sucked into the intermittent hell of eNoise.

I suspect the answer lies in that I have always used a set of self-concocted design and practical implementation rules for minimizing eNoise. I plan to share them here. 

Before we start I will acknowledge that noise elimination is often a matter of art as much as design. 
Every engineer has a view and a favorite explanation of the best way to prevent eNoise. Most of these are correct given the right conditions. 
Often you will find a FIX but it will not make engineering sense. You will walk away in bewilderment puzzled that it worked but thankful that it did. Forever wondering why it worked!

The biggest source of eNoise in my experience is the lack of a grounding design. We tend to think of power and motor driver connections as high current low-frequency connections with stable voltages at low slew rates. However, every wire in modern CNC systems has the potential to carry high currents with voltage changes in the ns ranges. These spikes can travel in the ground system and create ground shifts that can drive digital electronics nuts! 
Good grounding design considers every wire in the system as a HIGH SPEED transmission line with the ability to shift ground levels, couple cross-talk and transmit signals like a radio transmitter.

Donate:

Please consider donating (button to the right of this post).
Your donations help fund additional research, tools, and parts that I will return to the community as information.
For other information on the K40-S build use the  K40-S BUILD INDEX with schematics

Sensors; not the Droids you're looking for!

The noise problem is not usually the switch/sensor itself... it's the sensor wiring, so the type of switch may or may not matter. I have had many builders tell me that optical end stops are noise prone and not to use them. I have used Optical sensors for decades in harsh environments without a problem. Most times when I thought the problem was the sensor it was actually a noise problem introduced by poor grounding.

Tug of war: Pull up or down?

I agree that in general pulling the input to the processor low is better than letting it be pulled high. I also know that the approach chosen depends on many other factors. The key is to choose the switch's pull-up resistor value such that enough the current is flowing in the wiring to keep any coupling from shifting that level. Long wires from end stop switches to processors are prone to be disrupted by nearby high current wiring. This is especially true when an end-stop wire is routed in a bundle with a 48VDC motor cable. That said, often the I/O cannot sink/source the needed current. I generally like to use low true for its fail-safe properties.

Seriously! It's the cabling design!

The most common problem is that sensing switches are connected through a long cable to the input of a processor that runs at 3.3v and it doesn't take much for a 48V @10 transient to create a 3v shift in the ground. Yes, many controllers have noise filters on the input but they often do not dampen the signal enough.
Noise generated from motors can easily shift an end-stop signal during a transient at a frequency the filter is not tuned for and can't damp. Since processors are capable of seeing very short transitions of a few volts it doesn't take much for a motor spike in a cable harness to be seen at the end of an end stop cables destination. It then gets interpreted by the controller as a real end-stop signal. These disruptions are hard to see unless you employ a high-speed differential scope!


Often or in addition, poor grounding design can allow for signal level shifts between the sensor and the receiver. Long wires have transient characteristics that act like antennas or dynamic resistances the shift a signal off of its resting value creating a false signal.

Optical isolators can be used between the sensor and the processor. That will allow the sensor signal to operate at a higher voltage (5V) and give isolation. However, the grounding on this board must also be properly designed.


Soapbox: I wish these controller board designers would build in optical isolation and higher voltage/current drive. Processor input/outputs are not designed to receive and drive lines directly and in highly static environments, the connected line can blow the inputs.

So the bottom line is that just pulling up or down inputs or changing sensor types is not sufficient for a noise-free system. Often these things work but it is more likely because these changes also happen to alter the characteristics of the signal, it's wiring, and grounding in a positive way.

I spend a lot of time over on the K40 Laser G+ with folks that have done conversions. The problem there is that the Laser Power Supply is +20,000 VDC @ +20ma which is a lot of energy. Conversions that are done without "designing" signal and ground circuits often have problems when the laser arcs, starts-up or changes current rapidly. Digital signals sharing wiring with High Voltage drive is a worse case environment.

The sensor type, cable type, routing, and termination all need to be "designed-in" for any hope of a noiseless system. Most folks view wiring and grounding as a static thing and focus more on the convenience of the builds wiring vs the dynamic nature of the signal paths at high frequencies.

Design Guidelines

Here is my design regime. Using this on my OX and K40 conversion has resulted in noise-free operation from the start. This seems like a lot of extra work but it pays off when you have a quiet system that behaves predictably. Signal and ground integrity is as much an art as an engineering discipline, your results may vary. 

Signal path design:

  1. Whether pulling the endpoint of a remote signal up or down, insure that the max amount of current is provided. You are trying to ensure that low signals cannot be pulled up by induced noise and high signal stay high in the presence of noise.
  2. Wire the signal using twisted pair (TP) from one end to the other. The ground is on one wire and the signal on the other. The ground lead of the TP should be grounded as close to the driver as possible at the source end and likewise at the receiver end. Sometimes it works better to ground only one end but that is usually in extreme cases and requires trial and error to know which end to ground. Cat 5 cables often have twisted pairs and make a nice signal bundle. You have to strip them back to tell if they are in a TP configuration. Do not run signals all together without TP in the same wire harness or bundle. I logically group my signals into CAT 5 cable groups of like signals based on my guess as to the driving circuits dv/dt characteristics. Its a lot more wire but it's worth it. A shielded cable can also be used but it can create as many problems as it solves. Where to ground the shield is often a mystery and requires trial and error. I have never had to use it because most noise problems I have encountered are conducted not radiated. 
  3. Route the input sensors wire/harness as far away from high current devices as possible. Definitely do not run motor signals in the same harness as sensors whether using TP or not. I run my motor wiring in a totally separate harness. The big offender here is the spindle [or HVPS]. Having signal wires even close to the spindle drive and /or its 48VDC power connection is asking for trouble. Consider that these wires (both the DC input and motor load) endure large and high current transients in the order of 10+ amps. In the case of my OX I mounted my spindle driver on the gantry within 6 inches of the motor. This allows the driver's output to be short. The only cable that travels through the drag chain is the 48V supply and that is a separate wire with the largest gauge I can afford.
  4. Keep the length of cables as short as possible, especially those cables between a driver and an inductive load like a motor.

Grounding Design:

  1. The ground system design must consider the path the current follows to get back to the source driver (that's usually the device on the PCB). Signals that are a long way away that are not grounded back to the source can experience ground shifts when exposed to strong transients due to line inductance, capacitive coupling, voltage drop, etc. The distance that the current has to travel can have a profound effect on the signal voltage seen at the receiving end of the wire. As an example, if a switch out on the gantry uses one signal wire but the return is tied to the frame out on the gantry, the return current has to flow through the frame back to the controller's ground connection then across the PCB and to the input receivers ground connection. Unless the frame of the gantry has a beefy wire running back to the controller the ground path may not exist at all or at best travel through moving ball bearings. In unknown paths like this who knows what voltage is dropped across what unexpected resistances/inductances.
  2. Power supply wiring should be designed just like signal wiring. Power supplies should be wired directly to their load. That means two beefy wires (power and ground) as short as possible directly to each load. The bigger the wire the better, size matters here. Do not run a PS's wiring to one load and then daisy chain the grounds to the others. Each supply has dedicated power and ground wires to the load.
  3. Ground each power supply back at the supply's terminal with an additional wire run to a common gas-tight connection on a common frame location. Yes, I mean a single lug that all PS ground lugs connect to. All supplies should literally have a beefy wire from the ground lug on the supply to the common frame lug. 
  4. Tie the safety ground from the AC plug to this same common lug. In weird conditions, I have found that isolating frame ground from PS ground to solve some noise problems. Try this only as a last resort.
  5. For the common ground, I use a bolt with soldered ring tongues stacked with star washers in between each lug. 
Admittedly this regime requires a lot of upfront signal and physical planning and uses a lot more wire and likely more drag chains than you hoped.
I have found it to be worth it.

Enjoy and comment
Don



No comments:

Post a Comment