Wednesday, March 20, 2013

The Diode, The Inductor, and The Kick

A lot of hobbyists are still wondering why  do people put a diode across an inductive load, such as relays and motors. Some simply put it without ever pondering, putting their trust to the circuit designer, while others learn it the hard way, perhaps after a few busted transistors or IC.

This blog will show you why putting a diode across an inductor is such a good idea, and some consequences you must be prepared to deal with if you decide not to put one.

 
Energy Storage Devices

We are all accustomed with the way capacitors store energy. If you subject a perfect capacitor with a step voltage change, the capacitor, for a short moment, acts like a short circuit. The capacitor, in effect, tries to suppress voltage changes across its terminal. It exhibits the characteristics of a constant voltage node. Once charged, the voltage (electrical energy) will stay forever (capacitor leakage resistance, finite insulation resistance, humidity, are all working againts this) even after the source is removed, unless something discharges it.
  
A perfect inductor, on the other hand, store electrical energy rather differently. If you apply a direct current through an inductor, it stores the energy by building up magnetic fields around its core. While the field builds up, it tries to keep the current flowing through it constant. The inductor essentially acts like a constant current node.

Now, things become very interesting if you suddenly disconnect the charging current source from the inductor. With the inductor struggling to keep the current constant and flowing for a brief moment after the current source is removed, try to imagine what happens during this brief moment…








Actual experiments.

Let us build the experimental setup shown in the hand drawn circuit in figure 1. In our experiment, we use a small NAIS 5V relay (TX2-5V)  as our inductor. Picking a relay as our inductive test load is not a random choice.  The circuit we are building is actually a one of the most common circuit you will likely to use in one of your projects, a relay driver circuit. In our setup, we monitor and record the waveform at the driven side of the inductor, which happens to be the collector node of our transistor driver circuit, using a HP 54820A digital oscilloscope. The base input, on the other hand, is driven by a HP3325A Function Generator set to output a 2.8Vpeak (open circuit) square wave through its 50 ohm output.

Figure 1. Relay Inductive Kick test circuit.
Figure 2. parts used in the experiment.
 
                                                              
With the circuit configuration shown, the transistor is operated to function as a switch; it turns ON when the pulse generator output goes high (2.8V), and OFF otherwise. A high voltage 2SC2688 transistor is used for reasons that you will see later in our experiment. Let us now apply the 5V power to the circuit and see what goes on in our test point.

Figure 3.Captured waveform with the oscilloscope vertical set at 10V/div. Horizontal timebase is set at 50mS/div, and the transistor is switched at 10Hz rate during this test.
The transistor is alternately switched ON and OFF by the function generator at 10Hz rate. When the transistor is OFF, a full 5V appears across the transistor’s Vce. When the transistor is ON, Vce drops to 0V. Of course, the ON voltage will not be exactly zero, but is small enough to be ignored for the purposes of our discussion.

Note the appearance of narrow spikes (whimsically nicknamed inductive kick) during the ON to OFF transition. The oscilloscope saw this occurring with 71.5V peak, but we see waveform peaks going all the way to the upper boundary of the display window. This indicates we have not seen the peak yet! The peak voltage is probably much higher than what the oscilloscope believe it to be.Let us change the oscilloscope vertical setting a notch higher until we see the peak displayed below the window boundary.

Figure 4.Even when the oscilloscope vertical sensitivity reached its maximum settings, we still do not see the spike’s summit!

As it turned out, we reached the oscilloscope vertical maximum setting of 50V/div, but not the spike’s peak! The oscilloscope already displays a 400Vpeak spikes, and we are not at the spike’s summit yet. Although I did expect this to happen, still it made me quite nervous. I knew all too well my probes (HP 10400A 10:1) can only safely probe signals up to 450V peak. But I am less worried about the prospect of my 10,000 peso probe getting zapped. It is the oscilloscope. If this voltage ever manage to pass through the probe and get into my oscilloscope, my $$,$$$ scope is history!

Figure 5.I put my oscilloscope at risk to capture a more detailed waveform image of the spike. This waveform is acquired at 10uS/div horizontal sweep to get more details. The oscilloscope shows the spike peaking at 400V, but we know better, it is definitely more than that.
Figure 6. Everytime the transistor switches OFF, the relay, for a brief moment, would stress the transistor with a high voltage. If the transistor is not made to withstand voltage this high, it will die quickly.

At this point, it should be very clear to us what are we up against to whenever we switch ON and OFF a relay, or an inductive load. The relay transforms into a >400V source for a brief moment. It is not hard to imagine what this could have done to our transistor driver if we used one with a low voltage rating. That transistor would have been fried really good after just a few switching cycles.

It seems incredible and almost magical, a >400V appearing in a circuit with just a 5V supply. And how could that happen? Remember, the inductor essentially acts like a constant current node. If the charging current is suddenly disconnected, it will try to keep the current flowing through the open circuit. An open circuit corresponds to an extremely high resistance, in fact, it is infinite in theory. Ohms Law V=I*R clearly states that a very high voltage must develop across the coil during that brief moment some current managed to flow through the extremely high resistance node.





101 problems and 1 simple solution

You might be tempted to say, by all means, let us use high voltage transistor drivers, and so we can forget about these spikes. Not quite. If we let our circuit generate spikes like that, we are in for an avalanche of troubles not everyone will be happy to face. For example, the high voltage spikes, which can go higher than 1000V without even trying, can breach the PCB insulation and simply jump over to adjacent traces trigerring more troubles. It can even joy ride through your power supply rails, causing circuit latch ups, program crashes, and score of other troubles just waiting for this opportunity to pop up. How many times have you experienced crashes occurring in your microcontroller circuit every time it switches a (highly inductive) load?

Suppressing the high voltage spike is the better way of tackling this problem. And the solution is surprisingly simple and cheap – Add a diode across the inductive load. With a diode connected like that shown in Figure 7, a low impedance discharge path now exists during the OFF transition, preventing the voltage across the inductor from building up, while it remains invisible to the driving transistor. Figure 8 illustrates the significant improvement we made after a diode is installed. High voltage spikes altogether disappeared, with peak now hovering just near 7V.

By the way, a diode used this way got its own fancy name: it is called a Snubber Diode.

Figure 7. One diode is all that is needed to suppress the high voltage spikes.
Figure 8. High voltage spikes disappeared after the diode is installed. With spikes gone, low voltage transistors can now be used to drive the relay.
 Selecting a Snubber Diode

There are at least three diode parameters you must check in selecting for the snubber diode suited for a job:
  • Determine the appropriate PIV rating. It must greater than the maximum voltage you expect to be impressed across the inductive load. For example, if the relay has a 24V coil, select a diode with a PIV rating greater than 24V. A 50V diode will be a good choice.
  • Determine the required current rating. The inductor peak current could be several order in magnitude higher than the average current, so make sure you pick one capable of handling the peak current.
  • Determine the required speed. If the inductor is to be switched at a fast rate, such as in PWM circuits, a fast/ultrafast diode or a schottky device must me used.
Relays are seldom driven with switching rate higher than 5Hz (you will wear it out quickly if you do). This fact makes diode speed less of a factor when selecting one for a relay driver circuit. Furthermore, small relays used in electronics circuits uses a minimal amount of coil current to operate. It will be OK then to just use a 1N4004-1N4007 rectifier (1A, 400-700 PIV) and skip the selection details.

As a final note, you should be aware that a snubber diode can extend the turn off time of a relay. In most cases, this can be ignored. But be wise and keep this in mind, just in case you run into applications where this behavior can have a significant say.

No comments:

Post a Comment