Software Oriented
Implementing Closed-Loop Control of a Buck Converter Using PID Controller
Aim
To design, simulate, and analyze a buck converterbuck converterA step-down DC-to-DC power converter that reduces voltage while stepping up current. It typically uses closed-loop PID control to maintain strict voltage regulation against load variations. under both open-loop and closed-loop PID control using MATLAB/Simulink.
- To design and simulate a buck converter using MATLAB/Simulink.
- To implement closed-loop voltage control using a PID controllerpid controllerA generic control loop feedback mechanism (Proportional-Integral-Derivative) widely used in industrial control systems to continuously calculate an error value and apply a precise dynamic correction..
- To analyze the open-loop operation of the buck converter.
Apparatus & Software
| Sl. No. | Apparatus / Software | Technical Specification | Quantities |
|---|---|---|---|
| 1 | MATLAB / Simulink | R2023 or compatible, with Simscape Power Systems / Specialized Power Systems toolbox | 1 |
| 2 | Buck Converter (Simulated) | Vin = 48 V, Vo = 15 V, L = 85 µH, C = 125 µF, RL = 8 Ω, fsw = 40 kHz | 1 (simulation) |
| 3 | PID Controller Block | Simulink built-in PID controller block for closed-loop feedback | 1 |
Theory
A buck converter is a DC–DC switching converter used to step down a higher input DC voltage to a lower output voltage with high efficiency. The output voltage is regulated by controlling the duty cycle of a high-frequency switching signal applied to a power electronic switch.
The basic components of a buck converter include a controlled switch, diode, inductor L, capacitor C, and a resistive load R. The duty cycle D of the switch is defined as:
where T_on is the ON time of the switch and T is the switching period.

Figure 1: Equivalent circuit diagram of a buck converter
Under ideal conditions and continuous conduction mode, the average output voltage of the buck converter is directly proportional to the duty cycle and the input voltage:
The inductor stores energy when the switch is ON and releases energy to the load when the switch is OFF. The capacitor filters the output voltage and reduces ripple by maintaining a smooth voltage across the load.
In open-loop operation, the duty cycle is fixed and the output voltage depends on the input voltage and load conditions. The efficiency of the buck converter is defined as:
Pre-Lab / Circuit Diagram

Figure 2: Open-loop Simulink model of the buck converter

Figure 3: Closed-loop Simulink model of the buck converter
Procedure
Open-Loop Operation:
- Build the open-loop Simulink model of the buck converter as shown in Figure 2.
- Set the simulation parameters as per Table 1 (Vin = 48 V, L = 85 µH, C = 125 µF, RL = 8 Ω, fsw = 40 kHz, duty cycle = 31.25%).
- Replace the PWM generator with a pulse generator having a fixed duty cycle.
- Run the simulation and observe the output voltage, inductor current, diode current, and pulse waveforms.
- Record the steady-state output voltage.
Closed-Loop PID Control Operation:
- Build the closed-loop Simulink model as shown in Figure 3 by adding a PID controller block in the feedback path.
- Set the reference voltage to 15 V.
- Configure the PID controller with appropriate gain values.
- Run the simulation and observe the error signal, duty ratio, output current, output voltage, diode current, pulse, and inductor current waveforms.
- Compare the closed-loop output voltage with the open-loop result and the reference voltage.
Simulation / Execution
The buck converter was simulated in MATLAB/Simulink under both open-loop and closed-loop conditions. The simulation parameters used are listed below.
| Parameter | Value |
|---|---|
| Input Voltage (Vin) | 48 V |
| Reference Voltage (Vo) | 15 V |
| Inductance (L) | 85 µH |
| Capacitance (C) | 125 µF |
| Load Resistance (RL) | 8 Ω |
| Switching Frequency | 40 kHz |
| Pulse Width (Duty Cycle) | 31.25% of time period |
Observations
The closed-loop simulation outputs are shown below. Note: The time axis in the bottom portions of both figures is scaled to a different level, since the switching frequency is very high. The diode current, inductor current, and pulse waveforms are zoomed in while other signals are kept at the original time scale.

Figure 4: Closed-loop operation — Error, Duty Ratio, Output Current, Output Voltage (top); Diode Current, Pulse, Inductor Current zoomed (bottom)

Figure 5: Closed-loop operation — Output Current, Output Voltage (top); Diode Current, Pulse, Inductor Current zoomed (bottom)
Calculations
The key parameters of the buck converter are calculated using the simulation results.
Duty Cycle (D)
The duty cycle of a buck converter is given by:
Substituting the observed output voltage Vo = 14.4 V and Vin = 48 V:
Inductance (L)
The inductor value for continuous conduction mode is calculated as:
where ΔI_L = inductor current ripple = 3.2 A, f_sw = 40 kHz:
Capacitance (C)
The output capacitance estimated from the desired output voltage ripple ΔVo (closed-loop control):
Substituting ΔI_L = 3.2 A, f_sw = 40 kHz, ΔVo = 0.06 V:
Results & Analysis
The simulation results clearly demonstrate the difference between open-loop and closed-loop operation of the buck converter.
| Operating Mode | Output Voltage | Duty Cycle | Voltage Ripple | Remarks |
|---|---|---|---|---|
| Open-Loop | ~14.4 V (slightly below 15 V) | Fixed at 31.25% | Present | Output depends solely on fixed duty cycle; no feedback correction |
| Closed-Loop (PID) | ~15 V (regulated) | Continuously adjusted by PID | Almost none | PID actively corrects duty cycle based on output error |
In open-loop mode, the output voltage settled slightly below 15 V due to the fixed pulse width (duty cycle ≈ 31.25%). According to Vo = D·Vin, a duty cycle of approximately 0.31 results in an output close to 14.4 V. Since no feedback correction was present, the output depended only on the pulse width.
In closed-loop mode, the PID controller continuously adjusted the duty cycle with respect to changes in output voltage, resulting in a stable output of approximately 15 V with almost no voltage ripple. This confirmed the effectiveness of feedback control in maintaining output voltage at the desired reference level.
Conclusion
In this experiment, the buck converter was first analyzed under closed-loop operation using a feedback PID controller. The closed-loop system continuously adjusted the duty cycle of the switching signal with respect to changes in output voltage, resulting in a stable output voltage of approximately 15 V with almost no voltage ripple. This confirmed the effectiveness of feedback control in maintaining output voltage at the desired level.
The buck converter was also operated in open-loop mode by removing the feedback path and replacing the PWM generator with a pulse generator. In this case, the output voltage settled at a value slightly lower than 15 V, even though the input voltage was 48 V. This is due to the fixed pulse width generated based on the selected duty cycle of 31.25%. According to the theoretical relation Vo = D·Vin, a duty cycle of approximately 0.31 results in an output voltage close to the observed value.
Overall, the simulation results clearly demonstrate the difference between open-loop and closed-loop operation of a buck converter. While open-loop control follows the theoretical voltage conversion ratio determined by the duty cycle, closed-loop control provides improved voltage regulationvoltage regulationThe percentage change in output voltage from no-load to full-load conditions. A lower value indicates better voltage stability under varying load. by actively adjusting the duty cycle based on output feedback.
Post-Lab / Viva Voce
Note: The following questions are intended to evaluate conceptual understanding arising from this experiment on Closed-Loop Control of a Buck Converter Using a PID Controller.
- Q: What is a buck converter and how does the duty cycle control the output voltage?
A: A buck converter is a DC–DC switching power converter that steps down a higher input DC voltage to a lower output voltage with high efficiency. It operates by rapidly switching a power transistor ON and OFF at high frequency. When the switch is ON for a fraction D of the switching period T (where D = Ton/T is the duty cycle), energy is stored in the inductor. When the switch is OFF, the inductor releases this energy to the load through the freewheeling diode. Under ideal conditions in continuous conduction mode (CCM), the average output voltage is Vo = D·Vin. Therefore, by varying D between 0 and 1, the output voltage can be continuously controlled between 0 and Vin. - Q: Why does the open-loop buck converter in this experiment produce an output voltage slightly lower than the theoretical value of D·Vin?
A: In an ideal lossless buck converter, Vo = D·Vin exactly. However, practical converters have resistive losses in the inductor winding, switch on-state resistance (RDS(on)), diode forward voltage drop, and capacitor ESR (equivalent series resistance). These parasitic elements cause a voltage drop that reduces the actual output below the theoretical value. Additionally, the diode forward voltage reduces the effective duty cycle during the freewheeling interval. In this experiment, with D = 31.25% and Vin = 48 V, the theoretical output is 15 V but the simulated open-loop output settled at approximately 14.4 V, consistent with these losses. - Q: How does the PID controller achieve closed-loop voltage regulation in the buck converter?
A: The PID controller compares the measured output voltage Vo with the reference voltage Vref (15 V) to compute an error signal e(t) = Vref − Vo(t). The proportional term (Kp·e) provides an immediate corrective response proportional to the current error. The integral term (Ki·∫e dt) eliminates steady-state error by accumulating the error over time and increasing the control effort until the error is driven to zero. The derivative term (Kd·de/dt) anticipates future error by responding to the rate of change, improving transient responsetransient responseThe temporary behavior of a circuit immediately after a switching event or disturbance, before it reaches its new steady-state condition. and reducing overshoot. The combined PID output adjusts the duty cycle of the PWM signal in real time, continuously regulating the output voltage at 15 V despite load or input variations. - Q: What is the role of the inductor and capacitor in a buck converter, and how do their values affect performance?
A: The inductor serves as an energy storage element that smooths the pulsating current from the switch, providing a continuous current to the load. It limits the rate of change of current (di/dt = V/L), so a larger inductance results in smaller current ripple ΔIL. The capacitor filters the output voltage by absorbing and releasing charge during switching transients, reducing the output voltage ripple ΔVo. A larger capacitance results in smaller voltage ripple. However, larger L and C values increase component size, cost, and slow the transient response of the converter. The design trade-off in this experiment used L = 85 µH and C = 125 µF to balance ripple performance with transient speed. - Q: What is continuous conduction mode (CCM) and how does it affect the input–output voltage relationship of the buck converter?
A: In continuous conduction mode (CCM), the inductor current never falls to zero during the switching cycle — there is always a continuous current flowing through the inductor. Under CCM, the volt-second balance on the inductor gives the simple relationship Vo = D·Vin, making the output voltage linearly proportional to duty cycle and independent of load current (for an ideal converter). In discontinuous conduction mode (DCM), which occurs at light loads when the inductor current reaches zero before the next switching cycle, the voltage conversion ratio becomes nonlinear and dependent on the load resistance. The simulation parameters in this experiment (L = 85 µH, RL = 8 Ω, fsw = 40 kHz) are designed to maintain CCM operation at full load. - Q: Why is high switching frequency desirable in a buck converter, and what are its limitations?
A: A higher switching frequency reduces the required values of L and C to achieve the same current and voltage ripple, because the inductor and capacitor have less time to charge and discharge in each cycle (ΔIL = VL·Ton/L, so smaller Ton at higher fsw means smaller ripple for the same L). This leads to smaller, lighter, and cheaper passive components, improving power density. In this experiment, fsw = 40 kHz is used. However, higher switching frequency increases switching losses in the transistor (proportional to fsw) and the diode, core losses in the inductor, and electromagnetic interference (EMI). It also requires faster switching devices and more sophisticated gate drive circuits, increasing cost and design complexity. - Q: How would the buck converter respond if the load resistance RL suddenly decreases (load step increase) under open-loop and closed-loop operation?
A: Under open-loop operation with a fixed duty cycle, a sudden decrease in RL increases the load current demand. The additional current drawn from the capacitor causes the output voltage Vo to drop, since the converter cannot respond to the increased demand — the duty cycle remains fixed and the average inductor current is predetermined. The output voltage will settle at a new lower steady-state value determined by the circuit losses. Under closed-loop PID control, the voltage drop is detected immediately as an increased error signal. The PID controller responds by increasing the duty cycle, which increases the average inductor current to supply the higher load demand, restoring Vo back to 15 V within a transient settling timesettling timeThe time required for a system's response curve to reach and permanently stay within a specified tolerance band (usually 2% or 5%) of the final steady-state value.. This demonstrates the primary advantage of closed-loop regulation. - Q: What is the significance of the calculated inductance (78.7 µH) and capacitance (166.7 µH) compared to the simulated values of 85 µH and 125 µH?
A: The calculated values represent the minimum L and C required to maintain CCM and limit ripple to specified levels (ΔIL = 3.2 A, ΔVo = 0.06 V) given the operating conditions. The simulated values of L = 85 µH and C = 125 µF are close to but not identical to the calculated values. The inductance of 85 µH is slightly higher than the calculated 78.7 µH, providing a margin of safety to ensure CCM operation and slightly lower current ripple than the design target. The capacitance of 125 µF is lower than the calculated 166.7 µF, which means the actual voltage ripple will be slightly higher than 0.06 V. In closed-loop operation, the PID controller compensates for the higher ripple by actively correcting the duty cycle, so the effective output regulation is still maintained at 15 V.
References & Resources (Not Applicable)
This section is not required for this experiment.
Was this experiment helpful?
Your feedback helps us improve
Please Sign In to rate this experiment.