Application Solutions
Precision MicroControl Corp.
150
Record Motion Data
The controller supports capturing and retrieving motion data for closed loop axes and open loop steppers.
As many as 1024 'data sets' (actual, optimal, following error, DAC output) can be captured for each axis.
Captured position data is typically used to analyze servo motor performance and PID loop tuning
parameters. PMC's Servo Tuning utility uses this function to analyze servo performance. The Motion
Control API function
MCCaptureData( )
is used to acquire motion data for a servo axis. This function
supports capturing:
Actual Position versus time
Optimal Position versus time
Following error versus time
DAC output versus time (Analog Command axes only)
Auxiliary encoder position (for tuning an open loop Pulse Command servo axis)
The time base (4 KHz, 2 KHz, 1 KHz) for captured data is set by
Rate
member of the
MCMotion
data
structure. The function
MCGetCapturedData( )
is used to retrieve the captured data. This example
captures 1000 data points from axis 3, then reads the captured data into an array for further processing.
double Data[1000];
MCBlockBegin( hCtlr, MC_BLOCK_COMPOUND, 0 );
MCCaptureData( hCtlr, 3, 1000, 0.001, 0.0 );
MCMoveRelative( hCtlr, 3, 1000.0 );
MCWaitForStop( hCtlr, 3, 0.0 );
MCBlockEnd( hCtrlr, NULL );
// Retrieve captured actual position data into local array
//
if (MCGetCaptureData( hCtlr, 3, MC_DATA_ACTUAL, 0, 1000, &Data ) {
. . .
// process data
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com