
SM-Applications Modules & Motion Processors User Guide
27
Issue Number: 4
S
Info
rm
In
Inst
al
Get
tin
Pa
ra
DP
L
Pr
Communica
F
CT
Sy
nc
In
Sy
nc
D
Mi
Q
Ind
ex
4.9.2
Initial Task
As explained later in section 7.2
task
which is executed
when the SM-Applications Modules & Motion Processors is first powered up or is reset,
providing the Autorun parameter is set (refer to the section on saving parameters). In
this task are some DPL statements that initialise some integer variables (denoted by a
trailing % symbol) to zero.
4.9.3
Pos0 Task and the Function Block Diagram
Because this program will be dealing with position feedback information, the bulk of the
work will be done in the POS0 task. Any operations involving speed, position or torque
control are usually done in the POS0, and POS1 or the CLOCK task which is now
synchronized to the drive. In this case there is a single function block diagram which
does all the calculations we need to work out the incremental encoder position.
The basic steps taken are:
1. Read the current encoder feedback value
2. Subtract the previously read encoder feedback value to give us the delta.
3. Re-scale the value to actual encoder counts, assuming a standard incremental
(rather than SinCos type) encoder.
4. Add this delta to an accumulator
5. Remember the current encoder position for next time.
In this example program a variable, _Q 8 %, is used. This is a 32-bit value just like any
other variable, but is part of a special set of
registers
known as the PLC register set.
These PLC registers have the advantage of being able to be saved into non-volatile
memory and also are accessible via parameters in menu 70 through to 76. More
information on these can be found in section 5.4
In order to ensure that the POS0 task is executed, parameter
Pr 81.12
must be set to a
non-zero value in the Initial task. After setting this, a REINIT command must be issued
(see below).
4.10
Downloading Programs
By default, programs can only be downloaded to the SM-Applications Modules & Motion
Processors when the drive enable signal is not active (
Pr 6.15
=0). This behaviour can
be disabled by setting
Pr 81.37
to 0.
If you wish to create and try this program yourself and you have not used SyPTPro
software before then it is advised to read through the remainder of this chapter first, then
read the
Getting Started
section of
SyPTPro Help
which explains how to create such a
program.
NOTE
#81.12 = 3 //Pos task schedule period 1ms
REINIT //Reinitialise
Содержание Digitax ST Indexer
Страница 131: ......
Страница 132: ...0471 0062 04...