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