Estimate Online Frequency Response of Non-Isolated DC-DC Converter
R2026bIn this step of the Non-Isolated DC-DC Converter Controller Design Workflow example, you estimate the online frequency response of the non-isolated DC-DC converter plant to obtain a data-driven model for controller tuning. To get started, open the project and click the Sim FRE Workflow shortcut on the project toolstrip.
This workflow extracts the plant frequency response of a DC-DC converter under
open-loop control, enabling advanced control-gain estimation and stability analysis. The
plant frequency response is defined as Vout/Duty and is obtained by
modulating the open-loop control output (duty cycle) with sinestream perturbations. A
well-conditioned frequency response estimation (FRE) result gives you a data-driven plant
model that captures effects the analytical transfer function misses, including component
nonlinearities, quantization, and sampling dynamics.
The model references the Buck plant subsystem equivalent to the Buck circuit in
BOOSTXL-BUCKCONV. The model parameters are loaded from
BuckVoltageControlF28379dData.m.
Configure FRE Injection Parameters
Configure the frequency-response injection parameters. Define a series of frequencies and amplitudes to inject over the open-loop control input.
% Load specific hardware parameters BuckVoltageControlF28379dData; freq = [200 500 700 1000 2000 3000 5000 10000 20000 30000];%Hz Frequencies to be injected Amplitudes = 0.1; % duty cycles [0,1] % Amplitude of sine signals to be injected NumSetPeriod = 4; % Number of settling periods for the frequency injection NumEstPeriod = 2;% Number of estimation periods for the frequency injection
Generate FRE injection signals
Option 1: using Sinestream block
modelName1 = 'createSineStream'; load_system(modelName1); TestTime = 0; for index = 1:length(freq) TestTime = TestTime + (NumSetPeriod+NumEstPeriod) / freq(index); end TestTime = TestTime*1.01; SimTime1 = TestTime; out = sim(modelName1); sineLUT = out.FreInj; IdxLUT = out.Idx; disp(['Look up table length = ' num2str(length(sineLUT))]);
Look up table length = 12903
Option 2: using API
Open the model and update sinestream signal generator block
[sineLUT, IdxLUT] = generatePerturbSignal('sine', Tsc, ... 'Frequency', freq, ... 'Amplitude', Amplitudes, ... 'NumSetPeriod', NumSetPeriod, ... 'NumEstPeriod', NumEstPeriod);
Look up table length = 12780
Simulate FRE Model
modelName2 = 'BuckFrequencyInjectionSim';
open_system(modelName2);
simTime3 = length(sineLUT) * Tsc + 0.02;
sim(modelName2);
close_system(modelName2);Plot the Frequency Response
opts=bodeoptions; opts.FreqUnits='Hz'; opts.Grid='On'; opts.MagVisible ='On'; opts.PhaseVisible ='On'; Buck_FREResponse_sim = frd(FRD.Data, freq * 2 * pi); figure('Name','FRE plot') bodeplot(Buck_FREResponse_sim,'r*-',opts); title('DC-DC Buck');
