PWM – Pulse width modulation

Block SymbolLicensing group: STANDARD
PIC

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 = pertm|u|,

where pertm is the modulation time period. If u> 0 (u < 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:

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

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 SYNCH = 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

u

Analog input of the block

Double (F64)

Outputs

UP

The "up" signal

Bool

DN

The "down" signal

Bool

Parameters

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 of the period start

Bool

off ..

Synchronization disabled

on ...

Synchronization enabled

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