Motion Control
Precision MicroControl Corp.
114
MCEnableAxis( hCtlr, 1, TRUE );
MCMoveAbsolute( hCtlr, 1, 0.0 );
MCIsStopped( hCtlr, 1, 2.0 );
if (!MCIsStopped( hCtlr, 1, 2.0 )) {
// Motor failed to stop within time limit (2 seconds),
// error handling code goes here
}
Sleep( 100 );
// Enable / disable axis to set MC_STAT_INP_INDEX to monitor the current
// state (not capture & latch) of Home sensor
MCEnableAxis( hCtlr, 1, FALSE );
MCWait( hCtlr, 0.01 );
MCEnableAxis( hCtlr, 1, TRUE );
i
Prior to issuing
MCEdgeArm ( )
the status flag
MC_STAT_INP_INDEX
will
indicate the current state of the Home Sensor (1 = active, 0 = inactive). After
issuing
MCEdgeArm ( )
MC_STAT_INP_INDEX
will be latched when the
Home sensor edge has been captured. To clear latching of
MC_STAT_INP_INDEX
issue:
MCEnableAxis( hCtlr, 1, FALSE );
MCEnableAxis( hCtlr, 1, TRUE );
i
The following MCCL example uses the
E
dge
A
rm (
aEAn
) and the Wait for
E
dge
(
aWE
) commands to home a closed loop system.
; MCCL Stepper linear stage homing sequence using Home & positive limit
;sensors
MD5,5LM2,5LN3,MJ10
;enable
limits,
call
homing
macro
MD10,5VM,5DI0,5SV10000,5GO,LU"STATUS",5RL@0,IS24,MJ11,NO,IS10,MJ13,NO,JR-8
;test
for
sensors
(home
and
+limit)
MD11,LU"STATUS",5RL@0,IC24,MJ12,NO,JR-5
;continue moving until home
sensor off
MD12,5ST,5WS.1,5DI1,5SV5000,5GO,MJ14
;move back to the home sensor
MD13,5WS0.01,5MN,5DI1,5SV5000,5GO,MJ14
;move out of limit sensor range
;back
toward
the
home
sensor
MD14,5EL0,MC15,5WE,5ST,5WS.1,5MF,5MN,5PM,5MA-100
;capture the active edge of the
;home sensor. Stop axis and
;define a position 0, ;move to
;position -100
MD15,LU"STATUS",5RL@0,IS18,BK,NO,JR-5
;loop status for Edge found bit
set
i
Prior to issuing
E
dge
L
atch (
aELn
) the status bit 24 Index / Home will indicate
the current state of the Home Sensor (1 = active, 0 = inactive). After issuing
E
dge
L
atch (
aELn
) status bit 24 will be latched when the Home sensor edge
has been captured. To clear latching issue:
1MF,1MN
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com