Skip to content

Commit

Permalink
add auto exhaust fan control with delayed turn off
Browse files Browse the repository at this point in the history
  • Loading branch information
jv4779 committed Jun 19, 2013
1 parent 67fb353 commit 2d6fce6
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 29 deletions.
45 changes: 24 additions & 21 deletions 2x_Laser.hal
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ net laser-pwm <= pwmgen.0.pwm
setp pwmgen.0.enable 1
# pwm-freq 0 means PDM (pulse density modulation)
setp pwmgen.0.pwm-freq 0
setp pwmgen.0.max-dc 0.6
# scale 0%=0.1 100%=0.6
setp pwmgen.0.max-dc 0.7
setp pwmgen.0.scale 200
setp pwmgen.0.offset 0.1
setp pwmgen.0.dither-pwm true
Expand All @@ -48,7 +49,7 @@ net coolant-mist <= iocontrol.0.coolant-mist
net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in

net estop-out => parport.0.pin-01-out
#net estop-out => parport.0.pin-01-out
net xstep => parport.0.pin-02-out
# setp parport.0.pin-02-out-reset 1
net xdir => parport.0.pin-03-out
Expand All @@ -63,6 +64,8 @@ net wdir => parport.0.pin-07-out
setp parport.0.pin-07-out-invert 1
net xenable => parport.0.pin-08-out
setp parport.0.pin-08-out-invert 1

net laser-exhaust => parport.0.pin-01-out
net laser-pwm => parport.0.pin-14-out
net coolant-mist => parport.0.pin-16-out
net laser-final => parport.0.pin-17-out
Expand Down Expand Up @@ -114,8 +117,8 @@ net wpos-fb stepgen.2.position-fb => axis.8.motor-pos-fb
net wstep <= stepgen.2.step
net wdir <= stepgen.2.dir
net wenable axis.8.amp-enable-out => stepgen.2.enable
net both-w => axis.8.neg-lim-sw-in
net both-w => axis.8.pos-lim-sw-in
#net both-w => axis.8.neg-lim-sw-in
#net both-w => axis.8.pos-lim-sw-in

net zpos-cmd-fb <= axis.2.motor-pos-cmd => axis.2.motor-pos-fb

Expand Down Expand Up @@ -178,20 +181,20 @@ net laser-master => laser-final-lut.in-4
net laser-final <= laser-final-lut.out

########################
# chiller/assist-air control

loadrt oneshot names=laser-chiller-oneshot
loadrt or2 names=laser-chiller-or
addf laser-chiller-oneshot servo-thread
addf laser-chiller-or servo-thread

net laser-master => laser-chiller-oneshot.in
net laser-chiller-extra <= laser-chiller-oneshot.out
setp laser-chiller-oneshot.retriggerable 1
setp laser-chiller-oneshot.width [LASER]EXTRA_CHILLER_TIME
setp laser-chiller-oneshot.rising 0
setp laser-chiller-oneshot.falling 1

net laser-master => laser-chiller-or.in0
net laser-chiller-extra => laser-chiller-or.in1
net laser-chiller <= laser-chiller-or.out
# exhaust/assist-air control

loadrt oneshot names=laser-exhaust-oneshot
loadrt or2 names=laser-exhaust-or
addf laser-exhaust-oneshot servo-thread
addf laser-exhaust-or servo-thread

net laser-master => laser-exhaust-oneshot.in
net laser-exhaust-extra <= laser-exhaust-oneshot.out
setp laser-exhaust-oneshot.retriggerable 1
setp laser-exhaust-oneshot.width [LASER]EXTRA_EXHAUST_TIME
setp laser-exhaust-oneshot.rising 0
setp laser-exhaust-oneshot.falling 1

net laser-master => laser-exhaust-or.in0
net laser-exhaust-extra => laser-exhaust-or.in1
net laser-exhaust <= laser-exhaust-or.out
12 changes: 7 additions & 5 deletions 2x_Laser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ NML_FILE = emc.nml
DEBUG = 0

[LASER]
EXTRA_CHILLER_TIME = 20
# time exaust fan will stay on after cut is done in seconds
EXTRA_EXHAUST_TIME = 20
# duration of pulse "dashes" in ns
PULSED_CUT_DURATION = 3000000
# delay between triggering laser to fire and actual pulse in ns
TRIGGER_DELAY = 200
TRIGGER_DELAY = 000

[DISPLAY]
DISPLAY = axis
Expand Down Expand Up @@ -63,6 +64,7 @@ MDI_COMMAND = G38.2 W20 F4
MDI_COMMAND = G92 W0
MDI_COMMAND = G0 W0 F4
MDI_COMMAND = O146 call
MDI_COMMAND = G0 X0 Y0

[TRAJ]
AXES = 9
Expand Down Expand Up @@ -105,9 +107,9 @@ SCALE = 1000.0
FERROR = 1
MIN_FERROR = 0.05
MIN_LIMIT = -0.001
MAX_LIMIT = 17.501
HOME = 17.500
HOME_OFFSET = 17.750
MAX_LIMIT = 17.511
HOME = 17.510
HOME_OFFSET = 17.760
HOME_SEARCH_VEL = 2.5
HOME_LATCH_VEL = -0.83
HOME_SEQUENCE = 0
Expand Down
8 changes: 5 additions & 3 deletions custom_postgui.hal
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ net laser-freq-abs <= abs.0.out => pyvcp.spindle
net laser-power-cmd => pyvcp.power

net laser-air-assist halui.mist.is-on => pyvcp.air-assist
net laser-exhaust => pyvcp.laser-exhaust
net laser-master => pyvcp.laser-master
net laser-raster => pyvcp.laser-raster
net laser-dout => pyvcp.laser-dout
net laser-continuous <= laserfreq.0.continuous => pyvcp.laser-continuous
net laser-magic-z => pyvcp.laser-magic-z

net z-to-zero pyvcp.z-to-zero => halui.mdi-command-00
net xy-touchoff pyvcp.xy-touchoff => halui.mdi-command-01
net laser-test-fire pyvcp.laser-test-fire => halui.mdi-command-05
net button-z-to-zero pyvcp.z-to-zero => halui.mdi-command-00
net button-xy-touchoff pyvcp.xy-touchoff => halui.mdi-command-01
net button-laser-test-fire pyvcp.laser-test-fire => halui.mdi-command-05
net button-move-origin pyvcp.move-origin => halui.mdi-command-06

loadrt time
addf time.0 servo-thread
Expand Down
5 changes: 5 additions & 0 deletions custompanel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@
<led halpin="air-assist"/>
<label text="Air Assist"/>
</hbox>
<hbox>
<led halpin="laser-exhaust"/>
<label text="Exhaust fan"/>
</hbox>
<button halpin="xy-touchoff" text="Touch-off X/Y"/>
<button halpin="move-origin" text="Move to origin"/>

<labelframe text="Pulses">
<hbox>
Expand Down

0 comments on commit 2d6fce6

Please sign in to comment.