Help with noise spikes propagating through 5 feet of cable.
I have designed a system that employs two [four layer] circuit boards. One board contains a 16 bit ADC along with a propeller and other IC's. The second board controls three stepper motors. Both boards are connected to a switching power supply and both boards use a 5 foot long cable to send signals / power out towards.
My issue/s is the ADC reading is affected when I make one of the stepper motors turn. Keep in mind that the ADC is using a reference voltage, separate ground plane and an active low pass filter.
I am also using a ferrite bead on the outside of the cables but continue getting a bad ADC reading when the motor starts and stops. Any ideas on what I can do to resolve this issue?
I am currently testing out a "digital filter" in the propeller to help out. This "filter" is basically measuring the ADC then using a bubble sort to get the median.
My issue/s is the ADC reading is affected when I make one of the stepper motors turn. Keep in mind that the ADC is using a reference voltage, separate ground plane and an active low pass filter.
I am also using a ferrite bead on the outside of the cables but continue getting a bad ADC reading when the motor starts and stops. Any ideas on what I can do to resolve this issue?
I am currently testing out a "digital filter" in the propeller to help out. This "filter" is basically measuring the ADC then using a bubble sort to get the median.
Comments
Clearly the noise from the motor power surges is coupling from one board to the other. It could be coupling through the power lines or by inductive or capacitive coupling between cables.
Attachment not found.
As far as on board filtering : There is a low pass filter on the input to the ADC that feeds into a opamp with a gain of 1.
You want to ask yourself, why is the ADC reading off when the current is turned on or off to a motor winding? You're getting noise spikes from the current surge when the motor is turned on and another current surge (presumably of opposite polarity) when the field collapses in the motor winding. There are surges in the ground wiring and in the supply wiring to the motor controller. Do you have snubber diodes across the motor windings? Their absence would explain noise when the motor is turned off. Poor regulation in the power supply would also explain that.
On the motor controller board I have one 25 Volt 470 uF electrolytic capacitor for the power rail and 8 capacitors that are 25 Volt 470 uF electrolytic capacitors for each motor drive IC. I am not using any snubber diodes, yet when the motor is off I get no noise. Even when the motor is running the noise is not measured by the ADC. Its when the motor initially starts up (using a ramping function from a propeller) that the noise spike peers its ugly head towards me.
As far as the power supply issues. I am sure its not the PS because we have used them for over 10 years now and never an issue. Even with similar boards this is not of concern so I can assume that the noise is stemming from the new designed PCBs or the cables.
Any other ideas and or thoughts?
...yeah - never "assume anything" and verify everything.
Have a scope handy?
True - god so true. Um I have a scope fired up usually before my coffee is finished brewing. What do you have in mind?
Also take a look at the ground and the reference to the ADC.
Getting a visual of the noise can help to determine/understand the nature of the beast.
***I've debug time schedule this afternoon and will be off the ether until later this evening.
When the motor starts up, the current demand is the highest. Once the motor is moving, the counter-EMF opposes the voltage from the motor controller and reduces the current flow. Is your wiring heavy enough for the maximum current demand? Do you have separate connections at the power supply for the motor and the logic? Maybe there's a drop there under heavy load.
The scope shows a line with fuzz on it. This fuzz will change when I power the stepper motor but how much I just cant measure. It actually looks better when the motor is running. I wish I could take a picture of it but my scope is older.
This is a snapshot of the stepper motor drivers A3967 internals it looks like the diodes are included on the h-bridge portion. As far a connections look at my crude pic above.
Attachment not found.
Edit: Sorry that was a bit direct.. I typed up a much better and friendlier response previously, but the message disappeared
I don't have that type of cable, but I do work with a few brainded people!
I think ill need to do some deep thinking on this one. Its not an obvious problem.
I could not tell from the thread. Are you using the same cable for both the ADC signals and the stepper drive? (I am presuming the pcbs are located 5ft from the motors and the sensors). If so, then the ADC wires must be shielded from the stepper drive wires.
You could also try a resistor and capacitor across each motor winding. The resistor acts to reduce the inrush current to the cap when the supply changes. Perhaps a value of 100R with 100nF.
How much voltage overhead do you have from your power supply? If you have the overhead, you may benefit from a diode/cap filter to your motors.
http://forums.parallax.com/showthread.php?135631-DC-Motor-Causes-Servo-Problems
Now that you've approximately found the noise source, it would help a lot to make a test program designed to make the noise as bad as you can. I.e. constant periodic ramping up and down through the bad speed range. This will make it easier to see on the scope. You should be able to trigger off the "fuzz" burst and, if your scope is fast enough, zoom in till you see the shape of the noise. It also sounds like the low pass filters on the ADC may be working at high speeds. When the steppers start and stop the, step rate drops into the pass band of the filters causing noisy readings. Also check the reference inputs to the ADC for noise. The reference inputs are just as sensitive to "signal" as the ADC inputs are.
I had good luck taming a bad case of switch ringing from a little DC:DC power supply brick by placing common mode chokes at the input and output. (3-4 turns on a ferrite bead would do about the same) That particular supply had a noise burst that rang at ~30MHz and radiated LOTS of noise from my supply wires even though I had a 100uF electrolytic and 0.1uF ceramic capacitor right next to the chip.
Lawson
I am using 2 cables one for the ADC and the other for the motors. One of cables has a shielding in it but the other one has none. I am going to look into cables today. Also you mention filters but I think that I have ruled this out and instead of writing it twice read below.
- Beau
I would look into diode/cap filters but there is a issue with this. I just tested the entire design using 2 power supplies now. The result was that the noise is still present. This means that the cables are the concern (I think) and that I need to source a better cable or focus more on the cables. The cables are separated by randomness of how they lay on my desk, a few inches or touching, its random.
- Lawson
You make some good points. Funny you mention the low pass filter, late yesterday I set it up to 50Hz and it did not matter. I also have a difficult time checking the ADC input signal only because it changes the stability of the reading. I have measured the reference voltage for the ADC and its as solid as can be. I truly think this noise is generated in the cables.
So for today I will use different cables with shielding to see if this is the right direction to take. Thanks all for the heads up advice so far.
Two things I learned the hard way with electronics and neither were in the first chapter of the textbooks. First thing is ground loops. You find that out playing with audio - connect all the grounds together and you get massive hum. Better to use a shielded cable, but only connect the ground at one end! Wot Cluso said. Everything must be a star layout. And easier to debug with audio because you can hear what works and what doesn't. Second thing is RF - every cable is a radio receiver and every cable is a transmitter. The RF radiated by a mains cable going to a flouro light can reset some microcontrollers (eg picaxe). That shouldn't happen but it does.
The fact that the positioning of cables on the bench makes a difference is very useful information.
In an ideal world, you would sample the voltage very close to the motor and sample it so fast you detect all the transitions and all the noise and later you can process this. Can you sample close to the motor, convert to a high impedance signal (or even better, a digital signal) and transmit that using your 5 ft of cable?
I think a photo will help a lot here. The messier your bench the better, it is helpful to see what might be interacting with what.
Yes you both are correct in that the grounding of one end of the cable prevents a ground loop, and I already took steps long ago to implement this. I will bring in a camera soon and take a snap shot.
So far ferrite beads are helping. I cant seem to find shielded cable for my application so the search continues.
The noisy people read on, no pun intended
Two distinct problems I discovered where causing the noise in one of my designs. One my digital board I run an advanced Hbridge that is powered on the low side by Nchan mosfets. Since the propeller is a 3.3V I.O device I had no choice but to commission a "translator" to drive the gates correctly. This device in it self was not the problem but the resistors used to adjust the output were miss calculated. Once the proper resistor were selected the unit started running nominal. The other issue was the 3 meter cable. It transformed into an antenna and being a good antenna it enjoyed picking up EMI signals and destroying my sensitive signal quality. I solved this problem by using ferrite coils / beads on data lines and warped foil to shield the cable.
Glad that you got it worked out. If noise is still a problem, you can create a transmission line of sorts on your data lines. A simple pull-down resistor to ground on both ends will greatly attenuate any antenna effects entering a signal line. Otherwise the signal has to traverse a long distance before it finally gets to the destination input which essentially creates an antenna. The value of resistor you choose depends on the drive strength and/or voltage of the output as well as the speed at which the data is sent. On each end however, the resistors should have the same value.
That'll negate impressed interference and potential ground loop issues when using a foil/braid wrapped cable.
I agree with all of the other posts, there seems to be more than one effect going on here - this is a classic signal integrity problem. I am not speking for the others, but I am sure we have all been there before [smile].
If you ever get a chance to take one of Dr. Howard Johnson's signal integrity seminars, then by all means do so! Visit www.signalintegrity.com for details.
There are are at least 6 phenomina that need to be understood before a problem like this can be resolved:
Ground Loops - What causes them and how to prevent them.
Differential Signals - How they reduce noise (as aggressors and as victims).
Decoupling - How to keep loading effects local to a circuit.
Impedance Matching - The effects of transmission lines (cables/wires) and how to maximize energy transfer (signal propogation) and minimize signal reflections.
Shielding - How and when to shield.
Filtering - Usually implemented only if the efforts in the above 5 fail to acheive results or if Radio Frequency Interference (RFI) / Electro-Magnetic Interference (EMI) effects are expected to become a problem.
I will see if I can find some time to make up some slides.
In the mean time, used 22AWG Twisted Pair wire (Red/Black preferred) for Power cabling and 22 AWG Shielded Twisted Pair wire for Signal cabling. Two twists per inch should be appropriate for this application.