PWM – Pulse width modulation

Block SymbolLicensing group: STANDARD
Qt SVG Document Exported by REXYGEN Studio u UP DN PWM

Function Description
The PWM block performs pulse-width modulation of the input signal from the range from -1 to +1. Using this block, it is possible to implement a proportional control action even with actuators having a single (e.g., heating on/off) or dual (e.g., heating on/off and cooling on/off) binary inputs. The width L of the output pulse is determined by the relationship:

L = pertm|u|,

where pertm is the modulation period. If u > 0 (u < 0), the pulse is generated at the output UP (DN). However, for practical reasons, the duration of the generated pulse is further adjusted according to the specified block parameters. The asymmetry factor asyfac defines the ratio between the width of the negative pulse DN and the width of the positive pulse UP. The modified widths are calculated according to the equations:

if u > 0 then L(UP) := L forasyfac 1.0Lasyfac for asyfac > 1.0 if u < 0 then L(DN) := L asyfacforasyfac 1.0L for asyfac > 1.0

which, for any value of asyfac >0, ensure that the maximum width of the generated pulses equals pertm. Moreover, if the calculated pulse width is less than dtime, then the resulting width is set to zero. If the calculated pulse width differs from pertm by less than btime, then the resulting width is set to pertm. If a positive pulse UP is followed by a negative pulse DN or vice versa, then the later pulse is, if necessary, shifted so that the distance between these two pulses is at least offtime. If SYNCH = on, then a change in the input u causes an immediate recalculation of the output pulse width, assuming the synchronization condition between the beginning of the modulation period and the moment of change in the input u is not met.

This block propagates the signal quality. More information can be found in the 1.4 section.

Input

u

Analog input of the block

Double (F64)

Parameter

pertm

Modulation period length [s]  10.0

Double (F64)

dtime

Minimum width of the output pulse [s]  0.1

Double (F64)

btime

Minimum delay between output pulses [s]  0.1

Double (F64)

offtime

Minimum delay when altering direction [s]  1.0

Double (F64)

asyfac

Asymmetry factor  1.0

Double (F64)

SYNCH

Synchronization flag

Bool

off ..

Synchronization disabled

on ...

Synchronization enabled

Output

UP

The UP signal (up, more)

Bool

DN

The DOWN signal (down, less)

Bool

2024 © REX Controls s.r.o., www.rexygen.com