Custom_postgui file

####################

# Include your customized HAL commands here
# The commands in this file are run after the AXIS GUI (including PyVCP panel)
# starts
# This file will not be overwritten when you run stepconf again

# connect the X PyVCP buttons
net my-jogxminus halui.jog.0.minus <= pyvcp.x-minus
net my-jogxplus halui.jog.0.plus <= pyvcp.x-plus

# connect the Y PyVCP buttons
net my-jogyminus halui.jog.1.minus <= pyvcp.y-minus
net my-jogyplus halui.jog.1.plus <= pyvcp.y-plus

# connect the Z PyVCP buttons
net my-jogzminus halui.jog.2.minus <= pyvcp.z-minus
net my-jogzplus halui.jog.2.plus <= pyvcp.z-plus

# connect the PyVCP jog speed slider
  net my-jogspeed halui.jog-speed <= pyvcp.jog-speed-f

net spindle-speed-cmd  => pyvcp.spindle-speed



net touch-off-Z <= parport.1.pin-07-in


Custom Hal file-mpg2  

####################

# Include your customized HAL commands here
# This file will not be overwritten when you run stepconf again

# Jog Pendant
loadrt encoder num_chan=1
loadrt mux4 count=1
loadrt lut5 count=1
addf encoder.capture-position servo-thread
addf encoder.update-counters base-thread
addf mux4.0 servo-thread
addf lut5.0 servo-thread


# If your MPG outputs a quadrature signal per click set x4 to 1
# If your MPG puts out 1 pulse per click set x4 to 0
setp encoder.0.x4-mode 0

# For velocity mode, set n to 1
# In velocity mode the axis stops when the dial is stopped
# even if that means the commanded motion is not completed,
# For position mode (the default), set n to 0
# In position mode the axis will move exactly jog-scale
# units for each count, regardless of how long that might take,
setp axis.0.jog-vel-mode 0
setp axis.1.jog-vel-mode 0
setp axis.2.jog-vel-mode 0




# this sets the scale that will be used based on the input to the mux4
setp mux4.0.in0 0.1
setp mux4.0.in1 0.01
setp mux4.0.in2 0.001

# the inputs to the mux4 component
net scale1 mux4.0.sel0 <= parport.1.pin-09-in
net scale2 mux4.0.sel1 <= parport.1.pin-10-in

# the output from the mux4 is sent to each axis jog scale
net mpg-scale <= mux4.0.out
net mpg-scale => axis.0.jog-scale
net mpg-scale => axis.1.jog-scale
net mpg-scale => axis.2.jog-scale



# the MPG inputs
net mpg-a encoder.0.phase-A <= parport.1.pin-02-in
net mpg-b encoder.0.phase-B <= parport.1.pin-03-in

# the Axis select inputs
net mpg-x axis.0.jog-enable <= parport.1.pin-04-in
net mpg-y axis.1.jog-enable <= parport.1.pin-05-in
net mpg-z axis.2.jog-enable <= parport.1.pin-06-in



# the encoder output counts to the axis. Only the selected axis will move.
net encoder-counts  <= encoder.0.counts
net encoder-counts => axis.0.jog-counts
net encoder-counts => axis.1.jog-counts
net encoder-counts => axis.2.jog-counts

# Turn on the jog led if any jog axis is enabled
setp lut5.0.function 0x116
net mpg-x lut5.0.in-0
net mpg-y lut5.0.in-1
net mpg-z lut5.0.in-2
net mpg-4 lut5.0.in-3
setp lut5.0.in-4 0
net jog-on parport.1.pin-01-out <= lut5.0.out


Mill.hal

# configuration for 3-axis gantry router with tandem motors on the y-axis

# This file will not be overwritten when you run stepconf again


loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]SERVO_PERIOD key=[EMCMOT]SHMEM_KEY num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hal_parport cfg="0x378 0xcce0 in"
addf parport.1.read base-thread
addf parport.1.write base-thread
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0
# loadrt threads fp1=0 name1=fast period1=50000 name2=slow period2=1000000
loadrt classicladder_rt numPhysInputs=15 numPhysOutputs=15 numS32in=10 numS32out=10 numFloatIn=10 numFloatOut=10

# 0-10 PWM volt VFD Control
loadrt pwmgen output_type=0
addf pwmgen.update servo-thread
addf pwmgen.make-pulses base-thread
net spindle-speed-cmd motion.spindle-speed-out => pwmgen.0.value
net spindle-on motion.spindle-on => pwmgen.0.enable
net spindle-pwm pwmgen.0.pwm => parport.0.pin-17-out

# Set the spindle's top speed in RPM
setp pwmgen.0.scale 24000

# load the module for the tandem motor logic
loadrt and2 count=5 
loadrt or2 count=5 
loadrt not count=6 
loadrt debounce cfg=2,3


# add the module to the necessary threads
addf and2.0 base-thread  
addf and2.1 base-thread 
addf and2.2 base-thread
addf and2.3 base-thread 
addf and2.4 base-thread  
addf or2.0 base-thread
addf or2.1 base-thread
addf or2.2 base-thread
addf not.0 base-thread
addf not.1 base-thread
addf not.2 base-thread
addf not.3 base-thread
addf not.4 base-thread
addf debounce.0 base-thread
addf debounce.1 base-thread

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread


# set up the axis parameters and create the axis signals

# x-axis
setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 1
setp stepgen.0.dirhold 35000
setp stepgen.0.dirsetup 35000
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable

# y-axis
setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 1
setp stepgen.1.dirhold 35000
setp stepgen.1.dirsetup 35000
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable axis.1.amp-enable-out => stepgen.1.enable

# z-axis
setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 35000
setp stepgen.2.dirsetup 35000
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable axis.2.amp-enable-out => stepgen.2.enable


# set all of the step signals to reset
#setp parport.0.pin-02-out-reset 1
#setp parport.0.pin-04-out-reset 1
#setp parport.0.pin-06-out-reset 1
#setp parport.0.pin-08-out-reset 1

# invert a couple of direction signals
setp parport.0.pin-03-out-invert 1
setp parport.0.pin-05-out-invert 1
setp parport.0.pin-07-out-invert 1
setp parport.0.pin-09-out-invert 1

# debounce the y-axis switches and connect them to signals
net switches-y1-raw	<= parport.0.pin-11-in
net switches-y1-raw 	=> debounce.0.0.in 
net switches-y1 	<= debounce.0.0.out
net switches-y2-raw   	<= parport.0.pin-12-in
net switches-y2-raw 	=> debounce.0.1.in 
net switches-y2 	<= debounce.0.1.out
setp debounce.0.delay 100

# join the home switch signals so that both switches have to be closed to trigger a home position
net switches-y1		=> and2.0.in0
net switches-y2		=> and2.0.in1
net home-y 		<= and2.0.out
net home-y 		=> axis.1.home-sw-in

# we will need the inverse of the home switch signals for our logic, so run them through not gates
net switches-y1		=> not.0.in
net switches-y1-inv 	<= not.0.out
net switches-y2		=> not.1.in
net switches-y2-inv 	<= not.1.out

# we will need the inverse of the direction signals for our logic, so run it through a not gate
net ydir	=> not.2.in
net ydir-inv	=> not.2.out

# we need to determine if the home switch for each motor is tripped while the direction line is
# moving the motor towards the switch

# for both y-axis motors, we will prevent the step signal from passing to the motor 
# if the motor is moving towards the switch and the switch is tripped
# so "or" the inverted direction signals and the inverted home switches 
net ydir	=> and2.3.in0
net switches-y1 => and2.3.in1
net doh1	<= and2.3.out
net doh1	=> not.3.in
net doh1-inv	=> not.3.out

net ydir	=> and2.4.in0
net switches-y2 => and2.4.in1
net doh2	<= and2.4.out
net doh2	=> not.4.in
net doh2-inv	=> not.4.out	

# if the step generator is trying to send a step (ystep signal) and either the motor is moving 
# away from the switch or the switch is not tripped, then pass the step signal to the motor
net ystep 	and2.1.in0
net doh1-inv	and2.1.in1
net ystep1 	and2.1.out

net ystep 	and2.2.in0
net doh2-inv	and2.2.in1
net ystep2	and2.2.out

# connect our step and direction signals to the output pins
net xstep 	=> parport.0.pin-02-out
net xdir 	=> parport.0.pin-03-out
net ystep1 	=> parport.0.pin-04-out 
net ystep2 	=> parport.0.pin-08-out
net ydir 	=> parport.0.pin-05-out 
net ydir 	=> parport.0.pin-09-out
net zstep 	=> parport.0.pin-06-out
net zdir 	=> parport.0.pin-07-out

# we are using combined home and limit switches
# if either switch trips while the homing sequence is not running, then triggered a negative
# limit switch fault
net switches-y1 => or2.2.in0
net switches-y2	=> or2.2.in1
net limit-y 	<= or2.2.out
net limit-y 	=> axis.1.neg-lim-sw-in
net limit-y 	=> axis.1.pos-lim-sw-in


# set up the other home and limit switches
net switches-x-raw   	<= parport.0.pin-10-in
net switches-x-raw 	=> debounce.1.0.in 
net switches-x 		<= debounce.1.0.out
net switches-x 		=> axis.0.home-sw-in
net switches-x		=> axis.0.neg-lim-sw-in
net switches-x		=> axis.0.pos-lim-sw-in

net switches-z-raw 	<= parport.0.pin-13-in
net switches-z-raw 	=> debounce.1.1.in 
net switches-z 		<= debounce.1.1.out
net switches-z 		=> axis.2.home-sw-in
net switches-z		=> axis.2.pos-lim-sw-in

setp debounce.1.delay 100

# connect the spindle control to the relay pin
net spindle-cw => parport.0.pin-14-out
net spindle-cw <= motion.spindle-forward

# connect the shop vac to the flood coolant signal
net flood => iocontrol.0.coolant-flood
net flood => parport.0.pin-16-out

# set up the e-stop switch
net estop-raw <= parport.0.pin-15-in-not
net estop-raw => debounce.1.2.in
net estop-ext <= debounce.1.2.out
net estop-ext => iocontrol.0.emc-enable-in






#net estop-out <= iocontrol.0.user-enable-out
#net estop-out => iocontrol.0.emc-enable-in

net estop-out <= iocontrol.0.user-enable-out


loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

# Load Classicladder with modbus master included (GUI must run for Modbus)
loadusr classicladder --modmaster custom.clp



mill.ini file 

# Generated by stepconf at Sun Jul  7 17:53:35 2013
# If you make changes to this file, they will be
# overwritten when you run stepconf again

[EMC]
MACHINE = RicoReef_A1_V2.65
DEBUG = 0

[DISPLAY]
DISPLAY = axis
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
INTRO_GRAPHIC = emc2.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/probotix/emc2/nc_files
INCREMENTS = .1in .05in .01in .005in .001in .0005in .0001in
PYVCP = custompanel.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
SHMEM_KEY = 111
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
BASE_PERIOD = 100000
SERVO_PERIOD = 1000000

[HAL]
HALUI = halui
HALFILE = RicoReef_A1_V2.65.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal

[HALUI]
MDI_COMMAND = G10 L20 P1 X0

[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 3.328
MAX_LINEAR_VELOCITY = 3.328
NO_FORCE_HOMING = 0

[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl

[AXIS_0]
TYPE = LINEAR
HOME = 12.5
MAX_VELOCITY = 3.328
MAX_ACCELERATION = 6
STEPGEN_MAXACCEL = 30
SCALE = 800.0
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = -0.1
MAX_LIMIT = 25.2783
HOME_OFFSET = -0.2
HOME_SEARCH_VEL = -0.5
HOME_LATCH_VEL = -0.2
HOME_IGNORE_LIMITS = 1
HOME_SEQUENCE = 1
HOME_FINAL_VEL = 3.0

[AXIS_1]
TYPE = LINEAR
HOME = 25
MAX_VELOCITY = 3.328
MAX_ACCELERATION = 6
STEPGEN_MAXACCEL = 30
SCALE = 800.0
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = -0.1
MAX_LIMIT = 52.0417
HOME_OFFSET = -0.2
HOME_SEARCH_VEL = -0.5
HOME_LATCH_VEL = -0.2
HOME_IGNORE_LIMITS = 1
HOME_SEQUENCE = 1
HOME_FINAL_VEL = 3

[AXIS_2]
TYPE = LINEAR
HOME = 0
MAX_VELOCITY = 1
MAX_ACCELERATION = 10.0
STEPGEN_MAXACCEL = 31.5
SCALE = 2000
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = -6.0
MAX_LIMIT = 0.1
HOME_OFFSET = 0.2
HOME_SEARCH_VEL = 0.5
HOME_LATCH_VEL = 0.2
HOME_IGNORE_LIMITS = 1
HOME_SEQUENCE = 0