Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

Overlaying reference harmonics onto the Scope FFT display

0 votes
Hi all.

I would like to use PLECS to plot the current harmonics of a number of different circuit topologies. For each simulation I would also like to overlay the measured harmonics with some reference harmonics limits that I don't want them to exceed, so that I can easily spot if any of the harmonics magnitudes exceeds the limit for that harmonic. These limits are basically pre-defined fixed percentages of the fundamental frequency that reduce with frequency.

I am familiar with using the Fourier Spectrum feature of the scope and use of the different PLECS blocks.

Is there a neat and simple way to do this? Is there some script command I can use to just write values to the scope Fourier Spectrum? I have not found one in the manual. Or is the best way a matter of creating a sub-system template block to reuse across each circuit topology that outputs the exact harmonic limits I want for a multi-plot scope to then read and plot beside the measured harmonics?
asked Jan 4 by Josh SP (12 points)

1 Answer

+1 vote

Currently the Fourier Analysis feature of the PLECS Scope is not accessible via simulation scripts.

One approach to access the Fourier spectrum in simulation is to use the Fourier Transform block from the PLECS library. The output of the Fourier Transform block can then be accessed via a simulation script using a Signal Outport on the top level schematic.  Then, one can iterate through different configurations in a Configurable Subsystem to evaluate different topologies.  Additionally, as of PLECS 4.4 users have the ability to generate Octave plots from PLECS simulation scripts. 

Attached is an example model. The model includes a script to generate the figure below. The script is accessible from the Simulation + Simulation Scripts drop-down menu. In this case the harmonics waveforms are generated as a sum of sinusoids, but naturally this can be expanded upon.

Alternatively, you could use a similar script and the To File block from the PLECS library and post process the data in another tool.


answered Jan 5 by Bryan Lieblick (398 points)
edited Jan 5 by Bryan Lieblick
Thanks, much appreciated. I believe this answers my question. :)