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
ControllerParameters
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Frequency | frequency | 1000 | Frequency of PWM |
| SI.Time | startTime | 0 | Time instant of first pulse |
| Real | k | 100 | Constant reference of 100%, ex: 12 for 12 V |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.BooleanOutput | y | ||
| Modelica.Blocks.Interfaces.RealInput | u |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Math.Abs | abs | ||
| Modelica.Blocks.Math.Division | division1 | ||
| Modelica.Blocks.Sources.Constant | const | ||
| Servomechanisms.Electrical.BooleanPulse | booleanpulse |