Controller tuning in the frequency domain using imperix Sys. Id. toolbox

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:

Controller tuning procedure

The goal of this section is to tune the kik_i and kpk_p gains of the PI controller starting from the frequency response of the plant G(s)G(s). The following schematic shows the system under consideration and the controller C(s)C(s) to be designed, where the plant GG consists of the system portion inside the grey area.

Buck converter considered in this controller tuning example.
Schematic illustrating the buck converter considered in this controller tuning example.

The controller strcture is a typical parallel PI controller:

C(s)=kis+kpC(s) = \dfrac{k_i}{s} + k_p

The transfer function of interest for the controller-tuning procedure is from the duty cycle dd to the inductor current iLi_L. Its frequency response is identified in PN215, and it is obtained from a system with the following parameter values:

DescriptionSymbolValue
DC input voltageVDCV_\mathrm{DC}200 V
Filter inductanceLL2.65 mH
Load resistanceRR11.9 Ω
Switching frequencyFswF_\mathrm{sw}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.
Identified frequency response of the plant used in the controller tuning example.

Therefore, a first-order system plus delay is a good candidate to model the system behavior:

G(s)=K1+s/ωp⋅e−sTdG(s) = \dfrac{K}{1 + s/\omega_p}\cdot e^{-sT_d}

The magnitude-optimum procedure requires the knowledge of KK, ωp\omega_p, and TdT_d to derive the PI controller kik_i and kpk_p gain values:

  • KK corresponds to the static gain of the plant, that is |G(0)||G(0)|. The value at the lowest available frequency is a good approximation of that.
  • ωp\omega_p 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 |G(0)||G(0)|.

Finally, one can estimate TdT_d directly from the phase Bode plot, provided ωp\omega_p 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:

Δφ=Δω⋅Td\Delta\varphi = \Delta\omega\cdot T_d

where φ\varphi is in radians, ω\omega is in radians per second, and TdT_d is in seconds. Using the values available in the graphs yields the following parameters:

K≈24.5dB≈16.8ωp≈2π⋅700HzTd≈Δφ/Δω≈29.5μs\begin{split} K \approx 24.5\,\mathrm{dB}\approx 16.8\\\\ \omega_p \approx 2\pi\cdot 700\,\mathrm{Hz}\\\\ T_d \approx \Delta\varphi/\Delta\omega \approx 29.5\,\mathrm{\mu s} \end{split}

It is also possible to compute the total delay TdT_d directly as described in PN142. In such a system, the delay TdT_d 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 Td=30μsT_d=30\,\mathrm{\mu s}, 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:

Tn=1/ωp;Ti=2KTdkp=Tn/Ti;ki=1/Ti\begin{split} T_n = 1/\omega_p;\quad T_i = 2KT_d\\ k_p = T_n/T_i;\quad k_i = 1/T_i \end{split}

TN105 describes the derivation of these formulas. The resulting values are kp≈0.23k_p \approx 0.23 and ki≈1011.5k_i \approx 1011.5.

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 kik_i or kpk_p values should lead to an overdamped or underdamped response.

Comparison of the three main possible outcomes from the controller tuning procedure: optimally flat, overdamped, and underdamped.

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.

Perturbation injection point for the validation of the controller tuning procedure.
Scheme of the ETFE configuration.

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.

Simulink model implementing the validation step of the controller tuning procedure.
PLECS model implementing the validation step of the controller tuning procedure.

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:

  1. 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_L and i_Lref. Adding the duty cycle d is also a good idea, as it allows monitoring possible saturations.
  2. 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.
  3. Turn on the DC voltage source and make sure the variable V_dc settles around the expected value. If not, check the sensor’s sensitivity and whether it is connected to the correct channel. The PWM enable switch should be off, so i_L should be zero.
  4. 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_Lref value can be computed from dâ‹…|G(0)|d\cdot|G(0)|. Alternatively, the user can set a low current level and increase it gradually, monitoring the value of d. In this example, i_Lref=8 A.
  5. 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_Lref is the denominator and i_L is the numerator.
  6. At this point, i_L should be zero: enable the PWM and ensure the resulting current follows the reference.
  7. 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.

Resulting closed-loop system frequency response from the controller tuning procedure.

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.

Manual fine-tuning of the gains obtained from the controller tuning procedure.

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.