
PROGRAMMING
INSTRUCTIONS
SINUS PENTA
189/452
Example 5: Using the PWM Function.
Suppose that the motor of a machine tool is controlled by a drive. The tool must be lubricated based on the cutting
speed. At max. cutting speed, the electrovalve controlling lubrication must work for 0.5 sec with a frequency of 1Hz
(time period of 1 sec.): at max. speed, a duty cycle of 50% (Ton/T) is required, with a time period of 1 second; the time
when the electrovalve opens is directly proportional to the cutting speed.
Spd1 is the max. cutting speed and dtc1 is the duty cycle required; the saw carrier frequency required for PWM must
be 1 Hz (
P213
), the min. value must be 0rpm (when speed = 0rpm, the electrovalve is disabled) and max. value =
Spd1*100/ dtc1 = 2*Spd1.
Supposing that the tool can rotate in both directions, that Spd1 = 1500rpm and that the first digital output is used,
parameters are set as follows:
Table 47: MDO parameterization for the PWM function.
P270
MDO1: Digital output mode
PWM MODE
P271
MDO1: Variable A selection
A72: Speed Ref.
P272
MDO1: Variable B selection
P273
MDO1: Testing variable A
>
P274
MDO1: Testing variable B
P275
MDO1: Comparing value for Test A
3000.00 rpm
P276
MDO1: Comparing value for Test B
0.0 rpm
P277
MDO1: Function applied to the result of the two tests
P277a
MDO1: Variable C selection
D0: Disabled
P277b
MDO1: Function applied to the result of f(A,B) and C
test
P278
MDO1: Output logic level
TRUE
P215
Saw signal frequency
1Hz
Parameter
P215
in the ANALOG AND FREQUENCY OUTPUTS MENU sets the frequency of the saw wave, i.e. the
PWM frequency of the digital output.
In PWM mode, parameter
P275
sets the max. value (peak value) of the saw wave, while parameter
P276
sets the min.
value of the saw wave.
The test selected with
P273
is performed between the analog variable selected in
P271
and the saw wave.