🎯 Objective

By the end of this lab, students will be able to:

  • Understand the step-by-step procedure for designing a controller for a buck converter, including selecting gain and compensator structure (Type I vs Type II).
  • Evaluate how controller design (Type I vs Type II) influences the transient response of a buck converter, focusing on rise time, overshoot, and settling time.
  • Analyze the effect of controller gain variation, and identify how increasing gain impacts speed, damping, and stability of the system.
  • Examine the influence of load resistance, and determine how changes in load affect system damping and overall transient behavior.
  • Compare the performance of Type I and Type II controllers, and identify conditions under which Type II provides improved speed and reduced overshoot.
  • Identify the trade-offs between fast response and stability, and understand the limitations imposed by both controller design and plant dynamics.

📚 Prerequisite

  • Experiment A1, A2, A3, C1, and C2.
  • Basic understanding of the Nyquist plot and the Nyquist Stability Criterion
  • Concept of gain margin and phase margin

🧠 Theory

Based on the previous two experiments, we now have a mathematical description of the buck converter under different loading conditions, along with an experimentally measured frequency response (Bode plot) of the plant. In this lab, we will close the loop from output voltage to duty ratio in order to regulate the output voltage to a desired reference.

The control system can be described using three blocks:

  • K(s)K(s): controller to be designed
  • G(s)G(s): plant (buck converter)
  • H(s)H(s) measurement system, including any filter and/or potential divider.

The loop gain is defined as:L(s)=K(s)G(s)H(s)L(s) = K(s)\,G(s)\,H(s)The first requirement of any control system is stability—without it, performance is meaningless. We have already observed that the averaged model of the buck converter under typical operating conditions is open-loop stable. From the Nyquist stability criterion, the closed-loop system will be stable if the Nyquist plot of the loop gain does not encircle the point 1+j0-1 + j0, provided that the controller and measurement system are inherently stable (i.e., have no right-half-plane poles).

While Nyquist plots provide a complete stability test, an equivalent and more practical approach is to use the Bode plot of the loop gain. Stability can be assessed by ensuring:

  • The phase at the gain crossover frequency is greater than 180-180^\circ (positive phase margin), and
  • The gain at the phase crossover frequency is less than 0 dB (positive gain margin)

A simple starting point for controller design is to choose K(s)K(s) as a constant gain. Increasing the gain shifts the crossover frequency and affects both stability margins and bandwidth. While this approach can ensure stability, it does not guarantee good performance.

In practice, we want the closed-loop system to not only be stable, but also to have:

  • Fast transient response (higher bandwidth)
  • Minimal overshoot (adequate phase margin)
  • Zero steady-state error to a DC reference

These requirements are often conflicting and must be balanced through loop shaping, where the controller is designed to shape the frequency response of the loop gain.

A proportional controller alone is insufficient because it cannot eliminate steady-state error and provides limited control over phase margin. To improve performance, we introduce dynamic compensation.

A Type I controller adds an integrator:K(s)=KsK(s) = \frac{K}{s}This ensures zero steady-state error to a step reference by increasing low-frequency gain. However, the integrator introduces a phase lag of 90-90^\circ, which can reduce stability margins and limit achievable bandwidth.

To overcome this limitation, a Type II controller is used:K(s)=K1+s/ωzs(1+s/ωp)K(s) = K \cdot \frac{1 + s/\omega_z}{s(1 + s/\omega_p)}This controller combines:

  • An integrator (for zero steady-state error)
  • A zero (to add phase boost and improve stability margin)
  • A high-frequency pole (to reduce noise amplification and ensure proper roll-off)

By appropriately placing the zero and pole, the controller can increase phase margin near the crossover frequency while maintaining high gain at low frequencies. This allows us to achieve both stability and improved dynamic performance. In this experiment, we will design and implement Type I and Type II controllers using loop shaping techniques, and compare their effect on stability, bandwidth, and transient response of the buck converter.

Fig. 1: In this experiment, we will perturb the duty ratio using a signal generator and observe the output voltage. If the system (from Vcontrol as input to Vo as output) is linear, we should observe identical frequency components.

To begin with, let us design the controller for a nominal load case of 4.55 Ohm, input voltage of 10 V, switching frequency of 50 kHz, and a nominal output voltage of 5 V. This would give us margins to increase or decrease the load and observe its effect. We will go through the following steps:

  1. Find the plant transfer function: Using the Matlab code for plant identification, we can see that the plant transfer function isG(s)=10ω02s2+2ζω0s+ω02G(s) = \frac{10 \cdot \omega_0^2}{s^2 + 2\zeta \omega_0 s + \omega_0^2}with:ω0=2π4229  rad/s,ζ0.24\omega_0 = 2\pi \cdot 4229 \;\text{rad/s}, \quad \zeta \approx 0.24gives a reasonable match.
  2. The measurement system transfer function is a scaling block. In this example, let us keep this at 1/4. We will revisit this number during practical implementation. Since we are controlling based on our measurement, to achieve an output voltage of 5 V, we need to set Vref to 1.25 V. The simplest controller we can construct is a unity gain feedback. We will observe four plots as we start tweaking the controller design. The Nyquist plot (key thing to observe here is: Are we encompassing -1+ j0 point?), the bode plot ( positive gain margin and phase margin and we will get to more features in a moment), time domain plot (key thing to observe, if it has a steady state, if the steady state matches the reference, and if we are "happy" with the transient, and the controller output plot (recall at the end of the day, the controller output is a duty ratio which is bounded by zero and 1). Figure 2 shows the plots. Clearly you can observe the feedback system is stable (from all three plots) but that Fig. 2(c) has steady state error.
  1. Obviously we are stable. But we have a steady state error. We wanted 5 V got aroung 3.6 V. Transient is relatively fast but the control actions goes beyond 0 and 1. In practice, we will be limited by the duty ratio limit and the response would be a bit different. Let us solve the steady state error problem first by adding an integrator instead of unity gain. This integrator gives an infinite gain at dc which eliminates steady-state error in time. We will keep the gain of the integrator to unity for the momemnt.
  2. For K(s)=1/s, the same plots look like:
  1. We are still stable. Note how bode plot has a 20 db/decade slope at the low frequencies (implying infinite gain in dc), also because of the integrator the phase plot starts from -90 deg instead of 0 deg in the previous case. In time domain plot we have eliminated steady state error, control input also stays nicely between 0 and 1. The next problem solve is the transient response--its super sluggis...it takes 2 seconds to reach steasdy state, obviously not great for a power converter. To improve the transient reponse, we can increase the gain of the controller in this case. Below shows the diagrams for three cases with gain = 1000, 4000, and 10000.

As you can see, K=10000, the system becomes unstable (we have encompassed -1, j0 point). K = 1000 and 4000, one is bit slower but the other has more oscialltions. Depending on the requirement, we can pick a K. The parameters to watch are Phase margin, the higher the margin, less oscillatory it will be but it will also lead to lower response time. This can be see by the gain cross over frequency. IT changed from 2520 rad/s to 12220 rad/s indicating a faster transient response.

  1. The next question to ask is can we make the response faster without making it oscillatory--another way to frame this question is can we increase the gain cross over frequency and still have higher phase margin? Cant be done by gain of the integrator alone because the sharp change in phase hapening at the resonant frequency Needs another zero in the controller transfer function. But if we add a zero we need to add another high frequency pole so that the overall loop gain transfer function still have a -40 db/decade at high frequencies for better noise roll off. This gives rise to Type II compensator, whose control transfer function look like. The location of the zero is selected such that at the resonant frequency of the plant we get a phase boost of 90 degree. means we add the zero atleast a decade earlier....and add the high frequency pole at lease a decade later so that its phase dont interfere at the resonant frequency.
  1. Many times not good enough for lightly damped system..you can see that the red is still have oscillatory behaviour.....add another zero to get more phase margin...and another pole becomes Type III. more implementation complexity particularly in the analog world...but can be used...we will stop at Type II.
  2. If you have access to MATLAB, you can try controlSystemDesigner('bode',G,C,H). This will open a window where you can tune the controller and locate the pole and zero of the controller to get a reponse of your liking. Check the code section.

Now that we have a decent understanding of how to design the controller theoretically, the next step is to implement in the analog domain using opamps.

Figure shows the analog circuit using opamp that is used to implement a Type I controller (also compensator). The buck converter output voltage is scaled using a potential divider R1 and R2. The elements R3 and Cint creates the integrator with a controllable gain. Rleak provides an option to prevent integrator saturation if enabled. Rz and Dz creates a diode clamped circuit to limit the vcontrol signal within 0 and the peak of the carrier waveform Vcar. The duty ratio is Vcontrol over Vcar. Now let us do some math to figure out the controller transfer function if implemented this way and match it with the theoretical design.

The thevenin equivalent circuit looking into the sensing network gives rise to:

Using ideal opamp equations (which can be used if we choose Opamps which has a much higher gain bandwidth product compared to our frequencies of interest) and for cases where the zener diode is not in action, the transfer function from Vref to Vcontrol is given by....This is large signal in small signal where Vref is Vref + Vreftilda, the small signal transfer function. As you can see it has the similar framework as K/s. In the large signal case, we can see as if we have a feedforward term from Vref to Vcontrol, which can be helpful in some way...

Similarly for Type II implementation we have a circuit, which has additional elements in the opamp feedback network as shown below.

As before, we can come up with the transfer function from Vmid_sense to Vcontrol. When mapping the controller gain from the theoretical value to the implmentation value please

An interesting difference between the theoretical analysis to that of the implemented controller is how Vref to Vo changes due to feedforward of the reference. Many thimes this is helpful, as the controller has to do less effort in getting to the steady state. If the potential divider and modulator gain are designed carefully, the feedforward can provide control input even before the controller reacts due to the error.

🧰 Required Components

The components needed in this lab are:

  • Red Board
  • Blue Board
  • Oscilloscope
  • Signal Generator
  • Multimeter
  • Current probe (if interested in measuring inductor current)

🎥 Overview Video

This video gives you a quick glimpse of what you can expect from this lab.

🛡️ Safety

Watch out for potential safety issues.

  1. Confirm probe grounds are properly connected for each measurement.
  2. Don't power the blue board using both the USB-C cable and the power adapter.
  3. Always disconnect the power once you are done with the experiment.

⚠ Common Mistakes

  1. The gate of a MOSFET is directly connected to a microcontroller digital pin to perform switching actions without a gate driver.
  2. Incorrect grounding between comparator output, vref source, and carrier source. All of the signals are referenced relative to gnd of the blue board.
  3. Scope probe not set to dc-coupling.
  4. The reference of the scope channels are not properly set to zero at the start of the experiment. This will lead to incorrect reading of the signals.
  5. Forgetting to record Capacitances (C).

Arduino Code

Not applicable.

Matlab Code for Plant Identification

plant
%% Experiment C3: Measured Bode Data and Identified Buck Plant
clear; clc; close all;

%% Paste measured data here: [Frequency_Hz, Magnitude_dB, Phase_deg]
data = [
10	20.0028223	-2.514754857
10.97498765	20.00192129	-2.334081822
12.0450354	20.00736401	-2.10876997
13.21941148	20.00611721	-1.93494749
14.50828778	20.00351947	-1.789560137
15.92282793	20.00275542	-1.659362344
17.475284	20.0038644	-1.544075211
19.17910262	20.0057258	-1.422055962
21.04904145	20.00056013	-1.322160504
23.101297	20.00080701	-1.227857342
25.35364494	20.00401021	-1.154408461
27.82559402	20.00373222	-1.08016905
30.53855509	19.99915776	-1.007779303
33.51602651	20.00317017	-0.99491473
36.78379772	20.0014183	-0.909566441
40.37017259	19.99515375	-0.893940297
44.30621458	19.99646451	-0.856481424
48.6260158	19.99514546	-0.856329911
53.36699231	19.99439037	-0.858631581
58.57020818	19.99287246	-0.84730729
64.28073117	19.99620909	-0.825148671
70.54802311	19.99490709	-0.859663326
77.42636827	19.99051543	-0.87835764
84.97534359	19.99662441	-0.912584419
93.26033469	19.99238194	-0.960391182
102.3531022	19.99228063	-0.987129883
112.3324033	19.99486346	-1.044530219
123.2846739	19.9930863	-1.109120723
135.3047775	19.99498788	-1.178728535
148.4968262	19.99544516	-1.231407361
162.9750835	19.99542994	-1.335523647
178.8649529	19.99500704	-1.439991206
196.304065	19.99825965	-1.531428402
215.443469	19.99859216	-1.666300596
236.4489413	19.99812763	-1.795908787
259.5024211	20.00134576	-1.963267746
284.8035868	20.00326148	-2.136931624
312.571585	20.00536279	-2.307941535
343.0469286	20.0071946	-2.516921969
376.4935807	20.01215251	-2.74077325
413.20124	20.01539413	-2.979072794
453.4878508	20.02284484	-3.248420057
497.7023564	20.03184002	-3.530978945
546.2277218	20.04397169	-3.861028676
599.4842503	20.05588639	-4.208155387
657.9332247	20.07378059	-4.58432299
722.0809018	20.09952528	-5.006182141
792.4828984	20.12367864	-5.445107522
869.7490026	20.15765561	-5.93330397
954.5484567	20.20077059	-6.485978256
1047.615753	20.25898346	-7.094798968
1149.756995	20.33183191	-7.76216431
1261.856883	20.42045559	-8.50035027
1384.886371	20.53282296	-9.368958098
1519.911083	20.67597488	-10.34902725
1668.100537	20.85631639	-11.51558022
1830.73828	21.07873075	-12.89674403
2009.233003	21.3620709	-14.57294662
2205.13074	21.71560334	-16.67577115
2420.128265	22.16091815	-19.37831645
2656.087783	22.71899453	-22.96179639
2915.053063	23.41330125	-27.93471712
3199.267138	24.2489123	-35.17245197
3511.191734	25.1655912	-46.07153871
3853.528594	25.8742802	-62.04661707
4229.242874	25.86179374	-82.06015176
4641.588834	24.84578755	-102.1868638
5094.138015	23.03693702	-119.0356483
5590.810183	20.84059288	-131.630477
6135.907273	18.54147972	-140.6648176
6734.150658	16.2776173	-147.0810646
7390.722034	14.09491242	-151.6560884
8111.308308	12.01395615	-154.8906836
8902.150854	10.0476177	-157.1025214
9770.099573	8.214444261	-158.6173597
10722.67222	6.520092064	-160.0575066
11768.11952	4.883409678	-161.9720076
12915.49665	3.21378201	-164.0918888
14174.74163	1.490956012	-165.95195
15556.76144	-0.240539188	-167.4130973
17073.52647	-1.955254743	-168.4898689
18738.17423	-3.644760251	-169.2819172
20565.12308	-5.332481132	-169.9946747
22570.1972	-6.98556958	-170.5509421
24770.76356	-8.647806069	-171.0273983
27185.88243	-10.31242669	-171.2604808
29836.4724	-11.97512677	-172.0175216
32745.49163	-13.59989048	-171.6701965
35938.13664	-15.29292232	-171.6620848
39442.06059	-17.00928283	-172.3587968
43287.61281	-20.2148371	-168.6489977
47508.10162	-17.97964985	-164.0527226
52140.08288	-22.11576173	-162.450398
57223.67659	-19.62620262	-176.3029059
62802.91442	-22.45053991	-178.2410966
68926.12104	-24.22665661	-179.4248315
75646.33276	-25.79800333	179.8752848
83021.75681	-27.31825429	178.8774177
91116.27561	-29.13800895	176.4789999
100000	-29.34048478	-135.4607238
];

%% Extract measured data
f_meas = data(:,1);
mag_meas_dB = data(:,2);
phase_meas_deg = data(:,3);

%% Identified plant model
Kdc = 10;          % DC gain, 20 dB
f0 = 3900;         % resonant frequency in Hz
zeta = 0.28;       % damping ratio

w0 = 2*pi*f0;

G = tf(Kdc*w0^2, [1 2*zeta*w0 w0^2]);

%% Evaluate identified model at measured frequency points
w_meas = 2*pi*f_meas;
[mag_model, phase_model] = bode(G, w_meas);

mag_model = squeeze(mag_model);
phase_model = squeeze(phase_model);

mag_model_dB = 20*log10(mag_model);
phase_model_deg = squeeze(phase_model);

%% Plot measured data and identified plant
figure;

subplot(2,1,1);
semilogx(f_meas, mag_meas_dB, 'o', 'LineWidth', 1.2); hold on;
semilogx(f_meas, mag_model_dB, '-', 'LineWidth', 2);
grid on;
ylabel('Magnitude (dB)');
title('Measured Bode Plot and Identified Buck Converter Plant');
legend('Measured Data', 'Identified Plant', 'Location', 'Best');

subplot(2,1,2);
semilogx(f_meas, phase_meas_deg, 'o', 'LineWidth', 1.2); hold on;
semilogx(f_meas, phase_model_deg, '-', 'LineWidth', 2);
grid on;
xlabel('Frequency (Hz)');
ylabel('Phase (deg)');
legend('Measured Data', 'Identified Plant', 'Location', 'Best');

%% Display plant transfer function
disp('Identified plant transfer function G(s):');
G

Matlab Code for Controller Design

%% Experiment C3: Controller Comparison for Voltage-Mode Buck Converter
clear; clc; close all;

%% Formatting
set(groot,'defaultAxesFontSize',14);
set(groot,'defaultTextFontSize',14);
set(groot,'defaultLineLineWidth',2.5);

s = tf('s');

%% Plant transfer function
G = 7.07e9/(s^2 + 1.28e4*s + 7.07e8);

%% Measurement block
H = 1/4;

%% Desired output and reference
Vout_desired = 5;
Vref = H*Vout_desired;     % 1.25 V

%% Common axes for loop-gain plots
w = logspace(1,6,1500);    % rad/s
f = w/(2*pi);

bode_mag_lim   = [-80 40];
bode_phase_lim = [-300 0];

nyquist_x_lim = [-6 6];
nyquist_y_lim = [-6 6];

%% Controllers to compare
controllers(1).name = 'Unity Gain Controller';
controllers(1).K = tf(1);
controllers(1).t_final = 0.01;
controllers(1).time_ylim = [0 8];

controllers(2).name = 'Pure Integral Controller with Unity Gain';
controllers(2).K = 1/s;
controllers(2).t_final = 10;
controllers(2).time_ylim = [0 8];

controllers(3).name = "Integral Controller with |K|=1000";
controllers(3).K = 1000/s;
controllers(3).t_final = 0.01;
controllers(3).time_ylim = [0 8];

controllers(4).name = "Integral Controller with |K|=4000";
controllers(4).K = 4000/s;
controllers(4).t_final = 0.01;
controllers(4).time_ylim = [0 8];

controllers(5).name = "Integral Controller with |K|=10000";
controllers(5).K = 10000/s;
controllers(5).t_final = 0.01;
controllers(5).time_ylim = [0 8];

controllers(6).name = 'Type II Controller';

% Extract parameters from:
% 21813 (s + 2.143e04) / [ s (s + 1.522e05) ]

wz = 2.143e4;      % zero (rad/s)
wp = 1.522e5;      % pole (rad/s)

fz = wz/(2*pi);    % zero in Hz (for reference)
fp = wp/(2*pi);    % pole in Hz (for reference)

% Base Type II structure
K_base = (s + wz)/(s*(s + wp));

% Gain from given controller
K_gain = 21813;

controllers(6).K = K_gain * K_base;

controllers(6).t_final = 0.02;
controllers(6).time_ylim = [0 6];

%% Run controllers one by one
for idx = 1:1:length(controllers)

    K = controllers(idx).K;
    controller_name = controllers(idx).name;

    L = K*G*H;
    T = feedback(K*G,H);      % Vout/Vref
    T_meas = H*T;              % H*Vout/Vref

    t_final = controllers(idx).t_final;

    [y,t] = step(Vref*T,t_final);
    [yh,~] = step(Vref*T_meas,t);

%% Error and control input
e = Vref - yh;

if isequal(K,tf(1))
    u = e;
else
    u = lsim(K,e,t);
end

    Vout_ss = dcgain(Vref*T);
    ess_out = Vout_desired - Vout_ss;

    [Gm,Pm,Wcg,Wcp] = margin(L);

    if isinf(Gm)
        Gm_dB_text = 'Inf';
    else
        Gm_dB_text = sprintf('%.2f dB',20*log10(Gm));
    end

    if isnan(Pm)
        Pm_text = 'NaN';
    else
        Pm_text = sprintf('%.2f deg',Pm);
    end

    fprintf('\n==============================================================\n');
    fprintf('%s\n',controller_name);
    fprintf('==============================================================\n');
    fprintf('Reference voltage = %.4f V\n',Vref);
    fprintf('Desired output voltage = %.4f V\n',Vout_desired);
    fprintf('Steady-state output voltage = %.6f V\n',Vout_ss);
    fprintf('Output steady-state error = %.6e V\n',ess_out);
    fprintf('Gain margin = %s\n',Gm_dB_text);
    fprintf('Phase margin = %s\n',Pm_text);
    fprintf('Gain crossover frequency = %.2f Hz\n',Wcp/(2*pi));
    fprintf('Phase crossover frequency = %.2f Hz\n',Wcg/(2*pi));

%% 1. Bode plot with GM and PM
local_bode_margin_plot(L,w,f,bode_mag_lim,bode_phase_lim, ...
    'Loop Gain Bode Plot');

%% 2. Nyquist plot
local_nyquist_plot(L,nyquist_x_lim,nyquist_y_lim, ...
    'Nyquist Plot');

%% 3. Time-domain response
local_step_plot(t,y,Vout_desired,Vout_ss,ess_out, ...
    controllers(idx).time_ylim,t_final, ...
    'Closed-Loop Step Response');

%% 4. Control input response
    local_control_plot(t,u,t_final, ...
        'Control Input');

    %% Pause before next controller
    if idx < length(controllers)
        disp(' ');
        disp('==============================================================');
        disp('Press any key to continue to the next controller.');
        disp('The Nyquist and Bode axes will remain the same.');
        disp('The time-domain axis will be adjusted to show the main feature.');
        disp('==============================================================');
        pause;
    end
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Local functions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function local_bode_margin_plot(L,w,f,mag_lim,phase_lim,title_text)

    figure('Color','w');

    margin(L);
    grid on;

    title(title_text,'FontSize',18);

    % Make lines thick
    h = findall(gcf,'Type','line');
    set(h,'LineWidth',3);

    % Set fonts and axes
    ax = findall(gcf,'Type','axes');
    set(ax,'FontSize',16,'LineWidth',1.5);

    % Force same x-axis for all controllers
    for k = 1:length(ax)
        xlim(ax(k),[1e3 1e6]);   % rad/s
    end

    % Force same y-axis for magnitude and phase
    for k = 1:length(ax)
        yl = get(get(ax(k),'YLabel'),'String');

        if contains(yl,'Magnitude')
            ylim(ax(k),[-60 20]);
        elseif contains(yl,'Phase')
            ylim(ax(k),[-180 0]);
        end
    end

end

function local_nyquist_plot(L,x_lim,y_lim,title_text)

    figure('Color','w');
    nyquist(L);
    grid on;
    title(title_text,'FontSize',18);

    hline = findall(gcf,'Type','line');
    set(hline,'LineWidth',3);

    ax = findall(gcf,'Type','axes');
    set(ax,'FontSize',16,'LineWidth',1.5);
    xlim(x_lim);
    ylim(y_lim);

    hold on;
    plot(-1,0,'rx','MarkerSize',14,'LineWidth',3);
    text(-1,0.25,'-1 + j0','FontSize',16, ...
        'HorizontalAlignment','center');

end

function local_step_plot(t,y,Vout_desired,Vout_ss,ess_out,y_lim,t_final,title_text)

    figure('Color','w');

    plot(t,y,'LineWidth',3); hold on;
    plot(t,Vout_desired*ones(size(t)),'--','LineWidth',2.5);
    plot(t,Vout_ss*ones(size(t)),':','LineWidth',2.5);

    grid on;
    xlabel('Time (s)');
    ylabel('Output Voltage V_{out} (V)');
    title(title_text,'FontSize',18);

    legend('V_{out}(t)', ...
           'Desired output = 5 V', ...
           'Steady-state output', ...
           'Location','best');

    ylim(y_lim);
    xlim([0 t_final]);

    set(gca,'FontSize',16,'LineWidth',1.5);

    %% Highlight steady-state error
    t_arrow = 0.85*t_final;

    if abs(ess_out) > 1e-3
        plot([t_arrow t_arrow],[Vout_ss Vout_desired],'k','LineWidth',3);

        text(t_arrow*0.65,(Vout_ss + Vout_desired)/2, ...
            sprintf('Steady-state error = %.3f V',ess_out), ...
            'FontSize',15);
    else
        text(0.45*t_final,0.85*y_lim(2), ...
            sprintf('Steady-state error \\approx %.2e V',ess_out), ...
            'FontSize',15, ...
            'BackgroundColor','w', ...
            'EdgeColor','k');
    end


end

    function local_control_plot(t,u,t_final,title_text)

    figure('Color','w');

    plot(t,u,'LineWidth',3);
    grid on;

    xlabel('Time (s)');
    ylabel('Control Input u(t)');
    title(title_text,'FontSize',18);

    xlim([0 t_final]);

    set(gca,'FontSize',16,'LineWidth',1.5);

end

Matlab Code for using Control System Designer Toolbox

%% Open Control System Designer for Experiment C3
clear; clc; close all;

s = tf('s');

%% Plant: buck converter duty-to-output transfer function
G = 7.07e9/(s^2 + 1.28e4*s + 7.07e8);

%% Sensor / measurement gain
H = 0.25;

%% Controller: Start here and gradually add zero and poles.
C = 1;

%% Explicit sensor architecture, if supported
controlSystemDesigner('bode',G,C,H)

🧷 Jumper Settings

For this experiment, we will be using only the black board.

Blue Board:

JumperFunctionSettingNote
JP4Carrier waveform selection (Option 1: Constant, Option 2: External Carrier, Option 3: Sawtooth waveform internally generated)Position 3 (we will use internal sawtooth)-
JP5Reference signal selection (Option 1: a dc, whose magnitude can be varied using the potentiometer Rduty1, Option 2: any external signal that ranges between 0 and 5 V, Option 3: Voltage mode (we will use this later on for closed-loop control)Position 3 (Analog voltage mode controller drives the reference signal to the PWM)-
JP3The PWM input signal to the deadtime generation circuit can be provided in three ways. (Option 1: Using an external PWM source, for example, an Arduino generating PWM pulses, Option 2: Internal PWM that is generated by the PWM generation circuit, and Option 3: Using current-mode control.)Position 2. We will generate PWM using the internal comparator-
JP1The gate of the high-side MOSFET [qH (in Blue Board) or PWM_H(in Red Board)] can be fed three signals. (Option 1: q1 signal from the dead time compensation circuit, Option 2: gnd, Option 3: q2 signal from the dead time compensation circuit). Note that q1 follows q(t) and q2 is complementary.Position 1. We will use the half-bridge in synchronous mode.
JP2The gate of the low-side MOSFET [qL (in Blue Board) or PWM_L(in Red Board)] can be fed three signals. (Option 1: q2 signal from the dead time compensation circuit, Option 2: gnd, Option 3: q1 signal from the dead time compensation circuit). Note that q1 follows q(t) and q2 is complementary.Position 1. We will use the half-bridge in synchronous mode.
JP6Filter selection for the onboard measured inductor current. (Option 1: RC filter with a cut-off frequency at 159 Hz, Option 2: RC filter with a cut-off frequency at 1.59 MHz, Option 3: No filter).Position 3. We are interested in measuring the unfiltered inductor current in this experiment.
JP7Selection between only voltage mode or outer-loop voltage mode and inner loop current mode control. (Option 1: Only voltage mode. Option 2: Outer-loop voltage-mode control sends the reference to the inner-loop current-mode control.Position 1. We will use only the voltage mode controller in this experiment
JP8Selection between Type I or Type II voltage mode control. (Option 1: Type I, Option 2: Type II)We will start with Type I (Position 1) and move to Type II when asked (Position 2).
JP9Current mode control. The clock pulse (rising edge) is internally generated (position 1) or externally provided (position 2). This indirectly determines the switching frequency in current-mode control.X.
JP10Voltage feedback to the analog controller. Option 1. Vhigh_sns is fed back (useful for Boost converter voltage control, Option 2. Vmid_sns is fed back (useful for Buck converter voltage control)Position 2. We will be sending back the output voltage of the buck converter to the controller.

Red Board:

JumperFunctionSettingNote
J7Populating this jumper provides the 12 V supply to the gate driver. (Option 1: 12 V is internally generated, Option 2: An External supply is needed)Position 1. We will provide the internally generated 12V supply to the gate driver.-
J10 and J11These jumpers allow changing the direction of current measurement through the Rsense resistor. (Option 1: Current can be measured flowing from L2 to Vmid terminals, Option 2: Current can be measured flowing from Vmid to L2 terminals)Position 1. (We will set it up to measure the buck converter current.)

Keep all the other jumpers unpopulated.

⚙️ Circuit Configuration & Setting up the experiment

We will configure the red and blue boards to operate as a synchronous buck converter by connecting an external inductor (recommended value: 30 µH) and a load resistor using Bank A and Bank B in parallel. This configuration allows the load resistance to be varied by adding parallel resistors, enabling operation from no-load to the following approximate values: 51 Ω, 8.36 Ω, 4.55 Ω, 3.13 Ω, and 2.38 Ω. If a current probe is available, the inductor current should also be measured. The system is powered via USB. The reference signal to the controller can be provided either through the on-board potentiometer and tactile switch or using a signal generator. Please be extra cautious: The signal Vref. should always stay between 0 and 5 V, else we will destroy the voltage controller IC on the blue board.

Use the checklist below to mark each step as you complete it. You can download it later on to verify that you have performed all the steps.

Startup & Setup Checklist

Word of caution: the signal generator output must remain between 0 V and 5 V under all conditions. Exceeding this limit can destroy the opamp for voltage mode control on the Blue Board. Always ensure V_ref is within 0 and 5V before connection.
Red Board + External Components
Blue Board
Blue Board
Red Board
All signals are measured with respect to GND (black test points).
V_ref(t) is now provided either from Ext. Vref within the blue board or by the external signal generator.
Blue Board
Red Board
Initial Power-Up (Before Signal Injection)
Signal Generator Setup (Before Connecting to Blue Board)
Ext. Ref Setup
Connect and Verify

🧪 Experiment

Download the checklist above and ensure you have completed all steps before we power on. We will go through the following steps:

  1. Probe the following signals on the oscilloscope: Analog Cnt. D (controller output, Blue Board) q(t) (PWM signal, Blue Board) Vmid​ (Red Board) and Ch4 Inductor current (using external current probe or using iL_filt1 onboard measurement). Ensure all signals share a common ground reference and are properly scaled for clear observation on the oscilloscope.
  2. Reference Tracking and Transient Observation: As you vary the Ref. potentiometer, observe that q(t) is automatically adjusted by the controller to meet the reference. Verify that Vmid​ follows the reference set by the Ref. potentiometer. Adjust the Ref. potentiometer such that Vmid​≈5V. Ensure that the load resistance is 10 Ohm||10 Ohm||51 Ohm (~4.33 Ohm).
  3. Transient Response Measurement: Configure the oscilloscope to single trigger on the rising edge of Analog Cnt. D. Set the time scale to approximately 400 µs (adjust as needed). Using the tactile switch, press and release it to generate a step change on the reference signal. Observe the transient response of Vmid​ as it transitions from 0 V to 5 V. Capture the scope shot.
  4. Effect of Controller Gain: Vary the gain using the Rp1​ potentiometer on the Blue Board. Observe the effect on transient response: at low gain, the response is sluggish (slow rise, minimal overshoot). At high gain, the response is faster (reduced rise time, increased overshoot or ringing). Use the “G” marking and arrows on the blue board to identify the direction for increasing or decreasing gain.
  5. Next, let us turn off the 10 V power supply. Disconnect the USB.
  6. Replace the input to V_ref from Ext. Ref. to the signal generator. Probe the signal generator output one more time before feeding it to the Blue Board using the control port. Replace q(t) measurement with that of V_ref measurement on the scope.
  7. Plug the USB back in and then gradually increase the 10 V power supply. We are ready to do some measurements. If you trigger the scope using the V_ref signal, you should observe a clean transient response of Vmid and inductor current, as well as the controller output.
  8. Data Collection: We will repeat the transient measurement across multiple gain settings and loads, and use the table below to capture the data. For each test case, measure the following transient performance metrics from the Vmid​ waveform:
    • Rise Time: Time taken for VmidV_{mid}​ to rise from 10% to 90% of its final value.
    • Overshoot: Percentage by which VmidV_{mid} exceeds its final steady-state value, defined as%OS=VpeakVfinalVfinal×100\%OS = \frac{V_{\text{peak}} - V_{\text{final}}}{V_{\text{final}}} \times 100
    • Settling Time: Time taken for VmidV_{mid}​ to remain within ±5% of its final value.
    • Often, the scope can directly provide you with rise-time and overshoot measurements.
  9. Adjust the Rp1​ potentiometer to obtain at least 5 distinct data points, spanning: Lowest overshoot (well-damped response) to largest overshoot (underdamped response)
  10. Adjust the Rp1​ potentiometer such that the overshoot is 15%. Next, vary the loads, going from a heavy load (2.38 Ohm) to the lightest load (51 Ohm). Again, record the above-mentioned features of the transient waveform.
  11. Turn off the 10 V power supply. Move on to the Type II controller by setting jumper JP8 to position 2. Ensure that the load resistance is 10 Ohm||10 Ohm||51 Ohm (~4.33 Ohm).
  12. Turn on the 10 V power supply gradually.
  13. Repeat Steps 9 and 10.
  14. If you have access to soldering stations and 1206 package surface-mount capacitors and resistors, design a controller that outperforms the on-board controller. The performance metric is to limit the overshoot to 15% while increasing the settling time faster than the onboard controller for the 4.55 Ohm load case.

C3 Transient Response Data Collection Tool

Record rise time, overshoot, and settling time for Type I and Type II controllers under gain variation and load variation.

Measurement guidelines: Measure Vmid during the step response. Rise time is measured from 10% to 90% of the final value. Overshoot is measured relative to the final value. Settling time is the time required for Vmid to remain within ±5% of the final value.
Subgroup 1: Gain Variation - Type I Controller

Fixed condition: Load = 10 Ω || 10 Ω || 51 Ω ≈ 4.55 Ω.

CaseControllerGain SettingLoad R (Ω) Rise Time (µs)Overshoot (%)Settling Time (µs)Observations
1Type ILowest Overshoot
2Type ILow-Medium
3Type IMedium
4Type IMedium-High
5Type ILargest Overshoot
Subgroup 2: Load Variation - Type I Controller

Adjust Rp1 such that overshoot is approximately 15% for 4.55 Ω Load. Then keep gain fixed.

1Type IFixed
2Type IFixed
3Type IFixed
4Type IFixed
5Type IFixed
Subgroup 3: Gain Variation - Type II Controller

Fixed condition: Load = 10 Ω || 10 Ω || 51 Ω ≈ 4.55 Ω.

1Type IILowest Overshoot
2Type IILow-Medium
3Type IIMedium
4Type IIMedium-High
5Type IILargest Overshoot
Subgroup 4: Load Variation - Type II Controller

Adjust Rp1 such that overshoot is approximately 15% for 4.55 Ω Load. Then keep gain fixed.

1Type IIFixed
2Type IIFixed
3Type IIFixed
4Type IIFixed
5Type IIFixed

Turn off Checklist

Before we close the experiment, please ensure:

Turn-Off & Shutdown Checklist

🧠 Observations & Analysis

Now, let us analyze the data you collected to write a brief report that solidifies our understanding. Structure the report to include the following:

  1. Restate the objectives of this experiment in your own words. Your response should address the following: How does controller design (Type I vs Type II) influence the transient response of a buck converter? What is the effect of controller gain on rise time, overshoot, and settling time? How does the load resistance influence the transient response, and how does this compare to the effect of controller design?
  2. Theory: Explain the role of the controller in shaping transient response: Why does increasing gain generally reduce rise time but increase overshoot? What is the role of the integrator (Type I) in steady-state accuracy? What additional feature does a Type II controller introduce, and how does it improve performance? Discuss how phase margin is related to: Overshoot, Damping, and Robustness.
  3. Using the scope shot of Step 3, explain the controller action and switching signal. Explain how the inductor current transients during the step change. Can you identify the effect of the reference feedforward on the controller output?
  4. Gain Variation Analysis (Type I Controller): Using the data collected in Subgroup 1, analyze the effect of increasing gain: As gain increases, how does rise time change? How does overshoot vary? Does the system transition from overdamped → underdamped behavior?
  5. Load Variation Analysis (Type I Controller) Using the data collected in Subgroup 2, analyze the effect of load variation: As load resistance increases (heavy → light load), how does: Does the system become more or less damped at light load?
  6. Gain Variation Analysis (Type II Controller)
  7. Using the data collected in Subgroup 3, repeat the same analysis: Compare rise time and overshoot trends with Type I. For the same overshoot, does Type II achieve faster response? For the same rise time, does Type II reduce overshoot? Explain why Type II outperforms Type I, referring to: Phase boost, improved phase margin near crossover.
  8. Using the data collected in Subgroup 4, repeat the analysis and compare the results with those from Type I. At which load condition does Type II provide the most benefit? At which load condition do Type I and Type II behave similarly? Explain why controller influence reduces at heavy load.
  9. Controller vs Plant Dominance: Based on your observations, when does the controller dominate system behavior? When does the plant (LC + load) dominate behavior? Explain how this depends on: Load resistance and Damping
  10. What would be the trade-off of changing the controller structure from Type II to Type III?
  11. If you have step 14, show your theoretical calculations along with experimental results and compare them.
  12. Write a short conclusion summarizing the main findings of the experiment. Your conclusion should address: How does controller design influence transient performance? Why does Type II provide improved performance over Type I? The role of load in determining system damping. The importance of balancing speed and stability in control design.

✔ Conclusion

The experiment demonstrates that controller design and gain strongly shape the transient response, with Type II control achieving a superior balance between speed and damping, while load conditions ultimately determine the system’s inherent performance limits.

🔍 References & further reading

  • Erickson, R.W. and Maksimovic, D. (2020). Fundamentals of Power Electronics. 3rd Edition, Springer, Berlin.