Programmable Controllers

Programmable Logic Controllers

Pico Controllers

PicoGFX Arithmetic Functions

The “PW” Pulse Width Modulation Function for Pico GFX

Pulse Width Modulation Function for Pico GFX
Symbol in the function
block diagram

Pico GFX devices provide two function blocks for pulse width modulation PW01/PW02 that generate a pulse sequence with a constant period duration.

The main application of the PW function block is with devices which have transistor outputs.

The PW function block can also be used with devices with relay outputs. The long period duration and minimum on time required for these devices however severely restrict the range of possible applications.

The PW function block is used to create a PID controller with a pulse output for proportional actuators. For this the PW function block is used in conjunction with the DC (PID controller) function block.

Function

The PW.. function block modulates the pulse duty factor of a square wave signal, and thus changes the mark to space ratio and pulse duration.

The period duration of the signal is unchanged.

You define the period duration at the PD input. The on time or pulse duration is proportional to the manipulated variable at the SV input. You can also define the minimum on duration at the ME input.

A hardware output is assigned to each function block:

PW01 -> Q01, PW02 -> Q02

The function block causes the direct output of the calculated value on the hardware output.

Note: If you use a PW function block with its permanently assigned Q1 and Q2 output, you cannot make any additional associations of this output in the circuit diagram.

A status change at Q1 or Q2 that is caused by the circuit diagram is suppressed in favor of the higher priority status change caused by the function block.

Warning: When using the PW function block, ensure that there are no double output assignments if other hardware-dependent function blocks are used such as the PO function block.

If this is not observed, unforeseeable switching states may occur at the output concerned.

Parameter limit values for period duration and minimum on duration

  Period duration [ms] Minimum on duration [ms] Note
Pico GFX I/O Module
Transistor min. 5
max. 65535
min. 0
max. 65535
Period duration
When the value is 0, no pulses are output at Q1 or Q2.
Minimum on duration
The shortest possible on duration for a transistor output module is 0.1 ms.
This on duration is achieved if ME is not set or assigned the value 0. If ME=1, the on duration is 1 ms etc.
Relay min. 100
max. 65535
min.50
max. 65535
 
Table: Parameter limit values for period duration and minimum on duration

Minimum period duration

The minimum period duration is 5ms.

Minimum on duration

The minimum on duration is limited to 100 µs by the hardware when a very low manipulated variable is set at input SV.

Minimum on duration = Minimum off duration

The above hardware restriction also applies to the minimum off duration if a very high manipulated variable at input SV generates a correspondingly long pulse duration. With this kind of large mark-space ratio in which the on time is almost as long as the period duration, the minimum off duration is 100 µs.

If the duration is below the set minimum on duration or minimum off duration, the Boolean control output E1 is set to 1. This control output E1 is used for monitoring during commissioning and does not have to be connected.

Ratio period duration / minimum on duration

The ratio of the period duration/minimum on duration (P/M) determines which percentage of manipulated variables have no effect.

The minimum on duration must be set as low as possible so that P/M is as high as possible.

If, however, a very short on duration has no effect on the connected actuator, it is advisable to suppress these short on phases in order to reduce the load on the hardware. In this case, the period duration should not be set too low.

Manipulated variable SV

The value range from 0 to 4095 of the manipulated variable SV corresponds to 0 to 100% of the period duration.

If you wish to control the pulse duration with the DC.. PID controller, you can associate the DC..QV output directly with the input PW..SV. This kind of application does not require any normalization since the DC..QV covers the same value range between 0 and 4095.

If you wish to control the pulse duration via an analog input that has a value range between 0 and 1023, you will have to normalize this value first of all. If you require an integral normalization factor, in this case the factor of 4, only multiplication with the AR arithmetic function block is required.

If you wish to control the pulse duration with a signed value you will have to normalize this value first of all with an LS value scaling function block.

If the actual value specified via SV for the pulse duration is shorter than the minimum on duration, the output at Q1 or Q2 is accordingly 0. The status of the PW..E1 contact must be observed.

If the off duration of the pulse at the output is less than the minimum off duration, Q1 or Q2 are permanently on. The status of the PW..E1 contact must be observed.

The Function Block and its Parameters

  Description Note
Function block inputs (DWord)
SV Manipulated variable Value range: 0...4095 (12 bit) of this value range corresponds to 0...100% of the period duration. Notes on the normalization of the manipulated variable are provided in the previous section Manipulated variable SV. No signals are output at Q1 and Q2 if SV=0 or SV<ME, and the output concerned will stay at 0.
PD Period duration [ms]
Value range: 0...65535
When the value is 0, no pulses are output at Q1 or Q2.

The minimum period duration for a device with a transistor output is 5 ms.
(the resulting max. frequency is 200 Hz).
ME Minimum on duration [ms]
Value range: 0...65535
The minimum on duration for devices with a transistor output is 0.1 ms.
This on duration applies if ME is not set or set to 0.
If ME=1, the on duration is 1 ms etc..
The minimum on duration possible essentially depends on the downstream electronics.
Function block output
- - -
Contact
E1 Status 1 if the value is below the minimum on duration or minimum off duration  
Coil
EN Activates the function block on status 1. A falling edge from 1 to 0 will deactivate the entire function block and set output Q1 or Q2 to 0.
Parameter set
Call enabled Function block parameters can be viewed on the device.  
Simulation
Not possible   Hardware-dependent function block

Memory Requirement

The pulse width modulation function block requires 48 bytes of memory plus 4 bytes for each function block input that is configured with an NU constant.