The MOSFET Active Clamp: The Case Against a Relay’s Parallel Flyback Diode

Return to the Industrial Control and Automation Index

Installing a flyback diode across the coil of a relay is a common practice. In fact, manufacturers often integrate the diode into the relay socket or occasionally into the relay package itself. This near-universal practice is proof that the solution is practical and reliable. Despite this fact, the flyback diode is not an ideal solution. We can do better in terms of relay opening speed.

In this article we explore the limitations of the flyback diode and present a fast-inductive discharge circuit featuring an active clamp MOSFET. This provides faster relay opening by quickly dissipating the inductor’s magnetic field with a corresponding increase in physical contact velocity. This has the potential to improve the lifespan and performance of industrial control systems by reducing the arcing associated with opening relay contacts.

While this article is focused on theory and hands-on learning using discrete components, integrated solutions are available. One such example, and the inspiration for this article, is the Maxim MAX14912 industrial-speed switch. With the adoption of these components, we may expect a future where Programmable Logic Controller (PLC) manufacturers will advise against the common flyback diode.

Before diving in, I encourage you to read the supporting articles listed below to provide the necessary context. They present the prerequisite information concerning the nature of relay opening, closing, and the relationship to the inductive L/R time constant.

Review

In the previous articles we explored the time delay nature of opening and closing electromechanical relays. As suggested in those articles, relay action is dominated by the time constant associated with the coil’s inductance. To activate a relay, the magnetic field must be established. Likewise, to deactivate a relay, the magnetic field must collapse. The response is governed by the equation:

\tau = \dfrac{L}{R}

Where L is the inductance of the coil and R includes both the coil’s intrinsic resistance plus the addition of external resistance.

There is an implicit voltage dependency associated with the relay’s L/R time constant. Observe that:

  • V_{Applied} = V_{Relay} + (I_{Relay} \ x\ R_{External})

  • V_{Flyback} \approx I_{Relay} \ x \ R_{External}

For example, consider a relay designed for a 24 VDC system with a 500 Ω coil. Assuming an L/2R system, the circuit will include a 500 Ω external resistance and require a 48 VDC source. The additional 500 Ω external resistance approximately doubles the speed of the magnetic field expansion significantly increasing the relay’s close speed.

A similar situation exists for relay deactivation. Here, the added resistance in series with the flyback diode leads to faster collapse of the magnetic field and a corresponding increase in the relay’s opening speed.

Note that the previous articles ended on a disappointing note. For the chosen industrial relay, the inductive time constants match the theory. However, the apparent speed at which the contacts move did not change. The time in flight (time for the SPDT contacts to change state) and the bounce time were essentially constant. However, things are different for the experiment outlined in this article. We demonstrate a fast discharge of the relay’s magnetic field as well as increased speed of the contacts using a MOSFET active clamp circuit.

Active MOSFET Clamp

The test circuit is pictured in Figure 1, with the corresponding schematic as Figure 2. At first glance, the circuit may appear to be over engineered. After all, a low-side MOSFET with the relay connected to its drain could have been used to activate the relay. With that said, let’s analyze the circuit:

  • The Arduino Nano Every is optically coupled into the drive circuit. This provides a measure of safety. This is especially true as we breadboard a circuit with high voltage spikes. The optical isolation also isolated the grounds thereby separating the Arduino and driving PC from the experiment.

  • Transistors Q1 and Q2 function as level shifters. They take the ground referenced command signal above and beyond the 24 VDC rail. This is necessary as the gate of the high-side MOSFET must be driven to about 10 VDC above the 24 VDC rail.

  • The charge pump provides voltage for the MOSFET gate via transistor Q2.

  • The relay itself is driven by MOSFET Q3.

  • The circuitry on the right-hand side allows us to monitor the relay’s Normally Open (N.O.) and Normally Closed (N.C.) contacts.

The system we just described is unremarkable. While complex, the A to B to C to D activation follows from the Arduino all the way to the relay’s coil. The purpose becomes clear when we notice that there is no flyback diode. This is no mistake as the diode is not required.

Figure 1: Picture of the demonstration circuit. From left to right: charge pump, level shifter, and MOSFET with active clamp.

Figure 2: Relay driver schematic featuring a high-side MOSFET driver with an active clamp.

Tech Tip: Many MOSFETs include a body diode with current handling capacity on par with the active MOSFET channel. For an N-channel MOSFET, this diode “points” up with anode connected to source and cathode to the MOSFET drain.

You may be tempted to conclude that the flyback diode is not required because the function is performed by the MOSFET body diode. This is not the case as the polarity is wrong. In fact, the MOSFET body diode is never forward biased in this system.

Perhaps you are familiar with low-side drivers for relays. When the relay is turned off, we expect a positive voltage spike. Not so with a high-side driver. Instead, we see the flyback voltage as a negative spike when measured from the source of the MOSFET to ground. Visualizing this negative spike is essential to understanding the operation of the MOSFET clamp.

Let’s assume that Q2 has just been turned off. From a circuit analysis perspective everything to the left of R8 is removed. There is energy in the relay coil and the voltage on the source of the MOSFET is quickly headed negative relative to ground. This will continue until the active clamp consisting of diodes D3 and D6 activate. Conduction occurs near 100 VDC with the activation of the Zener diode D6.

At this point the gate of the MOSFET stops moving. The MOSFET starts to conduct when V_{GS} is once again positive. In fact, we have just formed a feedback loop that maintains a constant voltage for V_{DS}. In this example, the voltage across the MOSFET of approximately equal to the Zener diode voltage.

From this analysis, we see that the flyback diode along with any resistance for reducing L/R time constant is no longer necessary. Instead, the MOSFET serves the function of all three components. It serves as the relay driver, variable resistor, and flyback diode that clamps the relay’s flyback voltage.

Note that this circuit concerned with improving relay deactivation. It does nothing to improve the activation speed which is complete dominated by the relay’s intrinsic L/R time constant.

Results

The results shown in Figure 3 use the same basic setup as introduced in the previous articles. There are three panels:

  • Upper: The orange trace (CH 1) is the relay activation voltage as measured at the source of MOSFET Q2. The blue trace (CH 2) is the relay current as measured across the R10 shunt resistor.

  • Middle: The blue trace (CH 2) is the voltage as measured on the relay’s N.C. contact. This N.C. contact is transitioning back to closed.

  • Lower: The blue trace (CH 2) is the voltage as measured on the relays N.O. contact. Recall that we are deenergizing the relay. The N.O. contact is transitioning back to open.

Figure 3: Deactivation waveforms for the relay including the coil’s current, normally closed, and normally open contacts.

Based on the Figure 3 data we observe:

  • the armature movement is first observed at 2 ms when the N.O. contact toggles.

  • there is a 0.9 ms time of flight from 1.9 to 2.8 ms. In this “flight time” neither the N.0. nor the N.C. contacts are connected to the circuit.

  • first contact with the N.C. contact occurs at 2.8 ms.

  • the contacts bounce for 7.2 ms starting at 2.8 ms extending to 10 ms.

These are the best results recorded from all the previously conducted experiment. The first observed movement at 1.9 ms is very good as is the flight time of 0.9 ms. However, the bounce time has significantly increased. This is nearly double the time observed in the previous tests.

While this increased settling time for the relay is generally undesirable, it is a good result. It is a real indication that the contacts are moving with increased velocity. Like the basketball analogy mentioned in the earlier article, a ball with increased kinetic energy will bounce higher for an extended period. That appears to be the case with the contacts in this example.

Interpretation of Results

As mentioned, many times in this series of articles, the coil’s L/R time constant is the dominant factor for relay activation and deactivation time. To better understand the operation of the MOSFET active clamp the relay was replaced with a Hammond 30 H inductor. The results are captured in Figure 4.

Figure 4: Graphic showing the MOSFET active clamp demagnetizing a large inductor demonstrating a time varying resistance of the MOSFET.

Tech Tip: Graphics such as Figure 4 display ringing in the voltage waveform. This is typical for circuit that include both inductive and capacitive elements. The reactive components include the relay coils inductance, intrinsic wire-to-wire capacitance, and the energy stored in the C1 / R11 snubber.

The clamping action is shown in the orange (CH 1) trace. We see that the MOSFET’s source to ground voltage is held at approximately 78 VDC. When we include the 24 VDC rail, the MOSFET V_{GS} is about 100 VDC. The inductor’s current is shown as the blue (CH 2) trace.

This trace is not what we intuitively expected. It does not follow the exponential curve associated with a RC or RL circuit. The reason is that the resistance is not a constant in this circuit. Instead, we see that the resistance increase as time progresses. When we consider the time constant equation, we see that \tau is reduced faster with the active clamp than it would be for a fixed resistor:

\tau = \dfrac{L}{R_{increasing}}

The energy in the relay’s magnetic field is therefore transferred to the MOSFET and dissipated as heat. The calculated resistances included in Figure 4 represent the active V_{DS} resistance of the MOSFET at each point in time. For example, the calculation for the red line is:

R_{MOSFET} = \dfrac{V_{DS}}{I} = \dfrac{24 - (-78)}{0.035} = 2.9\ k\Omega

Once again, note that increased resistance is desirable to shorten the time constant. However, this must be balanced against the design maximum voltage of the relay’s driver. In the Figure 2 schematic, the component under the greatest amount of stress is Q2 PNP transistor. The transistor’s V_{CE} is subject to nearly 115 VDC which is approaching the transistor’s design maximum voltage of 150 VDC.

Conclusion

The circuit presented in this article is not optimized. Rather, it was quickly assembled from readily available components. I trust it has served its purpose and given you a starting point from which to build your own circuits. It’s a circuit you could build to continue the experiment. The first circuit element to improve is the charge pump. Additional current plus a more robust level shifter would provide a lower impedance drive to the MOSFET.

As mentioned at the beginning of this note, there are driver ICs that implement this function in an elegant package. This also includes current limiting and MOSFET heating detection circuits that are not address in this article. An example is the MAX14912, which provides eight such drivers in a tiny 56-QFN package. This part is designed for operation with the 24 VDC rail common to many industrial control systems.

Your comments and feedback are welcome.

Best Wishes,

APDahlen

Return to the Industrial Control and Automation Index