The PWM Block

as amplitude of sine signal
fs frequency of sine signal
at amplitude of triangular signal
ft frequency of triangular signal
vU upper output value
vL lower output value


The PWM block generates a pulse width modulation signal defined by the comparison between a sine signal and a triangular signal.

This block is an example demonstrating the possibility to reuse models as blocks within other models: instead of programming the PWM signal explicitly, it is actually an assembly of three other blocks: a Sine source, a Triangular source and a Comparator. The functionality of these three blocks is packed into one block (the PWM block) which can be reused as a component in other models. The interior structure of the PWM block can be found when activating the diagram-view of the PWM block.

Generated Events (QSS1/QSS2/QSS3 mode):

Output is generated each time the two signals (sine/triangular) cross each other. If the sine signal is bigger than the triangular signal, the output takes a value of vU, and vL otherwise.

Parameter setting: fs=1

Generated at 2020-08-11T01:53:57Z by OpenModelicaOpenModelica 1.16.0~dev-583-g9d71067 using GenerateDoc.mos