Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 836 of 909
Camming - Demo XYCircle
This program makes use of the single-shot (no repeat) MFSDC mode to construct a circle
pattern.
RUN?
' Make a circle.
' issue GOSUB5 to run a circle with:
rrr=8000 ' Radius in encoder counts.
ttt=4000 ' Time to complete a complete circle in milliseconds.
' Restricted to 0-32767
ddd=360 ' Degrees you want to run, signed value where positive is
' counter-clockwise. Restricted +/-3239
aaa=0 ' Angle to start at. Restricted to 0-359
END
C5
GOSUB(1) ' Write the cam
GOSUB(0) ' Run the cam
RETURN
C0 ' Run the cam.
MC ' Cam mode.
xx=aaa
yy=(aaa-90)
IF yy<0
yy=yy+360 ' Modulo sign correction.
ENDIF
IF CADDR==1 '*********************************************
'X axis
MCW(1,xx) ' Table 1, starting point
ENDIF
IF CADDR==2 '*********************************************
'Y axis
MCW(1,yy) ' Table 1, starting point
ENDIF
IF CADDR>2
END
ENDIF
MCE(2)
SRC(2)
af[3]=(28800/4.0)*(ddd/360.0)
af[4]=af[3]*2
MFA(af[3],1)
MFSLEW(af[4],1)
Camming - Demo XYCircle