UD70
Issue code: 70nu2
4-12 DPL programming
ENCODER task
The ENCODER task is primarily used to monitor the activity of an encoder.
The
ENCODER task is synchronized to the SPEED task within the Drive, and is
executed every fourth SPEED task cycle. Actual execution frequency of the
task is determined by the switching frequency selected.
Drive. A set-up parameter can be used to multiply the time by two.
Drive Switching
frequency
ENCODER task
timebase
kHz ms
Unidrive 3, 6 or 12 5.52
Unidrive 4.5 or 9 7.36
Example
ENCODER{
new
_master_pos% = #90.1
new
_slave_pos% = #90.3
master
_pos_change% = new_master_pos% – old_master_pos%
slave
_pos_change% = new_slave_pos% – old_slave_pos%
EPOS = EPOS + master
_pos_change% – slave_pos_change%
old
_master_pos% = new_master_pos%
old
_slave_pos% = new_slave_pos%
}
SPEED task
The SPEED task is synchronized to the speed control loop in the Unidrive, so
the execution frequency of the task is determined by the switching
frequency selected.
Drive Switching
frequency
SPEED task
timebase
ms kHz
Unidrive 3, 6 or 12 1.38
Unidrive 4.5 or 9 1.84