Peak current mode control is unstable above a duty cycle of 0.5 unless a compensating ramp is added: a disturbance of the inductor current is multiplied by every switching period, where and are the inductor current's up and down slopes and is the ramp's slope. With no ramp that factor is , larger than 1 in size above , so the current breaks into subharmonic oscillation. A ramp of keeps every duty cycle stable, and cancels a disturbance in one period. In a 12 V to 8 V buck at 200 kHz with 10 µH (), Voltecx shows a 0.2 A disturbance doubling every period with no ramp, halving with A/µs, and gone after one period with A/µs.
What peak current mode control does
In voltage mode control, the error amplifier sets a duty cycle and a PWM comparator turns it into a gate signal. In peak current mode control, the error amplifier sets a current instead, and each switching period goes like this:
- A clock pulse sets a latch, and the switch turns on.
- The inductor current rises at . A comparator watches it (through a current-sense resistor or transformer).
- When the sensed current reaches the command , the comparator resets the latch, and the switch turns off.
- The current falls at until the next clock pulse.
For a buck the slopes are and . The duty cycle is no longer commanded directly: it is whatever on-time makes the current reach .
The attractions are well known. The inductor nearly disappears from the voltage loop, which then sees a single pole instead of the LC double pole, so a simple Type II compensator does the job. The switch current is limited cycle by cycle just by clamping . Parallel phases share current naturally, and input voltage changes are corrected within a period, because a higher input steepens and shortens the on-time at once. This is why so many controller ICs, from the UC384x family on, use it.
The catch is that the loop is a sampled system: the current is only "looked at" once per period, at the instant it crosses . A sampled loop can oscillate at half its sampling rate, and this one does.
The circuit in Voltecx
The test circuit is the textbook buck example, buckIdeal, with its open-loop PWM replaced by a peak current modulator built from five control blocks:
Clk, a PWM block at a fixed duty of 0.02 on a 200 kHz sawtooth, gives a 100 ns clock pulse at the start of every period (netclk);Latch, an SR flip-flop, is set byclkand drives the switch gateg;Cmp, a comparator, resets the latch when its inputisumpasses the 5 A commandIc;SawandSe, a ramp block in saw mode restarted byclkand a gain, make the compensating ramp, in A/µs (its height at the end of a period is );Sumadds the ramp to the inductor currentiL, measured by the ammeterAmL.
To look at the current loop alone, the output is held at 8 V by a voltage source, as a battery or a large output capacitor would hold it over a few periods. The switch and diode are ideal (100 µΩ on). With V and µH, , A/µs and A/µs.
Why it oscillates: the perturbation gain
Take the converter in steady state and add a small error to the inductor current at the start of a period. The current now rises from a higher valley, so it reaches earlier: the on-time shrinks by . The off-time grows by the same , during which the current falls at instead of rising at . At the next clock edge the error is
and after periods . In steady state the volt-seconds balance, , so
Below the error shrinks and changes sign every period; above it, the error grows. At the factor is .
The simulation shows exactly that. Starting the buck 0.2 A above its 3.67 A steady-state valley, the valley error goes , , A in the first three periods, each ratio within 5 % of . Then the on-time runs into the next clock edge, the linear picture ends, and the current settles into no steady state at all: each valley is followed by one on the other side, wandering below 2 A and above 4.5 A while the peaks stay pinned at the 5 A command. That is subharmonic oscillation: a large ripple at half the switching frequency (and its sub-multiples), audible in magnetics, and a current loop that no longer controls the average current.
Notice that the peak current is perfectly controlled. It is the average current that wanders, because a peak with a short on-time and a peak with a long on-time give different averages.
The cure: a compensating ramp
Add a ramp of slope to the sensed current (or, equivalently, subtract it from the command). The comparator now trips when . Repeating the argument, the on-time shrinks by and the error at the next edge is
This is the perturbation gain, derived in Erickson and Maksimović, Fundamentals of Power Electronics, 2nd ed. (Kluwer, 2001), Chapter 12 "Current Programmed Control". Three values of are worth remembering:
- The stability edge is where the gain reaches : . In the example, 0.2 A/µs, a quarter of .
- makes the gain smaller than 1 in size for every duty cycle up to 1, because . It is the usual rule. In the example the gain is .
- makes the gain zero: a disturbance is gone after one period (deadbeat). The ramp then makes the comparator see a falling-slope mirror of the inductor current, so the trip point no longer depends on where the current started.
With A/µs the same 0.2 A start becomes A, then A, and the valley settles at 2.33 A within a few periods.
The ramp costs something: the peak inductor current is no longer but . Here the ramp takes A off the peak, so the steady-state valley drops from 3.67 A to 2.33 A for the same 5 A command. The outer voltage loop simply asks for more current, but the current limit (a clamp on ) becomes duty-dependent: at high duty the converter can deliver less current before it limits. Too much ramp also turns the converter back towards voltage mode, which is the subject of the next section.
The figure below puts the four cases side by side: the valley error after each period, divided by the first error. At (20 V in) the gain with no ramp is , so the error rings down. At it grows by with no ramp, decays by with , and vanishes in one step with . Every simulated point is within 0.05 of the formula, or 5 % where the formula's value is larger than 1.
Ridley's model: the double pole at half the switching frequency
The sampled-data picture explains stability, but loop design needs a transfer function. R. B. Ridley, "A new, continuous-time model for current-mode control", IEEE Transactions on Power Electronics, vol. 6, no. 2, April 1991, folds the sampling into a pair of complex poles at half the switching frequency, in the current loop:
with the quality factor
The two pictures agree. goes to infinity, an undamped oscillation at , exactly when , which works out to , the edge where the perturbation gain reaches . Below that is negative: right-half-plane poles, the subharmonic oscillation of the previous section.
For the example at ():
| Ramp | Gain | ||
|---|---|---|---|
| 0 | 1 | −2 | negative (unstable) |
| 0.2 A/µs () | 1.5 | −1 | infinite |
| 0.4 A/µs () | 2 | −0.5 | 1.91 |
| 0.58 A/µs () | 2.46 | −0.22 | 1 |
| 0.8 A/µs () | 3 | 0 | 0.64 |
A of 1.91 is stable but peaky: the current loop's response has a resonance at 100 kHz that eats phase margin from the voltage loop near crossover, and it rises further at low input voltage where grows. Ridley recommends a ramp that gives about 1; here that is A/µs. With , , well damped, at the cost of more peak-current error.
The next figure sweeps the ramp from 0 to . Each point is one Voltecx run of the 12 V buck, measuring the ratio of the second valley error to the first; all eleven lie within 0.04 of the formula. The lower panel is Ridley's from the formula, crossing 1 at .
Sizing the ramp in practice
- Find the worst case. depends only on the output: for a buck, for a boost, the reflected output for a flyback. The required ramp is set at the highest duty cycle, which for a buck is the lowest input voltage.
- Refer everything to the comparator. The controller compares a voltage. With a sense resistor (or a current transformer with its burden), the inductor slope becomes in V/s, and the ramp you add must be specified in the same units. Controller data sheets give the internal ramp in mV per period or mV/µs.
- Choose between and . is the minimum for any duty; aim for near 1 at the lowest input voltage, which usually lands between the two.
- Remember the inductance tolerance. grows when drops with temperature or with DC bias in a powder core. Size the ramp with the lowest you expect.
- Check the current limit. The peak current at the limit is ; at the highest duty it is lowest. Make sure that is still above the full-load peak current.
Below a small ramp is still worth adding: the perturbation gain at is , which rings for several periods and makes the loop sensitive to noise on the sense signal.
Common mistakes
- Testing only at nominal input. A buck from 12 V to 5 V is at and looks fine; the same board at 9 V in runs at and oscillates.
- Adding the ramp in the wrong place. The ramp has to be synchronised to the clock and restarted every period. A free-running ramp or one taken from a different oscillator does nothing useful.
- Leading-edge spikes. The current-sense signal carries the diode's reverse recovery and the switch-node charge at turn-on. Without leading-edge blanking or a small RC filter, the comparator trips on the spike, at minimum on-time, every period.
- Too much filtering on the sense signal. A large RC delays the sensed current and flattens its slope, which changes and as the comparator sees them.
- Reading the waveform at too coarse a time step. In simulation, a comparator crossing is only as accurate as the step around it. The runs here use steps of at most 2 ns, 0.04 % of the period. With 50 ns steps the trip can come up to 50 ns late, 40 mA at 0.8 A/µs, a fifth of the 0.2 A disturbance studied here.
How to do it in Voltecx
- File › Open Example › buck, then remove
DutyandPWMand add the modulator blocks with Circuit › Add Component (circuit.addComponent): apwmat duty 0.02 as the clock, arampin saw mode clocked by it, againfor the ramp height , asum, acomparatoragainst aconstantcurrent command, and ansrfflatch driving the switch gate. Put an ammeter in series with the inductor foriL. - Simulation › Settings (
simulation.settings): a maximum step of a few ns (here 2 ns at 200 kHz), and an initial inductor current a little off steady state (L1.i0) to see the disturbance grow or decay. - Simulation › Run Simulation (
simulation.run, F5), then look atiL,isumandgon the scope; Scope › Measurements (scope.measure) gives the valley and peak of each. - Analysis › Parameter Sweep (
analysis.paramSweep) over the gain ofSesweeps the ramp; measureiLwithminover a late window to see where the valley settles. - Circuit › Subsystem › Create Subsystem (
circuit.createSubsystem) wraps the modulator blocks into one subsystem, with pins for the sensed current, the command and the gate, once it works.
For a complete loop rather than the current loop alone, design.compare (Design › Automate › Compare Topologies and Control) designs peak current mode with a Type II compensator on Ridley's model, and the behavioural pwmController IC (UC384x type) is a ready peak-current-mode controller to place with ic.place.
Frequently asked questions
Why does peak current mode control need slope compensation above 50 % duty?
Because the current loop is sampled once per period and a disturbance in the inductor current is multiplied by each period. Above that is larger than 1 in size, so the disturbance grows into subharmonic oscillation.
How much slope compensation is enough?
At least at the highest duty cycle to be stable; is stable at every duty cycle. For a well-damped current loop, choose so that Ridley's is about 1, which lies between and .
What does give?
A perturbation gain of zero: any disturbance of the inductor current is corrected in one switching period (deadbeat control), and . The price is the largest difference between the commanded and the actual peak current.
Does slope compensation matter below 50 % duty?
The loop is stable without it, but the disturbance rings for several periods (gain at ) and the current loop is sensitive to noise. A small ramp also damps the poles that otherwise peak near the voltage loop's crossover at high duty.
Does the same apply to a boost or a flyback?
Yes. Only the slopes change: for a boost and ; for a flyback in continuous conduction, is the reflected output voltage over the magnetising inductance. The formulas for the perturbation gain and are the same.