rlm@11: # Generated by stepconf at Sun Mar 8 21:32:59 2009 rlm@11: # If you make changes to this file, they will be rlm@11: # overwritten when you run stepconf again rlm@11: rlm@11: loadrt threads name1=mask-thread period1=100000 rlm@11: rlm@11: loadrt trivkins rlm@11: 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: loadrt probe_parport rlm@11: loadrt hal_parport cfg=0x378 rlm@11: setp parport.0.reset-time 100000 rlm@11: loadrt stepgen step_type=0,0,0,0 rlm@11: loadrt charge_pump rlm@11: rlm@11: rlm@11: # Boring components that emc makes me load explicitly because it is a cunt rlm@11: loadrt comp names=comp-mask-lte,comp-discrete-z rlm@11: loadrt not names=not-mask-ffw,not-mask-not-empty rlm@11: loadrt xor2 names=xor2-mask-test rlm@11: loadrt and2 names=and2-mask-forward,and2-laser-mask,and2-laser-final rlm@11: loadrt or2 names=or2-mask-command-done,or2-mask-not-ffw,or2-mask-read,or2-laser-gcode,or2-laser-fine rlm@11: rlm@11: rlm@11: # Fast thread for generating signals rlm@11: addf parport.0.read base-thread rlm@11: addf stepgen.make-pulses base-thread rlm@11: addf parport.0.write base-thread rlm@11: addf parport.0.reset base-thread rlm@11: addf charge-pump base-thread rlm@11: rlm@11: # Slow thread for logic (more logic components are added further down) rlm@11: addf stepgen.capture-position servo-thread rlm@11: addf motion-command-handler servo-thread rlm@11: addf motion-controller servo-thread rlm@11: addf stepgen.update-freq servo-thread rlm@11: rlm@11: rlm@11: ################################################################################### rlm@11: # Raster Mask - stream in laser on/off commands behind AXIS's back rlm@11: # Input stream format: reset beam xop xarg rlm@11: # reset: 0=mask command 1=reset (begin mask sequence with "1 0 0 0", every other command starts with 0) rlm@11: # beam: 0=off 1=on rlm@11: # xop: X axis comparison operation 0=less-or-equal 1=greater rlm@11: # xarg: X axis comparison operand rlm@11: rlm@11: loadrt streamer depth=256 cfg="bbbf" rlm@11: net mask-reset <= streamer.0.pin.0 rlm@11: net mask-beam <= streamer.0.pin.1 rlm@11: net mask-xop <= streamer.0.pin.2 rlm@11: net mask-xarg <= streamer.0.pin.3 rlm@11: net mask-empty <= streamer.0.empty rlm@11: net mask-read => streamer.0.enable rlm@11: rlm@11: # hardware reported X axis position rlm@11: net motion-xpos-fb <= axis.0.joint-pos-fb rlm@11: rlm@11: # mask-lte <= motion-xpos-fb < mask-xarg rlm@11: addf comp-mask-lte mask-thread rlm@11: net motion-xpos-fb => comp-mask-lte.in0 rlm@11: net mask-xarg => comp-mask-lte.in1 rlm@11: net mask-lte <= comp-mask-lte.out rlm@11: rlm@11: # mask-test <= mask-xop ^ mask-lte rlm@11: addf xor2-mask-test mask-thread rlm@11: net mask-xop => xor2-mask-test.in0 rlm@11: net mask-lte => xor2-mask-test.in1 rlm@11: net mask-test <= xor2-mask-test.out rlm@11: rlm@11: # if job is running, read only if test is true or reset rlm@11: # if job is not running, read until reset rlm@11: # mask-read <= (laser-coarse && (mask-test || mask-reset)) || !(laser-coarse || mask-reset) rlm@11: rlm@11: addf or2-mask-command-done mask-thread rlm@11: net mask-test => or2-mask-command-done.in0 rlm@11: net mask-reset => or2-mask-command-done.in1 rlm@11: net mask-command-done <= or2-mask-command-done.out rlm@11: rlm@11: addf and2-mask-forward mask-thread rlm@11: net laser-coarse => and2-mask-forward.in0 rlm@11: net mask-command-done => and2-mask-forward.in1 rlm@11: net mask-forward <= and2-mask-forward.out rlm@11: rlm@11: addf or2-mask-not-ffw mask-thread rlm@11: net laser-coarse => or2-mask-not-ffw.in0 rlm@11: net mask-reset => or2-mask-not-ffw.in1 rlm@11: net mask-not-ffw <= or2-mask-not-ffw.out rlm@11: rlm@11: addf not-mask-ffw mask-thread rlm@11: net mask-not-ffw => not-mask-ffw.in rlm@11: net mask-ffw <= not-mask-ffw.out rlm@11: rlm@11: addf or2-mask-read mask-thread rlm@11: net mask-forward => or2-mask-read.in0 rlm@11: net mask-ffw => or2-mask-read.in1 rlm@11: net mask-read <= or2-mask-read.out rlm@11: rlm@11: # laser-mask <= mask-not-empty && mask-beam rlm@11: addf not-mask-not-empty mask-thread rlm@11: net mask-empty => not-mask-not-empty.in rlm@11: net mask-not-empty <= not-mask-not-empty.out rlm@11: rlm@11: addf and2-laser-mask mask-thread rlm@11: net mask-beam => and2-laser-mask.in0 rlm@11: net mask-not-empty => and2-laser-mask.in1 rlm@11: net laser-mask <= and2-laser-mask.out rlm@11: rlm@11: addf streamer.0 mask-thread rlm@11: rlm@11: # Raster Mask - end rlm@11: ####################################################################### rlm@11: rlm@11: # coarse laser control, wired to spindle on/off (M3/M5), not realtime rlm@11: net laser-coarse <= motion.spindle-on rlm@11: rlm@11: # fine laser control, wired to digital output 0 (M62 P0/M63 P0), realtime rlm@11: net laser-gate <= motion.digital-out-00 rlm@11: rlm@11: # legacy laser control, wired to Z < 0, can be used instead of M62/M63 rlm@11: addf comp-discrete-z servo-thread rlm@11: net motion-zpos-fb <= axis.2.joint-pos-fb rlm@11: net motion-zpos-fb => comp-discrete-z.in0 rlm@11: setp comp-discrete-z.in1 0 rlm@11: net discrete-z <= comp-discrete-z.out rlm@11: rlm@11: # laser-final <= laser-coarse & (laser-gate | discrete-z | laser-mask) rlm@11: addf or2-laser-gcode mask-thread rlm@11: net laser-gate => or2-laser-gcode.in0 rlm@11: net discrete-z => or2-laser-gcode.in1 rlm@11: net laser-gcode <= or2-laser-gcode.out rlm@11: rlm@11: addf or2-laser-fine mask-thread rlm@11: net laser-gcode => or2-laser-fine.in0 rlm@11: net laser-mask => or2-laser-fine.in1 rlm@11: net laser-fine <= or2-laser-fine.out rlm@11: rlm@11: addf and2-laser-final mask-thread rlm@11: net laser-fine => and2-laser-final.in0 rlm@11: net laser-coarse => and2-laser-final.in1 rlm@11: net laser-final <= and2-laser-final.out rlm@11: rlm@11: # laser-final => hardware rlm@11: net laser-final => parport.0.pin-01-out rlm@11: rlm@11: # make Z and W axes always homed rlm@11: #setp axis.2.homed 1 # Z rlm@11: #setp axis.8.homed 1 # W rlm@11: rlm@11: net xdir => parport.0.pin-02-out rlm@11: net xstep => parport.0.pin-03-out rlm@11: setp parport.0.pin-03-out-reset 1 rlm@11: net ydir => parport.0.pin-04-out rlm@11: net ystep => parport.0.pin-05-out rlm@11: setp parport.0.pin-05-out-reset 1 rlm@11: net wdir => parport.0.pin-06-out rlm@11: net wstep => parport.0.pin-07-out rlm@11: setp parport.0.pin-07-out-reset 1 rlm@11: rlm@11: # invert ydir rlm@11: #setp parport.0.pin-04-out-invert 1 rlm@11: rlm@11: rlm@11: net xenable => parport.0.pin-14-out rlm@11: rlm@11: net home-x <= parport.0.pin-10-in rlm@11: net home-y <= parport.0.pin-12-in rlm@11: net estop-ext <= parport.0.pin-15-in rlm@11: rlm@11: setp stepgen.0.position-scale [AXIS_0]SCALE rlm@11: setp stepgen.0.steplen 15200 rlm@11: setp stepgen.0.stepspace 15200 rlm@11: setp stepgen.0.dirhold 15200 rlm@11: setp stepgen.0.dirsetup 15200 rlm@11: setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL rlm@11: net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd rlm@11: net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb rlm@11: net xstep <= stepgen.0.step rlm@11: net xdir <= stepgen.0.dir rlm@11: net xenable axis.0.amp-enable-out => stepgen.0.enable rlm@11: net home-x => axis.0.home-sw-in rlm@11: rlm@11: setp stepgen.1.position-scale [AXIS_1]SCALE rlm@11: setp stepgen.1.steplen 15200 rlm@11: setp stepgen.1.stepspace 15200 rlm@11: setp stepgen.1.dirhold 15200 rlm@11: setp stepgen.1.dirsetup 15200 rlm@11: setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL rlm@11: net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd rlm@11: net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb rlm@11: net ystep <= stepgen.1.step rlm@11: net ydir <= stepgen.1.dir rlm@11: net yenable axis.1.amp-enable-out => stepgen.1.enable rlm@11: net home-y => axis.1.home-sw-in rlm@11: rlm@11: setp stepgen.2.position-scale [AXIS_2]SCALE rlm@11: setp stepgen.2.steplen 1 rlm@11: setp stepgen.2.stepspace 0 rlm@11: setp stepgen.2.dirhold 15200 rlm@11: setp stepgen.2.dirsetup 15200 rlm@11: setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL rlm@11: net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd rlm@11: net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb rlm@11: net zstep <= stepgen.2.step rlm@11: net zdir <= stepgen.2.dir rlm@11: net zenable axis.2.amp-enable-out => stepgen.2.enable rlm@11: net home-z => axis.2.home-sw-in rlm@11: rlm@11: setp stepgen.3.position-scale [AXIS_8]SCALE rlm@11: setp stepgen.3.steplen 1 rlm@11: setp stepgen.3.stepspace 0 rlm@11: setp stepgen.3.dirhold 15200 rlm@11: setp stepgen.3.dirsetup 15200 rlm@11: setp stepgen.3.maxaccel [AXIS_8]STEPGEN_MAXACCEL rlm@11: net wpos-cmd axis.8.motor-pos-cmd => stepgen.3.position-cmd rlm@11: net wpos-fb stepgen.3.position-fb => axis.8.motor-pos-fb rlm@11: net wstep <= stepgen.3.step rlm@11: net wdir <= stepgen.3.dir rlm@11: net wenable axis.8.amp-enable-out => stepgen.3.enable rlm@11: net home-w => axis.8.home-sw-in rlm@11: rlm@11: net estop-out <= iocontrol.0.user-enable-out rlm@11: net estop-ext => iocontrol.0.emc-enable-in rlm@11: rlm@11: loadusr -W hal_manualtoolchange rlm@11: net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change rlm@11: net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed rlm@11: net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number rlm@11: net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared rlm@11: rlm@11: # connect the charge pump signal to an output rlm@11: net charge-pump <= charge-pump.out rlm@11: setp parport.0.pin-17-out-reset 1 rlm@11: net charge-pump => parport.0.pin-17-out rlm@11: setp charge-pump.enable 1