Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 378 of 909
l
seglen (segment length): If the Cam table was specified as variable length in the CTA
command, then parameter 2 is required for each data point. It is optional when using a
fixed-length Cam table (specified in the CTA command). This parameter represents the
absolute distance of the encoder source beginning from the start of the table. For
reasons similar to pos, seglen should also be 0 for the first data point specified.
If you wish to use the optional user parameter, then the seglen parameter must be used
(set to the default: 0).
l
user (user bits): (Optional) Defines Cam user bits and Spline mode override. It is an 8-
bit binary value where:
l
Bit 0-5: User may apply as desired to Cam status bits 0-5 of status word 8; the
segment between the previous point and this point will apply these bits.
l
Bit 6: Factory reserved — user should leave as 0.
l
Bit 7: When set to 0, there is no special override of Spline mode; when set to 1,
the segment between the previous point and this point are forced into linear
interpolation. Bit 7 has no effect when MCE has chosen linear mode.
When loading Cam tables, it is important to note the table capacity. As mentioned previously:
l
When a Cam table is stored in user array memory (al[0]-al[50]), 52 points can be
stored as fixed-length segments; 35 points are possible when variable-length segments
are used.
l
When Cam tables are written to EEPROM memory, significantly more data can be
written:
l
For fixed-length segments, there is space for at least 750 points.
l
For variable length segments, at least 500 points can be written.
EXAMPLE: (Subroutine erases EEPROMtables and sets up Cam table)
C40
CTE(1) 'Erase all EEPROMtables
CTA(15,8000)
CTW(0) 'CP=0 {cam pointer or cam index pointer}
CTW(500) 'CP=1
CTW(4000) 'CP=2
CTW(20000)
CTW(45000)
CTW(50000)
CTW(60000)
CTW(65000)
CTW(55000,0,1) 'Turn on Bit 0 Status Word 8
CTW(46000) 'Will turn off at this point
CTW(45000,0,2) 'Turn on Bit 1 Status Word 8
CTW(8000) 'Will turn off at this point
CTW(4000)
CTW(500)
CTW(0) 'CP=14
RETURN
Part 2: Commands: CTW(pos[,seglen][,user])