Table of Contents
This note describes a simple frequency-domain PI controller tuning procedure using the imperix System Identification toolbox. The toolbox is a helpful companion in several relevant scenarios:
- It provides the system’s frequency response, allowing its use to validate an analytical model or to help the user derive one;
- It helps in assessing compliance with the chosen control objectives when tuning the controller, such as whether the closed-loop system meets the target stability margins or achieves the desired performance.
This article considers a buck converter and describes the steps to tune the inductor current controller using the magnitude-optimum method, deriving all necessary parameters from system identification data, and finally validating the design with the System Identification toolbox.
Hardware requirements
The following list describes the elements used to build the buck converter:
- A phase leg module (PEB-800-40, PEB8038, PEB8024, or PEB4050);
- A programmable controller (B-Box 4, B-Box 3, or B-Box 3 Micro);
- Control development tools for Simulink/PLECS (ACG SDK version 2026.3), with a valid license;
- A DC power supply;
- An inductor and a resistor;
Controller tuning procedure
The goal of this section is to tune the and gains of the PI controller starting from the frequency response of the plant . The following schematic shows the system under consideration and the controller to be designed, where the plant consists of the system portion inside the grey area.
The controller strcture is a typical parallel PI controller:
The transfer function of interest for the controller-tuning procedure is from the duty cycle to the inductor current . Its frequency response is identified in PN215, and it is obtained from a system with the following parameter values:
| Description | Symbol | Value |
| DC input voltage | 200 V | |
| Filter inductance | 2.65 mH | |
| Load resistance | 11.9 Ω | |
| Switching frequency | 50 kHz |
Derivation of necessary parameters
The following Bode plot shows the frequency response resulting from the procedure in PN215. By visual inspection, one notices the following characteristics:
- Flat response in the low-frequency domain;
- A roll-off of 20dB/dec in the high-frequency region;
- The typical phase profile of a system with a delay, where the phase lag increases linearly with the frequency.
Therefore, a first-order system plus delay is a good candidate to model the system behavior:
The magnitude-optimum procedure requires the knowledge of , , and to derive the PI controller and gain values:
- corresponds to the static gain of the plant, that is . The value at the lowest available frequency is a good approximation of that.
- is the frequency of the system pole. For a first-order system like this, it is the frequency at which the plant’s magnitude is 3dB lower than .
Finally, one can estimate directly from the phase Bode plot, provided is sufficiently far below the high-frequency region. As the delay provides a phase lag that grows linearly with the frequency, the following relation holds:
where is in radians, is in radians per second, and is in seconds. Using the values available in the graphs yields the following parameters:
It is also possible to compute the total delay directly as described in PN142. In such a system, the delay is inherent to the controller and includes the analog acquisition delay, the control-algorithm computation delay, and the PWM modulator delay. With a switching frequency of 50kHz and synchronous averaging in the analog acquisition, the resulting delay is , which is close to the value estimated above.
Design of the PI controller
Once the required parameters are determined, the magnitude-optimum design procedure is straightforward for a first-order system with delay. It merely consists of computing the gains directly from the formulas:
TN105 describes the derivation of these formulas. The resulting values are and .
Experimental validation
To validate the control design, it’s possible to identify the frequency response of the closed-loop transfer function from the inductor current reference to the measured inductor current. For a magnitude-optimal controller, the expected response is maximally flat up to a certain frequency range (the system bandwidth). If the designed controller is optimal, different or values should lead to an overdamped or underdamped response.
The procedure to obtain the system closed-loop transfer function consists of perturbing the inductor current reference signal and then computing the Empirical Transfer Function Estimation (ETFE) by taking the ratio of the Fourier transforms of the output signal (the perturbed inductor current) over the input signal (the perturbed current reference). In this case, i_Lref is perturbed, and it is measured together with i_L. The following schematic clarifies the idea. The System Identification toolbox handles the perturbation injection and transfer-function computation.
These Simulink and PLECS models are preconfigured to perform system identification on the closed-loop system. The Sys. Id. Injector block perturbs the system and then measures its response. The numerator signal is i_L, while the denominator is i_Lref.
The models can be directly built and sent to an imperix controller by pressing Ctrl + B in Simulink or Ctrl + Alt + B in PLECS. More information on deploying the model to an imperix controller is available in PN138. After building the model, Cockpit should automatically open. The user can also open it manually.
Validation in Cockpit
Once Cockpit is open, it is possible to perform the identification by following these steps:
- Add a Scope and a System Identification module in the Cockpit project page. Add the variables involved in the identification to the Scope; in this case,
i_Landi_Lref. Adding the duty cycledis also a good idea, as it allows monitoring possible saturations. - In principle, for validation to succeed, the system should operate at the same operating point as during characterization. This corresponds to an input DC voltage level of 200 V and an average duty cycle of 0.5, as described in the parametric identification example, presented in PN215.
- Turn on the DC voltage source and make sure the variable
V_dcsettles around the expected value. If not, check the sensor’s sensitivity and whether it is connected to the correct channel. ThePWM enableswitch should be off, soi_Lshould be zero. - The tunable reference signals should bring the system to the desired operating point. As discussed in 2., in this specific example the duty cycle bias should be at 0.5. The corresponding
i_Lrefvalue can be computed from . Alternatively, the user can set a low current level and increase it gradually, monitoring the value ofd. In this example,i_Lref=8 A. - Configure the injection parameter on the right panel, under Sys. Id.:
- As the injector perturbs the system outside the control loop, after a constant signal, Injection mode can be set either to open-loop or closed-loop, without any difference;
- The perturbation amplitude should yield a good signal-to-noise ratio without introducing harmonics that would reduce estimation accuracy (i.e., avoid non-linear operation). In this case, 0.5 is a good starting point.
- Leave the advanced parameters at their default values. The Sys. Id. module documentation provides more information.
- The numerator and denominator signals should belong to the frequency response of interest; in this case, from the duty cycle to the inductor current. Then,
i_Lrefis the denominator andi_Lis the numerator.
- At this point,
i_Lshould be zero: enable the PWM and ensure the resulting current follows the reference. - Press the start injection button, wait for the injection to end, and the Bode plot of the identified transfer function will appear.
Interpretation of the results and fine-tuning of the gains
In this case, the identification yields a closed-loop response presenting a small overshoot around 4 kHz, signaling a slightly underdamped closed-loop system. This is most likely due to under-modeling of the system. In particular, a first-order model might not fully capture the system behavior, especially for high frequencies.

At this point, the overshoot is so small that the user might consider it acceptable and conclude the tuning procedure. Otherwise, it is possible to manually fine-tune the k_p and k_i gains to try improving the frequency response. For example, the user can slightly reduce the controller gains in case of an underdamped response, or slightly increase them otherwise. Cockpit’s snapshots feature simplifies comparing multiple acquisitions with different parameters. The following picture shows some tests conducted by increasing or decreasing the controller gains by the amounts indicated in the legend. Empirically reducing the parameter gains by 7% yields a response close to a maximally flat one.

Conclusions
This note presented a frequency-domain PI controller tuning procedure. Starting from the frequency response measured in PN215, it showed how to derive all the necessary parameters from the Bode plot to apply the magnitude-optimum tuning criterion. The experimental validation yielded a slightly underdamped closed-loop frequency response, exposing the limitations of approximating this system as a first-order one. Finally, the procedure showed a simple way to tweak the controller gains and visually assess the flatness of the response, reducing the gap from the expected maximally flat one.







