Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # standard pinout config file for 3-axis steppers
- # using a parport for I/O
- #
- # first load the parport driver
- loadrt hal_parport cfg="0x0378 0xdff0 0xdfa8"
- #loadrt hal_parport cfg="0x0378 0xdfa8 0xdff0"
- #
- # next connect the parport functions to threads
- # read inputs first
- addf parport.0.read base-thread 1
- addf parport.1.read base-thread 1
- addf parport.2.read base-thread 1
- # write outputs last
- addf parport.0.write base-thread -1
- addf parport.1.write base-thread -1
- addf parport.2.write base-thread -1
- #
- # finally connect physical pins to the signals
- # using parport.1 for X Axis
- # using parport.2 for Y Axis
- # using parport.0 for Z Axis
- # as folows:
- linksp X_phaseA => parport.1.pin-07-out
- linksp X_phaseA => parport.1.pin-08-out
- setp parport.1.pin-08-out-invert TRUE
- linksp X_phaseB => parport.1.pin-05-out
- linksp X_phaseB => parport.1.pin-06-out
- setp parport.1.pin-06-out-invert TRUE
- linksp Y_phaseA => parport.2.pin-07-out
- linksp Y_phaseA => parport.2.pin-08-out
- setp parport.2.pin-08-out-invert TRUE
- linksp Y_phaseB => parport.2.pin-05-out
- linksp Y_phaseB => parport.2.pin-06-out
- setp parport.2.pin-06-out-invert TRUE
- linksp Z_phaseA => parport.0.pin-07-out
- linksp Z_phaseA => parport.0.pin-08-out
- setp parport.0.pin-08-out-invert TRUE
- linksp Z_phaseB => parport.0.pin-05-out
- linksp Z_phaseB => parport.0.pin-06-out
- setp parport.0.pin-06-out-invert TRUE
- # create a signal for the estop loopback
- # linkpp iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
- net enable iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
- # create signals for tool loading loopback
- # linkpp iocontrol.0.tool-prepare iocontrol.0.tool-prepared
- # linkpp iocontrol.0.tool-change iocontrol.0.tool-changed
- # I disabled the following 2 lines to enable hal_manualtoolchange I just setup below
- #net tool-prepared iocontrol.0.tool-prepare iocontrol.0.tool-prepared
- #net tool-changed iocontrol.0.tool-change iocontrol.0.tool-changed
- #Setup hal manual tool change
- 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
- # create a signal for "spindle on"
- newsig spindle-on bit
- # connect the controller to it
- linkps motion.spindle-on => spindle-on
- # connect it to a physical pin
- linksp spindle-on => parport.2.pin-17-out
- #create a signal and connect to parport pin for estop activated for Estop-on (red) ind
- net estopactivated halui.estop.is-activated parport.1.pin-03-out
- # now create a signal for estop not activated for Estop-off ind (grn) & motor control
- linksp estopactivated => parport.1.pin-04-out
- setp parport.1.pin-04-out-invert true
- #create a signal for machine on ind
- net machineon halui.machine.is-on parport.2.pin-02-out
- #create signals to show which axis is selected DON'T need this!
- #net xisselected axisui.jog.x parport.1.pin-02-out
- ###
- ### You might use something like this to enable chopper drives when machine ON
- ### the En1 signal is defined in 1BPstepper.hal
- ###
- linksp En1 => parport.0.pin-09-out
- setp parport.0.pin-09-out-invert true
- linksp En1 => parport.1.pin-09-out
- setp parport.1.pin-09-out-invert true
- linksp En1 => parport.2.pin-09-out
- setp parport.2.pin-09-out-invert true
- ###
- ### If you want active low for this pin, invert it like this:
- ###
- # setp parport.0.pin-01-out-invert true
- # or
- # setp parport.0.pin-01-out-invert 1
- #To create a +5v pull up on pin 17
- #newsig pu bit
- #linksp pu parport.0.pin-17-out
- #linksp pu parport.1.pin-17-out
- #linksp pu parport.2.pin-17-out
- #sets pu true
- #Create
- # create signals and link them between the appropriate
- # parport pins and axis limit pins
- newsig X-neg-limit bit
- linkps parport.1.pin-10-in => X-neg-limit
- linksp X-neg-limit => axis.0.neg-lim-sw-in
- linksp X-neg-limit => axis.0.home-sw-in
- ### See note pertaining to above statement below at ###
- newsig X-pos-limit bit
- linkps parport.1.pin-11-in => X-pos-limit
- linksp X-pos-limit => axis.0.pos-lim-sw-in
- #linksp X-pos-limit => axis.0.home-sw-in
- ### See note pertaining to above statement below at ###
- newsig Y-neg-limit bit
- linkps parport.2.pin-10-in => Y-neg-limit
- linksp Y-neg-limit => axis.1.neg-lim-sw-in
- newsig Y-pos-limit bit
- linkps parport.2.pin-11-in => Y-pos-limit
- linksp Y-pos-limit => axis.1.pos-lim-sw-in
- linksp Y-pos-limit => axis.1.home-sw-in
- newsig Z-neg-limit bit
- linkps parport.0.pin-10-in => Z-neg-limit
- linksp Z-neg-limit => axis.2.neg-lim-sw-in
- newsig Z-pos-limit bit
- linkps parport.0.pin-11-in => Z-pos-limit
- linksp Z-pos-limit => axis.2.pos-lim-sw-in
- linksp Z-pos-limit => axis.2.home-sw-in
- ### Using a limit switch to home to you must link the limit switch to the
- ### appropriate axis home switch input pin. Note - You can't connect two
- ### or more different signals to a one pin. You may connect a signal
- ### to as many pins as you wish.
- # Try this for external jog inputs
- net jog0minus halui.jog.2.minus parport.0.pin-12-in-not
- net jog0plus halui.jog.2.plus parport.0.pin-13-in-not
- setp halui.jog-speed .05
- # Wa-la! It looks like it worked!!
- #Setup for creating all homed signal
- #load 3 input "and" gate
- loadrt logic personality=259
- addf logic.0 servo-thread
- #Connect Sig name - pin - pin
- net xhomed logic.0.in-00 halui.joint.0.is-homed
- net yhomed logic.0.in-01 halui.joint.1.is-homed
- net zhomed logic.0.in-02 halui.joint.2.is-homed
- net allhomed logic.0.and parport.2.pin-03-out
- setp parport.2.pin-03-out-invert true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement