2 / 2 6 / 2 0 0 2 2 : 0 6 P M 2 / 2 6 / 2 0 0 2
9 6
N M I L - 7 0 5 6 S E R V O M O T O R D R I V E R
B A S I C S A M P L E P R O G R A M
REM RDRV: ReaD Real Velocity
10300 GOSUB 10005 : XBY(CMDADR) = 00BH : GOSUB 10005
10305 RDRV4 = XBY(DAT1ADR) : GOSUB 10005
10310 RDRV3 = XBY(DAT1ADR) : GOSUB 10005
10315 RDRV2 = 000H : RDRV1 = 000H
10319 GOTO 10005
REM RDSUM: ReaD Integration-Term SUMmation
10320 GOSUB 10005 : XBY(CMDADR) = 009H : GOSUB 10005
10325 RDRV4 = XBY(DAT1ADR) : GOSUB 10005
10330 RDRV3 = XBY(DAT1ADR) : GOSUB 10005
10335 RDRV2 = XBY(DAT1ADR) : GOSUB 10005
10339 RDRV1 = XBY(DAT1ADR) : GOTO 10005
REM Initialize Parameters
REM Mask interrupts
REM Wait for 1.5 mS minimum
10500 FOR I = 1 TO 750 : NEXT I
REM Load "Turn Off Motor" command
10510 GOSUB 10005 : XBY(CMDADR) = 01FH : GOSUB 10005
10520 DATBYTE2 = 001H : DATBYTE1 = 000H : GOSUB 10010
REM Issue STT to activate command
10530 GOSUB 10099
REM Read status byte
10540 GOSUB 10005 : GOSUB 10000
REM Check status and reset
10550 TEMP = (STATUS <> 084H) .AND. (STATUS <> 0C4H)
10560 IF (TEMP) THEN PH0." Status = ", STATUS
10570 GOSUB 10005 : XBY(CMDADR) = 000H
REM Parameter Initialization
10590 GOSUB 10005 : XBY(CMDADR) = 01CH : GOSUB 10005
10600 DATBYTE2 = 000H : DATBYTE1 = 000H : GOSUB 10010
REM Reset interrupts
10610 GOSUB 10001
REM Initialize and Load Filter Parameters
10620 KP2 = 000H : KP1 = 010H : KI2 = 000H : KI1 = 010H
10630 KD2 = 000H : KD1 = 00AH : IL2 = 000H : IL1 = 010H
10640 FILTCW2 = 000H : FILTCW1 = 00FH
10650 GOSUB 10120
:REM Load filter parameters and issue UDF
REM Initialize and Load Trajectory Parameters
REM Velocity mode, load acceleration, velocity, and position
REM to bring motor to zero position
10660 TRAJCW2 = 000H : TRAJCW1 = 02AH
10670 ACCELER4 = 000H : ACCELER3 = 002H : ACCELER2 = 005H : ACCELER1 = 000H
10680 VELOCTY4 = 000H : VELOCTY3 = 050H : VELOCTY2 = 000H : VELOCTY1 = 000H
10690 POSITIN4 = 000H : POSITIN3 = 000H : POSITIN2 = 000H : POSITIN1 = 000H
10700 GOSUB 10160
:REM Load traj. param. and issue STT
REM Wait for trajectory complete
10710 DO
10720 GOSUB 10000
:REM Read status port
10730 WHILE ( (STATUS .AND. 004H) = 000H )
10740 GOSUB 10001
REM Wait for busy bit clear and issue motor stop
10750 GOSUB 10005 : XBY(CMDADR) = 01FH : GOSUB 10005
10760 DATBYTE2 = 004H : DATBYTE1 = 000H : GOSUB 10010
REM Issue STT to activate command
10761 GOSUB 10099
10769 GOTO 100
Summary of Contents for NMIY-0031
Page 1: ...2 2 6 2 0 0 2 2 0 6 P M 1 NMIY 0031 Single Board Computer Covers NMIY 0031 V1 0 4 22 96 ...
Page 2: ...2 2 6 2 0 0 2 2 0 6 P M 2 ...
Page 6: ...2 2 6 2 0 0 2 2 0 6 P M 6 ...
Page 8: ...2 2 6 2 0 0 2 2 0 6 P M 8 ...
Page 14: ...2 2 6 2 0 0 2 2 0 6 P M 1 4 ...
Page 30: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 3 0 ...
Page 32: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 3 2 ...
Page 50: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 0 ...
Page 52: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 2 ...
Page 54: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 4 ...
Page 56: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 6 ...
Page 58: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 8 ...
Page 60: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 6 0 ...
Page 62: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 6 2 ...
Page 68: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 6 8 ...
Page 70: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 7 0 ...
Page 72: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 7 2 ...
Page 76: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 7 6 ...
Page 82: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 8 2 ...
Page 84: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 8 4 ...
Page 86: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 8 6 ...
Page 88: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 8 8 ...
Page 90: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 9 0 ...
Page 102: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 0 2 ...
Page 108: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 0 8 ...
Page 110: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 1 0 ...
Page 114: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 1 4 ...
Page 118: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 1 8 ...
Page 126: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 2 6 ...
Page 128: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 2 8 ...
Page 134: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 3 4 ...
Page 148: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 4 8 ...
Page 150: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 5 0 ...
Page 152: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 5 2 ...
Page 154: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 5 4 ...
Page 156: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 5 6 ...
Page 168: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 6 8 ...
Page 170: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 7 0 ...
Page 172: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 7 2 ...
Page 174: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 7 4 ...
Page 178: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 7 8 ...