Synchronous averaging is a sampling method, which computes the average value of an ADC channel over one control period. By contrast, synchronous sampling only takes one sample per period. This product note explores the difference between the two methods and how it can impact experimental results.
Synchronous sampling VS synchronous averaging
Synchronous sampling relies on the hypothesis that voltage and current ripples are perfect triangular waveforms. In this case, the average value of the ripple can be measured by acquiring a single sample, as illustrated below.
Unfortunately, the presence of parasitic inductances and capacitances causes a ringing effect. As a result, an unwanted oscillation of the voltage and current occurs after each switching event, and the ripples are not perfectly triangular. Furthermore, analog measurements can also be affected by noise.
In practice, it means that synchronous sampling could measure a transient disturbance rather than the average value of the ripple. It is even more likely to happen when the duty cycle is close to 1.0 because the switching and sampling events are close to each other.
The figure below shows an example where the experimental current ripples are noticeably distorted after each switching event. Since the carrier is a triangular waveform, the synchronous sample is taken in the middle of the period (at 10 ms). One can observe that for a duty cycle of 0.9 (right plot), the sampling event occurs right during a disturbance.
Synchronous averaging mitigates the effect of disturbances by taking as many samples as possible per period and computing the actual average value. The figure below illustrates the difference between the two methods: both of them give the average value over a period of CLOCK_0, but the time window used by synchronous averaging is shifted by half a period. From a control perspective, it introduces a delay of half a period.
How to enable synchronous averaging
In Simulink and PLECS, open the mask of the ADC block and select the corresponding option, as illustrated below. In C/C++, the feature can be activated by calling the Adc_EnableSynchronousAveraging function in UserInit.
The following test setup is used to compare the performances of the sampling methods. It consists of a PEB8038 half-bridge module supplied by a DC voltage source and connected to an RL load.
The experiment was carried out under challenging conditions to better illustrate how the sampling method can affect the experimental waveforms:
- The open-loop control applies a sinusoidal voltage on the passive load.
- The DC bus voltage is set to 700 Vdc. The higher the DC voltage, the bigger the oscillations due to ringing.
- The duty cycle oscillates in the [0.1; 0.9] range. As such, it comes close to 1.0 where synchronous sampling is particularly affected by distortions in the current.
- The output current is very low on purpose (< 3% of the nominal range). In this situation, the amplitude of ringing oscillations and noise becomes significant with respect to the current ripple.
In theory, applying a sinusoidal voltage on a (mostly) resistive load should result in a sinusoidal current. However, this is not the case when observing the current waveform obtained with synchronous sampling (see the figure below). In fact, distortions start to appear with a duty cycle of 0.75 or above. As explained above, the synchronous samples are taken just after the switching event, right in the middle of a transient disturbance.
By contrast, the current waveform obtained with synchronous averaging is a smooth sinewave with a white noise component, as expected. As such, choosing an appropriate sampling method can improve the quality of the measurements, especially under challenging conditions.