All pastes #763667 Raw Edit

Something

public text v1 · immutable
#763667 ·published 2007-11-06 17:27 UTC
rendered paste body
# standard pinout config file for 3-axis steppers
# using a parport for I/O
#
# first load the parport driver
loadrt probe_parport
loadrt hal_parport cfg="0x0378  0xDFE0"
#
# next connect the parport functions to threads
# read inputs first
addf parport.0.read base-thread 1
# write outputs last
addf parport.0.write base-thread -1
#read inputs first
addf parport.1.read base-thread 1
#write outputs last
addf parport.1.write base-thread -1

# finally connect physical pins to the signals
linksp Xstep => parport.0.pin-03-out
linksp Xdir  => parport.0.pin-02-out
linksp Ystep => parport.0.pin-05-out
linksp Ydir  => parport.0.pin-04-out
linksp Zstep => parport.0.pin-07-out
linksp Zdir  => parport.0.pin-06-out

# create a signal for the estop force false
# alternate for estop force false pin 13 only with no ewrite
#linkpp parport.1.pin-13-in iocontrol.0.emc-enable-in

# connect e-stop write/sense to I/O controller
newsig EstopSense bit
newsig EstopWrite bit
linksp EstopSense <= parport.1.pin-13-in
linksp EstopSense => iocontrol.0.emc-enable-in
linksp EstopWrite <= parport.1.pin-16-out
linksp EstopWrite => iocontrol.0.user-enable-out
#estop may need to be inverted

# create feedhold signal
newsig feedhold bit
# connect signal to motion cotrol
linkps motion.feed-hold => feedhold
# conect feedhold to physical pin
linksp feedhold => parport.1.pin-11-in-not
# or this works too
#net feedhold parport.1.pin-11-in-not motion.feed-hold

#use halui for run open program hardware button halui button non funtional now
#newsig runsignal bit
#net runsignal parport.1.pin-12-in-not  halui.program.run 

# use halui to abort on estop
#newsig abort bit
#net abort parport.0.pin-11-in-not halui.abort

# create a signal for "spindle brake"
# create a signal for "spindlefwd"
# create a signal for "spindlerev"
newsig spindle-brake bit
newsig spindle-forwrd bit
#newsig spindle-reverse bit
# connect the controller to it
linkps motion.spindle-brake => spindle-brake
linkps motion.spindle-forward => spindle-forwrd
#linkps motion.spindle-reverse => spindle-reverse
# connect it to physical pin
linksp spindle-brake => parport.1.pin-17-out
linksp spindle-forwrd => parport.1.pin-03-out
#linksp spindle-reverse => parport.1.pin-02-out
net spindle-rev motion.spindle-reverse parport.1.pin-02-out

# create a signle for mist coolant 
# create a signle for flood coolant
newsig MistOn bit
newsig FloodOn bit
# connect iocontroler to it
# connect it to a physical pin
linksp MistOn <= parport.1.pin-08-out
linksp MistOn => iocontrol.0.coolant-mist
linksp FloodOn <= parport.1.pin-09-out
linksp FloodOn => iocontrol.0.coolant-flood

# create signals for tool loading loopback
# use sig for tool prep to tool preped 
linkpp iocontrol.0.tool-prepare iocontrol.0.tool-prepared
# creat a signal for toolchange
newsig changetool bit
newsig toolchanged bit
# connect iocontroler to it
# connect it to pphyiscal pins 
linksp changetool <= parport.1.pin-04-out
linksp changetool => iocontrol.0.tool-change
linksp toolchanged <= parport.0.pin-10-in-not
linksp toolchanged => iocontrol.0.tool-changed

###
### You might use something like this to enable chopper drives when machine ON
### the Xen signal is defined in core_stepper.hal
###

# linksp Xen => parport.0.pin-01-out

###
### If you want active low for this pin, invert it like this:
###

# setp parport.0.pin-01-out-invert 1

###
### A sample home switch on the X axis (axis 0).  make a signal,
### link the incoming parport pin to the signal, then link the signal
### to EMC's axis 0 home switch input pin
###

# newsig Xhome bit
# linkps parport.0.pin-10-in => Xhome
# linksp Xhome => axis.0.home-sw-in

###
### Shared home switches all on one parallel port pin?
### that's ok, hook the same signal to all the axes, but be sure to 
### set HOME_IS_SHARED and HOME_SEQUENCE in the ini file.  See the
### user manual!
###

# newsig homeswitches bit
# linkps parport.0.pin-10-in => homeswitches
# linksp homeswitches => axis.0.home-sw-in
# linksp homeswitches => axis.1.home-sw-in
# linksp homeswitches => axis.2.home-sw-in

###
### Sample separate limit switches on the X axis (axis 0)
###

# newsig X-neg-limit bit
# linkps parport.0.pin-11-in => X-neg-limit
# linksp X-neg-limit => axis.0.neg-lim-sw-in

# create signal for pos-limits
 newsig pos-limits bit
# connect signal to physical pin
 linkps parport.0.pin-15-in-not => pos-limits
# connect signal to pos-limits
 linksp pos-limits => axis.0.pos-lim-sw-in
 linksp pos-limits => axis.1.pos-lim-sw-in
 linksp pos-limits => axis.2.pos-lim-sw-in
###
### Just like the shared home switches example, you can wire together
### limit switches.  Beware if you hit one, EMC will stop but can't tell
### you which switch/axis has faulted.  Use caution when recovering from this.
###
# create signal for neg-limits
 newsig neg-limits bit
# connect signal to physical pin
 linkps parport.0.pin-13-in-not => neg-limits
# create sig for neg-limits switches
 linksp neg-limits => axis.0.neg-lim-sw-in
 linksp neg-limits => axis.1.neg-lim-sw-in
 linksp neg-limits => axis.2.neg-lim-sw-in