Installation guide

268 Stepper Drive
10.5 - Special Programming Notes for Closed-Loop Stepper Operation
The parameters for closed loop are set in the project
configuration of the user’s program. These parame-
ters are:
Encoder resolution
Number of lines the encoder has. The line count
times four is the equivalent of encoder pulses/ revo-
lution. The direction for this parameter controls the
quadrature detection direction value.
Encoder position error (units)
Allowable error at standstill before a correction is
required.
Encoder following error (units)
Allowable error during motion before an error is
reported.
This value should be a minimum of 1/20
of a motor revolution
.
Number of correction attempts allowed
How many consecutive corrections cycles are al-
lowed.
Time between correction attempts (seconds)
Time between correction attempts. Allows motor to
settle out before correcting.
Error action
This setting selects what action, if any, is taken by
the controller when the commanded motor position
does not match the encoder position within the range
set by the
FOLERR
command (see programming
commands). This is also referred to as a stall condi-
tion. Once the
FOLERR
range is exceeded, one of
four things can happen according to the
Error Ac-
tion
selected. This can be changed during program
execution using the
ENCMODE
command.
If
Error action
is
disabled (ENCMODE=0)
, the
controller takes no action.
If
Error action
is
stop on error (ENCMODE=1)
,
the motor will stop and a controller error will result
(see
ERR
command). The fault light will illuminate.
If
Error action
is
correct on error
(ENCMODE=2)
, separate correction attempts
(moves) will be commanded to try and re-align the
motor. The user may specify
how many correction
attempts will occur, and the
Time between at-
tempts
. If after the specified maximum number of
correction attempts the motor still is not aligned,
motion stops and a controller error will result.
If
Error Action
is
Restart on error (ENCMODE
=3)
, the entire move is restarted. The motor returns
to the starting position of the move in progress, and
attempts to repeat the move. If during this repeat
cycle the motor stalls, the motor will again return to
the start position and retry the move. Each stall and
restart counts as a correction attempt. This continues
until the motor reaches the desired position, or the
maximum number of
correction attempts
is
reached. In the case of the latter a controller error
results and the fault light illuminates.
Testing closed loop operation
1) Send the following Host commands:
ABSPOS(axis)=0
ENCMODE(axis)=0
MOVE(axis)= 1 ‘ 1 rev of motor
2) After the motion is completed send:
ABSPOS(axis) : ENCPOS(axis)
3) If the absolute position and encoder position val-
ues and signs are alike the closed loop stepper is set
up properly.
4) If the values are the same and the directions are
reversed toggle the Encoder direction setting in the
program Configuration. Recompile the program and
download project and repeat steps 1-3.
5) If the values are different the encoder line count
is not correct or the encoder is miss wired.