Dual Loop (Auxiliary Encoder) - Galil Motion Control DMC-21 5 Series User Manual

Table of Contents

Advertisement

Example: Friction Correction
The following example illustrates how the SPM mode can be useful in correcting for A axis friction after each move
when conducting a reciprocating motion. The drive is a 1/64th microstepping drive with a 1.8
4000 count/rev encoder.
#setup;
KS
16;
MT -2,-2,-2,-2;
YA
64;
YB
200;
YC
4000;
SH
A;
WT
50;
YS
1;
#motion;
SP
16384;
PR
10000;
BG
A;
MC
A;
JS
#correct;
#motion2
SP
16384;
PR
-10000;
BG
A;
MC
A;
JS
#correct;
JP
#motion
#correct;
spa=_SPA
#loop;
SP
2048;
WT
100;
JP
#end,(@ABS[_QSA]<10);
YRA=_QSA;
MC
A
WT
100;
JP
#loop;
#end;
SPA=spa
EN

Dual Loop (Auxiliary Encoder)

The DMC-21x5 provides an interface for a second encoder for each axis except for axes configured for stepper
motor operation and axis used in circular compare. When used, the second encoder is typically mounted on the
motor or the load, but may be mounted in any position. The most common use for the second encoder is backlash
compensation, described below.
The second encoder may be a standard quadrature type, or it may provide pulse and direction. The controller also
offers the provision for inverting the direction of the encoder rotation. The main and the auxiliary encoders are
configured with the
CE
Chapter 6 Programming Motion ▫ 72
'set the profiler to continue upon error
'set step smoothing
'motor type set to stepper
'step resolution of the microstepping drive
'motor resolution (full steps per revolution)
'encoder resolution (counts per revolution)
'enable axis
'allow slight settle time
'enable SPM mode
'perform motion
'set the speed
'prepare mode of motion
'begin motion
'wait for motion to finish
'move to correction
'set the speed
'prepare mode of motion
'begin motion
'wait for motion to finish
'move to correction
'correction code
'save speed value
'set a new slow correction speed
'stabilize
'end correction if error is within defined tolerance
'correction move
'stabilize
'keep correcting until error is within tolerance
'end #CORRECT subroutine, returning to code
command. The
DE
command can be used to define the position of the auxiliary encoders
o
step motor and
DMC-21x5 User Manual 1.0a1

Advertisement

Table of Contents
loading

Table of Contents