tracking down / dealing with voltage spikes

Discussion in 'The Projects Forum' started by ebeowulf17, Aug 24, 2014.

  1. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    The following questions are all related to a hall effect sensor and comparator circuit that I'm working on as part of a new machine interface. Some previous questions of mine were dealt with in this thread:
    http://forum.allaboutcircuits.com/showthread.php?t=100400

    The issues I'm dealing with now appear to be voltage spikes related to solenoid coils and motor windings. The machine that this new circuit is being added to has a 240VAC power system and a power board/CPU with built in power supply that runs internally on 5VDC, along with various low voltage I/O pieces (if all goes well, my new circuit would be one of those inputs.) The high and low voltage systems share a common ground, which is tied to the chassis. In theory, the 240VAC solenoids and motors seem like they should be fairly well isolated from the low voltage stuff, but we see evidence of spikes quite often when motors or valves turn on (interestingly, it is when they turn ON, not OFF - I've already learned some ways to deal with field-collapse induced spikes, but don't know what would be happening when these devices are first energized.) Here is a rough diagram of the related components of the regular machine:

    https://drive.google.com/file/d/0B21hjJ3dWyi7Q0lKcnhRbEVPT1U/edit?usp=sharing (block diagram of relevant machine parts)

    The existing machine, prior to the addition of my prototype circuits, works just fine, but if you watch closely, you can see tiny blinks on the 5VDC indicator lights for all of our switching circuits (the light should be on only when the switched 5VDC signal for activating solenoids is present) when motors, or sometimes solenoid coils, are engaged. After adding my new circuit, we found that it occasionally returns a false trigger signal when a motor is turned on. I've played with changing capacitor values and improved immunity to this noise, but it's all just trial and error - I have no idea how to calculate what I really need. Here's the base version of the new circuit:

    https://drive.google.com/file/d/0B21hjJ3dWyi7dVVJcy02LXNJOHM/edit?usp=sharing (hall effect/comparator circuit)

    I imagine an oscilloscope (and the knowledge to properly use it) would help a lot with understanding the nature of these spikes, but I'm out of luck there. I've tried using a DMM to watch for voltage variations on the +5 or ground lines, and also tried setting up an Arduino as a high-sample-rate voltage meter with min/max/avg tracking for the same purpose, but had no luck with either.

    So the main questions are:
    1) Is there a good way to determine why motors and coils are adding so much noise to low-votage circuits that are meant to be isolated?
    2) What, if anything, can be done to reduce this noise?
    3) If the noise can't be reduced enough, how can I determine the best noise filtering to add to my new circuit to make it more immune?

    The circuit as drawn above is using a cap to protect the comparator IC exactly as directed in the comparator documentation, but it doesn't seem to provide enough protection. Just experimenting, I added another cap of the same value across the +5VDC and ground inputs to the circuit. Even with that, the LEDs I have on the outputs flicker a tiny bit sometimes, but the signal is weak or short enough that it doesn't seem to trigger the input on the CPU that the output is connected to. It feels like I could just keep adding more/higher value capacitors until I see no flicker and then test that everything else still works as intended, but I'd rather know what I'm doing!

    Do I need to better understand the nature of the noise/spike before figuring out how to fight it, or are there generic/universal solutions beyond what my comparator spec sheet called for?

    Also, is it likely that the spikes are induced voltage on the ground side (as opposed to the +5 side) and, if so, would different grounding schemes help us out? Should the 5V system just have + and - sides, with no connection to earth ground? Or, could it be that we just need each component to have a unique path all the way to the best quality ground point (where the power cord enters the machine) instead of each component just tying into ground wires and/or the grounded chassis wherever it's convenient.

    I'm really sorry this is so long winded - I was just trying to explain everything I've got to go on so far. I have so much to learn in the realm of electronics, but I really want to get this thing right!

    Thanks in advance!
    -Eric
     
  2. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    Oh, just came across the bit about connecting to mains without a transformer, so here's a little clarification on high/low voltage safety in this design:

    1) The power board/micro-controller shown on my diagram is a professionally made, UL listed board with an off the shelf, transformer-based, 5VDC supply integrated onto the main board with stand-offs and soldered posts.
    2) The other high-voltage to low-voltage junctions are all opto-isolated.
    3) The new circuit I'm designing to add to this design makes no new connections with the high voltage side.
     
  3. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Can you please attach (using forum attachments) the schematic? Your links to some google file service just give me java errors.

    Generally if your PSU design is good then motors and things switching on should not affect your +5v DC rail at all.

    A photo of the wiring layout will also help because you might have inductive coupling between wires that run close to each other.
     
  4. alfacliff

    Well-Known Member

    Dec 13, 2013
    2,449
    428
    also since you are using a hall effect sensor, the magnetic surges from the motor and solenoids could be falsing the hall effect sensor could you magneticly shield the sensor from such devices?
     
  5. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    Sorry about the weird google links!

    Here's the rough block diagram of overall machine flow:
    motor-solenoid_noise.jpg

    And here's the schematic for the new circuit I'm trying to add:
    Hall-Comparator_V2_schematic_lo-res.jpg

    I don't have a detailed schematic for the power board/micro-controller itself, but I'll see what I can do for wiring pics.
     
  6. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    I spent half my working life dealing with these issues. 90% of these problems are caused by ground loop currents (not inductive or capacitive coupling between adjacent wiring).

    You really have to learn about single-point-grounds between the low-level control circuitry and the inductive load currents...
     
    ebeowulf17 likes this.
  7. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,281
    1,232
    Noise can be hard to pin down especially without a scope. But from what you say towards the end it sounds like it is coming in on the supply. Here are a couple of things you can try:
    If you can find the 5 volt regulator in the machine and the filter cap on it's output, use the +/- side of that cap as the ground and +5 to your board. Twist these 2 wires as you run them to your board.
    At the input of your board add like a 10 ufd. electrolytic cap and a .1 ufd. ceramic.
    At the voltage dividers where you generate your references add a .1 or so ceramic from +5 to ground.
     
    ebeowulf17 likes this.
  8. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,500
    2,366
    ebeowulf17 likes this.
  9. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    Thanks for the help!

    Ronv, your advice on filter caps to add to my circuit perfectly matches what some Analog Devices thermocouple ICs I hooked up last year called for. I'm guessing that it's a pretty reasonable starting point for low voltage power conditioning in general? Either way, thanks for the tips. Through sheer luck, I still have extras of everything from that thermocouple project, so I have the parts on hand already to add to my current project! I'll try it out ASAP, hopefully tomorrow.

    And I look forward to reading the [somewhat daunting at first] Siemens paper linked above. I'm afraid this probably isn't the time for us to make fundamental changes to how we wire the whole machine, so I may not get immediate benefit from it, but hopefully I can learn what I need to now (and maybe even try some changes on our in-house R&D machine) so that I'm ready when the time comes for re-designs.

    For now, I'm just going to focus on getting this new circuit to work in the existing machine, unless there turns out to be an easier-than-expected solution to stopping the noise at its source.
     
  10. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    I would look at replacing your analogue hall sensor and circuit with a readymade hall switch. That has the hysteresis built in and will provide a good reliable signal (it eliminates any issues with your comparator circuit).

    The other issues might be on your power board/microcontroller. Is that an off the shelf PCB? It has AC mains and 5v systems on the one PCB which can be a big cause of noise issues. A photo of the PCB would help.

    And your opto solid state switch to switch the solenoid should be a zero crossing type, not random firing type. That should eliminate issues when the solenoid turns on.
     
  11. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    We're looking at hall switch options too. We need to get two separate outputs based on whether the magnet moves left or right of the sensor, so it would take two separate hall switches to do what one sensor and a dual comparator do. The bigger problem is consistency - assuming the published specs can be trusted, the SS494B I'm currently experimenting with is far more stable and accurate than any of the hall switches I've looked at. As an example, the last hall switch considered was designed to trip at 85 Gauss, but might trip with as little as 35 or require as much as 135 to trip. These numbers might work for a simple yes/no "is the magnet anywhere remotely close" scenario, but for any kind of useful position detection, we need far tighter tolerances. Any recommendations on tight, consistent hall switches would be appreciated. So far we haven't found anything even close to our sensor/comparator combo (which does seem rather strange - hopefully we're just looking in the wrong places!)
     
  12. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    Oh, thanks for bringing up zero-crossing. Totally forgot about that. Not sure if our current components work that way or not, but I'll look into it for sure.
     
  13. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    I use honeywell SS441 on my CNC machine, no problem detecting position to (close to) 0.01 mm resolution when moving at a slow controlled rate.
     
  14. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    Still lots of work ahead, but here's an update:

    Regarding the noise source (motors switching on) I just discovered that a modified version of this system that we make for Australia does not have the apparent noise spikes (or at least they're not bad enough to create a visible blip on the LEDs.) The wiring differences are:

    1) A fairly large capacitor right at the main AC input to the machine, required by law there to protect building wiring from noise introduced by appliances.
    2) Instead of the motor being switched by a DPDT relay, it's switched by an SSR on L1 (hot leg) which leaves "L2" (neutral on their power system) connected at all times.

    So either the capacitor, the solid-state switching instead of arcing relay, or the continuous neutral connection seems to be preventing the motor switching noise from reaching a problematic level in the rest of the machine. I intend to systematically test each possibility by trying the changes individually on our R&D machine to see which individual change (or combination of changes) it takes to subdue the noise. Not sure when I'll have time (we're very busy with production demands, so R&D is somewhat on the back-burner right now) but I'll try it as soon as I can.

    On the other side of things (making my low voltage circuit more immune to the whatever noise is present) I also have two developments:
    1) I tried adding the two caps on the 5VDC input side of my board that RonV recommended and it made a big difference. I couldn't get any significant false signals out of my board, although I did still get a very rare flicker on one or both of its indicator LEDs. I'd feel more comfortable with no flickers at all, but the caps definitely made a huge improvement.
    2) Although I'm only about halfway through the Siemens paper, I did try a preliminary experiment with my grounding scheme. The original setup was grounded with a ring terminal screwed to the stainless steel chassis at the point nearest the PCB mounting. I disconnected that ground and replaced it with a wire all the way back to the grounding post where the main power cord (and building ground) enter the machine. Although I haven't had time to test it as thoroughly as I'd like, I've not been able to get any false signals or flickers out of it so far (even without the extra two capacitors mentioned above.) It appears that simply moving the ground connection to the earliest, best point might eliminate my circuit's susceptibility to noise from the motors starting.

    In the current machine setup, the solenoid switch circuits (which include the indicator LEDs I keep watching) also pick up their grounds from nearby chassis points. I plan to try running some of their grounds all the way back to the primary ground post as well and see if that protects them the way it appeared to protect my new prototype circuit.

    Thanks to everyone who's helped!. I'll update further when I get more tests completed, but I was too excited about the progress so far to wait!
     
  15. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    Tested two of the three differences from the noise-free, Australian version of our machine on a standard unit:
    1) Leaving L2 unswitched didn't eliminate noise.
    2) Adding the big capacitor across the main inputs didn't eliminate noise.

    So, presumably it's the use of an SSR instead of a relay that's reducing/eliminating noise spikes in our machine. Not sure whether to think that the relay itself is what's introducing the noise, or if it's motor noise that passes through the relay, but doesn't make it through an SSR.
     
  16. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,281
    1,232
    It may be the relay making the noise because it is arcing. This can often be reduced with what is known as a snubber. For AC it is usually a fairly large capacitor and a series resistor placed across the relay contacts or the motor. The capacitor should be what is called AC rated so it is safe across the line voltage. The SCR of course has no arc and turns off when the voltage passes thru 0. Usually it will be worse when the relay opens rather than closing.
     
  17. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    That certainly sounds right to me... although the LED flash we see definitely happens right when the motor kicks on. Any advice on how to size a snubber? We're switching power to a Marathon Electric 240VAC 1/3HP carbonator pump motor that draws around 2 amps when running, although I have no idea what the initial current draw is when starting.
     
  18. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,281
    1,232
  19. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    Awesome! Expensive yes, but if it solves our noise problem, it might be worth it. If we can do one across the motor leads (as opposed to two per motor, one across each relay contact) then the relay plus snubber would still be cheaper than even one SSR per motor, much less two.

    ...and in a lucky coincidence I've just now discovered that we already have that exact snubber on hand. They were used in an older version of our machine. I've wired one in parallel with each of the three motors on our R&D machine and the spikes are almost completely gone! We'll have to do some more testing and think about costs, but this may well be our noise solution. Thanks!
     
  20. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,281
    1,232
    Just to try and make sure we are not just treating symptoms, can you draw how the grounds are wired? Just the major blocks would do. In other words; any place ground is moved from one assembly to another. This should include frame ground, +5 ground, sensor ground,and board being driven by the circuit.
     
Loading...