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.

How to create triangular waveform with variable phase shift

+2 votes
4,088 views
How to create variable delay for non-smooth signals? Specifically, I'm interested in a variable delay for a triangular waveform. The delay value should depend on a signal on the simulation sheet.

 

Thank you very much
asked Mar 27, 2018 by nikolay (18 points)
edited May 29, 2018 by Wolfgang Hammer

1 Answer

+4 votes
 
Best answer

Please find attached a PLECS model that creates a set of triangular waveforms with variable phase shift in two stages:

  1. First a reference ramp signal is generated, which is phase-shifted by subtracting a (vertical) offset and wrapping the result back to the interval [0, 1]. The trick here is to add a "Hit Crossing" block so that a variable-step solver will make a simulation step at the instant when the shifted ramp resets to zero.
  2. Map the ramp signals to a symmetrical triangle using a simple 1D Look-up Table. Again, the trick is to add a "Hit Crossing" block so that a variable-step solver will make a simulation step when the triangle signal reaches its maximum. (The minimum will be hit automatically because it coincides with the reset of the ramp signals.)
answered Mar 27, 2018 by Wolfgang Hammer (397 points)
selected Mar 28, 2018 by nikolay
...