Hi Arief,
The behavior you are observing is expected. The Small Signal Perturbation block is not an ordinary sine-wave source. Its output is zero during a normal transient simulation and it is activated internally only while the selected Frequency Response Analysis is running.
For each analysis frequency, PLECS runs a separate transient simulation with the configured sinusoidal perturbation, as well as an additional unperturbed simulation with zero perturbation amplitude. PLECS then subtracts the Fourier components of the unperturbed run from the corresponding components of the perturbed run and calculates the frequency response from the resulting differences.
These simulations are distributed across the available processor cores and executed in parallel. A regular Scope does not combine the results from all threads. Instead, after the analysis, the Scope contains the transient result from one of the simulations executed in parallel. It may be the unperturbed simulation, which would explain why the perturbation signal shown in the Scope is zero. The final Bode plot is nevertheless constructed from the extracted results of all the individual simulations.
The attached bode_example.plecs model demonstrates this behavior. It contains a first-order low-pass filter with a corner frequency of 1 kHz. At 2 kHz, its expected response is approximately −7.0 dB and −63.4°.
The example contains two configured analyses:
- Frequency Response performs the normal sweep from 5 Hz to 50 kHz. It calculates 21 logarithmically distributed frequency points, as well as an additional point at exact 2 kHz.
- Single Frequency Detail performs the analysis only at 2 kHz. This is useful for inspecting the perturbation and response waveforms at a particular frequency with a regular Scope. The Scope display shown in the figure contains both the 30 kHz signal from the Sine Wave source and the injected 2 kHz signal from the Perturbation source.
Markers and Cursors
Markers and cursors are useful for examining the calculated Bode plot results. To display the individual data points, right-click a Bode plot curve, select Edit Curve Properties, and enable markers. This makes all 22 points visible in the normal Frequency Response Analysis and reveals the single data point in the Single Frequency analysis. You can then use the plot cursors to read the frequency, magnitude, and phase of each point.
Frequency Analysis Log
The Show log button in the Analysis Tools dialog provides additional information about the analysis. For every simulation, the log shows the perturbation frequency, simulation duration, perturbation amplitude, and thread number. It can also report diagnostic information about individual frequency points.
The log of the normal Frequency Response Analysis in the example includes the following diagnostic message:
The following 1/22 (4.55%) frequency responses are potentially inaccurate:
31547.9 Hz
In this example, the warning is related to the 30 kHz Sine Wave source. Because its frequency is close to 31.5479 kHz, spectral leakage can affect the Fourier extraction at this point. However, the sine-wave signal is deterministic and independent of the perturbation, so its contribution is largely removed when the unperturbed result is subtracted.
If the amplitude of the 30 kHz Sine Wave block is set to zero and the analysis is repeated, the response at 31.5479 kHz remains essentially unchanged. This confirms that the warning does not indicate a meaningful inaccuracy in this particular example.
The warning may be more relevant when the analysis perturbs the duty cycle of a PWM-controlled converter at a frequency close to its switching frequency. In such cases, several measures can improve the reliability of the frequency-response extraction at the frequencies identified in the warning. These include increasing the number of Extraction cycles, increasing the perturbation Amplitude while remaining within the small-signal range, or excluding known interfering frequencies from the analysis.
Further information is available in the PLECS documentation:
Best regards,
Johannes