This example shows how to configure models that use Pulse Width Modulation (PWM) input signals for linearization. For linearization, specify a custom linearization of the subsystem that takes the DC signal to be a gain of 1.
Many industrial applications use Pulse Width Modulation (PWM) signals because such signals are robust in the presence of noise.
The next figure shows two PWM signals. In the top plot, a PWM signal with a 20% duty cycle represents a 0.2 V DC signal. A 20% duty cycle corresponding to 1 V signal for 20% of the cycle, followed by a value of 0 V signal for 80% of the cycle. The average signal value is 0.2 V.
In the bottom plot, a PWM signal with an 80% duty cycle represent a 0.8 V DC signal.
For example, in the
scdpwm model, a PWM signal
is converted to a constant signal.
When linearizing a model containing PWM signals there are two effects of linearization you should consider:
The signal level at the operating point is one of the discrete values within the PWM signal, not the DC signal value. For example, in the model above, the signal level is either 0 or 1, not 0.8. This change in operating point affects the linearized model.
The creation of the PWM signal within the subsystem
Voltage to PWM,
shown in the next figure, uses the Compare To Zero block. Such comparator
blocks do not linearize well due to their discontinuities and the nondouble outputs.