Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HAL FILE:
- ###First Try file by John English, June 24, 2010
- ##Using hm2-stepper.hal as a reference file
- # ###################################
- # BEGIN Core EMC/HAL Loads
- # ###################################
- # kinematics
- loadrt gantrykins
- #loadrt probe_parport
- setp gantrykins.joint-0 0
- setp gantrykins.joint-1 1
- setp gantrykins.joint-2 2
- setp gantrykins.joint-3 0
- # This configuration uses classicladder for machine logic
- # (load the realtime portion)
- # these classicladder parameters need to be optimized after ladder completion
- loadrt classicladder_rt numRungs=12 numBits=20 numWords=4 numTimers=5 numMonostables=2 numPhysInputs=16 numPhysOutputs=16 numArithmExpr=4 numSections=4
- # invoke the user part of CL to silently load the program
- # later we will need to add the clp file mentioned below
- # to the ini file so that we do not need to hardcode it here.
- loadusr -w classicladder --modmaster --nogui shopbot-ladder-1.clp
- loadrt stepgen step_type=0,0,0,0
- # motion controller, get name and thread periods from ini file
- loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
- # only the 7i43 needs this, but it doesnt hurt the others
- loadrt probe_parport
- #loading this based on sim-xyyz.hal reference
- #load additional blocks
- loadrt hypot count=2
- loadrt comp count=3
- loadrt or2 count=1
- # hostmot2 driver
- loadrt hostmot2
- # load low-level driver
- loadrt hm2_pci config="firmware=hm2/5i23/SVST2_4_7I47.BIT num_encoders=4 num_pwmgens=2 num_stepgens=4"
- setp hm2_5i23.0.pwmgen.pwm_frequency 100000
- setp hm2_5i23.0.pwmgen.pdm_frequency 100000
- setp hm2_5i23.0.watchdog.timeout_ns 10000000
- ########################################
- #### END Core EMC/Hal Loads ############
- ########################################
- # ################################################
- # THREADS
- # ################################################
- addf hm2_5i23.0.read servo-thread
- addf hm2_5i23.0.write servo-thread
- addf hm2_5i23.0.pet_watchdog servo-thread
- addf motion-command-handler servo-thread
- addf motion-controller servo-thread
- addf classicladder.0.refresh servo-thread
- # ################################################
- # External Output Signals
- # ################################################
- #Contactor control for Stepper power
- #net contactor-stepper-control <= axis.0.amp-enable-out
- #net contactor-stepper-control => hm2_5i23.0.gpio.044.out
- #net contactor-stepper-control => hm2_5i23.0.stepgen.00.enable
- setp hm2_5i23.0.gpio.044.is_output 1
- setp hm2_5i23.0.gpio.044.is_opendrain 1
- setp hm2_5i23.0.gpio.044.invert_output 1
- #Contactor control for Spindle power
- #net contactor-spindle-control <= axis.1.amp-enable-out
- #net contactor-spindle-control => hm2_5i23.0.gpio.046.out
- setp hm2_5i23.0.gpio.046.is_output 1
- setp hm2_5i23.0.gpio.046.is_opendrain 1
- setp hm2_5i23.0.gpio.046.invert_output 1
- #Spindle Fan Control
- net spindle-fan-control => hm2_5i23.0.gpio.047.out
- setp hm2_5i23.0.gpio.047.is_output 1
- #Mist Coolant Control
- net mist-control => hm2_5i23.0.gpio.043.out
- setp hm2_5i23.0.gpio.043.is_output 1
- #Stepper Driver Digital I/O
- net alarm-clear-x1 => hm2_5i23.0.gpio.050.out
- setp hm2_5i23.0.gpio.050.is_output 1
- net alarm-clear-y => hm2_5i23.0.gpio.054.out
- setp hm2_5i23.0.gpio.054.is_output 1
- net alarm-clear-z => hm2_5i23.0.gpio.058.out
- setp hm2_5i23.0.gpio.058.is_output 1
- net alarm-clear-x2 => hm2_5i23.0.gpio.062.out
- setp hm2_5i23.0.gpio.056.is_output 1
- net stepper-windings-off-x1 => hm2_5i23.0.gpio.051.out
- setp hm2_5i23.0.gpio.051.is_output 1
- net stepper-windings-off-y => hm2_5i23.0.gpio.055.out
- setp hm2_5i23.0.gpio.055.is_output 1
- net stepper-windings-off-z => hm2_5i23.0.gpio.059.out
- setp hm2_5i23.0.gpio.059.is_output 1
- net stepper-windings-off-x2 => hm2_5i23.0.gpio.063.out
- setp hm2_5i23.0.gpio.063.is_output 1
- # ################################################
- # External Input Signals
- # ################################################
- #Contactor status for Stepper and Spindle power
- net contactor-stepper-status <= hm2_5i23.0.gpio.064.in
- net contactor-spindle-status <= hm2_5i23.0.gpio.066.in
- net contactor-spindle-status => classicladder.0.in-04
- #Control Pendant
- net pendant-green-button <= hm2_5i23.0.gpio.065.in_not
- net pendant-green-button <= classicladder.0.in-03
- net pendant-blue-button <= hm2_5i23.0.gpio.067.in_not
- net pendant-blue-button => classicladder.0.in-02
- #Remote E-Stop
- net estop-remote <= hm2_5i23.0.gpio.032.in_not
- net estop-remote => classicladder.0.in-01
- #Spindle Key Switch
- net spindle-key-switch <= hm2_5i23.0.gpio.034.in_not
- net spindle-key-switch => classicladder.0.in-05
- #Zero Plate
- #net probe-in => motion.probe-input
- #net probe-in <= hm2_5i23.0.gpio.068.in_not
- #Prox Sensors
- net prox-x1 <= hm2_5i23.0.gpio.024.in_not
- net prox-x1 => axis.0.home-sw-in axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in axis.0.home-sw-in axis.3.neg-lim-sw-in axis.3.pos-lim-sw-in axis.3.home-sw-in
- net prox-y <= hm2_5i23.0.gpio.026.in_not
- net prox-y => axis.1.home-sw-in axis.1.neg-lim-sw-in axis.1.pos-lim-sw-in axis.1.home-sw-in
- net prox-z <= hm2_5i23.0.gpio.028.in_not
- net prox-z => axis.2.home-sw-in axis.2.neg-lim-sw-in axis.2.pos-lim-sw-in axis.2.home-sw-in
- net prox-x2 <= hm2_5i23.0.gpio.030.in_not
- #Stepper Driver Digital I/O #run all of these into estop chain
- net alarm-x1 <= hm2_5i23.0.gpio.048.in
- #net alarm-x1 => classicladder.0.in-05
- net alarm-y <= hm2_5i23.0.gpio.052.in
- #net alarm-y => classicladder.0.in-06
- net alarm-z <= hm2_5i23.0.gpio.056.in
- #net alarm-z => classicladder.0.in-07
- net alarm-x2 <= hm2_5i23.0.gpio.060.in
- #net alarm-x2 => classicladder.0.in-08
- # ######################################################
- # Axis-of-motion Specific Configs (not the GUI)
- # ######################################################
- # axis enable chain
- net axis-enable-chain-x1 axis.0.amp-enable-out => hm2_5i23.0.stepgen.00.enable hm2_5i23.0.gpio.044.out hm2_5i23.0.gpio.046.out
- net axis-enable-chain-y axis.1.amp-enable-out => hm2_5i23.0.stepgen.01.enable
- net axis-enable-chain-z axis.2.amp-enable-out => hm2_5i23.0.stepgen.02.enable
- net axis-enable-chain-x2 axis.3.amp-enable-out => hm2_5i23.0.stepgen.03.enable
- # position command and feedback
- net emcmot.00.pos-cmd <= axis.0.motor-pos-cmd
- net emcmot.01.pos-cmd <= axis.1.motor-pos-cmd
- net emcmot.02.pos-cmd <= axis.2.motor-pos-cmd
- net emcmot.03.pos-cmd <= axis.3.motor-pos-cmd
- net emcmot.00.pos-cmd => hm2_5i23.0.stepgen.00.position-cmd
- net emcmot.01.pos-cmd => hm2_5i23.0.stepgen.01.position-cmd
- net emcmot.02.pos-cmd => hm2_5i23.0.stepgen.02.position-cmd
- net emcmot.03.pos-cmd => hm2_5i23.0.stepgen.03.position-cmd
- net motor.00.pos-fb <= hm2_5i23.0.stepgen.00.position-fb
- net motor.01.pos-fb <= hm2_5i23.0.stepgen.01.position-fb
- net motor.02.pos-fb <= hm2_5i23.0.stepgen.02.position-fb
- net motor.03.pos-fb <= hm2_5i23.0.stepgen.03.position-fb
- #net motor.00.pos-fb <= hm2_5i23.0.encoder.00.position
- #net motor.01.pos-fb <= hm2_5i23.0.encoder.01.position
- #net motor.02.pos-fb <= hm2_5i23.0.encoder.02.position
- #net motor.03.pos-fb <= hm2_5i23.0.encoder.03.position
- net motor.00.pos-fb => axis.0.motor-pos-fb
- net motor.01.pos-fb => axis.1.motor-pos-fb
- net motor.02.pos-fb => axis.2.motor-pos-fb
- net motor.03.pos-fb => axis.3.motor-pos-fb
- # timing parameters
- setp hm2_5i23.0.stepgen.00.dirsetup [AXIS_0]DIRSETUP
- setp hm2_5i23.0.stepgen.01.dirsetup [AXIS_1]DIRSETUP
- setp hm2_5i23.0.stepgen.02.dirsetup [AXIS_2]DIRSETUP
- setp hm2_5i23.0.stepgen.03.dirsetup [AXIS_3]DIRSETUP
- setp hm2_5i23.0.stepgen.00.dirhold [AXIS_0]DIRHOLD
- setp hm2_5i23.0.stepgen.01.dirhold [AXIS_1]DIRHOLD
- setp hm2_5i23.0.stepgen.02.dirhold [AXIS_2]DIRHOLD
- setp hm2_5i23.0.stepgen.03.dirhold [AXIS_3]DIRHOLD
- setp hm2_5i23.0.stepgen.00.steplen [AXIS_0]STEPLEN
- setp hm2_5i23.0.stepgen.01.steplen [AXIS_1]STEPLEN
- setp hm2_5i23.0.stepgen.02.steplen [AXIS_1]STEPLEN
- setp hm2_5i23.0.stepgen.03.steplen [AXIS_3]STEPLEN
- setp hm2_5i23.0.stepgen.00.stepspace [AXIS_0]STEPSPACE
- setp hm2_5i23.0.stepgen.01.stepspace [AXIS_1]STEPSPACE
- setp hm2_5i23.0.stepgen.02.stepspace [AXIS_2]STEPSPACE
- setp hm2_5i23.0.stepgen.03.stepspace [AXIS_3]STEPSPACE
- setp hm2_5i23.0.stepgen.00.position-scale [AXIS_0]SCALE
- setp hm2_5i23.0.stepgen.01.position-scale [AXIS_1]SCALE
- setp hm2_5i23.0.stepgen.02.position-scale [AXIS_2]SCALE
- setp hm2_5i23.0.stepgen.03.position-scale [AXIS_3]SCALE
- setp hm2_5i23.0.stepgen.00.maxaccel [AXIS_0]MAX_ACCELERATION
- setp hm2_5i23.0.stepgen.01.maxaccel [AXIS_1]MAX_ACCELERATION
- setp hm2_5i23.0.stepgen.02.maxaccel [AXIS_2]MAX_ACCELERATION
- setp hm2_5i23.0.stepgen.03.maxaccel [AXIS_3]MAX_ACCELERATION
- setp hm2_5i23.0.stepgen.00.step_type 0
- setp hm2_5i23.0.stepgen.01.step_type 0
- setp hm2_5i23.0.stepgen.02.step_type 0
- setp hm2_5i23.0.stepgen.03.step_type 0
- #setp hm2_5i23.0.stepgen.00.maxvel 0
- #setp hm2_5i23.0.stepgen.01.maxvel 0
- #setp hm2_5i23.0.stepgen.02.maxvel 0
- #setp hm2_5i23.0.stepgen.03.maxvel 0
- # ######################################################
- # Post-GUI / Classic Ladder
- # ######################################################
- net gui-estop <= iocontrol.0.user-enable-out
- net gui-estop => classicladder.0.in-00
- #E-stop Related
- net estop-all-ok <= classicladder.0.out-00
- net estop-all-ok => iocontrol.0.emc-enable-in
- # ######################################################
- # Classic Ladder Zero-Plate Control
- # ######################################################
- # set up the z-axis touchoff button
- #net remote-z-axis-touchoff classicladder.0.in-00 <= pyvcp.z-axis-touchoff
- # set to mdi mode
- # show pin
- #net mode halui.mode.is-mdi => classicladder.0.in-07
- # wait for motion to finish
- #net in_pos motion.in-position => classicladder.0.in-08
- # mdi command 1 MDI_COMMAND = G38.2 Z-3 F16
- #net z-touchoff classicladder.0.out-05 => halui.mdi-command-00
- # mdi command 2 MDI_COMMAND = G92 Z0.25
- #net z-zero classicladder.0.out-06 => halui.mdi-command-01
- # mdi command 3 MDI_COMMAND = G0 Z1
- #net rapid-away classicladder.0.out-07 => halui.mdi-command-02
- # mdi command 4 MDI_COMMAND = G0 X-2 Y1
- #net zero-x-y halui.mdi-command-03 <= pyvcp.x-y_zero
- INI FILE:
- # Generated by PNCconf at Tue Jun 22 13:04:05 2010
- # If you make changes to this file, they will be
- # overwritten when you run PNCconf again
- [EMC]
- MACHINE = shopbot-config-1
- DEBUG = 0
- [DISPLAY]
- DISPLAY = axis
- # Cycle time, in seconds, that display will sleep between polls
- CYCLE_TIME = 0.200
- #- Initial display setting for position, RELATIVE or MACHINE
- POSITION_OFFSET = RELATIVE
- #- Initial display setting for position, COMMANDED or ACTUAL
- POSITION_FEEDBACK = ACTUAL
- #+ Highest value that will be allowed for feed override, 1.0 = 100%
- MAX_FEED_OVERRIDE = 2.000000
- MAX_SPINDLE_OVERRIDE = 1.000000
- MIN_SPINDLE_OVERRIDE = 0.500000
- INTRO_GRAPHIC = emc2.gif
- INTRO_TIME = 5
- PROGRAM_PREFIX = /home/bes/emc2/nc_files
- INCREMENTS = .1in .05in .01in .005in .001in .0005in .0001in
- POSITION_OFFSET = RELATIVE
- POSITION_FEEDBACK = ACTUAL
- DEFAULT_LINEAR_VELOCITY = 2
- MAX_LINEAR_VELOCITY = 12
- MIN_LINEAR_VELOCITY = 0.000833
- EDITOR = gedit
- GEOMETRY = xyz
- PYVCP = panel.xml
- [FILTER]
- PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
- PROGRAM_EXTENSION = .py Python Script
- png = image-to-gcode
- gif = image-to-gcode
- jpg = image-to-gcode
- py = python
- [TASK]
- TASK = milltask
- CYCLE_TIME = 0.010
- [RS274NGC]
- PARAMETER_FILE = emc.var
- [EMCMOT]
- EMCMOT = motmod
- COMM_TIMEOUT = 1.0
- COMM_WAIT = 0.010
- BASE_PERIOD = 20000
- SERVO_PERIOD = 1000000
- # [HOSTMOT2]
- # This is for info only
- # DRIVER0=hm2_pci
- # BOARD0=5i23
- # CONFIG0="firmware=hm2/5i23/SVST2_4_7I47.BIT num_encoders=4 num_pwmgens=2 num_stepgens=4"
- [HAL]
- # The run script first uses halcmd to execute any HALFILE
- # files, and then to execute any individual HALCMD commands.
- #
- # HALUI to interact with NML
- # Run before any other HALFILE
- HALUI = halui
- HALFILE = shopbot-config-1.hal
- [HALUI]
- MDI_COMMAND = G38.2 Z-2 f16
- MDI_COMMAND = G92 Z0.25
- MDI_COMMAND = G0 Z0.75
- MDI_COMMAND = G92 x2 y-.5
- [TRAJ]
- AXES = 4
- COORDINATES = X Y Z
- #HOME = 0 0 0
- LINEAR_UNITS = inch
- ANGULAR_UNITS = degree
- CYCLE_TIME = 0.010
- DEFAULT_VELOCITY = 2
- MAX_LINEAR_VELOCITY = 12
- NO_FORCE_HOMING = 1
- [EMCIO]
- EMCIO = io
- CYCLE_TIME = 0.100
- TOOL_TABLE = tool.tbl
- #********************
- # Axis X
- #********************
- [AXIS_0]
- TYPE = LINEAR
- SCALE = 2482.81711223357
- OUTPUT_SCALE = 1.0
- MAX_VELOCITY = 12
- MAX_ACCELERATION = 12
- OUTPUT_OFFSET = 0.0
- #INPUT_SCALE = 2000.0
- MIN_LIMIT = -0.25
- MAX_LIMIT = 96.0
- FERROR = 500
- MIN_FERROR = 01.00
- HOME = 1
- HOME_OFFSET = -0.25
- HOME_SEARCH_VEL = -0.50000
- HOME_LATCH_VEL = 0.16667
- HOME_FINAL_VEL = 0.16667
- HOME_USE_INDEX = No
- HOME_IGNORE_LIMITS = YES
- HOME_IS_SHARED = 1
- HOME_SEQUENCE = 1
- # these are in nanoseconds
- DIRSETUP = 1500
- DIRHOLD = 1500
- STEPLEN = 1500
- STEPSPACE = 2500
- #********************
- # Axis Y
- #********************
- [AXIS_1]
- TYPE = LINEAR
- SCALE = 2482.81711223357
- OUTPUT_SCALE = 1.0
- FERROR = 500
- MIN_FERROR = 01.00
- MAX_ACCELERATION = 12
- OUTPUT_OFFSET = 0.0
- MIN_LIMIT = -1
- MAX_LIMIT = 72.0
- HOME_OFFSET = -0.25
- HOME_SEARCH_VEL = -0.50000
- HOME_LATCH_VEL = 0.16667
- HOME_FINAL_VEL = 0.16667
- HOME_USE_INDEX = NO
- HOME_IGNORE_LIMITS = YES
- HOME_IS_SHARED = 1
- HOME_SEQUENCE = 0
- HOME = 1
- # these are in nanoseconds
- DIRSETUP = 1500
- DIRHOLD = 1500
- STEPLEN = 1500
- STEPSPACE = 2500
- #********************
- # Axis Z
- #********************
- [AXIS_2]
- TYPE = LINEAR
- SCALE = 2979.38053468028
- OUTPUT_SCALE = 1.0
- FERROR = 500
- MIN_FERROR = 01.00
- MAX_ACCELERATION = 12
- OUTPUT_OFFSET = 0.0
- MIN_LIMIT = -6
- MAX_LIMIT = 0
- HOME = 0.125
- HOME_OFFSET = 0
- HOME_SEARCH_VEL = 0.50000
- HOME_LATCH_VEL = -0.16667
- HOME_FINAL_VEL = -0.16667
- HOME_USE_INDEX = NO
- HOME_IGNORE_LIMITS = YES
- HOME_IS_SHARED = 1
- HOME_SEQUENCE = 2
- # these are in nanoseconds
- DIRSETUP = 1500
- DIRHOLD = 1500
- STEPLEN = 1500
- STEPSPACE = 2500
- #********************
- # Axis X2
- #********************
- [AXIS_3]
- TYPE = LINEAR
- SCALE = 2482.81711223357
- OUTPUT_SCALE = 1.0
- MAX_VELOCITY = 12
- MAX_ACCELERATION = 12
- OUTPUT_OFFSET = 0.0
- MIN_LIMIT = -0.25
- MAX_LIMIT = 96.0
- FERROR = 500
- MIN_FERROR = 01.00
- HOME = 1
- HOME_OFFSET = -0.25
- HOME_SEARCH_VEL = -0.50000
- HOME_LATCH_VEL = 0.16667
- HOME_FINAL_VEL = 0.16667
- HOME_USE_INDEX = No
- HOME_IGNORE_LIMITS = YES
- HOME_IS_SHARED = 1
- HOME_SEQUENCE = 1
- # these are in nanoseconds
- DIRSETUP = 1500
- DIRHOLD = 1500
- STEPLEN = 1500
- STEPSPACE = 2500
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement