Use a controller IC when a standard topology and control method fit, because it brings tested protection, soft start and gate drive in one part; use an analog op-amp compensator when you need a custom loop with no sampling delay; use digital control on a microcontroller when you need flexibility, communication, adaptive behaviour or many converters on one chip. The deciding numbers for digital control are its delay and its PWM resolution. A sampled loop with 1.5 sampling periods of delay loses 54° of phase at a 10 kHz crossover with 100 kHz sampling, and a 170 MHz timer at 200 kHz gives only 850 duty steps.
The idea: three ways to drive the same car
Think of the control loop as the driver of a car. A controller IC is a car with cruise control built in: you set the speed with a few resistors and capacitors, and it handles the common cases very well, with the safety features already fitted. An analog compensator is a driver you train yourself: an op-amp and a handful of parts, reacting continuously and instantly, but you add the safety features. Digital control is a driver who looks at the road through a camera that updates every few microseconds: very clever, able to learn and to talk to other systems, but always reacting to a picture that is slightly old.
That last point is the whole trade-off of digital control. The delay and the coarseness of its actions (the PWM resolution) are what this article puts numbers on.
What are the three options?
| Controller IC | Analog compensator | Digital (MCU, DSP) | |
|---|---|---|---|
| Loop | Fixed method (voltage or peak current mode), external R and C set the compensator | Type II or III network around an op-amp or the controller's error amplifier | Difference equation in firmware |
| Protection, soft start | Built in | You add it | You write it |
| Delay | None to speak of | None to speak of | Sampling and computation, about 1–1.5 periods |
| Flexibility | Low | Medium | High: adaptive gains, mode changes, telemetry |
| Parts | One IC, few passives | Op-amp, reference, network | MCU, ADC front ends, gate drivers |
| Best for | Standard DC-DC and flyback | Custom analog loops, legacy designs | Inverters, PFC, motor drives, multi-converter systems |
Why does digital control lose phase margin?
A digital loop samples the error, computes, then updates the PWM. A common total delay is 1.5 sampling periods: one for computation and half for the PWM's zero-order hold. A pure delay adds a phase lag of
With kHz ( µs) and :
| Crossover | Phase lag |
|---|---|
| 5 kHz | 27° |
| 10 kHz | 54° |
At , the delay alone eats most of a 60° phase margin target, so digital loops usually cross lower, or sample twice per period, or use a predictive update.
On a whole converter the effect is easy to see. design.compare designs every method for the same 60° of phase margin on a 48 V to 12 V, 10 A buck at 200 kHz, and keeps a PI's gain margin at 6 dB or more. The analog Type III crosses at 20 kHz; the digital PI, with its 1.5 periods of delay, can only cross at 4.1 kHz.
What does PWM resolution do?
A digital PWM puts each edge on a timer count, so the duty can only take values. With a 170 MHz timer clock at 200 kHz, . In a buck from 48 V, one count moves the output by
which is 0.47 % of a 12 V output. If the ADC resolves the output more finely than one PWM step, the loop hunts between two duty values: a limit cycle. Two cures: a high-resolution PWM, whose sub-count edge step can be 150 ps on some MCUs (TI's F28379D data sheet gives this typical MEP step), giving mV per step; or enough integral gain and dither so that the average duty is right.
How do you choose?
- Standard buck, boost or flyback, under a few hundred watts, no communication: a controller IC. Check that its control method suits your topology, for example peak current mode for a boost with an RHP zero.
- A loop the ICs don't offer, but no need for software: an analog compensator, often around the error amplifier of a simple PWM controller.
- Inverters, PFC, motor drives, grid-tied systems, or anything with a state machine, telemetry or adaptive control: digital. Budget the delay and PWM resolution first.
Common mistakes
- Designing a digital loop as if it were analog. Add the 1–1.5 periods of delay to the model before you pick the crossover; otherwise the margin you designed for is not the margin you get.
- Ignoring PWM resolution. If one timer count moves the output more than the ADC can see, the loop hunts. Compute and compare it with an ADC count at the output.
- Choosing an IC whose control method does not fit. A voltage-mode controller on a boost with a low RHP zero leaves very little bandwidth; peak current mode suits it better.
- Forgetting what the IC gives for free. Soft start, cycle-by-cycle current limit, UVLO and gate drive all have to be designed and tested again in an analog or digital solution.
- Assuming digital is cheaper because it has fewer parts. The MCU, its ADC front ends and the firmware effort often cost more than a controller IC for a single converter.
How to do it in Voltecx
- Compare control methods on your converter.
design.compare(Design › Automate › Compare Topologies and Control) designs voltage mode with a Type III network, peak current mode with a Type II network (Ridley's model), average current mode with two PIs and a digital PI, all for the same phase margin, and simulates each through a load step on a buck, boost or buck-boost. - Controller ICs. The behavioural IC library includes a
pwmController(peak-current-mode, UC384x type), asyncBuckController(voltage mode, LM5145 type) and asyncBoostController(peak current mode, LM5122 type). Place them withic.place; each is a subsystem with named pins. - Analog compensators. The Voltage loop task (
design.voltageLoop) gives a PI or a Type II or III transfer function; theopAmpIC model (withTL072,OPA2171andTLV9062presets) builds the network around a real op-amp's gain-bandwidth. - Digital.
design.digitalizeturns a loop design into a difference equation in your number format (Tustin, prewarped at the crossover, or matched poles and zeros). Thepwmblock takes the timercountsand anhrpwmstep, and an ISR execution time, so the simulation shows the real delay and resolution. Code generation writes the C for the MCU. - In development: a choice of control implementation inside automatic design (digital firmware, an analog op-amp compensator or a controller IC).
See the design tools overview.
Frequently asked questions
Is digital control better than analog control for power supplies?
Not by itself. Digital control adds flexibility, communication and adaptive behaviour, but also delay and quantisation. For a standard DC-DC converter a controller IC is often simpler, cheaper and faster.
How much phase does a digital control delay cost?
. With 1.5 sampling periods of delay and crossover at a tenth of the sampling frequency, that is 54°.
What is a limit cycle in digital power control?
A steady oscillation between duty values that happens when the ADC resolves the output more finely than the PWM can adjust it. Higher PWM resolution, or integral gain with dither, removes it.
Can I simulate a controller IC's loop before I build it?
Yes, with a behavioural model of the IC that includes its error amplifier, ramp and current-sense path. It is not the vendor's transistor-level model, so check the data sheet's application circuit against it.