主要内容

Design and Simulate Resonant Converter Control

R2026b

This example shows how to design and simulate voltage regulation for an LLC resonant converter. The example covers two modulation strategies. Direct Frequency Control (DFC) regulates Vout by varying the switching frequency Fsw. Time-Shift Control (TSC) regulates Vout by modulating the delay TD from a zero-crossing of the tank current to the next switching of the half bridge.

The relationship between TD and Vout can be approximated as a first-order system, which makes PI control with pole-zero cancellation an excellent design strategy for TSC.

In this example, you:

  • Simulate DFC on the shipped 100 W half-bridge preset and observe how Fsw adapts to regulate Vout

  • Select TSC plant parameters for the 100 W half-bridge preset

  • Identify the TD-to-Vout plant with open-loop simulations

  • Fit a first-order plant model and design a PI controller by pole-zero cancellation

  • Simulate the closed-loop TSC system with the designed gains

Direct Frequency Control

Direct Frequency Control varies the switching frequency Fsw directly through the PI controller output. Higher Fsw moves operation further above resonance and reduces Vout. Lower Fsw moves operation closer to resonance and increases Vout. DFC is the classical LLC control strategy and works over a wide power range.

To open the prebuilt DFC model, use open_system. The model loads the DFC plant and controller parameters using the DFC data script. This script calls getResonantConverterParam('Converter100W') to load a 400 V input, 54 V output, 100 W half-bridge preset, then sets TsVolt = 50 µs, TsPlant = 1/50e6, VRef = ResonantConv.Vout, and the open-loop switching frequency FswOpen = 1.2 * ResonantConv.Fres.

open_system("LLCVoltageControlWithDFC")

The model contains a variant LLC Plant subsystem and a Controller subsystem. The Controller subsystem pairs a Resonant Converter Gains block with a Resonant Voltage Controller block. Both blocks come from the Power Converter Control with Motor Control Blockset™ library. The Resonant Converter Gains block derives the PI gains internally from the converter dialog values and passed to the Resonant Voltage Controller at run time. No manual tuning is needed. The LoopSelect block selects open-loop or closed-loop operation. Set it to 0 to inject the fixed frequency FswOpen, or 1 to close the loop with the PI controller.

Run the closed-loop simulation.

set_param("LLCVoltageControlWithDFC/Controller/LoopSelect", Value="1")  % Close the loop
sim("LLCVoltageControlWithDFC");
dfcRunIDs = Simulink.sdi.getAllRunIDs();
dfcRun = Simulink.sdi.getRun(dfcRunIDs(end));  % Get the most recent simulation run
dfcVfb = dfcRun.getSignal(dfcRun.getSignalIDsByName("Vfb")).Values;  % Output voltage feedback
dfcFsw = dfcRun.getSignal(dfcRun.getSignalIDsByName("Fsw")).Values;  % Commanded switching frequency

To visualize the closed-loop DFC response, plot the output voltage and the commanded switching frequency on separate axes. The controller drives Vfb toward VRef. The switching frequency settles at the value required to hold the output at the reference under nominal load. The trade-off is that the switching frequency varies with load and line conditions. As a result, magnetics and EMI filters must be designed to accommodate the full frequency range [FswMin, FswMax] from the converter preset.

figure
t = tiledlayout(2,1);
nexttile  % Top tile: output voltage vs. reference
plot(dfcVfb.Time, dfcVfb.Data)
yline(VRef, "--", "V_{Ref}", LabelHorizontalAlignment="left")
xlabel("Time (s)")
ylabel("V_{fb} (V)")
title("DFC Closed-Loop Output Voltage")
grid on

nexttile  % Bottom tile: switching frequency adapts to regulate voltage
plot(dfcFsw.Time, dfcFsw.Data / 1e3)
xlabel("Time (s)")
ylabel("F_{sw} (kHz)")
title("DFC Commanded Switching Frequency")
grid on

Figure contains 2 axes objects. Axes object 1 with title DFC Closed-Loop Output Voltage, xlabel Time (s), ylabel V_{fb} (V) contains 2 objects of type line, constantline. Axes object 2 with title DFC Commanded Switching Frequency, xlabel Time (s), ylabel F_{sw} (kHz) contains an object of type line.

Select Parameters for Time-Shift Control

Time-Shift Control keeps the switching cadence fixed and modulates TD instead.

The first step is to select the plant parameters. The getResonantConverterParam function provides three presets:

  • Converter100W: 400 V input, 54 V output, 100 W

  • Converter150W: 395 V input, 12 V output, 150 W

  • Converter5kW: 400 V input, 150 V output, 5 kW

ConverterParam = 'Converter100W';  % Choose a preset
ResonantConv = getResonantConverterParam(ConverterParam);  % Returns struct with Vin, Vout, Pout, Fres, FswMin, FswMax, etc.
RLoad = ResonantConv.Vout^2/ResonantConv.Pout;  % Nominal load resistance (Ohms)

Select the switching topology of the LLC power stage. The preset returns HalfBridge by default. Switch to FullBridge to select the full-bridge variant of the plant.

PlantConfig = ResonantConv.PlantConfig;  % 'HalfBridge' by default; override to 'FullBridge' if needed

Set the sample times for the discrete-time controller implementation. The voltage loop runs at 50 µs, and the plant simulation step matches the 50 MHz FPGA clock.

TsVolt  = 50e-6;      % Voltage control loop sample time (50 µs)
FFpga   = 50e6;       % FPGA clock frequency (50 MHz)
TsPlant = 1/FFpga;    % Plant simulation step size matches FPGA clock

Set the target output voltage for closed-loop regulation.

VRef = ResonantConv.Vout;  % Target output voltage for closed-loop regulation

Compute the TD limits and switch dead-time in FPGA clock counts for use in the modulator.

TD_min       = 1/(4*ResonantConv.FswMax);       % Minimum TD: largest power transfer (highest Fsw)
TD_max       = 1/(2.5*ResonantConv.FswMin);     % Maximum TD: smallest power transfer (lowest Fsw)
Tdead        = ResonantConv.Tdead;              % Switch dead-time (s)
Tdead_counts = uint32(Tdead / TsPlant);         % Dead-time in FPGA clock counts

Set the startup TD to TD_max so the converter starts in a low-power state and the output ramps up smoothly. Initialize the PI gains to small placeholder values so the model can compile during the open-loop identification runs. The placeholders are inactive when LoopSelect is 0 and are replaced with the designed values before the closed-loop simulation.

TD_initial = TD_max;   % Start at maximum TD for a smooth low-power startup ramp
Kp_TSC = 1e-10;        % Placeholder Kp
Ki_TSC = 1e-8;         % Placeholder Ki

Add the Utilities folder to the path so the helper functions used below are visible.

addpath(fullfile(pwd, 'Utilities')); 

Run Open-Loop Simulations to Identify the Plant

To design a controller, you must first understand how the plant responds. In TSC control, the "plant" is the mapping from TD to output voltage Vout.

Identify the plant by running open-loop simulations at different equally-spaced TD values between TD,min and TD,max. In each simulation, the controller is disconnected (open-loop mode) and a constant TD is applied. The output voltage Vfb rises from zero and settles to a steady-state value that depends on the applied TD. For simulation, use the same TSC model that operates in open loop as well as in closed loop.

ModelName = 'LLCVoltageControlWithTSC';
open_system(ModelName)

From each response, extract:

  • Steady-state voltage Vss: the final settled output voltage

  • Time constant τ: how fast the output reaches steady state. This is estimated through log-linear regression on the normalized step response.

n = 5;           % Number of equally-spaced TD operating points to sweep
simTime = '0.01';
openloopresult = simulateOpenLoop(ModelName, TD_min, TD_max, n, simTime);  % Returns Vss and tau per operating point
Warning: Graphics acceleration hardware is unavailable. Graphics quality and performance might be diminished. See <a href="https://www.mathworks.com/support/requirements/matlab-system-requirements.html">MATLAB System Requirements</a>.

The plot below shows the output voltage versus time for each of the TD values. Key observations:

  • Lower TD (more power) produces higher steady-state voltage

  • Higher TD (less power) produces lower steady-state voltage

  • Most responses exhibit first-order-like behavior. For certain TD values you may see higher-order-like behavior.

  • Modify TD_min and TD_max if the Vout range has to be extended

clf
figure
plotOpenLoopResponses(openloopresult);  % Vout vs. time for each TD: lower TD → higher steady-state voltage

Figure contains an axes object. The axes object with title Open-Loop Step Responses for Different T_D Values, xlabel Time (ms), ylabel V indexOf out baseline (V) contains 5 objects of type line. These objects represent TD = 1.0 us, TD = 3.3 us, TD = 5.5 us, TD = 7.8 us, TD = 10.0 us.

By normalizing each response to its own steady-state value, you can visually verify that the dynamics (time constant) are consistent across different operating points. If all curves overlap, the first-order linear model is a good approximation across the operating range.

clf
figure
plotNormalizedResponses(openloopresult);  % Overlapping curves confirm consistent first-order dynamics

Figure contains an axes object. The axes object with title Normalized Open-Loop Step Responses, xlabel Time (ms), ylabel V indexOf out baseline (per-unit) contains 6 objects of type line, constantline. These objects represent TD = 1.0 us, TD = 3.3 us, TD = 5.5 us, TD = 7.8 us, TD = 10.0 us.

Fit the First-Order Plant Model

Model the plant as a first-order transfer function G(s)=K/(τs+1), where K is the plant DC gain in V/s (the slope of a linear regression of Vout,ss versus TD) and τ is the plant time constant in seconds (the average of the individual time-constant fits from all trials). A negative value of K indicates that increasing TD decreases Vout, which is the expected control direction for TSC.

[K, tau] = fitPlantModel(openloopresult)  % K: DC gain (V/s, negative); tau: time constant (s)
K = 
-3.5439e+06
tau = 
3.3678e-04

Design the PI Controller by Pole-Zero Cancellation

The closed-loop control system consists of:

  • Plant: G(s)=K/(τs+1)

  • Sample-and-hold (first-order approximation): H(s)=1/((Ts/2)⋅s+1)

  • PI controller: C(s)=Kp+Ki/s=Kp⋅(s+Ki/Kp)/s

The open-loop transfer function is L(s)=C(s)⋅G(s)⋅H(s). The key design is by choosing Ki/Kp=1/τ, the PI controller's zero exactly cancels the plant's pole. This simplifies the open-loop to a pure integrator L(s)=|K|⋅Kpτ⋅s. A pure integrator has exactly 90° phase margin at any crossover frequency. This guarantees a stable, overdamped closed-loop response with no oscillations.

The crossover frequency ωc determines how fast the closed-loop responds to disturbances and reference changes. Choose ωc based on:

  • Plant pole: 1/τ≈3000 rad/s

  • ZOH pole: 2/Ts≈40,000 rad/s

  • Default: ωc=0.2 rad/s. This value sits far below both poles. The linear approximations hold and the phase margin remains near 90°.

Increasing ωc gives faster disturbance rejection but reduces phase margin and robustness. The rule of thumb is to keep ωc≪1/τ for the pole-zero cancellation to yield an overdamped response.

wc = 0.2; 

From the unity-gain crossover condition |L(jωc)|=1, compute Kp=τωc/|K| and Ki=Kp/τ. The verification struct returned by computePIGains reports the actual loop gain magnitude and phase margin at ωc.

[Kp_TSC, Ki_TSC, verification] = computePIGains(K, tau, TsVolt, wc)
Kp_TSC = 
1.9006e-11
Ki_TSC = 
5.6435e-08
verification = struct with fields:
          mag_at_wc: 1.0000
    phase_at_wc_deg: -90.0003
          PM_actual: 89.9997

The verification confirms |L(jωc)|≈1 (unity gain at crossover) and phase margin ≈90° (overdamped, no oscillation).

Simulate the Closed-Loop System

With the PI gains computed, close the loop and simulate the full system. The controller uses the computed Kp and Ki to regulate Vfb to track the reference voltage VRef. Expect:

  • Overdamped response: smooth rise to the reference with no overshoot

  • Small steady-state error: the integrator in the PI controller eliminates DC error

  • Settling within a few milliseconds: determined by the chosen ωc

simTime = '0.01';  % 10 ms simulation; enough for Vout to settle to VRef
closedloopresult = simulateClosedLoop(ModelName, Kp_TSC, Ki_TSC, simTime);  % Assigns Kp_TSC/Ki_TSC to base workspace, closes loop, runs sim

Plot the closed-loop response. The controller drives Vfb toward VRef with an overdamped shape and no overshoot, consistent with the 90° phase margin design.

clf
figure
plotClosedLoopResponse(closedloopresult);  % Vfb rises to VRef with overdamped shape and no overshoot

Figure contains an axes object. The axes object with title Closed-Loop V indexOf fb baseline Tracking, xlabel Time (ms), ylabel Voltage (V) contains 2 objects of type line, constantline. These objects represent V_{fb}, V_{Ref}.

You simulated voltage regulation for an LLC resonant converter under two different modulation strategies. Direct Frequency Control adjusts Fsw directly through a PI controller. The gains are auto-computed from the plant dialog values on the Resonant Converter Gains block. DFC is a good default when the resulting frequency range is acceptable for the magnetics and EMI filter design. Time-Shift Control keeps the switching cadence fixed and modulates TD instead. The TD-to-Vout plant is approximately first-order. An open-loop system-identification workflow paired with pole-zero cancellation delivers a PI controller with 90° phase margin.

To adapt this workflow to a new LLC plant, change ConverterParam to another preset from getResonantConverterParam (or add a new preset), then rerun the identification and design sections. The utility functions compute new gains. Precomputed reference gains for the three shipped presets are stored in LLCVoltageControlWithTSCData.m so you can jump straight to closed-loop simulation for those presets. To try a different power-stage topology, override PlantConfig to 'FullBridge' before opening the model. Both harness models switch between half-bridge and full-bridge automatically. Reference standalone plants are provided in HalfBridgeLLCConverter.slx and FullBridgeLLCConverter.slx.