Square wave noise filter

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
Marcaroni
Posts: 13
Joined: Fri Jun 06, 2008 1:29 pm
Contact:

Square wave noise filter

Post by Marcaroni »

Hello everyone,
I'm in a bit over my head on my first "non-kit" project.
I'm using an Atmel UC3B (http://www.atmel.com/dyn/resources/prod ... 32059S.pdf) to produce 4 independent PWM signals. At this point it seems to be working perfect. I run those PWM output signals through IRL640 N-Channel Mosfet (http://www.mouser.com/catalog/specsheets/91305irl.pdf) to beef up the signal enough to drive some proportional solenoid valves (http://www.sensortechnics.com/download/md-pro-253.pdf). When I scope the signal coming off the UC3B I'm getting a beautiful 5V PWM square wave. But once the signal goes through the 640's I'm getting massive voltage spikes of about 50V. When I modulate one PWM channel the remaining 3 seem to react slightly to that change as well. I verified this interference with my scope. This is causing stability problems in my application. I'm assuming this cross channel interference is the result of the huge voltage spikes, but I don't know how to figure that out for sure. Despite these issues, the system actually functions surprisingly well (just some fine tuning problems). My best guess is the valve coils are the source of the "issue" but I don't know how to resolve that. I'm guessing this is a common "problem" but my electronics theory is still too weak to resolve it on my own. Any advice would be appreciated. If needed, I can provide schematics, pictures of my o-scope tests or anything else that might help narrow it down.

thanks for your time,
marcaroni
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Re: Square wave noise filter

Post by MrAl »

Hi there Marcaroni,


You are right in that this is a very common problem...but luckily it is also easily solved.

What is happening is the coils in the devices are creating an inductive kickback and that
kickback is what generates the voltage spike. It's full of high harmonics too so it can
easily interfere with local circuits.

The solution is to connect a diode across the device that has a coil in it, in reverse
polarity to what the drive signal is. I assume that you have the source of your MOSFETs
grounded, so that would mean you connect a diode across the coil with the ANODE
connected to the drain of the MOSFET, and the CATHODE to the positive supply
voltage. This diode should be across the coil itself.

That solution is the typical solution, but it does have one drawback. That drawback is
that if the circuit has to switch on and off rapidly then the diode will cause the coil's
energy to dissipate too slowly (due to the physics of the coil) and so it will not be
dissipated completely before the next turn on cycle. The solution then is to connect
a resistor in series with the diode so that the energy dissipates more rapidly, or a zener
so that the voltage across the coil is higher than that with just a single diode. This works
because the energy dissipates faster with higher reverse voltages. The drawback to this
new 'fix' however is that the voltage that appears across the MOSFET will now be higher
than it was before, so a tradeoff has to be made where the dissipating voltage across
the coil is higher than with a single diode but is still low enough so that when it adds
to the supply voltage it is still not above the MOSFET max voltage rating. The voltage
that appears across the MOSFET will be the zener (or resistor) voltage plus the supply
voltage, so if you have a 12v supply for example and a zener of 10v the max voltage
across the MOSFET will be simply 22v. Obviously the MOSFET has to have a rating
that can handle that voltage but even better a little higher.
The zener is probably a better fix than a resistor too as it's voltage drop is more
predictable and reliable over time.

You'll need one of these clamps (these circuits are called 'Clamps') per coil.

In the worst situations a snubber is also needed, but that's a bit rare. Try to keep the
lines to the coil as short as possible though.


Image
LEDs vs Bulbs, LEDs are winning.
Marcaroni
Posts: 13
Joined: Fri Jun 06, 2008 1:29 pm
Contact:

Re: Square wave noise filter

Post by Marcaroni »

Hi MrAl, I appreciate the super fast response.
I had some 1N4003's laying around to test it. Initial testing shows the spike is definitely gone. All I did was clip the 1N4003's across the valve leads. Below 15% PWM there's a small "kink" in the wave form on the low cycle. I'm sorry I can't explain it better than that, I'm still working on my terminology. I was going to try to post some pictures of it real quick but my camera needs charging. I don't think it's actually a problem though, more of a curiosity for me. Before applying this fix those valves would buzz like a swarm of bees. Now they've just got a soft hum. I'm hoping that's a good thing but I won't know for sure until I try to actually run some fluid through them.
I didn't try the version with the zener. I don't think it's necessary (I hope). The PWM is running at 180Hz. That's not what you'd consider "rapid," correct?
Overall I'm going to call it a success. Thank you very much for your effort.
Marcaroni
Posts: 13
Joined: Fri Jun 06, 2008 1:29 pm
Contact:

Re: Square wave noise filter

Post by Marcaroni »

Just another follow up. I made the diode mod, reassembled the entire system and tested all the valves with actual fluid. The difference is much more dramatic than I expected. The valves are much more obedient now. I'm seeing a huge increase in stability. Unfortunately for me, my software needs to be overhauled to match the new (proper) performance curves of the valves.
Thanks again for your help.
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Re: Square wave noise filter

Post by MrAl »

Hi again,


Oh you're welcome. I hope you have better luck with your circuit now.

I have updated the drawing now too to show yet another fix, where the frequency is higher and
the coil current is higher too. It involves several diodes in series to take the place of a zener.
This kind of fix is good when the current is a bit too high for a regular zener and since it uses
only diodes a high power zener is not required, which is usually a good idea. Higher current
diodes are too expensive yet the voltage drop is higher which means faster switching is
possible.

What i also did not mention yet is that the diode(s) in any of these fixes should be able to handle at least as
much current as the coil does during normal operation. The 1N400x series diodes are good for up to 1 amp.

Image
LEDs vs Bulbs, LEDs are winning.
Post Reply

Who is online

Users browsing this forum: No registered users and 62 guests