PWM
Generates an ideal pulse-width modulated signal according to the input signal well.
Description
The PWM unit generates an ideal pulse width modulated signal.
Pulse Width Modulation (PWM) is a method of encoding an analogue signal by usage of rectangular pulses. The principle of PWM is to change the pulse width at a constant pulse frequency. The ratio of pulse width to period is called the * duty cycle*. The relationship between the modulated signal and duty cycle is described as follows:
,
where
For the PWM block, the duty cycle lies in the range [0,1]
. The ideal PWM signal is proportional to the duty cycle D
.
Ports
Parameters
Period - pulse period
1 (by default)
| real scalar
| vector
| matrix
The time between rising edges of successive pulses of the output signal. A small value corresponds to a high frequency pulse.
Block parameters |
|
Values |
|
* By default* |
|
Disallow zero duty cycle - avoid algebraic loops
off (false) (by default)
| on (true)
Enable this parameter to break algebraic loops containing a PWM block.
Enabling this parameter causes the signal value to become 0 or lower, causing an input signal error.
|
Block parameter |
|
Values |
|
By default |
|
Data types: Bool
.
Sample Time - interval between calculation steps
0.1 (by default)
| scalar
Specify the interval between calculation steps as a non-negative number.
A value of -1 for the Sample Time parameters causes an error.
|