Discussions
Analog Outputs with Oomph - Printable Version

+- Discussions (https://lawsonlabs.com/bboard)
+-- Forum: Lawson Labs Products (https://lawsonlabs.com/bboard/forumdisplay.php?fid=1)
+--- Forum: Start Here (https://lawsonlabs.com/bboard/forumdisplay.php?fid=2)
+--- Thread: Analog Outputs with Oomph (/showthread.php?tid=23)



Analog Outputs with Oomph - Tom - 05-17-2021

Here, we are moving on from buffered digital outputs to buffered analog outputs. Analog outputs require quite a bit more circuitry in order to provide the necessary power and reliability. Since analog outputs are often used to power heaters or motors or other controls within feedback loops, they should be monotonic. That means the output should always go up when instructed to increase, and go down when instructed to decrease. If there is a non-monotonic wrinkle in the response, the feedback loop will likely find it, and will tend to get stuck at that point, because non-monotonicity will cause positive feedback.

Proportional controls need to handle a wide range of supply voltages efficiently, and must survive the voltage and current spikes associated with switching inductive loads like valves, motors and many heaters. With precision analog circuitry physically near by, it is also critical that the proportional outputs not generate large amounts of electrical noise or too much heat. Purely analog proportional control involves dissipating a large amount of heat. That means switching techniques are usually preferred instead. Switched power, done right, can be very efficient, but care must be taken to limit radiated electrical noise. The list of requirements already goes far beyond that for the previously discussed digital outputs. 

The voltage dropped across a bipolar transistor when turned all the way on causes a lot of heat at higher currents. That means the bipolar transistors we used in the previous digital output discussion are not best for analog outputs. Modern FETs are small and affordable, and they have tiny on resistances, measured in milliohms. That means they have very small voltage drops when on, even at higher currents, so they stay cool. The trick is to turn them on and off at a relatively fast rate, so that they appear to be in an intermediate steady state. That technique is called Pulse Width Modulation, or PWM. For example, if the FET Turns on and off for alternate equal periods, it will run the load at half the maximum current. With the frequency held constant, the on time, or pulse width, becomes the controlling factor.

Generally, you would prefer the switching frequency be outside of the audible range, or above 20 kHz (corresponding to a base period less than 50 us). If the FET takes very long to turn on or off, at 20 kHz it will spend a high percentage of the time partially on. That is not good for efficiency. The FET dissipates almost no power when it is all the way on, or all the off, but in between there is both current flow and substantial voltage across the switch. Volts times amps equals Watts, so the FET heats during the switching action. That inefficiency contributes to what is called switching loss. Faster control brings faster switching and lower losses.

Because it takes a certain minimum amount of time to turn a switch on, and again a minimum time to turn the switch off, you usually cannot have a super-small duty cycle, like a small fraction of one percent. If it takes at least 1 us to turn on and off, the minimum duty cycle at 20 kHz would be near 2%. The same applies at the other end of the scale. You can have a 100% duty cycle, but not 99.99% unless the base period for your PWM is impractically long.

As with higher current digital outputs, isolation is a good idea to separate high current paths from sensitive analog circuitry. As in the digital case, an optocoupler is the usual isolation means. Conveniently, because the FET is either on or off, a single bit of digital information serves to isolate a PWM analog output, but one issue quickly shows itself. Optocouplers are slow switching devices. You can't just run a FET from an optocoupler without having the switching losses go through the roof. The optocoupler output has to be the input for a circuit that pulls the gate of the FET up or down hard and fast. In order to rapidly slew the capacitance of the gate, a rather high peak current is required. So, to switch efficiently, you need to pull up or down fast, but not both at same time, and you need to be sure you don't let the gate of the FET spend any time in an indeterminate state. If the FET is left half on, half off, it will self-destruct before you can reach the power switch.

When you have optical isolation, you need a separate power supply on the isolated side. For these proportional output circuits, the isolated side power supply could be 48 volts or 8 volts, or anything in between. Different power FETs have different gate drive requirements, but all perform best when the gate voltage is switching between particular levels. That means you need the regulate that 8 to 48 volts to produce the desired gate drive voltages. All around, those driver circuits need careful attention. Don't try them at home without some prior experience with simpler interfacing.

The Lawson Labs PDr4 is just such a device. It includes a PWM interface to turn a low current analog input voltage into a PWM duty cycle, an optocoupler for isolation, a regulator to power the isolated side, and a snappy, beefy buffer optimized to take in the optocoupler signal and turn it into gate drive to the power FET. The PDr4 has two other necessary, but non-obvious features. First, it includes a clamp diode to keep the switched output point from rising much above the power supply voltage. To the extent that a switched load is inductive, the switched point will spike up to a higher voltage when the switch is opened. (Think of the need for a suppression diode on a relay coil.) The clamp diode conducts that energy, preventing damage from overvoltage.

The other feature is thermal protection. No matter how capable an output driver may be, there will always be a case where it is pushed beyond its ultimate limits. Thermal shutdown turns the switch off before it gets too hot. You need to be a bit careful how that is done. If the thermal limit causes the FET switch to turn off only momentarily, it will cool a bit, then turn back on again right away. Additional rapid turning off and on when near the temperature limit could destroy the FET. Instead, when the temperature limit is hit, the PDr4 stays off untill it has cooled to well below the upper limit. Then it snaps back to normal operation. 

For lower proportional output currents we offer expansion boards with one, two or three isolated proportional drive circuits. (You might have to ask for details.) Those analog drivers are similar to the PDr4 circuits, but with lower voltage and current ratings. So why go to all the extra trouble for proportional control compared to just turning, say, a heater, on and off to control a temperature? You are bound to alternately overshoot and undershoot using that method, plus the timing of the on/off switching becomes critical. If instead, you set a proportional control to nearly match the required heating in a steady state condition, ocassional fine tuning the heater current at non-critical intervals will keep the temperature very near where you want it to be.


Tom Lawson
May 2021