### PWM – Pulse width modulation

Block SymbolLicensing group: STANDARD

Function Description
The PWM block implements a pulse width modulation algorithm for proportional actuators. In the general, it is assumed the input signal u ranges in the interval from -1 to +1. The width $L$ of the output pulse is computed by the expression:

$L=\mathtt{\text{pertm}}\ast |\mathtt{\text{u}}|\phantom{\rule{0em}{0ex}},$

where pertm is the modulation time period. If $\mathtt{\text{u}}>\mathtt{\text{0}}$ ($\mathtt{\text{u}}<\mathtt{\text{0}}$), the pulse is generated in the output UP (DN). However, the width of the generated pulses are affected by other parameters of the block. The asymmetry factor asyfac determines the ratio of negative pulses duration to positive pulses duration. The modified pulse widths are given by:

Further, if the computed width is less than minimum pulse duration dtime the width is set to zero. If the pulse width differs from the modulation period pertm less than minimum pulse break time btime then width of the pulse is set to pertm. In the case the positive pulse is succeeded by the negative one (or vice versa) the latter pulse is possibly shifted in such a way that the distance between these pulses is at least equal to the minimum off time offtime. If $\mathtt{\text{SYNCH}}=\mathtt{\text{on}}$, then the change of the input value u causes the immediate recalculation of the current pulse widths if a synchronization condition is violated.

Input

 pertm Modulation period length [s]  $\odot$10.0 double dtime Minimum width of the output pulse [s]  $\odot$0.1 double btime Minimum delay between output pulses [s]  $\odot$0.1 double offtime Minimum delay when altering direction [s]  $\odot$1.0 double asyfac Asymmetry factor  $\odot$1.0 double SYNCH Synchronization flag of the period start bool off .. Synchronization disabled on ... Synchronization enabled