Technical Articles and Newsletters

# Estimating the Frequency Response of a Power Electronic Model: Sinestream vs. Pseudo-Random Binary Sequence (PRBS)

By Antonino Riccobono and Arkadiy Turevskiy, MathWorks

This article is the second in a two-part series. Part 1, Estimating the Frequency Response of a Power Electronics Model, introduced a six-step workflow for estimating the frequency response of an open-loop boost converter.

Power electronics engineers can use frequency response estimation (FRE) tools available in Simulink Control Design™ to linearize switch-mode power electronic converters modeled, for example, with Simscape Electrical™ components. With FRE, you select the relevant portion of the converter model and inject a perturbation signal of controllable amplitude and frequency content into the system in steady state. You can then compute the frequency response or a transfer function that represents the system dynamics near the operating point.

Both narrowband and wideband signals are available in Simulink Control Design (Figure 1). Sinestream is a narrowband perturbation signal because its frequency content is limited to a few frequency points. Random, chirp, and pseudo-random binary sequence (PRBS) are wideband perturbation signals, as their frequency content is distributed over a certain frequency spectrum.

Figure 1. Perturbation signals available in the Estimation tab of the Model Linearizer in Simulink Control Design.

This article compares FRE for an open-loop buck converter with sinestream and with PRBS, focusing on estimation time, number of estimated frequency points, and estimation accuracy.

## Buck Converter Example

A buck converter is a power electronics topology that can supply a load with a DC voltage lower than the DC supply voltage. It is widely used in many applications with different power ratings, including consumer electronics products, electric automobiles, more-electric ships and aircraft, renewables, and LED drivers.

Figure 2 shows a switch-mode buck converter modeled with Simscape Electrical™ components. It operates in continuous conduction mode (CCM)—that is, the inductor current never goes to zero in steady state. The converter operates in open loop, driven by a PWM Generator block with a constant duty cycle. To mimic a real-world embedded controller, sampling is included in the model. The linearization input and output analysis points are set to identify the control-to-output transfer function.

Figure 2. Buck converter model showing sampling times (green and red), as well as input and output analysis points for frequency response estimation (within the blue rectangles).

## Sinestream or PRBS? Setting Up the Comparative Analysis

Sinestream consists of a sequence of sine waves with increasing frequencies. To cover the desired frequency range, the sine wave input needs to be swept at controllable frequency increments. Each frequency excites the system for a certain number of periods. The estimation time can be long if many frequency points are required or if frequency response needs to be estimated at low frequencies.

Pseudo-random binary sequence (PRBS) reduces the estimation time. PRBS is a deterministic signal that commutes between two values and has white-noise-like properties. A PRBS signal is inherently periodic, with a maximum period length of 2n-1, where n is the PRBS order.

Figure 3 shows the sinestream signal injected at the output of the Duty Cycle block of the buck converter. It has been set with the Model Linearizer app to have 15 logarithmically spaced frequencies from 100 Hz to 20 kHz, each with a peak amplitude of 0.02 (2% duty cycle). Each frequency is represented by four periods.

Figure 3. A sinestream waveform.

Figure 4 shows a single-period PRBS signal set in Model Linearizer with order 11 and (peak-to-peak) amplitude of 0.04. The sampling time for both sinestream and PRBS, set to 10 µs, must match the control sampling time.

Figure 4 Left: PRBS signal. Right: zoomed-in view.

To generate the plots shown in Figure 3 and Figure 4, create the perturbation objects in the Model Linearizer app, move the objects `in_sine1` and `in_prbs1` to the MATLAB® workspace (Figure 5), and then use the following commands:

```>> in_sine1.plot
>> in_prbs1.plot
```

Figure 5. Moving sinestream and PRBS objects (blue) and frd objects (red) to the MATLAB workspace.

## Estimation Time

The estimation time is the sum of the elapsed wall clock time (the time it takes to run the simulation with the injected sinestream or PRBS signal) plus the frequency response calculation time (the time to calculate the fast Fourier transform [FFT] of the output over the input). Since calculation time is usually significantly shorter than elapsed wall clock time, our buck converter example will focus on the latter. Elapsed wall clock time depends on simulation time.

In our example, the simulation time for the sinestream signal is given by four times of each of 15 periods, with each period corresponding to one of the selected logarithmically spaced frequencies. You can calculate it as follows:

```>> in_sine1.getSimulationTime

ans =
0.1265
```

The simulation time for PRBS is given by the maximum period length 2n-1 multiplied by the sampling time. For the PRBS signal `in_prbs1` shown in Figure 4, n = 11 and the sampling time is 10 µs. You can calculate it as follows:

```>> in_prbs1.getSimulationTime

ans =
0.0205
```

Note that you need to move the objects `in_sine1` and `in_prbs1` to the MATLAB workspace (Figure 5) to execute the above commands.

## Number of Estimated Frequency Points

The number of frequency points in the estimated `frd` object depends on which input signal is used for the estimation.

If you use a sinestream signal, the frequencies in the estimated `frd` object are the frequencies specified in that signal. You can verify which frequencies are present with the MATLAB Variable Editor (Figure 6) after launching the following command:

```>> f_SineStream = estsys_SineStream.Frequency;
```

Figure 6. The 15 frequencies of f_SineStream in rad/s in the Variable Editor.

If you use PRBS, the frequency points are determined by the FFT computation. As the Variable Editor shows (Figure 7), 1024 frequency points are computed after launching the following command:

```>> f_PRBS = estsys_PRBS.Frequency;
```

Figure 7. The 1024 frequencies of f_PRBS in rad/s in the Variable Editor.

Notice that the vector `f_PRBS` contains 1023 positive frequencies as well as the frequency point ‘0’. The negative frequencies are discarded in the FFT computation process.

## Estimation Accuracy

With the objects `estsys_SineStream` and `estsys_PRBS` moved to the MATLAB workspace, you can obtain the Bode plot of the nonparametric estimation results with sinestream and PRBS (Figure 8). The results are consistent, even though the estimation with PRBS seems to be coarse at high frequencies.

Figure 8. Bode plot of the nonparametric estimation results with sinestream (red stars) and with PRBS (blue dots).

Note that while you have direct control of minimum and maximum identifiable frequencies with sinestream, this control is indirect with PRBS. In fact, the minimum identifiable frequency is given by the inverse of the simulation time (1/0.0205 = 48.7805 Hz), and the maximum identifiable frequency is given by the Nyquist frequency that is half of the switching frequency (100e3/2 = 50 kHz), depicted as a vertical line in Figure 8.

We can now compute and compare the parametric estimations. As described in part 1 of this series, you can obtain the parametric model using `tfest` from System Identification Toolbox™.

For the parametric estimation with sinestream, you simply execute the following command to estimate a transfer function with 2 poles and no zeros:

```paramsys_SineStream = tfest(estsys_SineStream, 2, 0, iodelay);
```

The variable `iodelay` takes into account the delays introduced by computation, PWM, and sampling. Figure 9 shows the Bode plot of parametric and nonparametric estimation with sinestream.

Figure 9. Bode plot of parametric and nonparametric estimation with sinestream.

For the parametric estimation with PRBS, it is best to thin the data points to ensure equal weighting for a controllable number of frequency points to be processed by `tfest`. The following code creates an `frd` object containing 100 logarithmically spaced frequencies between 100 Hz and 20 kHz. The function `interp` is available in System Identification Toolbox.

```% Thin the nonparametric estimation
fmin = 100; %Hz
fmax = 20e3; %Hz
Nfreq = 100;
f = logspace(log10(fmin),log10(fmax),Nfreq);
% Interpolate FRD data over the new frequency grid
estsys_PRBS_thinned = interp(estsys_PRBS, 2*pi*f);
```

Then, you can calculate the parametric model with:

```paramsys_PRBS = tfest(estsys_PRBS_thinned, 2, 0, iodelay);
```

Figure 10 shows the Bode plot of parametric and nonparametric thinned estimation with PRBS.

Figure 10. Bode plot of parametric and nonparametric thinned estimation with PRBS.

Finally, if you plot the parametric estimations with sinestream and with PRBS and compare them with the equivalent analytic control-to-output transfer function (Figure 11), you may notice the following:

• The discrepancy in the parametric estimation with sinestream around the resonant frequency is due to a poor initial choice of number of frequencies.
• The parametric estimation with PRBS closely matches the analytic transfer function.

Figure 11. Bode plot of parametric estimations with sinestream and with PRBS compared with the analytic transfer function.

## Conclusions and Recommendations

FRE with PRBS is a fast way to calculate transfer functions of switch-mode power electronics converters modeled with Simscape Electrical components. However, since this method estimates a large number of frequency points, special care is required when thinning them to maximize estimation accuracy.

FRE with sinestream generally produces accurate results. However, to accurately estimate sharp resonant characteristics, you may need to increase the number of frequencies, with a resultant increase in estimation time.

Moreover, due to the short injection time, FRE with PRBS has great potential for online estimation. In fact, power electronics systems vary over time, and it is often necessary to complete the estimation in a short time so that dedicated control systems can monitor estimated key transfer functions in real time and take corrective action if needed. Clearly, FRE with sinestream does not support this use case.

Published 2020