
APPLYING THE MODULE
5-5
5.3 Initialization
The following example illustrates the software required to
initialize one axis. The variables reference the configuration
data in Appendix H.
1000 !
1010 ! Initialize Axis Parameters
1020 !
2000 ENCODER_SETUP%=01414H\!Rotary, polarity reversed, *4
2010 DRIVE_SETUP%=02H \!Polarity reversed, current ref
2020 SWITCHES%=01DH \!Marker pulse, home negative
2030 PGAIN%=18700 \!Position Gain
2040 IGAIN%=1575 \!Integral Gain
2050 VGAIN%=140 \!Velocity Gain
2060 FGAIN%=8256 \!V Feedforward Gain
2070 DBCOMP%=27 \!Deadband Compensation
2080 MAX_FOLL_ERR%=1000 \!Maximum following error
2090 MAX_VEL_ERR%=8 \!Maximum velocity error
2100 IN_TOLERANCE%=40 \!In position tolerance
2110 GEAR_RATIO!=16777216 \!Gear ratio
2120 MAX_VOLTS%=1984 \!Maximum drive reference value
2130 P_CONST%=-1 \!Positive linearization constant
2140 N_CONST%=-1 \!Negative linearization constant
2150 FDBK_UNWIND!=4000 \!V Fdbk unwind = 1 revolution
2160 GEAR_UNWIND!=4000 \!Gearing unwind = 1 revolution
2170 MODES%=0
2180 CMD66%=0200H\GOSUB 25000\!Change default setups
2190 !
10000 !
24997 !
24998 ! Subroutine to write command to module
24999 !
25000 DELAY 2 TICKS \IF NOT (CMD_ACK@ OR ILLEGAL_CMD@)
THEN GOTO 25000
25005 FAULT
@=
ILLEGAL_CMD@
25010 CMD66%=0 \CMD67%=0
25015 DELAY 2 TICKS \IF CMD_ACK@ THEN GOTO 25015
25020 RETURN
30000 END
Comentarios a estos manuales