Repository navigation
PWM block
This block generates a pulse-width modulated signal.
##Parameters and ports
PWM Frequency: Determines the frequency of the PWM signal in Hertz.
###Inputs Duty_Cycle: Numerical value which varies from 0 to 1 and determines the percentage of time that the PWM signal will be at 1, e.g. Duty_Cycle at 0.3 means that the PWM signal will have value 1 30% percent of the time and value 0 70% of the time.
###Outputs PWM: The PWM signal.
Shows the output of five PWM blocks configured at different frequencies and different duty cycles. The simulation is done with a variable step solver and zero-crossing detection turned on so that the signals' shape is preserved.
Compares the time response of the BLDC simulator (using block commutation) when using the PWM or when using the mean values. The simulation is done with a variable step solver and zero-crossing detection turned on so that the shape of the PWM signal's is preserved. Furthermore, in order to accurately see the difference between the approaches, it's necessary to restrict the maximum step size to 1e-4 and zoom in the time response.
##Additional Information The user is responsible for specifying a sensible step size. The best results were obtained with the use of a variable step solver with zero-crossing detection turned on. To understand why this is so, refer to this stackexchange.com question. The question itself explains the problem of using a fixed-step solver with this block; the accepted answer explains how to correct it (use a variable-step solver with zero-detection)