Motion Control
MultiFlex PCI 1000 Series User's Manual
113
Homing an Open Loop Stepper -
Home Sensor and Over Travel Limits
Home
sensor
active?
Enable hard limit
error checking
Slow down
Limit +
sensor
tripped?
Start velocity
mode move
in the
positive
direction
No
Enable axis,
Move neg.
towards
Home
sensor
No
Stop axis,
change
direction
Yes
Stop, move
to position 0
(where index
mark was
captured)
Homing complete
Home
sensor
inactive?
Capture
sensor edge
MCEdgeLatch
MCWairForEdge
Yes
No
Yes
Figure 38. Typical homing routine for a stepper
i
The following C example uses the
MCEdgeArm( )
,
MCIsEdgeFound( )
, and
MCWaitForEdge( )
functions for homing a closed loop system. For complete C
code homing samples that can be cut and pasted into an application program
please refer to the Motion Control API on-line help (mcapi.hlp).
// Motion Control API open loop stepper linear stage homing sequence using
the home sensor
//
MCEdgeArm( hCtlr, 1, 1000.0 );
if (!MCIsEdgeFound( hCtlr, 1, 10.0 )) {
// Edge not found within time limit (10 seconds),
// error handling code goes here
}
// Process edge and stop motor
MCWaitForEdge( hCtlr, 1 ); // controller 'processes' edge data
MCStop( hCtlr, 1 ); // stop
if (!MCIsStopped( hCtlr, 1, 2.0 )) {
// Motor failed to stop within time limit (2 seconds),
// error handling code goes here
}
Sleep( 100 ); // let motor settle 100 msec (WIN32 API function)
// Move back to location of home sensor edge
//
MCSetOperatingMode( hCtlr, 1, 0, MC_MODE_POSITION );
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com