blockIdealPWM

Extends from Servomechanisms.Utilities.IconName, Servomechanisms.Utilities.box.

Information

General

This block generates a boolean PWM output from a real input.

Implementation

Using the MSL , the absolute value of the continous real input is calculated and then divided according to the 100 percentage reference value to obtain a number between 0 and 100.
The pulse is generated with the modified block BooleanPulse .

Notes

  • The pulse uses the absolute value of the real signal input.
  • The width of the pulse only goes from 0 to 100 percent. If the input value is greater than 100 the PWM takes 100 as width.
  • The user can change the frecuency of PWM and the start time.
  • The block needs a reference value for 100 percent.

Example

Controller

Parameters

TypeNameDefaultDescription
SI.Frequencyfrequency1000Frequency of PWM
SI.TimestartTime0Time instant of first pulse
Realk100Constant reference of 100%, ex: 12 for 12 V

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.BooleanOutputy
Modelica.Blocks.Interfaces.RealInputu

Components

TypeNameDefaultDescription
Modelica.Blocks.Math.Absabs
Modelica.Blocks.Math.Divisiondivision1
Modelica.Blocks.Sources.Constantconst
Servomechanisms.Electrical.BooleanPulsebooleanpulse