For my project I'm building a high voltage ultrasonic power supply (400V, 28kHz) based on the UC3525 pulse width modulation chip.
There's very little information on the net that explains how to use these chips, so for this week's update I thought I'd write a quick summary.
Where to get 3525 chips
Pulse width modulators are common. They're made by TI (UC3525), ON Semiconductor (SG3525), Fairchild (KA3525), and several others. They're available from DigiKey, Mouser, and from eBay in small quantities for about a buck each.
The datasheet for these chips contains almost no application information. Some have a small section detailing how the "Shutdown" pin can be used to skip a pulse when needed, but others don't even have that.
The internet isn't much help either. Tahmid's blog has a pin-by-pin functional description with a demonstration circuit, and the SG153x App Note describes a related chip, but with important differences.
If you don't understand something here, take a look at Tahmid's blog for a counterpoint explanation.
Generating PWM signals
A PWM signal is generated by comparing a triangle wave to a reference level. The output will be high when the triangle is higher than the reference and low everywhere else. Adjusting the reference adjusts the pulse width.
The UC3525 chip is basically a triangle wave generator and comparator, with some extras thrown in for convenience. Any properly-scaled voltage proportional to output error can be used as a reference voltage to the comparator. A larger error results in a higher reference voltage, which clips the triangle wave higher, which makes the output pulses narrower, which generates less output, which in turn generates a lower error voltage.
For example, a 12V power supply might have an error voltage proportional to the difference between 12 volts and the actual output. The voltage will shorten or lengthen the PWM times, forcing the output to exactly 12 volts.
The circuit doesn't have to be a power supply, it only needs a feedback voltage proportional to the error. To run a DC motor at a specific speed, simply feed back a voltage proportional to the difference between the requested speed and the actual speed: negative feedback will force the motor to the right speed.
So for another example, you can make a class-D amplifier using an audio signal as Vref:
Precision voltage source
The UC3525 supplies a precision 5.1V reference which can be compared to the error signal, or as a 5V supply for external logic (up to 20mA).
So to make a regulated power supply, simply divide the output down using 1% resistors and compare it to the voltage reference and you're done. For other circuits, simply generate 5.1V on correct output, with higher voltages for "too much" output.
An example from Tahmid's blog:
The UC3525 implements an extra op-amp on the VRef input of the comparator and brings the connections out to the user. This makes it easy to convert error signals - the positive input can level shift, while the inverting input and feedback can amplify the error to bring it into range.
You can also use the op-amp to slow down the feedback. In the circuit below, the PWM error adjustment is delayed by the RC constant of the amplifier feedback. This can eliminate ringing and spurious oscillations that you might get from instantaneous feedback.
If your output has a lot of inertia (big filter capacitors, motor speed, or similar), you can run the PWM in ON/OFF mode with an optoisolator. The control circuit is then isolated from the output.
In the example below, when the output is higher than 68 volts the optoisolator turns on, comparing the full Vref against Vref/2 and the PWM turns off. For a lower output voltage, the optoisolator is turned off and 0 volts is compared against Vref/2, turning the PWM completely on.
Triangle wave oscillator
So a natural question to ask is: how does one generate a triangle wave?
You start with a constant current source. Then you connect the constant current source to a constant capacitance and the voltage rises linearly as a function of time.
The UC3525 provides a constant current source and a flip-flop mechanism that alternately charges and discharges a capacitor which the user supplies. The user also supplies an external resistor which sets the amount of current.
The upshot is that the user sets the oscillation frequency by supplying an R and C to the oscillator section according to the following formula:
Note: the UC3525 has two outputs each modulating half-cycles of the output frequency. This means that the triangle oscillator runs at *twice* the output frequency (one output for each half cycle). If you want a 50Hz output, configure the oscillator to run at 100Hz.
The discharge resistor, Rd is discussed later.
The oscillator has a pulse output that can be used to measure the generated frequency, and an input for synchronizing multiple devices.
To synchronize two devices, set the "master" device to oscillate at the desired frequency, set slave to oscillate a little slower (for example: 90% of the master speed), and connect the "OSC Output" of the master to the slave "nSync" input.
Clock pulses on a slave nSync prematurely cycle the oscillator flip-flop - causing the peaks and troughs to synchronize with the master.
As far as I can tell, no one has ever used this feature. If you don't need to synchronize multiple units, just leave the nSync and OscOut pins unconnected.
Programmable Dead time
A "totem pole" output can have problem with synchronous control pulses.
The power transistors don't turn off instantly when their controlling pulse goes low, so if the falling and rising edges of the control pulses are close enough, there's a brief time when both transistors are conducting.
This is called "shoot through", and in effect the transistors briefly short the power supply to ground, often with disastrous results. Usually this ends up burning out your vary-expensive output transistors.
Conceptually, the gate has a small capacitance and the driver has an internal resistance, so switching the transistor takes an RC constant to complete. Other factors also come into play, such as the lead and trace inductance.
The solution is to have "dead time" where both pulses are off during the transitions, giving the active transistor time to turn off before the inactive one turns on.
The Rd in the UC3525 oscillator section allows the user to set a dead time.
The rise time of the oscillator is determined by Rt, but the fall time is determined by the sum of Rt and Rd. The extra conductance causes the capacitor to discharge faster than it rises, prematurely ending the pulse a little before the opposite pulse begins. The end result is that there is a short time when both pulses are "off" at the same time.
If you don't need dead time, short the "Discharge" pin directly to Ct, making Rd effectively zero.
Here's a variable frequency example with 8 uS dead time. See the datasheet to determine dead time per component values.
The UC3525 output is itself a totem-pole: each output can source or sink about half an amp of current (varies with vendor - see datasheet).
The output voltage comes from a supply separate from the internal chip logic, so you can interface the PWM sections with low-voltage logic while switching a much higher voltage. For example, high power FETs usually require between 8 and 20 volts for proper switching. You can operate the UC3525 logic from a high voltage input, 35 volts for example, while switching a lower voltage more appropriate for the FETs.
If you don't have need for separate voltage levels, just connect Vc and Vcc together. The UC3525 logic operates anywhere from 8 to 35 volts.
Soft start and low voltage
The UC3525 has a couple of other features which are straightforward to use.
A capacitor connected to the "soft start" input will delay startup during powerup. This prevents the device from generating spurious output before other sections of the circuit come on line. It can give a microcontroller a chance to boot, capacitors a chance to charge, and other control electronics time to start.
There's also a low-voltage detection that takes the outputs offline when the power is removed - you don't have to worry about the output going haywire as the control circuitry powers down.
Putting it all together
With all these features there's a lot going on in this one chip, but it's mostly passives programming the individual sections. Once you understand the individual sections, using the UC3525 in a circuit is straightforward.
Here's an example of a completed project from the links posted above, and the one on which I based my design. It's pretty simple, and can be breadboarded in an afternoon.
Once you have the basic circuit running, modifying it for your project is straightforward.