Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
137 lines (113 sloc) 4.44 KB
loadrt 4wirekins
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 "
loadrt stepgen step_type=0,0,0,0
loadrt or2 count=3
loadrt mux4 count=1
loadrt oneshot count=1
loadrt pwmgen output_type=0
setp 4wirekins.Lx 37.402
setp 4wirekins.Ly 37.402
setp 4wirekins.Eb 2.75
setp 4wirekins.Eh 2.75
addf base-thread
addf stepgen.make-pulses base-thread
addf pwmgen.make-pulses base-thread
addf or2.0 base-thread
addf parport.0.write base-thread
addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
addf pwmgen.update servo-thread
addf oneshot.0 servo-thread
# setup solenoid fire chain with latch max current and then a lower holding current
net dout-00 <=
# digital out 00 starts oneshot and pwm holding signal
net dout-00 =>
net dout-00 => pwmgen.0.enable
# latch time in seconds and hold current precent
setp oneshot.0.width [SOLENOID]LATCH_TIME_SECONDS
setp pwmgen.0.pwm-freq 1000
setp pwmgen.0.dither-pwm 1
# if either oneshot or pwm is active, then output is active
net pwmgen-out <= pwmgen.0.pwm => or2.0.in0
net oneshot-out <= oneshot.0.out => or2.0.in1
net solenoid-final <= or2.0.out
net dout-01 <=
net dout-02 <=
net a0-enable =>
setp 1
net a0-step =>
net a0-dir =>
setp 0
net a1-step =>
net a1-dir =>
setp 1
net a2-step =>
net a2-dir =>
setp 0
net a3-step =>
net a3-dir =>
setp 1
net solenoid-final =>
net dout-01 =>
net dout-02 =>
setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1000
setp stepgen.0.stepspace 1000
setp stepgen.0.dirhold 200
setp stepgen.0.dirsetup 200
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net a0-pos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net a0-pos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
#net a0-pos axis.0.motor-pos-fb axis.0.motor-pos-cmd
net a0-step <= stepgen.0.step
net a0-dir <= stepgen.0.dir
net a0-enable axis.0.amp-enable-out => stepgen.0.enable
setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1000
setp stepgen.1.stepspace 1000
setp stepgen.1.dirhold 200
setp stepgen.1.dirsetup 200
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net a1-pos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net a1-pos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
#net a1-pos axis.1.motor-pos-fb axis.1.motor-pos-cmd
net a1-step <= stepgen.1.step
net a1-dir <= stepgen.1.dir
net a1-enable axis.1.amp-enable-out => stepgen.1.enable
setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1000
setp stepgen.2.stepspace 1000
setp stepgen.2.dirhold 200
setp stepgen.2.dirsetup 200
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net a2-pos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
net a2-pos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
#net a2-pos axis.2.motor-pos-fb axis.2.motor-pos-cmd
net a2-step <= stepgen.2.step
net a2-dir <= stepgen.2.dir
net a2-enable axis.2.amp-enable-out => stepgen.2.enable
setp stepgen.3.position-scale [AXIS_3]SCALE
setp stepgen.3.steplen 1000
setp stepgen.3.stepspace 1000
setp stepgen.3.dirhold 200
setp stepgen.3.dirsetup 200
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
net a3-pos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
net a3-pos-fb stepgen.3.position-fb => axis.3.motor-pos-fb
#net a3-pos axis.3.motor-pos-fb axis.3.motor-pos-cmd
net a3-step <= stepgen.3.step
net a3-dir <= stepgen.3.dir
net a3-enable axis.3.amp-enable-out => stepgen.3.enable
net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in
loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
loadusr hal_input -KRAL Xbox