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.

Simple implementation of a variable peak sawtooth generator?

0 votes

I want to implement a fixed-frequency sawtooth generator with a peak voltage (Vpk) that I can control using an external variable (Vx). I created a simple circuit using a voltage controlled current source, a capacitor, and a reset switch like the figure below. However, this circuit increase the single simulation time from 0.2 second to 2.7 second. The time factor is important for me because I am doing thousands of simulation runs (optimization loop).

Is there a simpler and faster way to implement this variable-peak sawtooth generator (ideal ways are ok)?


asked Dec 21, 2023 by Mostafa Amer (17 points)

1 Answer

0 votes
Best answer

You can use a Triangular Wave Generator with a ramp between 0-1.  Then multiply the output Vx.  Placing a zero-order hold after Vx ensures the ramp peak is only updated on the carrier minimum.  See the attached model.


answered Dec 22, 2023 by Bryan Lieblick (1,795 points)
selected Dec 29, 2023 by Mostafa Amer