Shop OBEX P1 Docs P2 Docs Learn Events
Help with noise spikes propagating through 5 feet of cable. — Parallax Forums

Help with noise spikes propagating through 5 feet of cable.

BitsBits Posts: 414
edited 2012-01-08 10:05 in General Discussion
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.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-12-05 10:40
    How are your grounds connected? What kind of on-board filtering do you have for the power and signal lines? Where do you have shielding?

    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.
  • BitsBits Posts: 414
    edited 2011-12-05 10:56
    Sorry for the crude drawing but here what is happening.


    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.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-12-05 11:33
    By filtering I meant capacitors, inductors, etc. Typically you need both large (as much as 100's of uF) and small (0.1uF) capacitors where the power comes into a board, then lots of 0.1uF ceramic capacitors on the board itself, typically next to each IC. I'm sure you have them, but where are they? The motor controller also needs the same kind of filtering. Where's that?

    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.
  • BitsBits Posts: 414
    edited 2011-12-05 11:46
    Okay, I have designed on the digital board two 680 uF electrolytic capacitors on the power input rail. Each IC has as you mentioned has a 1uF capacitor located as closely as possible.

    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?
  • davejamesdavejames Posts: 4,047
    edited 2011-12-05 11:50
    Bits wrote: »
    ...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?
  • BitsBits Posts: 414
    edited 2011-12-05 11:54
    davejames wrote: »
    ...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?
  • davejamesdavejames Posts: 4,047
    edited 2011-12-05 12:05
    ...only to take a look at the supply lines when the servo starts up.

    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.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-12-05 12:12
    You will need snubber diodes across the motor coils unless the motor drivers have them built-in.

    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.
  • BitsBits Posts: 414
    edited 2011-12-05 12:33
    davejames wrote: »
    ...only to take a look at the supply lines when the servo starts up.

    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.

    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.
    Mike Green wrote: »
    You will need snubber diodes across the motor coils unless the motor drivers have them built-in.

    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.

    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.
  • Spiral_72Spiral_72 Posts: 791
    edited 2011-12-05 12:58
    You should use a separate cable for your signal and motor controls. Keep the maximum distance possible between the two and try not to run them parallel. Use brainded shielded cable for the signal line


    Edit: Sorry that was a bit direct.. I typed up a much better and friendlier response previously, but the message disappeared :( and I don't remember what I said now.
  • ercoerco Posts: 20,261
    edited 2011-12-05 13:01
    Spiral_72 wrote: »
    Use brainded shielded cable for the signal line

    I don't have that type of cable, but I do work with a few brainded people! :)
  • BitsBits Posts: 414
    edited 2011-12-05 13:31
    Yea this is not helping. Thanks people for the help.

    I think ill need to do some deep thinking on this one. Its not an obvious problem.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-12-05 15:24
    Bits:
    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.
  • Beau SchwabeBeau Schwabe Posts: 6,569
    edited 2011-12-05 15:43
    Bits,

    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
  • LawsonLawson Posts: 870
    edited 2011-12-05 23:09
    Bits wrote: »
    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.

    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
  • BitsBits Posts: 414
    edited 2011-12-06 06:53
    - Cluso99
    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.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-12-07 00:17
    Bits: You should try shielded cables and earth just one end (the power supply end) and the other end should be earthed via a capacitor to avoid ground loops. I am thinking an 0.47uF might be a good choice, but it is so long ago when we had these problems in minicomputers.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-12-07 05:41
    Any chance of a photo of the setup? And a photo of those scope tracings (even if they are blurry).

    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.
  • BitsBits Posts: 414
    edited 2011-12-07 06:39
    Thanks again DR, and Clusso

    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.
  • BitsBits Posts: 414
    edited 2011-12-08 22:28
    Wanted to say thank you to everyone how helped me.

    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.
  • Beau SchwabeBeau Schwabe Posts: 6,569
    edited 2011-12-08 22:44
    Bits,

    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.
  • davejamesdavejames Posts: 4,047
    edited 2011-12-09 09:01
    ...could go differential drive/twisted pair for the length of the cable, and then convert to single-ended "back-in-the-box".

    That'll negate impressed interference and potential ground loop issues when using a foil/braid wrapped cable.
  • Paul RomskyPaul Romsky Posts: 66
    edited 2012-01-08 10:05
    Bits, et al,

    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.
Sign In or Register to comment.