// University · EEE2312 · 23 November 2026
Tuning PID control for four DC-DC converter topologies
In our EEE2312 group project (team Epsilon Systems) we designed, built and tested four DC-DC converters. I was responsible for the Arduino PID firmware and the MATLAB small-signal modelling for all four topologies.
The four topologies
We built non-synchronous and synchronous versions of both a buck and a boost converter. The synchronous versions replace the freewheeling diode with a second switched MOSFET, which reduces losses but adds a high-side gate drive and its own failure modes.
From model to gains
For each topology I built a small-signal model in MATLAB: linearising the converter around its operating point to get a control-to-output transfer function. I then used MATLAB's pidtune to generate PID gains directly from those models rather than tuning by hand. Because of the time constraints at residential school, we applied the generated gains as-is on the hardware. Each converter's response was therefore a direct test of how well its model matched reality.
Getting the numbers right on the Arduino
Most of the debugging was about the maths between the model and the microcontroller:
- PWM frequency. The ATmega timers compute PWM frequency differently in Fast PWM mode (f = fclk / (N·(1 + TOP))) and phase-correct mode (f = fclk / (2·N·TOP)). Mixing up the two formulas gave the wrong switching frequency.
- Unit scaling. A discrete PID has to include the sample period: the integral term accumulates error·dt and the derivative divides by dt. Missing dt factors and mixed units in the output formula made the controller behave nothing like the model.
- Integral windup. When the output saturated, the integral term kept accumulating and the converter overshot badly on recovery, so I added anti-windup limiting.
Explaining the results
With the firmware fixed, the differences between model and hardware pointed to real physical effects:
- Non-synchronous buck: discontinuous conduction mode (DCM) at light load explains its open-loop deviation from the continuous-mode model.
- Synchronous buck: ADC saturation explains the runaway above a threshold input voltage, and I confirmed bootstrap capacitor droop on its high-side gate drive.
- Synchronous boost: an interaction at the sense node specific to the synchronous topology explains its steady-state offset.
What I learned
A model is only as good as its assumptions. Continuous conduction, an ideal ADC and correct units are all assumptions, and each one we broke showed up as a measurable difference on the bench. Working through the maths carefully, from the transfer function down to the timer registers, was what made those differences explainable.