MOTION PROGRAMMING
TECHNICAL REFERENCE
RECORD DATA MODE
Controllers can record motion data at a fixed rate and store
the data in an array. This data can be later used to duplicate
the motion or to analyze it.
The recording process includes several steps. First the
array where the data are stored must be specified; later
the type of data, such as position, position error, etc.
must be defined before the actual recording is accom-
plished at a specified rate. The process is illustrated by
the following example.
The example below illustrates how recorded data can be
used for analysis.
One of the main uses of the array is for recording motion as
described in the following section.
RECORD DATA MODE
Write a program to record the position error of the Y axis
every 16 msec. a total of 100 times and store the results in
the array YERROR.
The actual recording is done with the instruction
RC that has two parameters: the recording time interval
(2n msec) and the number of recorded points.
INSTRUCTION
INTERPRETATION
#RECORD
Label
RA YERROR [100] Storage array
RD _TEY Data type
RC 4,100 Actual recording
EN End program
Example--Record Data Mode
Use the position error data collected in the previous exam-
ple to perform a statistical analysis on the position error of
Y. Determine the maximum and the minimum values as
well as the mean square value. The following program per-
forms the required tasks and stores the results under the
variables MAX, MIN, and MEAN.
INSTRUCTION
INTERPRETATION
#STAT
Label
N = 0
Initial values
MAX = 0
MIN = 0
SUM = 0
#LOOP
Label
E = YERROR [N]
Read position error
JP#MAX, E<MAX
Compare with MAX
MAX = E
Redefine MAX
#MAX
Label
JP#MIN, E >MIN
Compare with MIN
MIN = E
Redefine MIN
#MIN
Label
SUM = E*E+SUM
Compute sum of squares
N = N+1
Increment index
JP#LOOP, N<100
Repeat 100 times
MEAN = SUM/100
Mean square
ROOT = @ SQR[MEAN] Root mean square (RMS)
EN
End program
Example--Statistical Analysis
www.galilmc.com
·
Galil Motion Control, Inc.
·
87