Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Generated by stepconf at Sun Aug 28 12:50:09 2011
- # If you make changes to this file, they will be
- # overwritten when you run stepconf again
- loadrt threads name1=laser-thread period1=[EMCMOT]BASE_PERIOD
- loadrt trivkins
- loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
- loadrt probe_parport
- loadrt hal_parport cfg="0x1040 out"
- setp parport.0.reset-time 1000
- loadrt stepgen step_type=0,0,0
- loadrt pwmgen output_type=0
- loadrt charge_pump
- loadrt abs count=1
- addf parport.0.read base-thread
- addf stepgen.make-pulses base-thread
- # need capture-position in laser-thread for raster engraving:
- addf stepgen.capture-position laser-thread
- addf pwmgen.make-pulses base-thread
- addf parport.0.write base-thread
- addf parport.0.reset base-thread
- addf charge-pump base-thread
- addf motion-command-handler servo-thread
- addf motion-controller servo-thread
- addf stepgen.update-freq servo-thread
- addf pwmgen.update servo-thread
- addf abs.0 servo-thread
- net laser-power-cmd <= motion.analog-out-00 => pwmgen.0.value
- net laser-pwm <= pwmgen.0.pwm
- # or tie pwmgen.0.enable to dout-00??
- setp pwmgen.0.enable 1
- # pwm-freq 0 means PDM (pulse density modulation)
- setp pwmgen.0.pwm-freq 0
- setp pwmgen.0.scale 1
- setp pwmgen.0.offset 0
- setp pwmgen.0.dither-pwm true
- 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 xstep => parport.0.pin-02-out
- setp parport.0.pin-02-out-reset 1
- net xdir => parport.0.pin-03-out
- setp parport.0.pin-03-out-invert 0
- net ystep => parport.0.pin-04-out
- setp parport.0.pin-04-out-reset 1
- net ydir => parport.0.pin-05-out
- setp parport.0.pin-05-out-invert 1
- net wstep => parport.0.pin-06-out
- setp parport.0.pin-06-out-reset 1
- 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-pwm => parport.0.pin-14-out
- net coolant-mist => parport.0.pin-16-out
- net laser-final => parport.0.pin-17-out
- net both-w <= parport.0.pin-12-in-not
- net max-home-y <= parport.0.pin-13-in-not
- net min-home-x <= parport.0.pin-15-in-not
- # charge pump output on pin 9
- net charge-pump-out-09 charge-pump.out => parport.0.pin-09-out
- # based on Pololu drivers with Allegro drivers (1us ea hi/lo step, 200ns dir setup/hold)
- setp stepgen.0.position-scale [AXIS_0]SCALE
- setp stepgen.0.steplen 1000
- setp stepgen.0.stepspace 0
- setp stepgen.0.dirhold 200
- setp stepgen.0.dirsetup 200
- setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
- net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
- net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
- net xstep <= stepgen.0.step
- net xdir <= stepgen.0.dir
- net xenable axis.0.amp-enable-out => stepgen.0.enable
- net min-home-x => axis.0.home-sw-in
- net min-home-x => axis.0.neg-lim-sw-in
- setp stepgen.1.position-scale [AXIS_1]SCALE
- setp stepgen.1.steplen 1000
- setp stepgen.1.stepspace 0
- setp stepgen.1.dirhold 200
- setp stepgen.1.dirsetup 200
- setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
- net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
- net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
- net ystep <= stepgen.1.step
- net ydir <= stepgen.1.dir
- net yenable axis.1.amp-enable-out => stepgen.1.enable
- net max-home-y => axis.1.home-sw-in
- net max-home-y => axis.1.pos-lim-sw-in
- setp stepgen.2.position-scale [AXIS_8]SCALE
- setp stepgen.2.steplen 1000
- setp stepgen.2.stepspace 0
- setp stepgen.2.dirhold 200
- setp stepgen.2.dirsetup 200
- setp stepgen.2.maxaccel [AXIS_8]STEPGEN_MAXACCEL
- net wpos-cmd axis.8.motor-pos-cmd => stepgen.2.position-cmd
- 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 zpos-cmd-fb <= axis.2.motor-pos-cmd => axis.2.motor-pos-fb
- net tool-change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed
- net tool-prepare-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
- ########################
- # M3/M5, not realtime/coordinated but master on/off:
- net laser-master <= motion.spindle-on
- # M62/M63 coordinated or M64/M65 immediate firing:
- net laser-dout <= motion.digital-out-00
- ########################
- loadrt laserfreq
- addf laserfreq.0.make-pulses laser-thread
- addf laserfreq.0.update servo-thread
- setp laserfreq.0.duration [LASER]PULSED_CUT_DURATION
- net current-vel motion.current-vel => laserfreq.0.velocity
- net laser-freq motion.spindle-speed-out => laserfreq.0.pulse-per-unit
- #net laser-dout => laserfreq.0.enable
- setp laserfreq.0.enable 1
- net laser-pulsed <= laserfreq.0.pulse
- ########################
- # XXX configurable axis 0
- # Compute motion-offset by observing how it affects the cmd so we can
- # apply it manually to the fb. That allows us to use axis.0.position-fb
- # directly (at base-thread rate) rather than waiting for servo-thread
- # do do the same math and give us axis.N.joint-pos-fb
- loadrt sum2 names=motion-offset-sub,motion-offset-apply
- addf motion-offset-sub servo-thread
- setp motion-offset-sub.gain1 -1
- net xpos-jcmd axis.0.joint-pos-cmd => motion-offset-sub.in0
- net xpos-cmd axis.0.motor-pos-cmd => motion-offset-sub.in1
- net motion-offset <= motion-offset-sub.out
- addf motion-offset-apply laser-thread
- net xpos-fb => motion-offset-apply.in0
- net motion-offset => motion-offset-apply.in1
- net raster-pos-fb <= motion-offset-apply.out
- loadrt comp names=raster-pos-gt-comp,laser-magic-z-comp
- loadrt lut5 names=raster-read-lut,raster-fire-lut,laser-final-lut
- loadrt streamer depth=256 cfg=bbf
- # The order of addf determines the order of execution.
- # Order these so that the inputs cascade correctly to the outputs:
- addf raster-pos-gt-comp laser-thread
- addf raster-read-lut laser-thread
- addf streamer.0 laser-thread
- addf raster-fire-lut laser-thread
- addf laser-final-lut laser-thread
- net raster-fire <= streamer.0.pin.0
- net raster-rev <= streamer.0.pin.1
- net raster-pos <= streamer.0.pin.2
- net raster-empty <= streamer.0.empty
- net raster-read => streamer.0.enable
- # has the raster reached the target?
- # raster-pos-gt := raster-pos-fb > raster-pos
- net raster-pos => raster-pos-gt-comp.in0
- net raster-pos-fb => raster-pos-gt-comp.in1
- net raster-pos-gt <= raster-pos-gt-comp.out
- # equation for reading the stream:
- # 1) XXX you can't avoid reading when empty or the state never changes
- # 2) flush (read all) when not running (M5 / laser-master off)
- # 3) when the laser position passes the target position in the right direction
- # raster-read := (~laser-master | (raster-pos-gt ^ raster-rev))
- #setp raster-read-lut.function 0x15511551 (with raster-empty)
- setp raster-read-lut.function 0x3ff33ff3
- net raster-empty => raster-read-lut.in-0
- net laser-master => raster-read-lut.in-1
- net raster-pos-gt => raster-read-lut.in-2
- net raster-rev => raster-read-lut.in-3
- net raster-read <= raster-read-lut.out
- # equation for firing the laser:
- # 1) never fire when empty (underflow or job finished)
- # 2) fire when raster-fire enabled
- # laser-raster := ~raster-empty & raster-fire
- setp raster-fire-lut.function 0x44444444
- net raster-empty => raster-fire-lut.in-0
- net raster-fire => raster-fire-lut.in-1
- net laser-raster <= raster-fire-lut.out
- ########################
- addf laser-magic-z-comp servo-thread
- net zpos-fb <= axis.2.joint-pos-fb => laser-magic-z-comp.in0
- setp laser-magic-z-comp.in1 0.0
- net laser-magic-z <= laser-magic-z-comp.out
- ########################
- # Final laser equation: When laser-master is enabled (M3) fire for
- # raster or at pulse rate when cutting:
- #
- # laser-final <= laser-master &
- # (laser-raster |
- # ((laser-magic-z | laser-dout) & laser-pulsed))
- setp laser-final-lut.function 0xfeaa0000
- net laser-raster => laser-final-lut.in-0
- net laser-dout => laser-final-lut.in-1
- net laser-magic-z => laser-final-lut.in-2
- net laser-pulsed => laser-final-lut.in-3
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement