Example: Friction Correction
The following example illustrates how the SPM mode can be useful in correcting for X axis friction after each move
when conducting a reciprocating motion. The drive is a 1/64th microstepping drive with a 1.8
o
step motor and
4000 count/rev encoder.
#SETUP;
Set the profiler to continue upon error
KS16;
Set step smoothing
MT-2,-2,-2,-2;
Motor type set to stepper
YA64;
Step resolution of the microstepping drive
YB200;
Motor resolution (full steps per revolution)
YC4000;
Encoder resolution (counts per revolution)
SHX;
Enable axis
WT50;
Allow slight settle time
YS1;
Enable SPM mode
#MOTION;
Perform motion
SP16384;
Set the speed
PR10000;
Prepare mode of motion
BGX;
Begin motion
MCX
JS#CORRECT;
Move to correction
#MOTION2
SP16384;
Set the speed
PR-10000;
Prepare mode of motion
BGX;
Begin motion
MCX
JS#CORRECT;
Move to correction
JP#MOTION
#CORRECT;
Correction code
spx=_SPX
#LOOP;
Save speed value
SP2048;
Set a new slow correction speed
WT100;
Stabilize
JP#END,@ABS[_QSX]<10;
End correction if error is within defined tolerance
YRX=_QSX;
Correction move
MCX
WT100;
Stabilize
JP#LOOP;
Keep correcting until error is within tolerance
#END;
End #CORRECT subroutine, returning to code
SPX=spx
EN
Dual Loop (Auxiliary Encoder)
The DMC-42x0 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 command. The command form is CE x,y,z,w (or a,b,c,d,e,f,g,h for controllers with more than
4 axes) where the parameters x,y,z,w each equal the sum of two integers m and n. m configures the main encoder
and n configures the auxiliary encoder.
Chapter 6 Programming Motion ▫ 95
DMC-42x0 User Manual
Summary of Contents for DMC-42 0 Series
Page 195: ...ICM 2900 PCB Layout Appendices 191 DMC 42x0 User Manual...
Page 205: ...CB 50 100 Drawings Appendices 201 DMC 42x0 User Manual...
Page 206: ...Appendices 202 DMC 42x0 User Manual...
Page 207: ...Appendices 203 DMC 42x0 User Manual...
Page 208: ...Appendices 204 DMC 42x0 User Manual...
Page 209: ...Appendices 205 DMC 42x0 User Manual...
Page 210: ...Appendices 206 DMC 42x0 User Manual...
Page 211: ...Appendices 207 DMC 42x0 User Manual...
Page 214: ...CB 50 80 Drawing Appendices 210 DMC 42x0 User Manual...