All pastes #364802 Raw Edit

Something

public text v1 · immutable
#364802 ·published 2007-02-20 12:16 UTC
rendered paste body
# standard pinout config file for 3-axis steppers
# using a parport for I/O
#
# first load the parport driver
loadrt hal_parport cfg="0x0378"
#
# 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
#
# finally connect physical pins to the signals
linksp Xstep => parport.0.pin-02-out
linksp Xdir  => parport.0.pin-03-out
linksp Ystep => parport.0.pin-04-out
linksp Ydir  => parport.0.pin-05-out
linksp Zstep => parport.0.pin-06-out
linksp Zdir  => parport.0.pin-07-out

# create a signal for the estop loopback
# linkpp parport.0.pin-10-in iocontrol.0.emc-enable-in

# create signal for external estop
newsig ext-estop bit
linksp ext-estop parport.0.pin-10-in
linkpp parport.0.pin-10-in 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

# create a signal for "spindle on"
# connect the controller to it
# connect it to a physical pin
#newsig spindle-on bit
#linkps motion.spindle-on => spindle-on
#linksp spindle-on => parport.0.pin-17-out

# spindle signals "spindle forw,rev"
# spindle status has not been resolved
# a simple loop through is set here
linkpp motion.spindle-forward  parport.0.pin-16-out 
# linkpp motion.spindle-reverse  parport.0.pin-17-out

########## Charge Pump #########

# This is for Charge Pump which requires a 15khz signal to activate, maxfreq is the limiter 
loadrt freqgen step_type=0
loadrt siggen
loadrt threads name1=fastcp period1=30000 name2=slowcp period2=1000000
loadrt and2 count=1

newsig velcp float
newsig stepcp bit
newsig latchedcp bit

linksp velcp siggen.0.square
linksp velcp freqgen.0.velocity
linksp stepcp freqgen.0.step

addf siggen.0.update slowcp
addf freqgen.update-freq slowcp
addf freqgen.make-pulses fastcp
addf and2.0 fastcp
setp freqgen.0.velocity-scale 1000000
setp freqgen.0.maxfreq 12500


linksp stepcp and2.0.in0
linksp iocontrol.0.user-enable-out and2.0.in1

linksp latchedcp and2.0.out
linksp latchedcp parport.0.pin-17-out
# linksp stepcp parport.1.pin-17-out

# newsig charge-pump bit
# linksp charge-pump parport.0.pin-17-out


# Home/Limit Shared Switch on Same Pin

newsig Xswitches bit
linkps parport.0.pin-11-in-not => Xswitches
linksp Xswitches => axis.0.home-sw-in
linksp Xswitches => axis.0.neg-lim-sw-in
linksp Xswitches => axis.0.pos-lim-sw-in
 
newsig Yswitches bit
linkps parport.0.pin-12-in-not => Yswitches
linksp Yswitches => axis.1.home-sw-in
linksp Yswitches => axis.1.neg-lim-sw-in
linksp Yswitches => axis.1.pos-lim-sw-in
 
newsig Zswitches bit
linkps parport.0.pin-13-in-not => Zswitches
linksp Zswitches => axis.2.home-sw-in
linksp Zswitches => axis.2.neg-lim-sw-in
linksp Zswitches => axis.2.pos-lim-sw-in


# coolant signals
# note that these do NOT represent proper IO signals from iocontrol
# should separate command and status for production versions
# and run these through CL to test conditions
linkpp  iocontrol.0.coolant-flood  parport.0.pin-08-out 
# linkpp  iocontrol.0.coolant-mist  parport.0.pin-09-out

loadrt pwmgen output_type=1
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-09-out
setp pwmgen.0.scale 2000 # Change to your spindle’s top speed in RPM