view graster/hacklab-engraver/hacklab-engraver3.hal @ 11:f952052e37b7

trying a fix.
author Robert McIntyre <rlm@mit.edu>
date Tue, 24 Aug 2010 19:06:45 -0400
parents
children
line wrap: on
line source
1 # Generated by stepconf at Sun Mar 8 21:32:59 2009
2 # If you make changes to this file, they will be
3 # overwritten when you run stepconf again
5 loadrt threads name1=mask-thread period1=100000
7 loadrt trivkins
8 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
9 loadrt probe_parport
10 loadrt hal_parport cfg=0x378
11 setp parport.0.reset-time 100000
12 loadrt stepgen step_type=0,0,0,0
13 loadrt charge_pump
16 # Boring components that emc makes me load explicitly because it is a cunt
17 loadrt comp names=comp-mask-lte,comp-discrete-z
18 loadrt not names=not-mask-ffw,not-mask-not-empty
19 loadrt xor2 names=xor2-mask-test
20 loadrt and2 names=and2-mask-forward,and2-laser-mask,and2-laser-final
21 loadrt or2 names=or2-mask-command-done,or2-mask-not-ffw,or2-mask-read,or2-laser-gcode,or2-laser-fine
24 # Fast thread for generating signals
25 addf parport.0.read base-thread
26 addf stepgen.make-pulses base-thread
27 addf parport.0.write base-thread
28 addf parport.0.reset base-thread
29 addf charge-pump base-thread
31 # Slow thread for logic (more logic components are added further down)
32 addf stepgen.capture-position servo-thread
33 addf motion-command-handler servo-thread
34 addf motion-controller servo-thread
35 addf stepgen.update-freq servo-thread
38 ###################################################################################
39 # Raster Mask - stream in laser on/off commands behind AXIS's back
40 # Input stream format: reset beam xop xarg
41 # reset: 0=mask command 1=reset (begin mask sequence with "1 0 0 0", every other command starts with 0)
42 # beam: 0=off 1=on
43 # xop: X axis comparison operation 0=less-or-equal 1=greater
44 # xarg: X axis comparison operand
46 loadrt streamer depth=256 cfg="bbbf"
47 net mask-reset <= streamer.0.pin.0
48 net mask-beam <= streamer.0.pin.1
49 net mask-xop <= streamer.0.pin.2
50 net mask-xarg <= streamer.0.pin.3
51 net mask-empty <= streamer.0.empty
52 net mask-read => streamer.0.enable
54 # hardware reported X axis position
55 net motion-xpos-fb <= axis.0.joint-pos-fb
57 # mask-lte <= motion-xpos-fb < mask-xarg
58 addf comp-mask-lte mask-thread
59 net motion-xpos-fb => comp-mask-lte.in0
60 net mask-xarg => comp-mask-lte.in1
61 net mask-lte <= comp-mask-lte.out
63 # mask-test <= mask-xop ^ mask-lte
64 addf xor2-mask-test mask-thread
65 net mask-xop => xor2-mask-test.in0
66 net mask-lte => xor2-mask-test.in1
67 net mask-test <= xor2-mask-test.out
69 # if job is running, read only if test is true or reset
70 # if job is not running, read until reset
71 # mask-read <= (laser-coarse && (mask-test || mask-reset)) || !(laser-coarse || mask-reset)
73 addf or2-mask-command-done mask-thread
74 net mask-test => or2-mask-command-done.in0
75 net mask-reset => or2-mask-command-done.in1
76 net mask-command-done <= or2-mask-command-done.out
78 addf and2-mask-forward mask-thread
79 net laser-coarse => and2-mask-forward.in0
80 net mask-command-done => and2-mask-forward.in1
81 net mask-forward <= and2-mask-forward.out
83 addf or2-mask-not-ffw mask-thread
84 net laser-coarse => or2-mask-not-ffw.in0
85 net mask-reset => or2-mask-not-ffw.in1
86 net mask-not-ffw <= or2-mask-not-ffw.out
88 addf not-mask-ffw mask-thread
89 net mask-not-ffw => not-mask-ffw.in
90 net mask-ffw <= not-mask-ffw.out
92 addf or2-mask-read mask-thread
93 net mask-forward => or2-mask-read.in0
94 net mask-ffw => or2-mask-read.in1
95 net mask-read <= or2-mask-read.out
97 # laser-mask <= mask-not-empty && mask-beam
98 addf not-mask-not-empty mask-thread
99 net mask-empty => not-mask-not-empty.in
100 net mask-not-empty <= not-mask-not-empty.out
102 addf and2-laser-mask mask-thread
103 net mask-beam => and2-laser-mask.in0
104 net mask-not-empty => and2-laser-mask.in1
105 net laser-mask <= and2-laser-mask.out
107 addf streamer.0 mask-thread
109 # Raster Mask - end
110 #######################################################################
112 # coarse laser control, wired to spindle on/off (M3/M5), not realtime
113 net laser-coarse <= motion.spindle-on
115 # fine laser control, wired to digital output 0 (M62 P0/M63 P0), realtime
116 net laser-gate <= motion.digital-out-00
118 # legacy laser control, wired to Z < 0, can be used instead of M62/M63
119 addf comp-discrete-z servo-thread
120 net motion-zpos-fb <= axis.2.joint-pos-fb
121 net motion-zpos-fb => comp-discrete-z.in0
122 setp comp-discrete-z.in1 0
123 net discrete-z <= comp-discrete-z.out
125 # laser-final <= laser-coarse & (laser-gate | discrete-z | laser-mask)
126 addf or2-laser-gcode mask-thread
127 net laser-gate => or2-laser-gcode.in0
128 net discrete-z => or2-laser-gcode.in1
129 net laser-gcode <= or2-laser-gcode.out
131 addf or2-laser-fine mask-thread
132 net laser-gcode => or2-laser-fine.in0
133 net laser-mask => or2-laser-fine.in1
134 net laser-fine <= or2-laser-fine.out
136 addf and2-laser-final mask-thread
137 net laser-fine => and2-laser-final.in0
138 net laser-coarse => and2-laser-final.in1
139 net laser-final <= and2-laser-final.out
141 # laser-final => hardware
142 net laser-final => parport.0.pin-01-out
144 # make Z and W axes always homed
145 #setp axis.2.homed 1 # Z
146 #setp axis.8.homed 1 # W
148 net xdir => parport.0.pin-02-out
149 net xstep => parport.0.pin-03-out
150 setp parport.0.pin-03-out-reset 1
151 net ydir => parport.0.pin-04-out
152 net ystep => parport.0.pin-05-out
153 setp parport.0.pin-05-out-reset 1
154 net wdir => parport.0.pin-06-out
155 net wstep => parport.0.pin-07-out
156 setp parport.0.pin-07-out-reset 1
158 # invert ydir
159 #setp parport.0.pin-04-out-invert 1
162 net xenable => parport.0.pin-14-out
164 net home-x <= parport.0.pin-10-in
165 net home-y <= parport.0.pin-12-in
166 net estop-ext <= parport.0.pin-15-in
168 setp stepgen.0.position-scale [AXIS_0]SCALE
169 setp stepgen.0.steplen 15200
170 setp stepgen.0.stepspace 15200
171 setp stepgen.0.dirhold 15200
172 setp stepgen.0.dirsetup 15200
173 setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
174 net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
175 net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
176 net xstep <= stepgen.0.step
177 net xdir <= stepgen.0.dir
178 net xenable axis.0.amp-enable-out => stepgen.0.enable
179 net home-x => axis.0.home-sw-in
181 setp stepgen.1.position-scale [AXIS_1]SCALE
182 setp stepgen.1.steplen 15200
183 setp stepgen.1.stepspace 15200
184 setp stepgen.1.dirhold 15200
185 setp stepgen.1.dirsetup 15200
186 setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
187 net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
188 net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
189 net ystep <= stepgen.1.step
190 net ydir <= stepgen.1.dir
191 net yenable axis.1.amp-enable-out => stepgen.1.enable
192 net home-y => axis.1.home-sw-in
194 setp stepgen.2.position-scale [AXIS_2]SCALE
195 setp stepgen.2.steplen 1
196 setp stepgen.2.stepspace 0
197 setp stepgen.2.dirhold 15200
198 setp stepgen.2.dirsetup 15200
199 setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
200 net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
201 net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
202 net zstep <= stepgen.2.step
203 net zdir <= stepgen.2.dir
204 net zenable axis.2.amp-enable-out => stepgen.2.enable
205 net home-z => axis.2.home-sw-in
207 setp stepgen.3.position-scale [AXIS_8]SCALE
208 setp stepgen.3.steplen 1
209 setp stepgen.3.stepspace 0
210 setp stepgen.3.dirhold 15200
211 setp stepgen.3.dirsetup 15200
212 setp stepgen.3.maxaccel [AXIS_8]STEPGEN_MAXACCEL
213 net wpos-cmd axis.8.motor-pos-cmd => stepgen.3.position-cmd
214 net wpos-fb stepgen.3.position-fb => axis.8.motor-pos-fb
215 net wstep <= stepgen.3.step
216 net wdir <= stepgen.3.dir
217 net wenable axis.8.amp-enable-out => stepgen.3.enable
218 net home-w => axis.8.home-sw-in
220 net estop-out <= iocontrol.0.user-enable-out
221 net estop-ext => iocontrol.0.emc-enable-in
223 loadusr -W hal_manualtoolchange
224 net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
225 net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
226 net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
227 net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
229 # connect the charge pump signal to an output
230 net charge-pump <= charge-pump.out
231 setp parport.0.pin-17-out-reset 1
232 net charge-pump => parport.0.pin-17-out
233 setp charge-pump.enable 1