early Joints/Axes work
This starts the Joints/Axes branch. Squashed work by:
Alex Joni
Chris Radek
John Kasunich
Michael Geszkiewicz
This commit is contained in:
parent
928b7f266d
commit
0f0d50adfd
115 changed files with 4121 additions and 2972 deletions
7
TODO
7
TODO
|
|
@ -1,3 +1,10 @@
|
|||
TODO for the joints_axes branch
|
||||
|
||||
* clean up joints/axes throughout the whole code (lots of parts already done)
|
||||
* define a unified jogging way (both for joints and axes)
|
||||
* implement joint-limits for carthesian moves (requires simulating the speed in userspace)
|
||||
* update configs
|
||||
(and many other probably..)
|
||||
|
||||
TODO sort out axis/joints issues:
|
||||
* limits need to be imposed on joints (tricky with kins)
|
||||
|
|
|
|||
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
2.8.0~pre1
|
||||
2.8.0~pre1-ja
|
||||
|
|
|
|||
|
|
@ -80,14 +80,14 @@ net limit-reached-z parport.0.pin-13-in-not
|
|||
net limit-reached-a parport.0.pin-15-in-not
|
||||
|
||||
#Connect all limit signals to relevant axes
|
||||
net limit-reached-x axis.0.neg-lim-sw-in
|
||||
net limit-reached-x axis.0.pos-lim-sw-in
|
||||
net limit-reached-y axis.1.neg-lim-sw-in
|
||||
net limit-reached-y axis.1.pos-lim-sw-in
|
||||
net limit-reached-a axis.1.neg-lim-sw-in
|
||||
net limit-reached-a axis.1.neg-lim-sw-in
|
||||
net limit-reached-z axis.2.neg-lim-sw-in
|
||||
net limit-reached-z axis.2.neg-lim-sw-in
|
||||
net limit-reached-x joint.0.neg-lim-sw-in
|
||||
net limit-reached-x joint.0.pos-lim-sw-in
|
||||
net limit-reached-y joint.1.neg-lim-sw-in
|
||||
net limit-reached-y joint.1.pos-lim-sw-in
|
||||
net limit-reached-a joint.1.neg-lim-sw-in
|
||||
net limit-reached-a joint.1.neg-lim-sw-in
|
||||
net limit-reached-z joint.2.neg-lim-sw-in
|
||||
net limit-reached-z joint.2.neg-lim-sw-in
|
||||
|
||||
|
||||
########## Charge Pump #########
|
||||
|
|
@ -214,7 +214,7 @@ net Zpos-cmd-muxed mux2.2.out
|
|||
addf mux2.2 servo-thread
|
||||
|
||||
#Disconnect Machine/Manual Axis Z Control while ArcOK for safety and to eliminate jitter
|
||||
net Zpos-instructed-cmd <= axis.2.motor-pos-cmd
|
||||
net Zpos-instructed-cmd <= joint.2.motor-pos-cmd
|
||||
|
||||
net Zpos-instructed-cmd => mux2.3.in0
|
||||
net Zpos-fb => mux2.3.in1
|
||||
|
|
|
|||
|
|
@ -18,30 +18,30 @@ addf motion-controller servo-thread
|
|||
addf stepgen.update-freq servo-thread
|
||||
|
||||
# connect position commands from motion module to step generator
|
||||
net Xpos-cmd <= axis.0.motor-pos-cmd
|
||||
net Xpos-cmd <= joint.0.motor-pos-cmd
|
||||
net Xpos-cmd => stepgen.0.position-cmd
|
||||
net Ypos-cmd <= axis.1.motor-pos-cmd
|
||||
net Ypos-cmd <= joint.1.motor-pos-cmd
|
||||
net Ypos-cmd => stepgen.1.position-cmd
|
||||
# Disabled to make THC work better
|
||||
#linksp Zpos-cmd <= axis.2.motor-pos-cmd
|
||||
#linksp Zpos-cmd <= joint.2.motor-pos-cmd
|
||||
# Disabled for THC to work
|
||||
#linksp Zpos-cmd => stepgen.2.position-cmd
|
||||
|
||||
# connect position feedback from step generators
|
||||
# to motion module
|
||||
net Xpos-fb <= stepgen.0.position-fb
|
||||
net Xpos-fb => axis.0.motor-pos-fb
|
||||
net Xpos-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb <= stepgen.1.position-fb
|
||||
net Ypos-fb => axis.1.motor-pos-fb
|
||||
net Ypos-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb <= stepgen.2.position-fb
|
||||
net Zpos-fb => axis.2.motor-pos-fb
|
||||
net Zpos-fb => joint.2.motor-pos-fb
|
||||
|
||||
# connect enable signals for step generators
|
||||
net Xen <= axis.0.amp-enable-out
|
||||
net Xen <= joint.0.amp-enable-out
|
||||
net Xen => stepgen.0.enable
|
||||
net Yen <= axis.1.amp-enable-out
|
||||
net Yen <= joint.1.amp-enable-out
|
||||
net Yen => stepgen.1.enable
|
||||
net Zen <= axis.2.amp-enable-out
|
||||
net Zen <= joint.2.amp-enable-out
|
||||
net Zen => stepgen.2.enable
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ net motion-enable motion.enable
|
|||
|
||||
# servo amp enable (only one, driven by axis 0)
|
||||
net servo-enable motenc.3.out-02
|
||||
net servo-enable axis.0.amp-enable-out
|
||||
net servo-enable joint.0.amp-enable-out
|
||||
|
||||
# servo amp fault signals
|
||||
# the signals from the amps are actually "not running"
|
||||
|
|
@ -221,27 +221,27 @@ net Z-amp-running motenc.3.out-15
|
|||
# these are the real fault signals, and go to the motion
|
||||
# controller, they are derived from the ones above by
|
||||
# ladder logic
|
||||
net X-amp-fault axis.0.amp-fault-in
|
||||
net Y-amp-fault axis.1.amp-fault-in
|
||||
net Z-amp-fault axis.2.amp-fault-in
|
||||
net X-amp-fault joint.0.amp-fault-in
|
||||
net Y-amp-fault joint.1.amp-fault-in
|
||||
net Z-amp-fault joint.2.amp-fault-in
|
||||
|
||||
# Limit switches
|
||||
# (the switches are NC, and open when hit, so
|
||||
# we invert the signals by using the -not input
|
||||
# pin - the result is limit signals that are
|
||||
# TRUE when the machine is on the limit.)
|
||||
net X-lim-plus motenc.3.in-00-not => axis.0.pos-lim-sw-in
|
||||
net X-lim-minus motenc.3.in-01-not => axis.0.neg-lim-sw-in
|
||||
net Y-lim-plus motenc.3.in-02-not => axis.1.pos-lim-sw-in
|
||||
net Y-lim-minus motenc.3.in-03-not => axis.1.neg-lim-sw-in
|
||||
net Z-lim-plus motenc.3.in-04-not => axis.2.pos-lim-sw-in
|
||||
net Z-lim-minus motenc.3.in-05-not => axis.2.neg-lim-sw-in
|
||||
net X-lim-plus motenc.3.in-00-not => joint.0.pos-lim-sw-in
|
||||
net X-lim-minus motenc.3.in-01-not => joint.0.neg-lim-sw-in
|
||||
net Y-lim-plus motenc.3.in-02-not => joint.1.pos-lim-sw-in
|
||||
net Y-lim-minus motenc.3.in-03-not => joint.1.neg-lim-sw-in
|
||||
net Z-lim-plus motenc.3.in-04-not => joint.2.pos-lim-sw-in
|
||||
net Z-lim-minus motenc.3.in-05-not => joint.2.neg-lim-sw-in
|
||||
|
||||
# Home switches
|
||||
# (the switches are NC, see note above)
|
||||
net X-home motenc.3.in-08-not => axis.0.home-sw-in
|
||||
net Y-home motenc.3.in-09-not => axis.1.home-sw-in
|
||||
net Z-home motenc.3.in-10-not => axis.2.home-sw-in
|
||||
net X-home motenc.3.in-08-not => joint.0.home-sw-in
|
||||
net Y-home motenc.3.in-09-not => joint.1.home-sw-in
|
||||
net Z-home motenc.3.in-10-not => joint.2.home-sw-in
|
||||
|
||||
# spindle related signals: "high level" signals
|
||||
# ready (from drive to PC)
|
||||
|
|
@ -528,9 +528,9 @@ net Y-enc-pos motenc.3.enc-01-position
|
|||
net Z-enc-pos motenc.3.enc-02-position
|
||||
|
||||
# index pulses
|
||||
net X-index-enable motenc.3.enc-00-index-enable axis.0.index-enable
|
||||
net Y-index-enable motenc.3.enc-01-index-enable axis.1.index-enable
|
||||
net Z-index-enable motenc.3.enc-02-index-enable axis.2.index-enable
|
||||
net X-index-enable motenc.3.enc-00-index-enable joint.0.index-enable
|
||||
net Y-index-enable motenc.3.enc-01-index-enable joint.1.index-enable
|
||||
net Z-index-enable motenc.3.enc-02-index-enable joint.2.index-enable
|
||||
|
||||
# -----------------------------------------------------
|
||||
# DACs - output to servo amps
|
||||
|
|
@ -566,9 +566,9 @@ setp motenc.3.adc-02-offset 0.0
|
|||
|
||||
# signals for position command
|
||||
# hook the motion controller outputs to the position command
|
||||
net X-pos-cmd axis.0.motor-pos-cmd
|
||||
net Y-pos-cmd axis.1.motor-pos-cmd
|
||||
net Z-pos-cmd axis.2.motor-pos-cmd
|
||||
net X-pos-cmd joint.0.motor-pos-cmd
|
||||
net Y-pos-cmd joint.1.motor-pos-cmd
|
||||
net Z-pos-cmd joint.2.motor-pos-cmd
|
||||
# and to the PID inputs
|
||||
net X-pos-cmd pid.0.command
|
||||
net Y-pos-cmd pid.1.command
|
||||
|
|
@ -579,9 +579,9 @@ net X-enc-pos pid.0.feedback
|
|||
net Y-enc-pos pid.1.feedback
|
||||
net Z-enc-pos pid.2.feedback
|
||||
# and to motion controller
|
||||
net X-enc-pos axis.0.motor-pos-fb
|
||||
net Y-enc-pos axis.1.motor-pos-fb
|
||||
net Z-enc-pos axis.2.motor-pos-fb
|
||||
net X-enc-pos joint.0.motor-pos-fb
|
||||
net Y-enc-pos joint.1.motor-pos-fb
|
||||
net Z-enc-pos joint.2.motor-pos-fb
|
||||
|
||||
# hook PID outputs to DACs
|
||||
net X-volts pid.0.output
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ newsig emcmot.00.enable bit
|
|||
sets emcmot.00.enable FALSE
|
||||
net emcmot.00.enable => pid.0.enable
|
||||
net emcmot.00.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.00.enable
|
||||
net emcmot.00.enable <= axis.0.amp-enable-out
|
||||
net emcmot.00.enable <= joint.0.amp-enable-out
|
||||
|
||||
# encoder feedback
|
||||
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.counter-mode 0
|
||||
|
|
@ -86,7 +86,7 @@ setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-mask-invert 0
|
|||
|
||||
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.scale [AXIS_0]INPUT_SCALE
|
||||
net motor.00.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.00.position => pid.0.feedback
|
||||
net motor.00.pos-fb => axis.0.motor-pos-fb #push copy back to Axis GUI
|
||||
net motor.00.pos-fb => joint.0.motor-pos-fb #push copy back to Axis GUI
|
||||
|
||||
# set PID loop gains from inifile
|
||||
setp pid.0.Pgain [AXIS_0]P
|
||||
|
|
@ -103,7 +103,7 @@ setp pid.0.maxoutput [AXIS_0]MAX_OUTPUT
|
|||
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.output-type 1 #pwm on pin1, dir on pin2
|
||||
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.scale [AXIS_0]OUTPUT_SCALE
|
||||
|
||||
net emcmot.00.pos-cmd axis.0.motor-pos-cmd => pid.0.command
|
||||
net emcmot.00.pos-cmd joint.0.motor-pos-cmd => pid.0.command
|
||||
net motor.00.command pid.0.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.00.value
|
||||
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ newsig emcmot.01.enable bit
|
|||
sets emcmot.01.enable FALSE
|
||||
net emcmot.01.enable => pid.1.enable
|
||||
net emcmot.01.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.01.enable
|
||||
net emcmot.01.enable <= axis.1.amp-enable-out
|
||||
net emcmot.01.enable <= joint.1.amp-enable-out
|
||||
|
||||
# encoder feedback
|
||||
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.counter-mode 0
|
||||
|
|
@ -127,7 +127,7 @@ setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-mask-invert 0
|
|||
|
||||
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.scale [AXIS_1]INPUT_SCALE
|
||||
net motor.01.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.01.position => pid.1.feedback
|
||||
net motor.01.pos-fb => axis.1.motor-pos-fb #push copy back to Axis GUI
|
||||
net motor.01.pos-fb => joint.1.motor-pos-fb #push copy back to Axis GUI
|
||||
|
||||
# set PID loop gains from inifile
|
||||
setp pid.1.Pgain [AXIS_1]P
|
||||
|
|
@ -144,7 +144,7 @@ setp pid.1.maxoutput [AXIS_1]MAX_OUTPUT
|
|||
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.01.output-type 1 #pwm on pin1, dir on pin2
|
||||
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.01.scale [AXIS_1]OUTPUT_SCALE
|
||||
|
||||
net emcmot.01.pos-cmd axis.1.motor-pos-cmd => pid.1.command
|
||||
net emcmot.01.pos-cmd joint.1.motor-pos-cmd => pid.1.command
|
||||
net motor.01.command pid.1.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.01.value
|
||||
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ newsig emcmot.02.enable bit
|
|||
sets emcmot.02.enable FALSE
|
||||
net emcmot.02.enable => pid.2.enable
|
||||
net emcmot.02.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.02.enable
|
||||
net emcmot.02.enable <= axis.2.amp-enable-out
|
||||
net emcmot.02.enable <= joint.2.amp-enable-out
|
||||
|
||||
# encoder feedback
|
||||
setp hm2_[HOSTMOT2](BOARD).0.encoder.02.counter-mode 0
|
||||
|
|
@ -168,7 +168,7 @@ setp hm2_[HOSTMOT2](BOARD).0.encoder.02.index-mask-invert 0
|
|||
|
||||
setp hm2_[HOSTMOT2](BOARD).0.encoder.02.scale [AXIS_2]INPUT_SCALE
|
||||
net motor.02.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.02.position => pid.2.feedback
|
||||
net motor.02.pos-fb => axis.2.motor-pos-fb #push copy back to Axis GUI
|
||||
net motor.02.pos-fb => joint.2.motor-pos-fb #push copy back to Axis GUI
|
||||
|
||||
# set PID loop gains from inifile
|
||||
setp pid.2.Pgain [AXIS_2]P
|
||||
|
|
@ -185,7 +185,7 @@ setp pid.2.maxoutput [AXIS_2]MAX_OUTPUT
|
|||
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.02.output-type 1 #pwm on pin1, dir on pin2
|
||||
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.02.scale [AXIS_2]OUTPUT_SCALE
|
||||
|
||||
net emcmot.02.pos-cmd axis.2.motor-pos-cmd => pid.2.command
|
||||
net emcmot.02.pos-cmd joint.2.motor-pos-cmd => pid.2.command
|
||||
net motor.02.command pid.2.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.02.value
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -65,16 +65,16 @@ addf estop-latch.0 servo-thread
|
|||
newsig emcmot.00.enable bit
|
||||
sets emcmot.00.enable FALSE
|
||||
|
||||
net emcmot.00.enable <= axis.0.amp-enable-out
|
||||
net emcmot.00.enable <= joint.0.amp-enable-out
|
||||
net emcmot.00.enable => hm2_[HOSTMOT2](BOARD).0.stepgen.00.enable
|
||||
|
||||
|
||||
# position command and feedback
|
||||
net emcmot.00.pos-cmd <= axis.0.motor-pos-cmd
|
||||
net emcmot.00.pos-cmd <= joint.0.motor-pos-cmd
|
||||
net emcmot.00.pos-cmd => hm2_[HOSTMOT2](BOARD).0.stepgen.00.position-cmd
|
||||
|
||||
net motor.00.pos-fb <= hm2_[HOSTMOT2](BOARD).0.stepgen.00.position-fb
|
||||
net motor.00.pos-fb => axis.0.motor-pos-fb
|
||||
net motor.00.pos-fb => joint.0.motor-pos-fb
|
||||
|
||||
|
||||
# timing parameters
|
||||
|
|
@ -100,16 +100,16 @@ setp hm2_[HOSTMOT2](BOARD).0.stepgen.00.step_type 0
|
|||
newsig emcmot.01.enable bit
|
||||
sets emcmot.01.enable FALSE
|
||||
|
||||
net emcmot.01.enable <= axis.1.amp-enable-out
|
||||
net emcmot.01.enable <= joint.1.amp-enable-out
|
||||
net emcmot.01.enable => hm2_[HOSTMOT2](BOARD).0.stepgen.01.enable
|
||||
|
||||
|
||||
# position command and feedback
|
||||
net emcmot.01.pos-cmd <= axis.1.motor-pos-cmd
|
||||
net emcmot.01.pos-cmd <= joint.1.motor-pos-cmd
|
||||
net emcmot.01.pos-cmd => hm2_[HOSTMOT2](BOARD).0.stepgen.01.position-cmd
|
||||
|
||||
net motor.01.pos-fb <= hm2_[HOSTMOT2](BOARD).0.stepgen.01.position-fb
|
||||
net motor.01.pos-fb => axis.1.motor-pos-fb
|
||||
net motor.01.pos-fb => joint.1.motor-pos-fb
|
||||
|
||||
|
||||
# timing parameters
|
||||
|
|
@ -135,16 +135,16 @@ setp hm2_[HOSTMOT2](BOARD).0.stepgen.01.step_type 0
|
|||
newsig emcmot.02.enable bit
|
||||
sets emcmot.02.enable FALSE
|
||||
|
||||
net emcmot.02.enable <= axis.2.amp-enable-out
|
||||
net emcmot.02.enable <= joint.2.amp-enable-out
|
||||
net emcmot.02.enable => hm2_[HOSTMOT2](BOARD).0.stepgen.02.enable
|
||||
|
||||
|
||||
# position command and feedback
|
||||
net emcmot.02.pos-cmd <= axis.2.motor-pos-cmd
|
||||
net emcmot.02.pos-cmd <= joint.2.motor-pos-cmd
|
||||
net emcmot.02.pos-cmd => hm2_[HOSTMOT2](BOARD).0.stepgen.02.position-cmd
|
||||
|
||||
net motor.02.pos-fb <= hm2_[HOSTMOT2](BOARD).0.stepgen.02.position-fb
|
||||
net motor.02.pos-fb => axis.2.motor-pos-fb
|
||||
net motor.02.pos-fb => joint.2.motor-pos-fb
|
||||
|
||||
|
||||
# timing parameters
|
||||
|
|
|
|||
|
|
@ -38,14 +38,14 @@ setp stepgen.0.stepspace 0
|
|||
setp stepgen.0.dirhold 16000
|
||||
setp stepgen.0.dirsetup 16000
|
||||
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 xpos-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
|
||||
net xpos-fb stepgen.0.position-fb => joint.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 both-home-x => axis.0.home-sw-in
|
||||
net both-home-x => axis.0.neg-lim-sw-in
|
||||
net both-home-x => axis.0.pos-lim-sw-in
|
||||
net xenable joint.0.amp-enable-out => stepgen.0.enable
|
||||
net both-home-x => joint.0.home-sw-in
|
||||
net both-home-x => joint.0.neg-lim-sw-in
|
||||
net both-home-x => joint.0.pos-lim-sw-in
|
||||
|
||||
setp stepgen.1.position-scale [AXIS_1]SCALE
|
||||
setp stepgen.1.steplen 1
|
||||
|
|
@ -53,14 +53,14 @@ setp stepgen.1.stepspace 0
|
|||
setp stepgen.1.dirhold 16000
|
||||
setp stepgen.1.dirsetup 16000
|
||||
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 ypos-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd
|
||||
net ypos-fb stepgen.1.position-fb => joint.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 both-home-y => axis.1.home-sw-in
|
||||
net both-home-y => axis.1.neg-lim-sw-in
|
||||
net both-home-y => axis.1.pos-lim-sw-in
|
||||
net yenable joint.1.amp-enable-out => stepgen.1.enable
|
||||
net both-home-y => joint.1.home-sw-in
|
||||
net both-home-y => joint.1.neg-lim-sw-in
|
||||
net both-home-y => joint.1.pos-lim-sw-in
|
||||
|
||||
setp stepgen.2.position-scale [AXIS_2]SCALE
|
||||
setp stepgen.2.steplen 1
|
||||
|
|
@ -68,14 +68,14 @@ setp stepgen.2.stepspace 0
|
|||
setp stepgen.2.dirhold 16000
|
||||
setp stepgen.2.dirsetup 16000
|
||||
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
|
||||
net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
|
||||
net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
|
||||
net zpos-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd
|
||||
net zpos-fb stepgen.2.position-fb => joint.2.motor-pos-fb
|
||||
net zstep <= stepgen.2.step
|
||||
net zdir <= stepgen.2.dir
|
||||
net zenable axis.2.amp-enable-out => stepgen.2.enable
|
||||
net both-home-z => axis.2.home-sw-in
|
||||
net both-home-z => axis.2.neg-lim-sw-in
|
||||
net both-home-z => axis.2.pos-lim-sw-in
|
||||
net zenable joint.2.amp-enable-out => stepgen.2.enable
|
||||
net both-home-z => joint.2.home-sw-in
|
||||
net both-home-z => joint.2.neg-lim-sw-in
|
||||
net both-home-z => joint.2.pos-lim-sw-in
|
||||
|
||||
# net estop-out <= iocontrol.0.user-enable-out
|
||||
# net estop-out => iocontrol.0.emc-enable-in
|
||||
|
|
|
|||
|
|
@ -92,11 +92,10 @@ net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
|
|||
# connect this signal to pin 10 on the parport
|
||||
net limit-reached parport.0.pin-10-in-not
|
||||
# connect this signal to all limit signals of relevant axes
|
||||
net limit-reached axis.0.neg-lim-sw-in
|
||||
net limit-reached axis.0.pos-lim-sw-in
|
||||
net limit-reached axis.1.neg-lim-sw-in
|
||||
net limit-reached axis.1.pos-lim-sw-in
|
||||
net limit-reached axis.2.neg-lim-sw-in
|
||||
#linksp limit-reached axis.2.pos-lim-sw-in
|
||||
|
||||
net limit-reached joint.0.neg-lim-sw-in
|
||||
net limit-reached joint.0.pos-lim-sw-in
|
||||
net limit-reached joint.1.neg-lim-sw-in
|
||||
net limit-reached joint.1.pos-lim-sw-in
|
||||
net limit-reached joint.2.neg-lim-sw-in
|
||||
#linksp limit-reached joint.2.pos-lim-sw-in
|
||||
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ net Ypos-fb <= encoder.1.position
|
|||
|
||||
net Xpos-fb => pid.0.feedback
|
||||
net Ypos-fb => pid.1.feedback
|
||||
net Xpos-fb => axis.0.motor-pos-fb
|
||||
net Ypos-fb => axis.1.motor-pos-fb
|
||||
net Xpos-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb => joint.1.motor-pos-fb
|
||||
|
||||
net Xvel-cmd <= pid.0.output
|
||||
net Yvel-cmd <= pid.1.output
|
||||
|
|
@ -92,12 +92,12 @@ setp pid.1.FF2 [AXIS_1]FF2
|
|||
# deadband should be just over 1 count
|
||||
setp pid.1.deadband [AXIS_1]DEADBAND
|
||||
|
||||
net Xpos-cmd <= axis.0.motor-pos-cmd
|
||||
net Ypos-cmd <= axis.1.motor-pos-cmd
|
||||
net Xpos-cmd <= joint.0.motor-pos-cmd
|
||||
net Ypos-cmd <= joint.1.motor-pos-cmd
|
||||
net Xpos-cmd => pid.0.command
|
||||
net Ypos-cmd => pid.1.command
|
||||
net Xenable <= axis.0.amp-enable-out
|
||||
net Yenable <= axis.1.amp-enable-out
|
||||
net Xenable <= joint.0.amp-enable-out
|
||||
net Yenable <= joint.1.amp-enable-out
|
||||
net Xenable => pid.0.enable
|
||||
net Xenable => pwmgen.0.enable
|
||||
net Yenable => pid.1.enable
|
||||
|
|
|
|||
|
|
@ -70,28 +70,28 @@ addf mult2.0 servo-thread
|
|||
#######################################################
|
||||
|
||||
# connect position commands from motion module to step generator
|
||||
net Xpos-cmd <= axis.0.motor-pos-cmd
|
||||
net Xpos-cmd <= joint.0.motor-pos-cmd
|
||||
net Xpos-cmd => stepgen.0.position-cmd
|
||||
net Ypos-cmd <= axis.1.motor-pos-cmd
|
||||
net Ypos-cmd <= joint.1.motor-pos-cmd
|
||||
net Ypos-cmd => stepgen.1.position-cmd
|
||||
net Zpos-cmd <= axis.2.motor-pos-cmd
|
||||
net Zpos-cmd <= joint.2.motor-pos-cmd
|
||||
net Zpos-cmd => stepgen.2.position-cmd
|
||||
|
||||
# connect position feedback from step generators
|
||||
# to motion module
|
||||
net Xpos-fb <= stepgen.0.position-fb
|
||||
net Xpos-fb => axis.0.motor-pos-fb
|
||||
net Xpos-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb <= stepgen.1.position-fb
|
||||
net Ypos-fb => axis.1.motor-pos-fb
|
||||
net Ypos-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb <= stepgen.2.position-fb
|
||||
net Zpos-fb => axis.2.motor-pos-fb
|
||||
net Zpos-fb => joint.2.motor-pos-fb
|
||||
|
||||
# connect enable signals for step generators
|
||||
net Xen <= axis.0.amp-enable-out
|
||||
net Xen <= joint.0.amp-enable-out
|
||||
net Xen => stepgen.0.enable
|
||||
net Yen <= axis.1.amp-enable-out
|
||||
net Yen <= joint.1.amp-enable-out
|
||||
net Yen => stepgen.1.enable
|
||||
net Zen <= axis.2.amp-enable-out
|
||||
net Zen <= joint.2.amp-enable-out
|
||||
net Zen => stepgen.2.enable
|
||||
|
||||
# connect signals to step pulse generator outputs
|
||||
|
|
@ -190,8 +190,8 @@ setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
|
|||
# end of basic machine
|
||||
|
||||
net homeswitches <= parport.0.pin-10-in
|
||||
net homeswitches => axis.0.home-sw-in
|
||||
net homeswitches => axis.2.home-sw-in
|
||||
net homeswitches => joint.0.home-sw-in
|
||||
net homeswitches => joint.2.home-sw-in
|
||||
|
||||
#######################################################
|
||||
# Beginning of threading-related stuff
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ net PosZ-fb => wcomp.4.in
|
|||
net TimeLeft oneshot.1.time-left => wcomp.5.in
|
||||
|
||||
# Simulate limits with wcomps
|
||||
net LimitX wcomp.0.out => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in axis.0.home-sw-in
|
||||
net LimitY wcomp.1.out => axis.1.neg-lim-sw-in axis.1.pos-lim-sw-in axis.1.home-sw-in
|
||||
net LimitX wcomp.0.out => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in joint.0.home-sw-in
|
||||
net LimitY wcomp.1.out => joint.1.neg-lim-sw-in joint.1.pos-lim-sw-in joint.1.home-sw-in
|
||||
net LimitZ or2.9.out => or2.2.in0
|
||||
net LimitA wcomp.3.out => axis.3.neg-lim-sw-in axis.3.pos-lim-sw-in axis.3.home-sw-in
|
||||
net LimitA wcomp.3.out => joint.3.neg-lim-sw-in joint.3.pos-lim-sw-in joint.3.home-sw-in
|
||||
|
||||
# Hook up other simulated signals
|
||||
net FloatSwitch and2.9.out => or2.1.in1 and2.4.in0 and2.5.in1 and2.6.in1
|
||||
|
|
@ -39,7 +39,7 @@ net IgnDebugTimer wcomp.5.out and2.10.in0
|
|||
net ArcOKSwitch and2.11.out and2.10.in1
|
||||
|
||||
# Fix the problem with the float switch being triggered during homing because machine starts at pos 0
|
||||
net MachineIsHoming axis.2.homing = not.3.in
|
||||
net MachineIsHoming joint.2.homing = not.3.in
|
||||
net InvertedMachineIsHoming not.3.out => and2.9.in0
|
||||
net OriginalFloatSignal wcomp.4.out => and2.9.in1
|
||||
|
||||
|
|
|
|||
|
|
@ -37,18 +37,18 @@ setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
|
|||
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
|
||||
|
||||
# Hook up stepgen to motion modules
|
||||
net PosX-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
|
||||
net PosX-fb stepgen.0.position-fb => axis.0.motor-pos-fb ddt.0.in
|
||||
net PosY-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
|
||||
net PosY-fb stepgen.1.position-fb => axis.1.motor-pos-fb ddt.1.in
|
||||
net PosX-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
|
||||
net PosX-fb stepgen.0.position-fb => joint.0.motor-pos-fb ddt.0.in
|
||||
net PosY-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd
|
||||
net PosY-fb stepgen.1.position-fb => joint.1.motor-pos-fb ddt.1.in
|
||||
# Z Axis Position and feedback signals handled by THC, see thc.hal
|
||||
#net PosZ-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
|
||||
#net PosZ-fb stepgen.2.position-fb => axis.2.motor-pos-fb
|
||||
net PosA-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
|
||||
net PosA-fb stepgen.3.position-fb => axis.3.motor-pos-fb
|
||||
#net PosZ-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd
|
||||
#net PosZ-fb stepgen.2.position-fb => joint.2.motor-pos-fb
|
||||
net PosA-cmd joint.3.motor-pos-cmd => stepgen.3.position-cmd
|
||||
net PosA-fb stepgen.3.position-fb => joint.3.motor-pos-fb
|
||||
|
||||
# Hook up enable signals for step generators
|
||||
net EnableX axis.0.amp-enable-out => stepgen.0.enable
|
||||
net EnableY axis.1.amp-enable-out => stepgen.1.enable
|
||||
net EnableZ axis.2.amp-enable-out => stepgen.2.enable
|
||||
net EnableA axis.3.amp-enable-out => stepgen.3.enable
|
||||
net EnableX joint.0.amp-enable-out => stepgen.0.enable
|
||||
net EnableY joint.1.amp-enable-out => stepgen.1.enable
|
||||
net EnableZ joint.2.amp-enable-out => stepgen.2.enable
|
||||
net EnableA joint.3.amp-enable-out => stepgen.3.enable
|
||||
|
|
|
|||
|
|
@ -139,8 +139,8 @@ net TorchAndFloat and2.6.out => flipflop.0.set
|
|||
net PosAndFloat and2.7.out => or2.5.in1
|
||||
net IgnitionEstop comp.2.out => logic.0.in-01
|
||||
net StartTorchOn and2.8.out => and2.3.in0
|
||||
net OriginalPosZ-cmd axis.2.motor-pos-cmd => mux2.5.in0 sum2.2.in1
|
||||
net JointPoz-cmd axis.2.joint-pos-cmd => sum2.2.in0
|
||||
net OriginalPosZ-cmd joint.2.motor-pos-cmd => mux2.5.in0 sum2.2.in1
|
||||
net JointPoz-cmd joint.2.pos-cmd => sum2.2.in0
|
||||
net CHLTriggered comp.0.out => and2.0.in0
|
||||
net AtPosition comp.1.equal => and2.7.in0
|
||||
net VelX ddt.0.out => hypot.0.in0
|
||||
|
|
@ -166,7 +166,7 @@ net PierceDelayElapsed oneshot.0.out-not => and2.2.in1
|
|||
net IgnitionTimer oneshot.1.out => edge.0.in or2.8.in0
|
||||
net AdjustHeight or2.0.out => xor2.2.in1 and2.1.in0
|
||||
net TakeSnapshot or2.1.out => mux2.2.sel
|
||||
net TriggerLimit or2.2.out => axis.2.neg-lim-sw-in axis.2.pos-lim-sw-in axis.2.home-sw-in
|
||||
net TriggerLimit or2.2.out => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
|
||||
net ProbeOrArcOK or2.3.out => mux2.6.sel
|
||||
net PAFOrArcOK or2.5.out => and2.3.in1
|
||||
net EstopOrArcOK or2.6.out => flipflop.0.reset
|
||||
|
|
@ -176,7 +176,7 @@ net ExtEStop => logic.0.in-00
|
|||
# Z limit handled by simulator, see simulator.hal
|
||||
#net LimitZ parport.0.pin-13-in => or2.2.in0
|
||||
net ThresholdPercentage scale.0.out => mult2.1.in1
|
||||
net PosZ-fb stepgen.2.position-fb => axis.2.motor-pos-fb mux2.2.in1 comp.1.in0
|
||||
net PosZ-fb stepgen.2.position-fb => joint.2.motor-pos-fb mux2.2.in1 comp.1.in0
|
||||
net PierceOffset sum2.0.out => mux2.0.in0
|
||||
net DestinationHeight sum2.1.out => mux2.6.in1
|
||||
net JointAxisDiff sum2.2.out => sum2.3.in1 sum2.4.in1
|
||||
|
|
|
|||
|
|
@ -34,17 +34,17 @@ setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
|
|||
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
|
||||
|
||||
# Hook up stepgen to motion modules
|
||||
net PosX-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
|
||||
net PosX-fb stepgen.0.position-fb => axis.0.motor-pos-fb
|
||||
net PosY-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
|
||||
net PosY-fb stepgen.1.position-fb => axis.1.motor-pos-fb
|
||||
net PosZ-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
|
||||
net PosZ-fb stepgen.2.position-fb => axis.2.motor-pos-fb
|
||||
net PosA-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
|
||||
net PosA-fb stepgen.3.position-fb => axis.3.motor-pos-fb
|
||||
net PosX-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
|
||||
net PosX-fb stepgen.0.position-fb => joint.0.motor-pos-fb
|
||||
net PosY-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd
|
||||
net PosY-fb stepgen.1.position-fb => joint.1.motor-pos-fb
|
||||
net PosZ-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd
|
||||
net PosZ-fb stepgen.2.position-fb => joint.2.motor-pos-fb
|
||||
net PosA-cmd joint.3.motor-pos-cmd => stepgen.3.position-cmd
|
||||
net PosA-fb stepgen.3.position-fb => joint.3.motor-pos-fb
|
||||
|
||||
# Hook up enable signals for step generators
|
||||
net EnableX axis.0.amp-enable-out => stepgen.0.enable
|
||||
net EnableY axis.1.amp-enable-out => stepgen.1.enable
|
||||
net EnableZ axis.2.amp-enable-out => stepgen.2.enable
|
||||
net EnableA axis.3.amp-enable-out => stepgen.3.enable
|
||||
net EnableX joint.0.amp-enable-out => stepgen.0.enable
|
||||
net EnableY joint.1.amp-enable-out => stepgen.1.enable
|
||||
net EnableZ joint.2.amp-enable-out => stepgen.2.enable
|
||||
net EnableA joint.3.amp-enable-out => stepgen.3.enable
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ net DirZ stepgen.2.dir => parport.0.pin-08-out
|
|||
net DirA stepgen.3.dir => parport.0.pin-09-out
|
||||
|
||||
# Hook up limit and home switches, each axis shares a common pin for homing, limit min and limit max
|
||||
net LimitX parport.0.pin-11-in-not => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in axis.0.home-sw-in
|
||||
net LimitY parport.0.pin-12-in-not => axis.1.neg-lim-sw-in axis.1.pos-lim-sw-in axis.1.home-sw-in
|
||||
#net LimitZ parport.0.pin-13-in => axis.2.neg-lim-sw-in axis.2.pos-lim-sw-in axis.2.home-sw-in
|
||||
net LimitA parport.0.pin-15-in-not => axis.3.neg-lim-sw-in axis.3.pos-lim-sw-in axis.3.home-sw-in
|
||||
net LimitX parport.0.pin-11-in-not => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in joint.0.home-sw-in
|
||||
net LimitY parport.0.pin-12-in-not => joint.1.neg-lim-sw-in joint.1.pos-lim-sw-in joint.1.home-sw-in
|
||||
#net LimitZ parport.0.pin-13-in => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
|
||||
net LimitA parport.0.pin-15-in-not => joint.3.neg-lim-sw-in joint.3.pos-lim-sw-in joint.3.home-sw-in
|
||||
|
||||
# Hook up the spindle signal
|
||||
net SpindleOn motion.spindle-forward => parport.1.pin-01-out
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ net DirZ stepgen.2.dir => parport.0.pin-08-out
|
|||
net DirA stepgen.3.dir => parport.0.pin-09-out
|
||||
|
||||
# Hook up limit and home switches, each axis shares a common pin for homing, limit min and limit max
|
||||
net LimitX parport.0.pin-11-in-not => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in axis.0.home-sw-in
|
||||
net LimitY parport.0.pin-12-in-not => axis.1.neg-lim-sw-in axis.1.pos-lim-sw-in axis.1.home-sw-in
|
||||
net LimitZ parport.0.pin-13-in => axis.2.neg-lim-sw-in axis.2.pos-lim-sw-in axis.2.home-sw-in
|
||||
net LimitA parport.0.pin-15-in-not => axis.3.neg-lim-sw-in axis.3.pos-lim-sw-in axis.3.home-sw-in
|
||||
net LimitX parport.0.pin-11-in-not => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in joint.0.home-sw-in
|
||||
net LimitY parport.0.pin-12-in-not => joint.1.neg-lim-sw-in joint.1.pos-lim-sw-in joint.1.home-sw-in
|
||||
net LimitZ parport.0.pin-13-in => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
|
||||
net LimitA parport.0.pin-15-in-not => joint.3.neg-lim-sw-in joint.3.pos-lim-sw-in joint.3.home-sw-in
|
||||
|
||||
# Hook up the spindle signal
|
||||
net SpindleOn motion.spindle-forward => parport.1.pin-01-out
|
||||
|
|
|
|||
|
|
@ -16,25 +16,25 @@ addf motion-controller servo-thread
|
|||
addf stepgen.update-freq servo-thread
|
||||
|
||||
# connect position commands from motion module to step generator
|
||||
net Xpos-cmd <= axis.0.motor-pos-cmd
|
||||
net Xpos-cmd <= joint.0.motor-pos-cmd
|
||||
net Xpos-cmd => stepgen.0.position-cmd
|
||||
net Ypos-cmd <= axis.1.motor-pos-cmd
|
||||
net Ypos-cmd <= joint.1.motor-pos-cmd
|
||||
net Ypos-cmd => stepgen.1.position-cmd
|
||||
net Zpos-cmd <= axis.2.motor-pos-cmd
|
||||
net Zpos-cmd <= joint.2.motor-pos-cmd
|
||||
net Zpos-cmd => stepgen.2.position-cmd
|
||||
net Apos-cmd <= axis.3.motor-pos-cmd
|
||||
net Apos-cmd <= joint.3.motor-pos-cmd
|
||||
net Apos-cmd => stepgen.3.position-cmd
|
||||
|
||||
# connect position feedback from step generators
|
||||
# to motion module
|
||||
net Xpos-fb <= stepgen.0.position-fb
|
||||
net Xpos-fb => axis.0.motor-pos-fb
|
||||
net Xpos-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb <= stepgen.1.position-fb
|
||||
net Ypos-fb => axis.1.motor-pos-fb
|
||||
net Ypos-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb <= stepgen.2.position-fb
|
||||
net Zpos-fb => axis.2.motor-pos-fb
|
||||
net Zpos-fb => joint.2.motor-pos-fb
|
||||
net Apos-fb <= stepgen.3.position-fb
|
||||
net Apos-fb => axis.3.motor-pos-fb
|
||||
net Apos-fb => joint.3.motor-pos-fb
|
||||
|
||||
# send the position commands thru differentiators to
|
||||
# generate velocity and accel signals
|
||||
|
|
@ -68,13 +68,13 @@ net Avel => ddt.7.in
|
|||
net Aacc <= ddt.7.out
|
||||
|
||||
# connect enable signals for step generators
|
||||
net Xen <= axis.0.amp-enable-out
|
||||
net Xen <= joint.0.amp-enable-out
|
||||
net Xen => stepgen.0.enable
|
||||
net Yen <= axis.1.amp-enable-out
|
||||
net Yen <= joint.1.amp-enable-out
|
||||
net Yen => stepgen.1.enable
|
||||
net Zen <= axis.2.amp-enable-out
|
||||
net Zen <= joint.2.amp-enable-out
|
||||
net Zen => stepgen.2.enable
|
||||
net Aen <= axis.3.amp-enable-out
|
||||
net Aen <= joint.3.amp-enable-out
|
||||
net Aen => stepgen.3.enable
|
||||
|
||||
# connect signals to step pulse generator outputs
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ net spindle-on motion.spindle-on => parport.0.pin-09-out
|
|||
### to EMC's axis 0 home switch input pin
|
||||
###
|
||||
|
||||
# net Xhome parport.0.pin-10-in => axis.0.home-sw-in
|
||||
# net Xhome parport.0.pin-10-in => joint.0.home-sw-in
|
||||
|
||||
###
|
||||
### Shared home switches all on one parallel port pin?
|
||||
|
|
@ -57,16 +57,16 @@ net spindle-on motion.spindle-on => parport.0.pin-09-out
|
|||
###
|
||||
|
||||
# net homeswitches <= parport.0.pin-10-in
|
||||
# net homeswitches => axis.0.home-sw-in
|
||||
# net homeswitches => axis.1.home-sw-in
|
||||
# net homeswitches => axis.2.home-sw-in
|
||||
# net homeswitches => joint.0.home-sw-in
|
||||
# net homeswitches => joint.1.home-sw-in
|
||||
# net homeswitches => joint.2.home-sw-in
|
||||
|
||||
###
|
||||
### Sample separate limit switches on the X axis (axis 0)
|
||||
###
|
||||
|
||||
# net X-neg-limit parport.0.pin-11-in => axis.0.neg-lim-sw-in
|
||||
# net X-pos-limit parport.0.pin-12-in => axis.0.pos-lim-sw-in
|
||||
# net X-neg-limit parport.0.pin-11-in => joint.0.neg-lim-sw-in
|
||||
# net X-pos-limit parport.0.pin-12-in => joint.0.pos-lim-sw-in
|
||||
|
||||
###
|
||||
### Just like the shared home switches example, you can wire together
|
||||
|
|
@ -74,4 +74,4 @@ net spindle-on motion.spindle-on => parport.0.pin-09-out
|
|||
### you which switch/axis has faulted. Use caution when recovering from this.
|
||||
###
|
||||
|
||||
# net Xlimits parport.0.pin-13-in => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in
|
||||
# net Xlimits parport.0.pin-13-in => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in
|
||||
|
|
|
|||
|
|
@ -5,32 +5,32 @@
|
|||
|
||||
# connect limit/home switch outputs to motion controller
|
||||
net Xminlim <= ppmc.0.din.01.in
|
||||
net Xminlim => axis.0.neg-lim-sw-in
|
||||
net Xminlim => joint.0.neg-lim-sw-in
|
||||
net Xmaxlim <= ppmc.0.din.02.in
|
||||
net Xmaxlim => axis.0.pos-lim-sw-in
|
||||
net Xmaxlim => joint.0.pos-lim-sw-in
|
||||
net Xhome <= ppmc.0.din.00.in
|
||||
net Xhome => axis.0.home-sw-in
|
||||
net Xhome => joint.0.home-sw-in
|
||||
|
||||
net Yminlim <= ppmc.0.din.05.in
|
||||
net Yminlim => axis.1.neg-lim-sw-in
|
||||
net Yminlim => joint.1.neg-lim-sw-in
|
||||
net Ymaxlim <= ppmc.0.din.06.in
|
||||
net Ymaxlim => axis.1.pos-lim-sw-in
|
||||
net Ymaxlim => joint.1.pos-lim-sw-in
|
||||
net Yhome <= ppmc.0.din.04.in
|
||||
net Yhome => axis.1.home-sw-in
|
||||
net Yhome => joint.1.home-sw-in
|
||||
|
||||
net Zminlim <= ppmc.0.din.09.in
|
||||
net Zminlim => axis.2.neg-lim-sw-in
|
||||
net Zminlim => joint.2.neg-lim-sw-in
|
||||
net Zmaxlim <= ppmc.0.din.10.in
|
||||
net Zmaxlim => axis.2.pos-lim-sw-in
|
||||
net Zmaxlim => joint.2.pos-lim-sw-in
|
||||
net Zhome <= ppmc.0.din.08.in
|
||||
net Zhome => axis.2.home-sw-in
|
||||
net Zhome => joint.2.home-sw-in
|
||||
|
||||
net Aminlim <= ppmc.0.din.12.in
|
||||
net Aminlim => axis.3.neg-lim-sw-in
|
||||
net Aminlim => joint.3.neg-lim-sw-in
|
||||
net Amaxlim <= ppmc.0.din.13.in
|
||||
net Amaxlim => axis.3.pos-lim-sw-in
|
||||
net Amaxlim => joint.3.pos-lim-sw-in
|
||||
net Ahome <= ppmc.0.din.11.in
|
||||
net Ahome => axis.3.home-sw-in
|
||||
net Ahome => joint.3.home-sw-in
|
||||
|
||||
|
||||
# connect index pulses to motion controller
|
||||
|
|
@ -39,11 +39,11 @@ net Ahome => axis.3.home-sw-in
|
|||
#newsig Yindex bit
|
||||
#newsig Zindex bit
|
||||
#linksp Xindex <= ppmc.0.encoder.00.index-enable
|
||||
#linksp Xindex => axis.0.index-enable
|
||||
#linksp Xindex => joint.0.index-enable
|
||||
#linksp Yindex <= ppmc.0.encoder.01.index-enable
|
||||
#linksp Yindex => axis.1.index-enable
|
||||
#linksp Yindex => joint.1.index-enable
|
||||
#linksp Zindex <= ppmc.0.encoder.02.index-enable
|
||||
#linksp Zindex => axis.2.index-enable
|
||||
#linksp Zindex => joint.2.index-enable
|
||||
|
||||
#
|
||||
# Connect I/O controller I/Os
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ net Zpos-fb => pid.2.feedback
|
|||
net Apos-fb => pid.3.feedback
|
||||
|
||||
# connect position feedback to motion module
|
||||
net Xpos-fb => axis.0.motor-pos-fb
|
||||
net Ypos-fb => axis.1.motor-pos-fb
|
||||
net Zpos-fb => axis.2.motor-pos-fb
|
||||
net Apos-fb => axis.3.motor-pos-fb
|
||||
net Xpos-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb => joint.2.motor-pos-fb
|
||||
net Apos-fb => joint.3.motor-pos-fb
|
||||
|
||||
# create PID to DAC output signals
|
||||
|
||||
|
|
@ -69,10 +69,10 @@ setp pid.3.deadband [AXIS_3]DEADBAND
|
|||
# create four position command signals
|
||||
|
||||
# connect position commands to motion controller
|
||||
net Xpos-cmd <= axis.0.motor-pos-cmd
|
||||
net Ypos-cmd <= axis.1.motor-pos-cmd
|
||||
net Zpos-cmd <= axis.2.motor-pos-cmd
|
||||
net Apos-cmd <= axis.3.motor-pos-cmd
|
||||
net Xpos-cmd <= joint.0.motor-pos-cmd
|
||||
net Ypos-cmd <= joint.1.motor-pos-cmd
|
||||
net Zpos-cmd <= joint.2.motor-pos-cmd
|
||||
net Apos-cmd <= joint.3.motor-pos-cmd
|
||||
|
||||
# connect position commands to PID input
|
||||
net Xpos-cmd => pid.0.command
|
||||
|
|
@ -83,10 +83,10 @@ net Apos-cmd => pid.3.command
|
|||
# create bit signals to enable/disable the PID loops
|
||||
|
||||
# connect the signals to the motion controller
|
||||
net Xenable <= axis.0.amp-enable-out
|
||||
net Yenable <= axis.1.amp-enable-out
|
||||
net Zenable <= axis.2.amp-enable-out
|
||||
net Aenable <= axis.3.amp-enable-out
|
||||
net Xenable <= joint.0.amp-enable-out
|
||||
net Yenable <= joint.1.amp-enable-out
|
||||
net Zenable <= joint.2.amp-enable-out
|
||||
net Aenable <= joint.3.amp-enable-out
|
||||
|
||||
# connect the signals to the PID blocks
|
||||
net Xenable => pid.0.enable
|
||||
|
|
|
|||
|
|
@ -5,42 +5,42 @@
|
|||
|
||||
# connect limit/home switch outputs to motion controller
|
||||
net Xminlim <= ppmc.0.din.01.in
|
||||
net Xminlim => axis.0.neg-lim-sw-in
|
||||
net Xminlim => joint.0.neg-lim-sw-in
|
||||
net Xmaxlim <= ppmc.0.din.02.in
|
||||
net Xmaxlim => axis.0.pos-lim-sw-in
|
||||
net Xmaxlim => joint.0.pos-lim-sw-in
|
||||
net Xhome <= ppmc.0.din.00.in
|
||||
net Xhome => axis.0.home-sw-in
|
||||
net Xhome => joint.0.home-sw-in
|
||||
|
||||
net Yminlim <= ppmc.0.din.05.in
|
||||
net Yminlim => axis.1.neg-lim-sw-in
|
||||
net Yminlim => joint.1.neg-lim-sw-in
|
||||
net Ymaxlim <= ppmc.0.din.06.in
|
||||
net Ymaxlim => axis.1.pos-lim-sw-in
|
||||
net Ymaxlim => joint.1.pos-lim-sw-in
|
||||
net Yhome <= ppmc.0.din.04.in
|
||||
net Yhome => axis.1.home-sw-in
|
||||
net Yhome => joint.1.home-sw-in
|
||||
|
||||
net Zminlim <= ppmc.0.din.09.in
|
||||
net Zminlim => axis.2.neg-lim-sw-in
|
||||
net Zminlim => joint.2.neg-lim-sw-in
|
||||
net Zmaxlim <= ppmc.0.din.10.in
|
||||
net Zmaxlim => axis.2.pos-lim-sw-in
|
||||
net Zmaxlim => joint.2.pos-lim-sw-in
|
||||
net Zhome <= ppmc.0.din.08.in
|
||||
net Zhome => axis.2.home-sw-in
|
||||
net Zhome => joint.2.home-sw-in
|
||||
|
||||
net Aminlim <= ppmc.0.din.12.in
|
||||
net Aminlim => axis.3.neg-lim-sw-in
|
||||
net Aminlim => joint.3.neg-lim-sw-in
|
||||
net Amaxlim <= ppmc.0.din.13.in
|
||||
net Amaxlim => axis.3.pos-lim-sw-in
|
||||
net Amaxlim => joint.3.pos-lim-sw-in
|
||||
net Ahome <= ppmc.0.din.11.in
|
||||
net Ahome => axis.3.home-sw-in
|
||||
net Ahome => joint.3.home-sw-in
|
||||
|
||||
|
||||
# connect index pulses to motion controller
|
||||
# uncomment if you have encoder index signals
|
||||
#linksp Xindex <= ppmc.0.encoder.00.index-enable
|
||||
#linksp Xindex => axis.0.index-enable
|
||||
#linksp Xindex => joint.0.index-enable
|
||||
#linksp Yindex <= ppmc.0.encoder.01.index-enable
|
||||
#linksp Yindex => axis.1.index-enable
|
||||
#linksp Yindex => joint.1.index-enable
|
||||
#linksp Zindex <= ppmc.0.encoder.02.index-enable
|
||||
#linksp Zindex => axis.2.index-enable
|
||||
#linksp Zindex => joint.2.index-enable
|
||||
|
||||
#
|
||||
# Connect I/O controller I/Os
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ net Zpos-fb => pid.2.feedback
|
|||
net Apos-fb => pid.3.feedback
|
||||
|
||||
# connect position feedback to motion module
|
||||
net Xpos-fb => axis.0.motor-pos-fb
|
||||
net Ypos-fb => axis.1.motor-pos-fb
|
||||
net Zpos-fb => axis.2.motor-pos-fb
|
||||
net Apos-fb => axis.3.motor-pos-fb
|
||||
net Xpos-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb => joint.2.motor-pos-fb
|
||||
net Apos-fb => joint.3.motor-pos-fb
|
||||
|
||||
# create PID to DAC output signals
|
||||
|
||||
|
|
@ -69,10 +69,10 @@ setp pid.3.deadband [AXIS_3]DEADBAND
|
|||
# create four position command signals
|
||||
|
||||
# connect position commands to motion controller
|
||||
net Xpos-cmd <= axis.0.motor-pos-cmd
|
||||
net Ypos-cmd <= axis.1.motor-pos-cmd
|
||||
net Zpos-cmd <= axis.2.motor-pos-cmd
|
||||
net Apos-cmd <= axis.3.motor-pos-cmd
|
||||
net Xpos-cmd <= joint.0.motor-pos-cmd
|
||||
net Ypos-cmd <= joint.1.motor-pos-cmd
|
||||
net Zpos-cmd <= joint.2.motor-pos-cmd
|
||||
net Apos-cmd <= joint.3.motor-pos-cmd
|
||||
|
||||
# connect position commands to PID input
|
||||
net Xpos-cmd => pid.0.command
|
||||
|
|
@ -83,10 +83,10 @@ net Apos-cmd => pid.3.command
|
|||
# create bit signals to enable/disable the PID loops
|
||||
|
||||
# connect the signals to the motion controller
|
||||
net Xenable <= axis.0.amp-enable-out
|
||||
net Yenable <= axis.1.amp-enable-out
|
||||
net Zenable <= axis.2.amp-enable-out
|
||||
net Aenable <= axis.3.amp-enable-out
|
||||
net Xenable <= joint.0.amp-enable-out
|
||||
net Yenable <= joint.1.amp-enable-out
|
||||
net Zenable <= joint.2.amp-enable-out
|
||||
net Aenable <= joint.3.amp-enable-out
|
||||
|
||||
# connect the signals to the PID blocks
|
||||
net Xenable => pid.0.enable
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ net Zpos-fb => pid.2.feedback
|
|||
net Apos-fb => pid.3.feedback
|
||||
|
||||
# connect position feedback to motion module
|
||||
net Xpos-fb => axis.0.motor-pos-fb
|
||||
net Ypos-fb => axis.1.motor-pos-fb
|
||||
net Zpos-fb => axis.2.motor-pos-fb
|
||||
net Apos-fb => axis.3.motor-pos-fb
|
||||
net Xpos-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb => joint.2.motor-pos-fb
|
||||
net Apos-fb => joint.3.motor-pos-fb
|
||||
|
||||
# create PID to DAC output signals
|
||||
|
||||
|
|
@ -69,10 +69,10 @@ setp pid.3.deadband [AXIS_3]DEADBAND
|
|||
# create four position command signals
|
||||
|
||||
# connect position commands to motion controller
|
||||
net Xpos-cmd <= axis.0.motor-pos-cmd
|
||||
net Ypos-cmd <= axis.1.motor-pos-cmd
|
||||
net Zpos-cmd <= axis.2.motor-pos-cmd
|
||||
net Apos-cmd <= axis.3.motor-pos-cmd
|
||||
net Xpos-cmd <= joint.0.motor-pos-cmd
|
||||
net Ypos-cmd <= joint.1.motor-pos-cmd
|
||||
net Zpos-cmd <= joint.2.motor-pos-cmd
|
||||
net Apos-cmd <= joint.3.motor-pos-cmd
|
||||
|
||||
# connect position commands to PID input
|
||||
net Xpos-cmd => pid.0.command
|
||||
|
|
@ -83,10 +83,10 @@ net Apos-cmd => pid.3.command
|
|||
# create bit signals to enable/disable the PID loops
|
||||
|
||||
# connect the signals to the motion controller
|
||||
net Xenable <= axis.0.amp-enable-out
|
||||
net Yenable <= axis.1.amp-enable-out
|
||||
net Zenable <= axis.2.amp-enable-out
|
||||
net Aenable <= axis.3.amp-enable-out
|
||||
net Xenable <= joint.0.amp-enable-out
|
||||
net Yenable <= joint.1.amp-enable-out
|
||||
net Zenable <= joint.2.amp-enable-out
|
||||
net Aenable <= joint.3.amp-enable-out
|
||||
|
||||
# connect the signals to the PID blocks
|
||||
net Xenable => pid.0.enable
|
||||
|
|
|
|||
|
|
@ -5,32 +5,32 @@
|
|||
|
||||
# connect limit/home switch outputs to motion controller
|
||||
net Xminlim <= ppmc.0.din.01.in
|
||||
net Xminlim => axis.0.neg-lim-sw-in
|
||||
net Xminlim => joint.0.neg-lim-sw-in
|
||||
net Xmaxlim <= ppmc.0.din.02.in
|
||||
net Xmaxlim => axis.0.pos-lim-sw-in
|
||||
net Xmaxlim => joint.0.pos-lim-sw-in
|
||||
net Xhome <= ppmc.0.din.00.in
|
||||
net Xhome => axis.0.home-sw-in
|
||||
net Xhome => joint.0.home-sw-in
|
||||
|
||||
net Yminlim <= ppmc.0.din.05.in
|
||||
net Yminlim => axis.1.neg-lim-sw-in
|
||||
net Yminlim => joint.1.neg-lim-sw-in
|
||||
net Ymaxlim <= ppmc.0.din.06.in
|
||||
net Ymaxlim => axis.1.pos-lim-sw-in
|
||||
net Ymaxlim => joint.1.pos-lim-sw-in
|
||||
net Yhome <= ppmc.0.din.04.in
|
||||
net Yhome => axis.1.home-sw-in
|
||||
net Yhome => joint.1.home-sw-in
|
||||
|
||||
net Zminlim <= ppmc.0.din.09.in
|
||||
net Zminlim => axis.2.neg-lim-sw-in
|
||||
net Zminlim => joint.2.neg-lim-sw-in
|
||||
net Zmaxlim <= ppmc.0.din.10.in
|
||||
net Zmaxlim => axis.2.pos-lim-sw-in
|
||||
net Zmaxlim => joint.2.pos-lim-sw-in
|
||||
net Zhome <= ppmc.0.din.08.in
|
||||
net Zhome => axis.2.home-sw-in
|
||||
net Zhome => joint.2.home-sw-in
|
||||
|
||||
net Aminlim <= ppmc.0.din.12.in
|
||||
net Aminlim => axis.3.neg-lim-sw-in
|
||||
net Aminlim => joint.3.neg-lim-sw-in
|
||||
net Amaxlim <= ppmc.0.din.13.in
|
||||
net Amaxlim => axis.3.pos-lim-sw-in
|
||||
net Amaxlim => joint.3.pos-lim-sw-in
|
||||
net Ahome <= ppmc.0.din.11.in
|
||||
net Ahome => axis.3.home-sw-in
|
||||
net Ahome => joint.3.home-sw-in
|
||||
|
||||
|
||||
# connect index pulses to motion controller
|
||||
|
|
@ -41,11 +41,11 @@ net Ahome => axis.3.home-sw-in
|
|||
#newsig Yindex bit
|
||||
#newsig Zindex bit
|
||||
#linksp Xindex <= ppmc.0.encoder.00.index-enable
|
||||
#linksp Xindex => axis.0.index-enable
|
||||
#linksp Xindex => joint.0.index-enable
|
||||
#linksp Yindex <= ppmc.0.encoder.01.index-enable
|
||||
#linksp Yindex => axis.1.index-enable
|
||||
#linksp Yindex => joint.1.index-enable
|
||||
#linksp Zindex <= ppmc.0.encoder.02.index-enable
|
||||
#linksp Zindex => axis.2.index-enable
|
||||
#linksp Zindex => joint.2.index-enable
|
||||
|
||||
#
|
||||
# Connect I/O controller I/Os
|
||||
|
|
|
|||
|
|
@ -55,11 +55,11 @@ setp pid.1.FF1 [AXIS_2]FF1
|
|||
setp pid.1.FF2 [AXIS_2]FF2
|
||||
setp pid.1.deadband [AXIS_2]DEADBAND
|
||||
|
||||
net Xpos-fb pluto-servo.encoder.0.position => pid.0.feedback axis.0.motor-pos-fb
|
||||
net Zpos-fb pluto-servo.encoder.1.position => pid.1.feedback axis.2.motor-pos-fb
|
||||
net Xpos-fb pluto-servo.encoder.0.position => pid.0.feedback joint.0.motor-pos-fb
|
||||
net Zpos-fb pluto-servo.encoder.1.position => pid.1.feedback joint.2.motor-pos-fb
|
||||
|
||||
net Xpos-cmd axis.0.motor-pos-cmd => pid.0.command ddt.0.in
|
||||
net Zpos-cmd axis.2.motor-pos-cmd => pid.1.command ddt.2.in
|
||||
net Xpos-cmd joint.0.motor-pos-cmd => pid.0.command ddt.0.in
|
||||
net Zpos-cmd joint.2.motor-pos-cmd => pid.1.command ddt.2.in
|
||||
|
||||
net Xvel-cmd pid.0.output => pluto-servo.pwm.0.value
|
||||
net Zvel-cmd pid.1.output => pluto-servo.pwm.1.value
|
||||
|
|
@ -71,8 +71,8 @@ net Zvel ddt.2.out => ddt.3.in
|
|||
net Zacc ddt.3.out
|
||||
|
||||
# machine ON
|
||||
net Xenable axis.0.amp-enable-out => pid.0.enable pluto-servo.pwm.0.enable pluto-servo.dout.09
|
||||
net Zenable axis.2.amp-enable-out => pid.1.enable pluto-servo.pwm.1.enable
|
||||
net Xenable joint.0.amp-enable-out => pid.0.enable pluto-servo.pwm.0.enable pluto-servo.dout.09
|
||||
net Zenable joint.2.amp-enable-out => pid.1.enable pluto-servo.pwm.1.enable
|
||||
|
||||
net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
|
|||
|
||||
setp debounce.0.delay 3
|
||||
net Xswitch pluto-servo.din.00-not => debounce.0.0.in
|
||||
net Xswitch-debounced debounce.0.0.out => axis.0.home-sw-in axis.0.pos-lim-sw-in
|
||||
net Xswitch-debounced debounce.0.0.out => joint.0.home-sw-in joint.0.pos-lim-sw-in
|
||||
|
||||
# tool loading loopback
|
||||
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
||||
|
|
|
|||
|
|
@ -14,17 +14,17 @@ setp pluto-step.stepgen.0.scale [AXIS_0]SCALE
|
|||
setp pluto-step.stepgen.1.scale [AXIS_1]SCALE
|
||||
setp pluto-step.stepgen.2.scale [AXIS_2]SCALE
|
||||
|
||||
net Xpos-cmd axis.0.motor-pos-cmd => pluto-step.stepgen.0.position-cmd
|
||||
net Ypos-cmd axis.1.motor-pos-cmd => pluto-step.stepgen.1.position-cmd
|
||||
net Zpos-cmd axis.2.motor-pos-cmd => pluto-step.stepgen.2.position-cmd
|
||||
net Xpos-cmd joint.0.motor-pos-cmd => pluto-step.stepgen.0.position-cmd
|
||||
net Ypos-cmd joint.1.motor-pos-cmd => pluto-step.stepgen.1.position-cmd
|
||||
net Zpos-cmd joint.2.motor-pos-cmd => pluto-step.stepgen.2.position-cmd
|
||||
|
||||
net Xpos-fb pluto-step.stepgen.0.position-fb => axis.0.motor-pos-fb
|
||||
net Ypos-fb pluto-step.stepgen.1.position-fb => axis.1.motor-pos-fb
|
||||
net Zpos-fb pluto-step.stepgen.2.position-fb => axis.2.motor-pos-fb
|
||||
net Xpos-fb pluto-step.stepgen.0.position-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb pluto-step.stepgen.1.position-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb pluto-step.stepgen.2.position-fb => joint.2.motor-pos-fb
|
||||
|
||||
net Xen axis.0.amp-enable-out => pluto-step.stepgen.0.enable
|
||||
net Yen axis.1.amp-enable-out => pluto-step.stepgen.1.enable
|
||||
net Zen axis.2.amp-enable-out => pluto-step.stepgen.2.enable
|
||||
net Xen joint.0.amp-enable-out => pluto-step.stepgen.0.enable
|
||||
net Yen joint.1.amp-enable-out => pluto-step.stepgen.1.enable
|
||||
net Zen joint.2.amp-enable-out => pluto-step.stepgen.2.enable
|
||||
|
||||
# create a signal for the estop loopback
|
||||
net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
|
||||
|
|
|
|||
|
|
@ -19,35 +19,35 @@ addf stg.do-write servo-thread 1
|
|||
|
||||
# connect limit/home switch outputs to motion controller
|
||||
net Xminlim <= stg.in-02
|
||||
net Xminlim => axis.0.neg-lim-sw-in
|
||||
net Xminlim => joint.0.neg-lim-sw-in
|
||||
net Xmaxlim <= stg.in-01
|
||||
net Xmaxlim => axis.0.pos-lim-sw-in
|
||||
net Xmaxlim => joint.0.pos-lim-sw-in
|
||||
net Xhome <= stg.in-00
|
||||
net Xhome => axis.0.home-sw-in
|
||||
net Xhome => joint.0.home-sw-in
|
||||
|
||||
net Yminlim <= stg.in-06
|
||||
net Yminlim => axis.1.neg-lim-sw-in
|
||||
net Yminlim => joint.1.neg-lim-sw-in
|
||||
net Ymaxlim <= stg.in-05
|
||||
net Ymaxlim => axis.1.pos-lim-sw-in
|
||||
net Ymaxlim => joint.1.pos-lim-sw-in
|
||||
net Yhome <= stg.in-04
|
||||
net Yhome => axis.1.home-sw-in
|
||||
net Yhome => joint.1.home-sw-in
|
||||
|
||||
net Zminlim <= stg.in-10
|
||||
net Zminlim => axis.2.neg-lim-sw-in
|
||||
net Zminlim => joint.2.neg-lim-sw-in
|
||||
net Zmaxlim <= stg.in-09
|
||||
net Zmaxlim => axis.2.pos-lim-sw-in
|
||||
net Zmaxlim => joint.2.pos-lim-sw-in
|
||||
net Zhome <= stg.in-08
|
||||
net Zhome => axis.2.home-sw-in
|
||||
net Zhome => joint.2.home-sw-in
|
||||
|
||||
#continue in the same manner for further axes (A,B,C)
|
||||
|
||||
# connect amp faults to motion controller
|
||||
net Xfault <= stg.in-03
|
||||
net Xfault => axis.0.amp-fault-in
|
||||
net Xfault => joint.0.amp-fault-in
|
||||
net Yfault <= stg.in-07
|
||||
net Yfault => axis.1.amp-fault-in
|
||||
net Yfault => joint.1.amp-fault-in
|
||||
net Zfault <= stg.in-11
|
||||
net Zfault => axis.2.amp-fault-in
|
||||
net Zfault => joint.2.amp-fault-in
|
||||
|
||||
# connect index pulses to motion controller
|
||||
# do these when index pulsing is figured out
|
||||
|
|
@ -55,11 +55,11 @@ net Zfault => axis.2.amp-fault-in
|
|||
#newsig Yindex bit
|
||||
#newsig Zindex bit
|
||||
#linksp Xindex <= stg.0.enc-index
|
||||
#linksp Xindex => axis.0.index-enable
|
||||
#linksp Xindex => joint.0.index-enable
|
||||
#linksp Yindex <= stg.1.enc-index
|
||||
#linksp Yindex => axis.1.index-enable
|
||||
#linksp Yindex => joint.1.index-enable
|
||||
#linksp Zindex <= stg.2.enc-index
|
||||
#linksp Zindex => axis.2.index-enable
|
||||
#linksp Zindex => joint.2.index-enable
|
||||
|
||||
# connect amp enables to motion controller
|
||||
net Xenable => stg.out-00
|
||||
|
|
|
|||
|
|
@ -22,31 +22,31 @@ addf vti.do-write servo-thread -1
|
|||
#newsig Xmaxlim bit
|
||||
#newsig Xhome bit
|
||||
#linksp Xminlim <= vti.in-02
|
||||
#linksp Xminlim => axis.0.neg-lim-sw-in
|
||||
#linksp Xminlim => joint.0.neg-lim-sw-in
|
||||
#linksp Xmaxlim <= vti.in-01
|
||||
#linksp Xmaxlim => axis.0.pos-lim-sw-in
|
||||
#linksp Xmaxlim => joint.0.pos-lim-sw-in
|
||||
#linksp Xhome <= vti.in-00
|
||||
#linksp Xhome => axis.0.home-sw-in
|
||||
#linksp Xhome => joint.0.home-sw-in
|
||||
|
||||
#newsig Yminlim bit
|
||||
#newsig Ymaxlim bit
|
||||
#newsig Yhome bit
|
||||
#linksp Yminlim <= vti.in-06
|
||||
#linksp Yminlim => axis.1.neg-lim-sw-in
|
||||
#linksp Yminlim => joint.1.neg-lim-sw-in
|
||||
#linksp Ymaxlim <= vti.in-05
|
||||
#linksp Ymaxlim => axis.1.pos-lim-sw-in
|
||||
#linksp Ymaxlim => joint.1.pos-lim-sw-in
|
||||
#linksp Yhome <= vti.in-04
|
||||
#linksp Yhome => axis.1.home-sw-in
|
||||
#linksp Yhome => joint.1.home-sw-in
|
||||
|
||||
#newsig Zminlim bit
|
||||
#newsig Zmaxlim bit
|
||||
#newsig Zhome bit
|
||||
#linksp Zminlim <= vti.in-10
|
||||
#linksp Zminlim => axis.2.neg-lim-sw-in
|
||||
#linksp Zminlim => joint.2.neg-lim-sw-in
|
||||
#linksp Zmaxlim <= vti.in-09
|
||||
#linksp Zmaxlim => axis.2.pos-lim-sw-in
|
||||
#linksp Zmaxlim => joint.2.pos-lim-sw-in
|
||||
#linksp Zhome <= vti.in-08
|
||||
#linksp Zhome => axis.2.home-sw-in
|
||||
#linksp Zhome => joint.2.home-sw-in
|
||||
|
||||
#continue in the same manner for further axes (A,B,C)
|
||||
|
||||
|
|
@ -55,11 +55,11 @@ addf vti.do-write servo-thread -1
|
|||
#newsig Yfault bit
|
||||
#newsig Zfault bit
|
||||
#linksp Xfault <= vti.in-03
|
||||
#linksp Xfault => axis.0.amp-fault-in
|
||||
#linksp Xfault => joint.0.amp-fault-in
|
||||
#linksp Yfault <= vti.in-07
|
||||
#linksp Yfault => axis.1.amp-fault-in
|
||||
#linksp Yfault => joint.1.amp-fault-in
|
||||
#linksp Zfault <= vti.in-11
|
||||
#linksp Zfault => axis.2.amp-fault-in
|
||||
#linksp Zfault => joint.2.amp-fault-in
|
||||
|
||||
# connect index pulses to motion controller
|
||||
# do these when index pulsing is figured out
|
||||
|
|
@ -67,11 +67,11 @@ addf vti.do-write servo-thread -1
|
|||
#newsig Yindex bit
|
||||
#newsig Zindex bit
|
||||
#linksp Xindex <= vti.0.enc-index
|
||||
#linksp Xindex => axis.0.index-enable
|
||||
#linksp Xindex => joint.0.index-enable
|
||||
#linksp Yindex <= vti.1.enc-index
|
||||
#linksp Yindex => axis.1.index-enable
|
||||
#linksp Yindex => joint.1.index-enable
|
||||
#linksp Zindex <= vti.2.enc-index
|
||||
#linksp Zindex => axis.2.index-enable
|
||||
#linksp Zindex => joint.2.index-enable
|
||||
|
||||
# connect amp enables to motion controller
|
||||
#linksp Xenable => vti.out-00
|
||||
|
|
|
|||
|
|
@ -28,33 +28,33 @@ addf motenc.0.digital-out-write servo-thread -1
|
|||
|
||||
# Connect limit/home switch outputs to motion controller.
|
||||
net Xminlim <= motenc.0.in-00
|
||||
net Xminlim => axis.0.neg-lim-sw-in
|
||||
net Xminlim => joint.0.neg-lim-sw-in
|
||||
net Xmaxlim <= motenc.0.in-01
|
||||
net Xmaxlim => axis.0.pos-lim-sw-in
|
||||
net Xmaxlim => joint.0.pos-lim-sw-in
|
||||
net Xhome <= motenc.0.in-02
|
||||
net Xhome => axis.0.home-sw-in
|
||||
net Xhome => joint.0.home-sw-in
|
||||
|
||||
net Yminlim <= motenc.0.in-04
|
||||
net Yminlim => axis.1.neg-lim-sw-in
|
||||
net Yminlim => joint.1.neg-lim-sw-in
|
||||
net Ymaxlim <= motenc.0.in-05
|
||||
net Ymaxlim => axis.1.pos-lim-sw-in
|
||||
net Ymaxlim => joint.1.pos-lim-sw-in
|
||||
net Yhome <= motenc.0.in-06
|
||||
net Yhome => axis.1.home-sw-in
|
||||
net Yhome => joint.1.home-sw-in
|
||||
|
||||
net Zminlim <= motenc.0.in-08
|
||||
net Zminlim => axis.2.neg-lim-sw-in
|
||||
net Zminlim => joint.2.neg-lim-sw-in
|
||||
net Zmaxlim <= motenc.0.in-09
|
||||
net Zmaxlim => axis.2.pos-lim-sw-in
|
||||
net Zmaxlim => joint.2.pos-lim-sw-in
|
||||
net Zhome <= motenc.0.in-10
|
||||
net Zhome => axis.2.home-sw-in
|
||||
net Zhome => joint.2.home-sw-in
|
||||
|
||||
# Connect amp faults to motion controller.
|
||||
net Xfault <= motenc.0.in-03
|
||||
net Xfault => axis.0.amp-fault-in
|
||||
net Xfault => joint.0.amp-fault-in
|
||||
net Yfault <= motenc.0.in-07
|
||||
net Yfault => axis.1.amp-fault-in
|
||||
net Yfault => joint.1.amp-fault-in
|
||||
net Zfault <= motenc.0.in-11
|
||||
net Zfault => axis.2.amp-fault-in
|
||||
net Zfault => joint.2.amp-fault-in
|
||||
|
||||
# Connect amp enables to motion controller.
|
||||
net Xenable => motenc.0.out-08
|
||||
|
|
|
|||
|
|
@ -70,6 +70,6 @@ setp pid.1.maxoutput [AXIS_1]MAX_OUTPUT
|
|||
setp pid.2.maxoutput [AXIS_2]MAX_OUTPUT
|
||||
|
||||
# Connect index pulses to motion controller.
|
||||
net Xindex motenc.0.enc-00-index-enable <=> axis.0.index-enable pid.0.index-enable
|
||||
net Yindex motenc.0.enc-01-index-enable <=> axis.1.index-enable pid.1.index-enable
|
||||
net Zindex motenc.0.enc-02-index-enable <=> axis.2.index-enable pid.2.index-enable
|
||||
net Xindex motenc.0.enc-00-index-enable <=> joint.0.index-enable pid.0.index-enable
|
||||
net Yindex motenc.0.enc-01-index-enable <=> joint.1.index-enable pid.1.index-enable
|
||||
net Zindex motenc.0.enc-02-index-enable <=> joint.2.index-enable pid.2.index-enable
|
||||
|
|
|
|||
|
|
@ -92,16 +92,16 @@ setp pid.3.FF2 [AXIS_3]FF2
|
|||
setp pid.3.deadband [AXIS_3]DEADBAND
|
||||
|
||||
# Connect the enable signals to the PID blocks.
|
||||
net xEnable axis.0.amp-enable-out => pid.0.enable
|
||||
net yEnable axis.1.amp-enable-out => pid.1.enable
|
||||
net zEnable axis.2.amp-enable-out => pid.2.enable
|
||||
net aEnable axis.3.amp-enable-out => pid.3.enable
|
||||
net xEnable joint.0.amp-enable-out => pid.0.enable
|
||||
net yEnable joint.1.amp-enable-out => pid.1.enable
|
||||
net zEnable joint.2.amp-enable-out => pid.2.enable
|
||||
net aEnable joint.3.amp-enable-out => pid.3.enable
|
||||
|
||||
# Connect position commands to PID inputs.
|
||||
net xPosCmd axis.0.motor-pos-cmd => pid.0.command
|
||||
net yPosCmd axis.1.motor-pos-cmd => pid.1.command
|
||||
net zPosCmd axis.2.motor-pos-cmd => pid.2.command
|
||||
net aPosCmd axis.3.motor-pos-cmd => pid.3.command
|
||||
net xPosCmd joint.0.motor-pos-cmd => pid.0.command
|
||||
net yPosCmd joint.1.motor-pos-cmd => pid.1.command
|
||||
net zPosCmd joint.2.motor-pos-cmd => pid.2.command
|
||||
net aPosCmd joint.3.motor-pos-cmd => pid.3.command
|
||||
|
||||
# DACs
|
||||
#
|
||||
|
|
@ -138,39 +138,39 @@ net zPosFb motenc.0.enc-02-position => pid.2.feedback
|
|||
net aPosFb motenc.0.enc-00-position => pid.3.feedback
|
||||
|
||||
# Connect position feedback to motion module.
|
||||
net xPosFb => axis.0.motor-pos-fb
|
||||
net yPosFb => axis.1.motor-pos-fb
|
||||
net zPosFb => axis.2.motor-pos-fb
|
||||
net aPosFb => axis.3.motor-pos-fb
|
||||
net xPosFb => joint.0.motor-pos-fb
|
||||
net yPosFb => joint.1.motor-pos-fb
|
||||
net zPosFb => joint.2.motor-pos-fb
|
||||
net aPosFb => joint.3.motor-pos-fb
|
||||
|
||||
# Connect position feedback to PLC.
|
||||
net xPosFb => boss_plc.0.x-position-in
|
||||
net yPosFb => boss_plc.0.y-position-in
|
||||
|
||||
# Connect index pulses to motion controller.
|
||||
net xIndex motenc.0.enc-01-index-enable <=> axis.0.index-enable
|
||||
net yIndex motenc.0.enc-03-index-enable <=> axis.1.index-enable
|
||||
net zIndex motenc.0.enc-02-index-enable <=> axis.2.index-enable
|
||||
net aIndex motenc.0.enc-00-index-enable <=> axis.3.index-enable
|
||||
net xIndex motenc.0.enc-01-index-enable <=> joint.0.index-enable
|
||||
net yIndex motenc.0.enc-03-index-enable <=> joint.1.index-enable
|
||||
net zIndex motenc.0.enc-02-index-enable <=> joint.2.index-enable
|
||||
net aIndex motenc.0.enc-00-index-enable <=> joint.3.index-enable
|
||||
|
||||
# Limits.
|
||||
#
|
||||
# Connect limit/home switch inputs to PLC and motion controller.
|
||||
net xLimitSw motenc.0.in-09 => boss_plc.0.x-limit-in
|
||||
net xLimitSw => axis.0.home-sw-in
|
||||
net xLimitSw => joint.0.home-sw-in
|
||||
net yLimitSw motenc.0.in-13 => boss_plc.0.y-limit-in
|
||||
net yLimitSw => axis.1.home-sw-in
|
||||
net yLimitSw => joint.1.home-sw-in
|
||||
net zMinlimSw motenc.0.in-26 => boss_plc.0.z-limit-neg-in
|
||||
net zMaxlimSw motenc.0.in-25 => boss_plc.0.z-limit-pos-in
|
||||
net zHome motenc.0.in-27 => axis.2.home-sw-in
|
||||
net zHome motenc.0.in-27 => joint.2.home-sw-in
|
||||
|
||||
# Connect PLC limit switch outputs to motion controller.
|
||||
net xMinLim boss_plc.0.x-limit-neg-out => axis.0.neg-lim-sw-in
|
||||
net xMaxLim boss_plc.0.x-limit-pos-out => axis.0.pos-lim-sw-in
|
||||
net yMinLim boss_plc.0.y-limit-neg-out => axis.1.neg-lim-sw-in
|
||||
net yMaxLim boss_plc.0.y-limit-pos-out => axis.1.pos-lim-sw-in
|
||||
net zMinLim boss_plc.0.z-limit-neg-out => axis.2.neg-lim-sw-in
|
||||
net zMaxLim boss_plc.0.z-limit-pos-out => axis.2.pos-lim-sw-in
|
||||
net xMinLim boss_plc.0.x-limit-neg-out => joint.0.neg-lim-sw-in
|
||||
net xMaxLim boss_plc.0.x-limit-pos-out => joint.0.pos-lim-sw-in
|
||||
net yMinLim boss_plc.0.y-limit-neg-out => joint.1.neg-lim-sw-in
|
||||
net yMaxLim boss_plc.0.y-limit-pos-out => joint.1.pos-lim-sw-in
|
||||
net zMinLim boss_plc.0.z-limit-neg-out => joint.2.neg-lim-sw-in
|
||||
net zMaxLim boss_plc.0.z-limit-pos-out => joint.2.pos-lim-sw-in
|
||||
|
||||
# Amp enables/faults.
|
||||
#
|
||||
|
|
@ -193,10 +193,10 @@ net zEnable => boss_plc.0.z-amp-enable-in
|
|||
net aEnable => boss_plc.0.a-amp-enable-in
|
||||
|
||||
# Connect amp faults to motion controller.
|
||||
net xFault boss_plc.0.x-amp-fault-out => axis.0.amp-fault-in
|
||||
net yFault boss_plc.0.y-amp-fault-out => axis.1.amp-fault-in
|
||||
net zFault boss_plc.0.z-amp-fault-out => axis.2.amp-fault-in
|
||||
net aFault boss_plc.0.a-amp-fault-out => axis.3.amp-fault-in
|
||||
net xFault boss_plc.0.x-amp-fault-out => joint.0.amp-fault-in
|
||||
net yFault boss_plc.0.y-amp-fault-out => joint.1.amp-fault-in
|
||||
net zFault boss_plc.0.z-amp-fault-out => joint.2.amp-fault-in
|
||||
net aFault boss_plc.0.a-amp-fault-out => joint.3.amp-fault-in
|
||||
|
||||
# Spindle.
|
||||
#
|
||||
|
|
@ -280,22 +280,22 @@ net feedOverride motenc.0.enc-04-count => halui.feed-override.counts
|
|||
#net rapidOverride motenc.0.enc-06-count => halui.rapid-override.counts
|
||||
|
||||
# Set the jog mode so motion stops as soon as the wheel stops.
|
||||
setp axis.0.jog-vel-mode TRUE
|
||||
setp axis.1.jog-vel-mode TRUE
|
||||
setp axis.2.jog-vel-mode TRUE
|
||||
setp axis.3.jog-vel-mode TRUE
|
||||
setp joint.0.jog-vel-mode TRUE
|
||||
setp joint.1.jog-vel-mode TRUE
|
||||
setp joint.2.jog-vel-mode TRUE
|
||||
setp joint.3.jog-vel-mode TRUE
|
||||
|
||||
# Connect jog axis select to motion controller and PLC.
|
||||
net xJog motenc.0.in-40 => axis.0.jog-enable
|
||||
net yJog motenc.0.in-41 => axis.1.jog-enable
|
||||
net zJog motenc.0.in-42 => axis.2.jog-enable
|
||||
net aJog motenc.0.in-43 => axis.3.jog-enable
|
||||
net xJog motenc.0.in-40 => joint.0.jog-enable
|
||||
net yJog motenc.0.in-41 => joint.1.jog-enable
|
||||
net zJog motenc.0.in-42 => joint.2.jog-enable
|
||||
net aJog motenc.0.in-43 => joint.3.jog-enable
|
||||
net xJog => boss_plc.0.x-jog-en-in
|
||||
net yJog => boss_plc.0.y-jog-en-in
|
||||
net zJog => boss_plc.0.z-jog-en-in
|
||||
|
||||
# Connect jog wheel encoder.
|
||||
net jogCounts motenc.0.enc-05-count => axis.0.jog-counts axis.1.jog-counts axis.2.jog-counts axis.3.jog-counts
|
||||
net jogCounts motenc.0.enc-05-count => joint.0.jog-counts joint.1.jog-counts joint.2.jog-counts joint.3.jog-counts
|
||||
|
||||
# Connect jog scale selects to PLC.
|
||||
setp boss_plc.0.jog-scale-0 0.000001
|
||||
|
|
@ -306,4 +306,4 @@ net jogScaleSel1 motenc.0.in-37 => boss_plc.0.jog-sel-in-1
|
|||
net jogScaleSel2 motenc.0.in-38 => boss_plc.0.jog-sel-in-2
|
||||
|
||||
# Connect PLC jog scale output.
|
||||
net jogScale boss_plc.0.jog-scale-out => axis.0.jog-scale axis.1.jog-scale axis.2.jog-scale axis.3.jog-scale
|
||||
net jogScale boss_plc.0.jog-scale-out => joint.0.jog-scale joint.1.jog-scale joint.2.jog-scale joint.3.jog-scale
|
||||
|
|
|
|||
|
|
@ -128,10 +128,10 @@ setp pid.3.tune-cycles [AXIS_3]TUNE_CYCLES
|
|||
setp pid.3.tune-type [AXIS_3]TUNE_TYPE
|
||||
|
||||
# Connect the enable signals to the PID blocks.
|
||||
net xEnable axis.0.amp-enable-out => pid.0.enable
|
||||
net yEnable axis.1.amp-enable-out => pid.1.enable
|
||||
net zEnable axis.2.amp-enable-out => pid.2.enable
|
||||
net aEnable axis.3.amp-enable-out => pid.3.enable
|
||||
net xEnable joint.0.amp-enable-out => pid.0.enable
|
||||
net yEnable joint.1.amp-enable-out => pid.1.enable
|
||||
net zEnable joint.2.amp-enable-out => pid.2.enable
|
||||
net aEnable joint.3.amp-enable-out => pid.3.enable
|
||||
|
||||
# Set siggen parameters.
|
||||
setp siggen.0.frequency 0.5
|
||||
|
|
@ -139,10 +139,10 @@ setp siggen.0.offset 0
|
|||
setp siggen.0.amplitude 0.01
|
||||
|
||||
# Connect position commands to PID inputs.
|
||||
net xPosCmd axis.0.motor-pos-cmd => mux2.4.in0
|
||||
net yPosCmd axis.1.motor-pos-cmd => mux2.5.in0
|
||||
net zPosCmd axis.2.motor-pos-cmd => mux2.6.in0
|
||||
net aPosCmd axis.3.motor-pos-cmd => mux2.7.in0
|
||||
net xPosCmd joint.0.motor-pos-cmd => mux2.4.in0
|
||||
net yPosCmd joint.1.motor-pos-cmd => mux2.5.in0
|
||||
net zPosCmd joint.2.motor-pos-cmd => mux2.6.in0
|
||||
net aPosCmd joint.3.motor-pos-cmd => mux2.7.in0
|
||||
|
||||
net squareWave siggen.0.square => mux2.4.in1
|
||||
net squareWave => mux2.5.in1
|
||||
|
|
@ -220,10 +220,10 @@ net yPosCmd => mux2.1.in1
|
|||
net zPosCmd => mux2.2.in1
|
||||
net aPosCmd => mux2.3.in1
|
||||
|
||||
net xPosFb mux2.0.out => axis.0.motor-pos-fb
|
||||
net yPosFb mux2.1.out => axis.1.motor-pos-fb
|
||||
net zPosFb mux2.2.out => axis.2.motor-pos-fb
|
||||
net aPosFb mux2.3.out => axis.3.motor-pos-fb
|
||||
net xPosFb mux2.0.out => joint.0.motor-pos-fb
|
||||
net yPosFb mux2.1.out => joint.1.motor-pos-fb
|
||||
net zPosFb mux2.2.out => joint.2.motor-pos-fb
|
||||
net aPosFb mux2.3.out => joint.3.motor-pos-fb
|
||||
|
||||
net xTuneMode => mux2.0.sel
|
||||
net yTuneMode => mux2.1.sel
|
||||
|
|
@ -235,29 +235,29 @@ net xMotorPosFb => boss_plc.0.x-position-in
|
|||
net yMotorPosFb => boss_plc.0.y-position-in
|
||||
|
||||
# Connect index pulses to motion controller.
|
||||
net xIndex motenc.0.enc-01-index-enable <=> axis.0.index-enable
|
||||
net yIndex motenc.0.enc-03-index-enable <=> axis.1.index-enable
|
||||
net zIndex motenc.0.enc-02-index-enable <=> axis.2.index-enable
|
||||
net aIndex motenc.0.enc-00-index-enable <=> axis.3.index-enable
|
||||
net xIndex motenc.0.enc-01-index-enable <=> joint.0.index-enable
|
||||
net yIndex motenc.0.enc-03-index-enable <=> joint.1.index-enable
|
||||
net zIndex motenc.0.enc-02-index-enable <=> joint.2.index-enable
|
||||
net aIndex motenc.0.enc-00-index-enable <=> joint.3.index-enable
|
||||
|
||||
# Limits.
|
||||
#
|
||||
# Connect limit/home switch inputs to PLC and motion controller.
|
||||
net xLimitSw motenc.0.in-09 => boss_plc.0.x-limit-in
|
||||
net xLimitSw => axis.0.home-sw-in
|
||||
net xLimitSw => joint.0.home-sw-in
|
||||
net yLimitSw motenc.0.in-13 => boss_plc.0.y-limit-in
|
||||
net yLimitSw => axis.1.home-sw-in
|
||||
net yLimitSw => joint.1.home-sw-in
|
||||
net zMinlimSw motenc.0.in-26 => boss_plc.0.z-limit-neg-in
|
||||
net zMaxlimSw motenc.0.in-25 => boss_plc.0.z-limit-pos-in
|
||||
net zHome motenc.0.in-27 => axis.2.home-sw-in
|
||||
net zHome motenc.0.in-27 => joint.2.home-sw-in
|
||||
|
||||
# Connect PLC limit switch outputs to motion controller.
|
||||
net xMinLim boss_plc.0.x-limit-neg-out => axis.0.neg-lim-sw-in
|
||||
net xMaxLim boss_plc.0.x-limit-pos-out => axis.0.pos-lim-sw-in
|
||||
net yMinLim boss_plc.0.y-limit-neg-out => axis.1.neg-lim-sw-in
|
||||
net yMaxLim boss_plc.0.y-limit-pos-out => axis.1.pos-lim-sw-in
|
||||
net zMinLim boss_plc.0.z-limit-neg-out => axis.2.neg-lim-sw-in
|
||||
net zMaxLim boss_plc.0.z-limit-pos-out => axis.2.pos-lim-sw-in
|
||||
net xMinLim boss_plc.0.x-limit-neg-out => joint.0.neg-lim-sw-in
|
||||
net xMaxLim boss_plc.0.x-limit-pos-out => joint.0.pos-lim-sw-in
|
||||
net yMinLim boss_plc.0.y-limit-neg-out => joint.1.neg-lim-sw-in
|
||||
net yMaxLim boss_plc.0.y-limit-pos-out => joint.1.pos-lim-sw-in
|
||||
net zMinLim boss_plc.0.z-limit-neg-out => joint.2.neg-lim-sw-in
|
||||
net zMaxLim boss_plc.0.z-limit-pos-out => joint.2.pos-lim-sw-in
|
||||
|
||||
# Amp enables/faults.
|
||||
#
|
||||
|
|
@ -280,10 +280,10 @@ net zEnable => boss_plc.0.z-amp-enable-in
|
|||
net aEnable => boss_plc.0.a-amp-enable-in
|
||||
|
||||
# Connect amp faults to motion controller.
|
||||
net xFault boss_plc.0.x-amp-fault-out => axis.0.amp-fault-in
|
||||
net yFault boss_plc.0.y-amp-fault-out => axis.1.amp-fault-in
|
||||
net zFault boss_plc.0.z-amp-fault-out => axis.2.amp-fault-in
|
||||
net aFault boss_plc.0.a-amp-fault-out => axis.3.amp-fault-in
|
||||
net xFault boss_plc.0.x-amp-fault-out => joint.0.amp-fault-in
|
||||
net yFault boss_plc.0.y-amp-fault-out => joint.1.amp-fault-in
|
||||
net zFault boss_plc.0.z-amp-fault-out => joint.2.amp-fault-in
|
||||
net aFault boss_plc.0.a-amp-fault-out => joint.3.amp-fault-in
|
||||
|
||||
# Spindle.
|
||||
#
|
||||
|
|
@ -361,22 +361,22 @@ net feedOverride motenc.0.enc-04-count => halui.feed-override.counts
|
|||
#net rapidOverride motenc.0.enc-06-count => halui.rapid-override.counts
|
||||
|
||||
# Set the jog mode so motion stops as soon as the wheel stops.
|
||||
setp axis.0.jog-vel-mode TRUE
|
||||
setp axis.1.jog-vel-mode TRUE
|
||||
setp axis.2.jog-vel-mode TRUE
|
||||
setp axis.3.jog-vel-mode TRUE
|
||||
setp joint.0.jog-vel-mode TRUE
|
||||
setp joint.1.jog-vel-mode TRUE
|
||||
setp joint.2.jog-vel-mode TRUE
|
||||
setp joint.3.jog-vel-mode TRUE
|
||||
|
||||
# Connect jog axis select to motion controller and PLC.
|
||||
net xJog motenc.0.in-40 => axis.0.jog-enable
|
||||
net yJog motenc.0.in-41 => axis.1.jog-enable
|
||||
net zJog motenc.0.in-42 => axis.2.jog-enable
|
||||
net aJog motenc.0.in-43 => axis.3.jog-enable
|
||||
net xJog motenc.0.in-40 => joint.0.jog-enable
|
||||
net yJog motenc.0.in-41 => joint.1.jog-enable
|
||||
net zJog motenc.0.in-42 => joint.2.jog-enable
|
||||
net aJog motenc.0.in-43 => joint.3.jog-enable
|
||||
net xJog => boss_plc.0.x-jog-en-in
|
||||
net yJog => boss_plc.0.y-jog-en-in
|
||||
net zJog => boss_plc.0.z-jog-en-in
|
||||
|
||||
# Connect jog wheel encoder.
|
||||
net jogCounts motenc.0.enc-05-count => axis.0.jog-counts axis.1.jog-counts axis.2.jog-counts axis.3.jog-counts
|
||||
net jogCounts motenc.0.enc-05-count => joint.0.jog-counts joint.1.jog-counts joint.2.jog-counts joint.3.jog-counts
|
||||
|
||||
# Connect jog scale selects to PLC.
|
||||
setp boss_plc.0.jog-scale-0 0.000001
|
||||
|
|
@ -387,4 +387,4 @@ net jogScaleSel1 motenc.0.in-37 => boss_plc.0.jog-sel-in-1
|
|||
net jogScaleSel2 motenc.0.in-38 => boss_plc.0.jog-sel-in-2
|
||||
|
||||
# Connect PLC jog scale output.
|
||||
net jogScale boss_plc.0.jog-scale-out => axis.0.jog-scale axis.1.jog-scale axis.2.jog-scale axis.3.jog-scale
|
||||
net jogScale boss_plc.0.jog-scale-out => joint.0.jog-scale joint.1.jog-scale joint.2.jog-scale joint.3.jog-scale
|
||||
|
|
|
|||
|
|
@ -18,34 +18,34 @@ addf motion-controller servo-thread
|
|||
|
||||
|
||||
# connect position commands from motion module to step generator
|
||||
net Xpos-cmd <= axis.0.motor-pos-cmd
|
||||
net Xpos-cmd <= joint.0.motor-pos-cmd
|
||||
net Xpos-cmd => stepgen.0.position-cmd
|
||||
net Ypos-cmd <= axis.1.motor-pos-cmd
|
||||
net Ypos-cmd <= joint.1.motor-pos-cmd
|
||||
net Ypos-cmd => stepgen.1.position-cmd
|
||||
net Zpos-cmd <= axis.2.motor-pos-cmd
|
||||
net Zpos-cmd <= joint.2.motor-pos-cmd
|
||||
net Zpos-cmd => stepgen.2.position-cmd
|
||||
net Apos-cmd <= axis.3.motor-pos-cmd
|
||||
net Apos-cmd <= joint.3.motor-pos-cmd
|
||||
net Apos-cmd => stepgen.3.position-cmd
|
||||
|
||||
# connect position feedback from step generators
|
||||
# to motion module
|
||||
net Xpos-fb <= stepgen.0.position-fb
|
||||
net Xpos-fb => axis.0.motor-pos-fb
|
||||
net Xpos-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb <= stepgen.1.position-fb
|
||||
net Ypos-fb => axis.1.motor-pos-fb
|
||||
net Ypos-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb <= stepgen.2.position-fb
|
||||
net Zpos-fb => axis.2.motor-pos-fb
|
||||
net Zpos-fb => joint.2.motor-pos-fb
|
||||
net Apos-fb <= stepgen.3.position-fb
|
||||
net Apos-fb => axis.3.motor-pos-fb
|
||||
net Apos-fb => joint.3.motor-pos-fb
|
||||
|
||||
# connect enable signals for step generators
|
||||
net Xen <= axis.0.amp-enable-out
|
||||
net Xen <= joint.0.amp-enable-out
|
||||
net Xen => stepgen.0.enable
|
||||
net Yen <= axis.1.amp-enable-out
|
||||
net Yen <= joint.1.amp-enable-out
|
||||
net Yen => stepgen.1.enable
|
||||
net Zen <= axis.2.amp-enable-out
|
||||
net Zen <= joint.2.amp-enable-out
|
||||
net Zen => stepgen.2.enable
|
||||
net Aen <= axis.3.amp-enable-out
|
||||
net Aen <= joint.3.amp-enable-out
|
||||
net Aen => stepgen.3.enable
|
||||
|
||||
# connect signals to step pulse generator outputs
|
||||
|
|
|
|||
|
|
@ -18,46 +18,46 @@ addf motion-controller servo-thread
|
|||
|
||||
|
||||
# connect position commands from motion module to step generator
|
||||
net Xpos-cmd <= axis.0.motor-pos-cmd
|
||||
net Xpos-cmd <= joint.0.motor-pos-cmd
|
||||
net Xpos-cmd => stepgen.0.position-cmd
|
||||
net Ypos-cmd <= axis.1.motor-pos-cmd
|
||||
net Ypos-cmd <= joint.1.motor-pos-cmd
|
||||
net Ypos-cmd => stepgen.1.position-cmd
|
||||
net Zpos-cmd <= axis.2.motor-pos-cmd
|
||||
net Zpos-cmd <= joint.2.motor-pos-cmd
|
||||
net Zpos-cmd => stepgen.2.position-cmd
|
||||
net Apos-cmd <= axis.3.motor-pos-cmd
|
||||
net Apos-cmd <= joint.3.motor-pos-cmd
|
||||
net Apos-cmd => stepgen.3.position-cmd
|
||||
net Bpos-cmd <= axis.4.motor-pos-cmd
|
||||
net Bpos-cmd <= joint.4.motor-pos-cmd
|
||||
net Bpos-cmd => stepgen.4.position-cmd
|
||||
net Cpos-cmd <= axis.5.motor-pos-cmd
|
||||
net Cpos-cmd <= joint.5.motor-pos-cmd
|
||||
net Cpos-cmd => stepgen.5.position-cmd
|
||||
|
||||
# connect position feedback from step generators
|
||||
# to motion module
|
||||
net Xpos-fb <= stepgen.0.position-fb
|
||||
net Xpos-fb => axis.0.motor-pos-fb
|
||||
net Xpos-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb <= stepgen.1.position-fb
|
||||
net Ypos-fb => axis.1.motor-pos-fb
|
||||
net Ypos-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb <= stepgen.2.position-fb
|
||||
net Zpos-fb => axis.2.motor-pos-fb
|
||||
net Zpos-fb => joint.2.motor-pos-fb
|
||||
net Apos-fb <= stepgen.3.position-fb
|
||||
net Apos-fb => axis.3.motor-pos-fb
|
||||
net Apos-fb => joint.3.motor-pos-fb
|
||||
net Bpos-fb <= stepgen.4.position-fb
|
||||
net Bpos-fb => axis.4.motor-pos-fb
|
||||
net Bpos-fb => joint.4.motor-pos-fb
|
||||
net Cpos-fb <= stepgen.5.position-fb
|
||||
net Cpos-fb => axis.5.motor-pos-fb
|
||||
net Cpos-fb => joint.5.motor-pos-fb
|
||||
|
||||
# connect enable signals for step generators
|
||||
net Xen <= axis.0.amp-enable-out
|
||||
net Xen <= joint.0.amp-enable-out
|
||||
net Xen => stepgen.0.enable
|
||||
net Yen <= axis.1.amp-enable-out
|
||||
net Yen <= joint.1.amp-enable-out
|
||||
net Yen => stepgen.1.enable
|
||||
net Zen <= axis.2.amp-enable-out
|
||||
net Zen <= joint.2.amp-enable-out
|
||||
net Zen => stepgen.2.enable
|
||||
net Aen <= axis.3.amp-enable-out
|
||||
net Aen <= joint.3.amp-enable-out
|
||||
net Aen => stepgen.3.enable
|
||||
net Ben <= axis.4.amp-enable-out
|
||||
net Ben <= joint.4.amp-enable-out
|
||||
net Ben => stepgen.4.enable
|
||||
net Cen <= axis.5.amp-enable-out
|
||||
net Cen <= joint.5.amp-enable-out
|
||||
net Cen => stepgen.5.enable
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ net spindle-on motion.spindle-on => parport.0.pin-09-out
|
|||
### to EMC's axis 0 home switch input pin
|
||||
###
|
||||
|
||||
# net Xhome parport.0.pin-10-in => axis.0.home-sw-in
|
||||
# net Xhome parport.0.pin-10-in => joint.0.home-sw-in
|
||||
|
||||
###
|
||||
### Shared home switches all on one parallel port pin?
|
||||
|
|
@ -57,16 +57,16 @@ net spindle-on motion.spindle-on => parport.0.pin-09-out
|
|||
###
|
||||
|
||||
# net homeswitches <= parport.0.pin-10-in
|
||||
# net homeswitches => axis.0.home-sw-in
|
||||
# net homeswitches => axis.1.home-sw-in
|
||||
# net homeswitches => axis.2.home-sw-in
|
||||
# net homeswitches => joint.0.home-sw-in
|
||||
# net homeswitches => joint.1.home-sw-in
|
||||
# net homeswitches => joint.2.home-sw-in
|
||||
|
||||
###
|
||||
### Sample separate limit switches on the X axis (axis 0)
|
||||
###
|
||||
|
||||
# net X-neg-limit parport.0.pin-11-in => axis.0.neg-lim-sw-in
|
||||
# net X-pos-limit parport.0.pin-12-in => axis.0.pos-lim-sw-in
|
||||
# net X-neg-limit parport.0.pin-11-in => joint.0.neg-lim-sw-in
|
||||
# net X-pos-limit parport.0.pin-12-in => joint.0.pos-lim-sw-in
|
||||
|
||||
###
|
||||
### Just like the shared home switches example, you can wire together
|
||||
|
|
@ -74,4 +74,4 @@ net spindle-on motion.spindle-on => parport.0.pin-09-out
|
|||
### you which switch/axis has faulted. Use caution when recovering from this.
|
||||
###
|
||||
|
||||
# net Xlimits parport.0.pin-13-in => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in
|
||||
# net Xlimits parport.0.pin-13-in => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in
|
||||
|
|
|
|||
|
|
@ -16,25 +16,25 @@ addf motion-controller servo-thread
|
|||
addf stepgen.update-freq servo-thread
|
||||
|
||||
# connect position commands from motion module to step generator
|
||||
net Xpos-cmd <= axis.0.motor-pos-cmd
|
||||
net Xpos-cmd <= joint.0.motor-pos-cmd
|
||||
net Xpos-cmd => stepgen.0.position-cmd
|
||||
net Ypos-cmd <= axis.1.motor-pos-cmd
|
||||
net Ypos-cmd <= joint.1.motor-pos-cmd
|
||||
net Ypos-cmd => stepgen.1.position-cmd
|
||||
net Zpos-cmd <= axis.2.motor-pos-cmd
|
||||
net Zpos-cmd <= joint.2.motor-pos-cmd
|
||||
net Zpos-cmd => stepgen.2.position-cmd
|
||||
net Apos-cmd <= axis.3.motor-pos-cmd
|
||||
net Apos-cmd <= joint.3.motor-pos-cmd
|
||||
net Apos-cmd => stepgen.3.position-cmd
|
||||
|
||||
# connect position feedback from step generators
|
||||
# to motion module
|
||||
net Xpos-fb <= stepgen.0.position-fb
|
||||
net Xpos-fb => axis.0.motor-pos-fb
|
||||
net Xpos-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb <= stepgen.1.position-fb
|
||||
net Ypos-fb => axis.1.motor-pos-fb
|
||||
net Ypos-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb <= stepgen.2.position-fb
|
||||
net Zpos-fb => axis.2.motor-pos-fb
|
||||
net Zpos-fb => joint.2.motor-pos-fb
|
||||
net Apos-fb <= stepgen.3.position-fb
|
||||
net Apos-fb => axis.3.motor-pos-fb
|
||||
net Apos-fb => joint.3.motor-pos-fb
|
||||
|
||||
# send the position commands thru differentiators to
|
||||
# generate velocity and accel signals
|
||||
|
|
@ -68,13 +68,13 @@ net Avel => ddt.7.in
|
|||
net Aacc <= ddt.7.out
|
||||
|
||||
# connect enable signals for step generators
|
||||
net Xen <= axis.0.amp-enable-out
|
||||
net Xen <= joint.0.amp-enable-out
|
||||
net Xen => stepgen.0.enable
|
||||
net Yen <= axis.1.amp-enable-out
|
||||
net Yen <= joint.1.amp-enable-out
|
||||
net Yen => stepgen.1.enable
|
||||
net Zen <= axis.2.amp-enable-out
|
||||
net Zen <= joint.2.amp-enable-out
|
||||
net Zen => stepgen.2.enable
|
||||
net Aen <= axis.3.amp-enable-out
|
||||
net Aen <= joint.3.amp-enable-out
|
||||
net Aen => stepgen.3.enable
|
||||
|
||||
# connect signals to step pulse generator outputs
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ net spindle-on motion.spindle-on => parport.0.pin-09-out
|
|||
### to EMC's axis 0 home switch input pin
|
||||
###
|
||||
|
||||
# net Xhome parport.0.pin-10-in => axis.0.home-sw-in
|
||||
# net Xhome parport.0.pin-10-in => joint.0.home-sw-in
|
||||
|
||||
###
|
||||
### Shared home switches all on one parallel port pin?
|
||||
|
|
@ -57,16 +57,16 @@ net spindle-on motion.spindle-on => parport.0.pin-09-out
|
|||
###
|
||||
|
||||
# net homeswitches <= parport.0.pin-10-in
|
||||
# net homeswitches => axis.0.home-sw-in
|
||||
# net homeswitches => axis.1.home-sw-in
|
||||
# net homeswitches => axis.2.home-sw-in
|
||||
# net homeswitches => joint.0.home-sw-in
|
||||
# net homeswitches => joint.1.home-sw-in
|
||||
# net homeswitches => joint.2.home-sw-in
|
||||
|
||||
###
|
||||
### Sample separate limit switches on the X axis (axis 0)
|
||||
###
|
||||
|
||||
# net X-neg-limit parport.0.pin-11-in => axis.0.neg-lim-sw-in
|
||||
# net X-pos-limit parport.0.pin-12-in => axis.0.pos-lim-sw-in
|
||||
# net X-neg-limit parport.0.pin-11-in => joint.0.neg-lim-sw-in
|
||||
# net X-pos-limit parport.0.pin-12-in => joint.0.pos-lim-sw-in
|
||||
|
||||
###
|
||||
### Just like the shared home switches example, you can wire together
|
||||
|
|
@ -74,4 +74,4 @@ net spindle-on motion.spindle-on => parport.0.pin-09-out
|
|||
### you which switch/axis has faulted. Use caution when recovering from this.
|
||||
###
|
||||
|
||||
# net Xlimits parport.0.pin-13-in => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in
|
||||
# net Xlimits parport.0.pin-13-in => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in
|
||||
|
|
|
|||
|
|
@ -79,28 +79,28 @@ setp hm2_5i20.0.stepgen.03.maxaccel [AXIS_3]STEPGEN_MAXACCEL
|
|||
setp hm2_5i20.0.stepgen.03.maxvel [AXIS_3]STEPGEN_MAXVEL
|
||||
|
||||
# connect position commands from motion module to step generator
|
||||
net Xpos-cmd axis.0.motor-pos-cmd => hm2_5i20.0.stepgen.00.position-cmd
|
||||
net Ypos-cmd axis.1.motor-pos-cmd => hm2_5i20.0.stepgen.01.position-cmd
|
||||
net Zpos-cmd axis.2.motor-pos-cmd => hm2_5i20.0.stepgen.02.position-cmd
|
||||
#net Apos-cmd axis.3.motor-pos-cmd => hm2_5i20.0.stepgen.03.position-cmd
|
||||
net Xpos-cmd joint.0.motor-pos-cmd => hm2_5i20.0.stepgen.00.position-cmd
|
||||
net Ypos-cmd joint.1.motor-pos-cmd => hm2_5i20.0.stepgen.01.position-cmd
|
||||
net Zpos-cmd joint.2.motor-pos-cmd => hm2_5i20.0.stepgen.02.position-cmd
|
||||
#net Apos-cmd joint.3.motor-pos-cmd => hm2_5i20.0.stepgen.03.position-cmd
|
||||
|
||||
# connect position feedback from step generators to motion module
|
||||
net Xpos-fb hm2_5i20.0.stepgen.00.position-fb => axis.0.motor-pos-fb
|
||||
net Ypos-fb hm2_5i20.0.stepgen.01.position-fb => axis.1.motor-pos-fb
|
||||
net Zpos-fb hm2_5i20.0.stepgen.02.position-fb => axis.2.motor-pos-fb
|
||||
#net Apos-fb hm2_5i20.0.stepgen.03.position-fb => axis.3.motor-pos-fb
|
||||
net Xpos-fb hm2_5i20.0.stepgen.00.position-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb hm2_5i20.0.stepgen.01.position-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb hm2_5i20.0.stepgen.02.position-fb => joint.2.motor-pos-fb
|
||||
#net Apos-fb hm2_5i20.0.stepgen.03.position-fb => joint.3.motor-pos-fb
|
||||
|
||||
# connect enable signals for step generators
|
||||
net Xen axis.0.amp-enable-out => hm2_5i20.0.stepgen.00.enable
|
||||
net Yen axis.1.amp-enable-out => hm2_5i20.0.stepgen.01.enable
|
||||
net Zen axis.2.amp-enable-out => hm2_5i20.0.stepgen.02.enable
|
||||
#net Aen axis.3.amp-enable-out => hm2_5i20.0.stepgen.03.enable
|
||||
net Xen joint.0.amp-enable-out => hm2_5i20.0.stepgen.00.enable
|
||||
net Yen joint.1.amp-enable-out => hm2_5i20.0.stepgen.01.enable
|
||||
net Zen joint.2.amp-enable-out => hm2_5i20.0.stepgen.02.enable
|
||||
#net Aen joint.3.amp-enable-out => hm2_5i20.0.stepgen.03.enable
|
||||
|
||||
# enable velocity mode jogging
|
||||
net Enable axis.0.jog-vel-mode
|
||||
net Enable axis.1.jog-vel-mode
|
||||
net Enable axis.2.jog-vel-mode
|
||||
#net Enable axis.3.jog-vel-mode
|
||||
net Enable joint.0.jog-vel-mode
|
||||
net Enable joint.1.jog-vel-mode
|
||||
net Enable joint.2.jog-vel-mode
|
||||
#net Enable joint.3.jog-vel-mode
|
||||
|
||||
# enable the PWM generator
|
||||
net Enable => hm2_5i20.0.pwmgen.00.enable
|
||||
|
|
@ -118,17 +118,17 @@ net estop-enable hm2_5i20.0.gpio.037.in => iocontrol.0.emc-enable-in
|
|||
net machine-on hm2_5i20.0.gpio.039.in_not => halui.machine.on
|
||||
|
||||
#connect limit switches to limit inputs
|
||||
net Xmax hm2_5i20.0.gpio.024.in_not => axis.0.pos-lim-sw-in
|
||||
net Xmin hm2_5i20.0.gpio.026.in_not => axis.0.neg-lim-sw-in
|
||||
net Ymax hm2_5i20.0.gpio.028.in_not => axis.1.pos-lim-sw-in
|
||||
net Ymin hm2_5i20.0.gpio.030.in_not => axis.1.neg-lim-sw-in
|
||||
net Zmax hm2_5i20.0.gpio.032.in_not => axis.2.pos-lim-sw-in
|
||||
net Zmin hm2_5i20.0.gpio.034.in_not => axis.2.neg-lim-sw-in
|
||||
net Xmax hm2_5i20.0.gpio.024.in_not => joint.0.pos-lim-sw-in
|
||||
net Xmin hm2_5i20.0.gpio.026.in_not => joint.0.neg-lim-sw-in
|
||||
net Ymax hm2_5i20.0.gpio.028.in_not => joint.1.pos-lim-sw-in
|
||||
net Ymin hm2_5i20.0.gpio.030.in_not => joint.1.neg-lim-sw-in
|
||||
net Zmax hm2_5i20.0.gpio.032.in_not => joint.2.pos-lim-sw-in
|
||||
net Zmin hm2_5i20.0.gpio.034.in_not => joint.2.neg-lim-sw-in
|
||||
|
||||
#connect positive limit signals to home inputs
|
||||
net Xmax => axis.0.home-sw-in
|
||||
net Ymax => axis.1.home-sw-in
|
||||
net Zmax => axis.2.home-sw-in
|
||||
net Xmax => joint.0.home-sw-in
|
||||
net Ymax => joint.1.home-sw-in
|
||||
net Zmax => joint.2.home-sw-in
|
||||
|
||||
# Spindle Contactor Enable
|
||||
setp hm2_5i20.0.gpio.041.is_output TRUE
|
||||
|
|
|
|||
|
|
@ -74,10 +74,10 @@ setp stepgen.0.stepspace 0
|
|||
setp stepgen.0.dirhold 35000
|
||||
setp stepgen.0.dirsetup 16000
|
||||
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 xenable axis.0.amp-enable-out stepgen.0.enable
|
||||
net all-home axis.0.home-sw-in
|
||||
net xpos-cmd joint.0.motor-pos-cmd stepgen.0.position-cmd
|
||||
net xpos-fb stepgen.0.position-fb joint.0.motor-pos-fb
|
||||
net xenable joint.0.amp-enable-out stepgen.0.enable
|
||||
net all-home joint.0.home-sw-in
|
||||
|
||||
setp stepgen.1.position-scale [AXIS_1]SCALE
|
||||
setp stepgen.1.steplen 1
|
||||
|
|
@ -85,10 +85,10 @@ setp stepgen.1.stepspace 0
|
|||
setp stepgen.1.dirhold 35000
|
||||
setp stepgen.1.dirsetup 16000
|
||||
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 yenable axis.1.amp-enable-out stepgen.1.enable
|
||||
net all-home axis.1.home-sw-in
|
||||
net ypos-cmd joint.1.motor-pos-cmd stepgen.1.position-cmd
|
||||
net ypos-fb stepgen.1.position-fb joint.1.motor-pos-fb
|
||||
net yenable joint.1.amp-enable-out stepgen.1.enable
|
||||
net all-home joint.1.home-sw-in
|
||||
|
||||
setp stepgen.2.position-scale [AXIS_2]SCALE
|
||||
setp stepgen.2.steplen 1
|
||||
|
|
@ -96,10 +96,10 @@ setp stepgen.2.stepspace 0
|
|||
setp stepgen.2.dirhold 35000
|
||||
setp stepgen.2.dirsetup 16000
|
||||
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
|
||||
net zpos-cmd axis.2.motor-pos-cmd stepgen.2.position-cmd
|
||||
net zpos-fb stepgen.2.position-fb axis.2.motor-pos-fb
|
||||
net zenable axis.2.amp-enable-out stepgen.2.enable
|
||||
net all-home axis.2.home-sw-in
|
||||
net zpos-cmd joint.2.motor-pos-cmd stepgen.2.position-cmd
|
||||
net zpos-fb stepgen.2.position-fb joint.2.motor-pos-fb
|
||||
net zenable joint.2.amp-enable-out stepgen.2.enable
|
||||
net all-home joint.2.home-sw-in
|
||||
|
||||
setp stepgen.3.position-scale [AXIS_3]SCALE
|
||||
setp stepgen.3.steplen 1
|
||||
|
|
@ -107,18 +107,18 @@ setp stepgen.3.stepspace 0
|
|||
setp stepgen.3.dirhold 35000
|
||||
setp stepgen.3.dirsetup 16000
|
||||
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
|
||||
net apos-cmd axis.3.motor-pos-cmd stepgen.3.position-cmd
|
||||
net apos-fb stepgen.3.position-fb axis.3.motor-pos-fb
|
||||
net aenable axis.3.amp-enable-out stepgen.3.enable
|
||||
net apos-cmd joint.3.motor-pos-cmd stepgen.3.position-cmd
|
||||
net apos-fb stepgen.3.position-fb joint.3.motor-pos-fb
|
||||
net aenable joint.3.amp-enable-out stepgen.3.enable
|
||||
|
||||
newsig false bit
|
||||
sets false FALSE
|
||||
net xhoming axis.0.homing match8.0.a0
|
||||
net yhoming axis.1.homing match8.0.a1
|
||||
net zhoming axis.2.homing match8.0.a2
|
||||
net xhoming joint.0.homing match8.0.a0
|
||||
net yhoming joint.1.homing match8.0.a1
|
||||
net zhoming joint.2.homing match8.0.a2
|
||||
net false match8.0.b0 match8.0.b1 match8.0.b2
|
||||
net all-home match8.0.in
|
||||
net limit match8.0.out axis.0.neg-lim-sw-in
|
||||
net limit match8.0.out joint.0.neg-lim-sw-in
|
||||
|
||||
# These loopbacks are usually disconnected by a postgui halfile
|
||||
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
|
||||
|
|
|
|||
|
|
@ -19,17 +19,17 @@ addf motion-command-handler servo-thread
|
|||
addf motion-controller servo-thread
|
||||
addf stepgen.update-freq servo-thread
|
||||
|
||||
net Xpos-cmd axis.0.motor-pos-cmd stepgen.0.position-cmd
|
||||
net Ypos-cmd axis.1.motor-pos-cmd stepgen.1.position-cmd
|
||||
net Zpos-cmd axis.2.motor-pos-cmd stepgen.2.position-cmd
|
||||
net Xpos-cmd joint.0.motor-pos-cmd stepgen.0.position-cmd
|
||||
net Ypos-cmd joint.1.motor-pos-cmd stepgen.1.position-cmd
|
||||
net Zpos-cmd joint.2.motor-pos-cmd stepgen.2.position-cmd
|
||||
|
||||
net Xpos-fb stepgen.0.position-fb axis.0.motor-pos-fb
|
||||
net Ypos-fb stepgen.1.position-fb axis.1.motor-pos-fb
|
||||
net Zpos-fb stepgen.2.position-fb axis.2.motor-pos-fb
|
||||
net Xpos-fb stepgen.0.position-fb joint.0.motor-pos-fb
|
||||
net Ypos-fb stepgen.1.position-fb joint.1.motor-pos-fb
|
||||
net Zpos-fb stepgen.2.position-fb joint.2.motor-pos-fb
|
||||
|
||||
net Xen <= axis.0.amp-enable-out stepgen.0.enable
|
||||
net Yen <= axis.1.amp-enable-out stepgen.1.enable
|
||||
net Zen <= axis.2.amp-enable-out stepgen.2.enable
|
||||
net Xen <= joint.0.amp-enable-out stepgen.0.enable
|
||||
net Yen <= joint.1.amp-enable-out stepgen.1.enable
|
||||
net Zen <= joint.2.amp-enable-out stepgen.2.enable
|
||||
|
||||
net Xstep stepgen.0.step parport.0.pin-03-out
|
||||
net Xdir stepgen.0.dir parport.0.pin-02-out
|
||||
|
|
@ -67,11 +67,11 @@ net tool-prepare-loopback iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
|||
|
||||
newsig false bit
|
||||
sets false FALSE
|
||||
net xhoming axis.0.homing match8.0.a0
|
||||
net yhoming axis.1.homing match8.0.a1
|
||||
net zhoming axis.2.homing match8.0.a2
|
||||
net xhoming joint.0.homing match8.0.a0
|
||||
net yhoming joint.1.homing match8.0.a1
|
||||
net zhoming joint.2.homing match8.0.a2
|
||||
net false match8.0.b0 match8.0.b1 match8.0.b2
|
||||
net home-raw parport.0.pin-15-in-not debounce.0.0.in
|
||||
net home-filtered debounce.0.0.out axis.0.home-sw-in axis.1.home-sw-in axis.2.home-sw-in match8.0.in
|
||||
net limit match8.0.out axis.0.neg-lim-sw-in
|
||||
net home-filtered debounce.0.0.out joint.0.home-sw-in joint.1.home-sw-in joint.2.home-sw-in match8.0.in
|
||||
net limit match8.0.out joint.0.neg-lim-sw-in
|
||||
|
||||
|
|
|
|||
|
|
@ -19,20 +19,20 @@ addf motion-command-handler servo-thread
|
|||
addf motion-controller servo-thread
|
||||
addf stepgen.update-freq servo-thread
|
||||
|
||||
net Xpos-cmd axis.0.motor-pos-cmd stepgen.0.position-cmd
|
||||
net Ypos-cmd axis.1.motor-pos-cmd stepgen.1.position-cmd
|
||||
net Zpos-cmd axis.2.motor-pos-cmd stepgen.2.position-cmd
|
||||
net Apos-cmd axis.3.motor-pos-cmd stepgen.3.position-cmd
|
||||
net Xpos-cmd joint.0.motor-pos-cmd stepgen.0.position-cmd
|
||||
net Ypos-cmd joint.1.motor-pos-cmd stepgen.1.position-cmd
|
||||
net Zpos-cmd joint.2.motor-pos-cmd stepgen.2.position-cmd
|
||||
net Apos-cmd joint.3.motor-pos-cmd stepgen.3.position-cmd
|
||||
|
||||
net Xpos-fb stepgen.0.position-fb axis.0.motor-pos-fb
|
||||
net Ypos-fb stepgen.1.position-fb axis.1.motor-pos-fb
|
||||
net Zpos-fb stepgen.2.position-fb axis.2.motor-pos-fb
|
||||
net Apos-fb stepgen.3.position-fb axis.3.motor-pos-fb
|
||||
net Xpos-fb stepgen.0.position-fb joint.0.motor-pos-fb
|
||||
net Ypos-fb stepgen.1.position-fb joint.1.motor-pos-fb
|
||||
net Zpos-fb stepgen.2.position-fb joint.2.motor-pos-fb
|
||||
net Apos-fb stepgen.3.position-fb joint.3.motor-pos-fb
|
||||
|
||||
net Xen <= axis.0.amp-enable-out stepgen.0.enable
|
||||
net Yen <= axis.1.amp-enable-out stepgen.1.enable
|
||||
net Zen <= axis.2.amp-enable-out stepgen.2.enable
|
||||
net Aen <= axis.3.amp-enable-out stepgen.3.enable
|
||||
net Xen <= joint.0.amp-enable-out stepgen.0.enable
|
||||
net Yen <= joint.1.amp-enable-out stepgen.1.enable
|
||||
net Zen <= joint.2.amp-enable-out stepgen.2.enable
|
||||
net Aen <= joint.3.amp-enable-out stepgen.3.enable
|
||||
|
||||
net Xstep stepgen.0.step parport.0.pin-03-out
|
||||
net Xdir stepgen.0.dir parport.0.pin-02-out
|
||||
|
|
@ -75,12 +75,12 @@ net tool-prepare-loopback iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
|||
|
||||
newsig false bit
|
||||
sets false FALSE
|
||||
net xhoming axis.0.homing match8.0.a0
|
||||
net yhoming axis.1.homing match8.0.a1
|
||||
net zhoming axis.2.homing match8.0.a2
|
||||
net ahoming axis.3.homing match8.0.a3
|
||||
net xhoming joint.0.homing match8.0.a0
|
||||
net yhoming joint.1.homing match8.0.a1
|
||||
net zhoming joint.2.homing match8.0.a2
|
||||
net ahoming joint.3.homing match8.0.a3
|
||||
net false match8.0.b0 match8.0.b1 match8.0.b2 match8.0.b3
|
||||
net home-raw parport.0.pin-15-in-not debounce.0.0.in
|
||||
net home-filtered debounce.0.0.out axis.0.home-sw-in axis.1.home-sw-in axis.2.home-sw-in axis.3.home-sw-in match8.0.in
|
||||
net limit match8.0.out axis.0.neg-lim-sw-in
|
||||
net home-filtered debounce.0.0.out joint.0.home-sw-in joint.1.home-sw-in joint.2.home-sw-in joint.3.home-sw-in match8.0.in
|
||||
net limit match8.0.out joint.0.neg-lim-sw-in
|
||||
|
||||
|
|
|
|||
|
|
@ -71,28 +71,28 @@ setp hm2_5i20.0.stepgen.03.maxaccel [AXIS_3]STEPGEN_MAXACCEL
|
|||
setp hm2_5i20.0.stepgen.03.maxvel [AXIS_3]STEPGEN_MAXVEL
|
||||
|
||||
# connect position commands from motion module to step generator
|
||||
net Xpos-cmd axis.0.motor-pos-cmd => hm2_5i20.0.stepgen.00.position-cmd
|
||||
net Ypos-cmd axis.1.motor-pos-cmd => hm2_5i20.0.stepgen.01.position-cmd
|
||||
net Zpos-cmd axis.2.motor-pos-cmd => hm2_5i20.0.stepgen.02.position-cmd
|
||||
#net Apos-cmd axis.3.motor-pos-cmd => hm2_5i20.0.stepgen.03.position-cmd
|
||||
net Xpos-cmd joint.0.motor-pos-cmd => hm2_5i20.0.stepgen.00.position-cmd
|
||||
net Ypos-cmd joint.1.motor-pos-cmd => hm2_5i20.0.stepgen.01.position-cmd
|
||||
net Zpos-cmd joint.2.motor-pos-cmd => hm2_5i20.0.stepgen.02.position-cmd
|
||||
#net Apos-cmd joint.3.motor-pos-cmd => hm2_5i20.0.stepgen.03.position-cmd
|
||||
|
||||
# connect position feedback from step generators to motion module
|
||||
net Xpos-fb hm2_5i20.0.stepgen.00.position-fb => axis.0.motor-pos-fb
|
||||
net Ypos-fb hm2_5i20.0.stepgen.01.position-fb => axis.1.motor-pos-fb
|
||||
net Zpos-fb hm2_5i20.0.stepgen.02.position-fb => axis.2.motor-pos-fb
|
||||
#net Apos-fb hm2_5i20.0.stepgen.03.position-fb => axis.3.motor-pos-fb
|
||||
net Xpos-fb hm2_5i20.0.stepgen.00.position-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb hm2_5i20.0.stepgen.01.position-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb hm2_5i20.0.stepgen.02.position-fb => joint.2.motor-pos-fb
|
||||
#net Apos-fb hm2_5i20.0.stepgen.03.position-fb => joint.3.motor-pos-fb
|
||||
|
||||
# connect enable signals for step generators
|
||||
net Xen axis.0.amp-enable-out => hm2_5i20.0.stepgen.00.enable
|
||||
net Yen axis.1.amp-enable-out => hm2_5i20.0.stepgen.01.enable
|
||||
net Zen axis.2.amp-enable-out => hm2_5i20.0.stepgen.02.enable
|
||||
#net Aen axis.3.amp-enable-out => hm2_5i20.0.stepgen.03.enable
|
||||
net Xen joint.0.amp-enable-out => hm2_5i20.0.stepgen.00.enable
|
||||
net Yen joint.1.amp-enable-out => hm2_5i20.0.stepgen.01.enable
|
||||
net Zen joint.2.amp-enable-out => hm2_5i20.0.stepgen.02.enable
|
||||
#net Aen joint.3.amp-enable-out => hm2_5i20.0.stepgen.03.enable
|
||||
|
||||
# enable velocity mode jogging
|
||||
net Enable axis.0.jog-vel-mode
|
||||
net Enable axis.1.jog-vel-mode
|
||||
net Enable axis.2.jog-vel-mode
|
||||
#net Enable axis.3.jog-vel-mode
|
||||
net Enable joint.0.jog-vel-mode
|
||||
net Enable joint.1.jog-vel-mode
|
||||
net Enable joint.2.jog-vel-mode
|
||||
#net Enable joint.3.jog-vel-mode
|
||||
|
||||
# enable the PWM generator
|
||||
net Enable => hm2_5i20.0.pwmgen.00.enable
|
||||
|
|
@ -110,17 +110,17 @@ net estop-enable hm2_5i20.0.gpio.037.in => iocontrol.0.emc-enable-in
|
|||
net machine-on hm2_5i20.0.gpio.039.in_not => halui.machine.on
|
||||
|
||||
#connect limit switches to limit inputs
|
||||
net Xmax hm2_5i20.0.gpio.032.in => axis.0.pos-lim-sw-in
|
||||
net Xmin hm2_5i20.0.gpio.034.in => axis.0.neg-lim-sw-in
|
||||
net Ymax hm2_5i20.0.gpio.028.in => axis.1.pos-lim-sw-in
|
||||
net Ymin hm2_5i20.0.gpio.030.in => axis.1.neg-lim-sw-in
|
||||
net Zmax hm2_5i20.0.gpio.024.in => axis.2.pos-lim-sw-in
|
||||
net Zmin hm2_5i20.0.gpio.026.in => axis.2.neg-lim-sw-in
|
||||
net Xmax hm2_5i20.0.gpio.032.in => joint.0.pos-lim-sw-in
|
||||
net Xmin hm2_5i20.0.gpio.034.in => joint.0.neg-lim-sw-in
|
||||
net Ymax hm2_5i20.0.gpio.028.in => joint.1.pos-lim-sw-in
|
||||
net Ymin hm2_5i20.0.gpio.030.in => joint.1.neg-lim-sw-in
|
||||
net Zmax hm2_5i20.0.gpio.024.in => joint.2.pos-lim-sw-in
|
||||
net Zmin hm2_5i20.0.gpio.026.in => joint.2.neg-lim-sw-in
|
||||
|
||||
#connect positive limit signals to home inputs
|
||||
net Xmax => axis.0.home-sw-in
|
||||
net Ymax => axis.1.home-sw-in
|
||||
net Zmax => axis.2.home-sw-in
|
||||
net Xmax => joint.0.home-sw-in
|
||||
net Ymax => joint.1.home-sw-in
|
||||
net Zmax => joint.2.home-sw-in
|
||||
|
||||
# Spindle Contactor Enable
|
||||
setp hm2_5i20.0.gpio.041.is_output TRUE
|
||||
|
|
@ -135,7 +135,7 @@ net ACOK hm2_5i20.0.gpio.035.in_not
|
|||
# A Axis Home - On Sieg machines there is no VFD fault signal,
|
||||
# it is used for the A axis home sensor on 4 axis machines
|
||||
#net VFDOK hm2_5i20.0.gpio.031.in_not
|
||||
#net AHOME hm2_5i20.0.gpio.031.in axis.3.home-sw-in
|
||||
#net AHOME hm2_5i20.0.gpio.031.in joint.3.home-sw-in
|
||||
# Spindle Contactor - False when spindle contactor is energized
|
||||
net SOFF hm2_5i20.0.gpio.033.in halui.program.pause motion.feed-hold
|
||||
|
||||
|
|
|
|||
|
|
@ -71,28 +71,28 @@ setp hm2_5i20.0.stepgen.03.maxaccel [AXIS_3]STEPGEN_MAXACCEL
|
|||
setp hm2_5i20.0.stepgen.03.maxvel [AXIS_3]STEPGEN_MAXVEL
|
||||
|
||||
# connect position commands from motion module to step generator
|
||||
net Xpos-cmd axis.0.motor-pos-cmd => hm2_5i20.0.stepgen.00.position-cmd
|
||||
net Ypos-cmd axis.1.motor-pos-cmd => hm2_5i20.0.stepgen.01.position-cmd
|
||||
net Zpos-cmd axis.2.motor-pos-cmd => hm2_5i20.0.stepgen.02.position-cmd
|
||||
net Apos-cmd axis.3.motor-pos-cmd => hm2_5i20.0.stepgen.03.position-cmd
|
||||
net Xpos-cmd joint.0.motor-pos-cmd => hm2_5i20.0.stepgen.00.position-cmd
|
||||
net Ypos-cmd joint.1.motor-pos-cmd => hm2_5i20.0.stepgen.01.position-cmd
|
||||
net Zpos-cmd joint.2.motor-pos-cmd => hm2_5i20.0.stepgen.02.position-cmd
|
||||
net Apos-cmd joint.3.motor-pos-cmd => hm2_5i20.0.stepgen.03.position-cmd
|
||||
|
||||
# connect position feedback from step generators to motion module
|
||||
net Xpos-fb hm2_5i20.0.stepgen.00.position-fb => axis.0.motor-pos-fb
|
||||
net Ypos-fb hm2_5i20.0.stepgen.01.position-fb => axis.1.motor-pos-fb
|
||||
net Zpos-fb hm2_5i20.0.stepgen.02.position-fb => axis.2.motor-pos-fb
|
||||
net Apos-fb hm2_5i20.0.stepgen.03.position-fb => axis.3.motor-pos-fb
|
||||
net Xpos-fb hm2_5i20.0.stepgen.00.position-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb hm2_5i20.0.stepgen.01.position-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb hm2_5i20.0.stepgen.02.position-fb => joint.2.motor-pos-fb
|
||||
net Apos-fb hm2_5i20.0.stepgen.03.position-fb => joint.3.motor-pos-fb
|
||||
|
||||
# connect enable signals for step generators
|
||||
net Xen axis.0.amp-enable-out => hm2_5i20.0.stepgen.00.enable
|
||||
net Yen axis.1.amp-enable-out => hm2_5i20.0.stepgen.01.enable
|
||||
net Zen axis.2.amp-enable-out => hm2_5i20.0.stepgen.02.enable
|
||||
net Aen axis.3.amp-enable-out => hm2_5i20.0.stepgen.03.enable
|
||||
net Xen joint.0.amp-enable-out => hm2_5i20.0.stepgen.00.enable
|
||||
net Yen joint.1.amp-enable-out => hm2_5i20.0.stepgen.01.enable
|
||||
net Zen joint.2.amp-enable-out => hm2_5i20.0.stepgen.02.enable
|
||||
net Aen joint.3.amp-enable-out => hm2_5i20.0.stepgen.03.enable
|
||||
|
||||
# enable velocity mode jogging
|
||||
net Enable axis.0.jog-vel-mode
|
||||
net Enable axis.1.jog-vel-mode
|
||||
net Enable axis.2.jog-vel-mode
|
||||
net Enable axis.3.jog-vel-mode
|
||||
net Enable joint.0.jog-vel-mode
|
||||
net Enable joint.1.jog-vel-mode
|
||||
net Enable joint.2.jog-vel-mode
|
||||
net Enable joint.3.jog-vel-mode
|
||||
|
||||
# enable the PWM generator
|
||||
net Enable => hm2_5i20.0.pwmgen.00.enable
|
||||
|
|
@ -110,17 +110,17 @@ net estop-enable hm2_5i20.0.gpio.037.in => iocontrol.0.emc-enable-in
|
|||
net machine-on hm2_5i20.0.gpio.039.in_not => halui.machine.on
|
||||
|
||||
#connect limit switches to limit inputs
|
||||
net Xmax hm2_5i20.0.gpio.032.in => axis.0.pos-lim-sw-in
|
||||
net Xmin hm2_5i20.0.gpio.034.in => axis.0.neg-lim-sw-in
|
||||
net Ymax hm2_5i20.0.gpio.028.in => axis.1.pos-lim-sw-in
|
||||
net Ymin hm2_5i20.0.gpio.030.in => axis.1.neg-lim-sw-in
|
||||
net Zmax hm2_5i20.0.gpio.024.in => axis.2.pos-lim-sw-in
|
||||
net Zmin hm2_5i20.0.gpio.026.in => axis.2.neg-lim-sw-in
|
||||
net Xmax hm2_5i20.0.gpio.032.in => joint.0.pos-lim-sw-in
|
||||
net Xmin hm2_5i20.0.gpio.034.in => joint.0.neg-lim-sw-in
|
||||
net Ymax hm2_5i20.0.gpio.028.in => joint.1.pos-lim-sw-in
|
||||
net Ymin hm2_5i20.0.gpio.030.in => joint.1.neg-lim-sw-in
|
||||
net Zmax hm2_5i20.0.gpio.024.in => joint.2.pos-lim-sw-in
|
||||
net Zmin hm2_5i20.0.gpio.026.in => joint.2.neg-lim-sw-in
|
||||
|
||||
#connect positive limit signals to home inputs
|
||||
net Xmax => axis.0.home-sw-in
|
||||
net Ymax => axis.1.home-sw-in
|
||||
net Zmax => axis.2.home-sw-in
|
||||
net Xmax => joint.0.home-sw-in
|
||||
net Ymax => joint.1.home-sw-in
|
||||
net Zmax => joint.2.home-sw-in
|
||||
|
||||
# Spindle Contactor Enable
|
||||
setp hm2_5i20.0.gpio.041.is_output TRUE
|
||||
|
|
@ -135,7 +135,7 @@ net ACOK hm2_5i20.0.gpio.035.in_not
|
|||
# A Axis Home - On Sieg machines there is no VFD fault signal,
|
||||
# it is used for the A axis home sensor on 4 axis machines
|
||||
#net VFDOK hm2_5i20.0.gpio.031.in_not
|
||||
net AHOME hm2_5i20.0.gpio.031.in axis.3.home-sw-in
|
||||
net AHOME hm2_5i20.0.gpio.031.in joint.3.home-sw-in
|
||||
# Spindle Contactor - False when spindle contactor is energized
|
||||
net SOFF hm2_5i20.0.gpio.033.in halui.program.pause motion.feed-hold
|
||||
|
||||
|
|
|
|||
|
|
@ -70,10 +70,10 @@ setp stepgen.0.stepspace 0
|
|||
setp stepgen.0.dirhold 35000
|
||||
setp stepgen.0.dirsetup 16000
|
||||
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 xenable axis.0.amp-enable-out stepgen.0.enable
|
||||
net all-home axis.0.home-sw-in
|
||||
net xpos-cmd joint.0.motor-pos-cmd stepgen.0.position-cmd
|
||||
net xpos-fb stepgen.0.position-fb joint.0.motor-pos-fb
|
||||
net xenable joint.0.amp-enable-out stepgen.0.enable
|
||||
net all-home joint.0.home-sw-in
|
||||
|
||||
setp stepgen.1.position-scale [AXIS_1]SCALE
|
||||
setp stepgen.1.steplen 1
|
||||
|
|
@ -81,10 +81,10 @@ setp stepgen.1.stepspace 0
|
|||
setp stepgen.1.dirhold 35000
|
||||
setp stepgen.1.dirsetup 16000
|
||||
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 yenable axis.1.amp-enable-out stepgen.1.enable
|
||||
net all-home axis.1.home-sw-in
|
||||
net ypos-cmd joint.1.motor-pos-cmd stepgen.1.position-cmd
|
||||
net ypos-fb stepgen.1.position-fb joint.1.motor-pos-fb
|
||||
net yenable joint.1.amp-enable-out stepgen.1.enable
|
||||
net all-home joint.1.home-sw-in
|
||||
|
||||
setp stepgen.2.position-scale [AXIS_2]SCALE
|
||||
setp stepgen.2.steplen 1
|
||||
|
|
@ -92,10 +92,10 @@ setp stepgen.2.stepspace 0
|
|||
setp stepgen.2.dirhold 35000
|
||||
setp stepgen.2.dirsetup 16000
|
||||
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
|
||||
net zpos-cmd axis.2.motor-pos-cmd stepgen.2.position-cmd
|
||||
net zpos-fb stepgen.2.position-fb axis.2.motor-pos-fb
|
||||
net zenable axis.2.amp-enable-out stepgen.2.enable
|
||||
net all-home axis.2.home-sw-in
|
||||
net zpos-cmd joint.2.motor-pos-cmd stepgen.2.position-cmd
|
||||
net zpos-fb stepgen.2.position-fb joint.2.motor-pos-fb
|
||||
net zenable joint.2.amp-enable-out stepgen.2.enable
|
||||
net all-home joint.2.home-sw-in
|
||||
|
||||
setp stepgen.3.position-scale [AXIS_3]SCALE
|
||||
setp stepgen.3.steplen 1
|
||||
|
|
@ -103,18 +103,18 @@ setp stepgen.3.stepspace 0
|
|||
setp stepgen.3.dirhold 35000
|
||||
setp stepgen.3.dirsetup 16000
|
||||
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
|
||||
net apos-cmd axis.3.motor-pos-cmd stepgen.3.position-cmd
|
||||
net apos-fb stepgen.3.position-fb axis.3.motor-pos-fb
|
||||
net aenable axis.3.amp-enable-out stepgen.3.enable
|
||||
net apos-cmd joint.3.motor-pos-cmd stepgen.3.position-cmd
|
||||
net apos-fb stepgen.3.position-fb joint.3.motor-pos-fb
|
||||
net aenable joint.3.amp-enable-out stepgen.3.enable
|
||||
|
||||
newsig false bit
|
||||
sets false FALSE
|
||||
net xhoming axis.0.homing match8.0.a0
|
||||
net yhoming axis.1.homing match8.0.a1
|
||||
net zhoming axis.2.homing match8.0.a2
|
||||
net xhoming joint.0.homing match8.0.a0
|
||||
net yhoming joint.1.homing match8.0.a1
|
||||
net zhoming joint.2.homing match8.0.a2
|
||||
net false match8.0.b0 match8.0.b1 match8.0.b2
|
||||
net all-home match8.0.in
|
||||
net limit match8.0.out axis.0.neg-lim-sw-in
|
||||
net limit match8.0.out joint.0.neg-lim-sw-in
|
||||
|
||||
# These loopbacks are usually disconnected by a postgui halfile
|
||||
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
|
||||
|
|
|
|||
|
|
@ -71,20 +71,20 @@ setp hm2_5i20.0.stepgen.01.maxaccel [AXIS_2]STEPGEN_MAXACCEL
|
|||
setp hm2_5i20.0.stepgen.01.maxvel [AXIS_2]STEPGEN_MAXVEL
|
||||
|
||||
# connect position commands from motion module to step generator
|
||||
net Xpos-cmd axis.0.motor-pos-cmd => hm2_5i20.0.stepgen.00.position-cmd
|
||||
net Zpos-cmd axis.2.motor-pos-cmd => hm2_5i20.0.stepgen.01.position-cmd
|
||||
net Xpos-cmd joint.0.motor-pos-cmd => hm2_5i20.0.stepgen.00.position-cmd
|
||||
net Zpos-cmd joint.2.motor-pos-cmd => hm2_5i20.0.stepgen.01.position-cmd
|
||||
|
||||
# connect position feedback from step generators to motion module
|
||||
net Xpos-fb hm2_5i20.0.stepgen.00.position-fb => axis.0.motor-pos-fb
|
||||
net Zpos-fb hm2_5i20.0.stepgen.01.position-fb => axis.2.motor-pos-fb
|
||||
net Xpos-fb hm2_5i20.0.stepgen.00.position-fb => joint.0.motor-pos-fb
|
||||
net Zpos-fb hm2_5i20.0.stepgen.01.position-fb => joint.2.motor-pos-fb
|
||||
|
||||
# connect enable signals for step generators
|
||||
net Xen axis.0.amp-enable-out => hm2_5i20.0.stepgen.00.enable
|
||||
net Zen axis.2.amp-enable-out => hm2_5i20.0.stepgen.01.enable
|
||||
net Xen joint.0.amp-enable-out => hm2_5i20.0.stepgen.00.enable
|
||||
net Zen joint.2.amp-enable-out => hm2_5i20.0.stepgen.01.enable
|
||||
|
||||
# enable velocity mode jogging
|
||||
net Enable axis.0.jog-vel-mode
|
||||
net Enable axis.2.jog-vel-mode
|
||||
net Enable joint.0.jog-vel-mode
|
||||
net Enable joint.2.jog-vel-mode
|
||||
|
||||
# enable the PWM generator
|
||||
net Enable => hm2_5i20.0.pwmgen.00.enable
|
||||
|
|
@ -102,14 +102,14 @@ net estop-enable hm2_5i20.0.gpio.037.in => iocontrol.0.emc-enable-in
|
|||
net machine-on hm2_5i20.0.gpio.039.in_not => halui.machine.on
|
||||
|
||||
#connect limit switches to limit inputs
|
||||
net Xmax hm2_5i20.0.gpio.024.in => axis.0.pos-lim-sw-in
|
||||
net Xmin hm2_5i20.0.gpio.026.in => axis.0.neg-lim-sw-in
|
||||
net Zmax hm2_5i20.0.gpio.028.in => axis.2.pos-lim-sw-in
|
||||
net Zmin hm2_5i20.0.gpio.030.in => axis.2.neg-lim-sw-in
|
||||
net Xmax hm2_5i20.0.gpio.024.in => joint.0.pos-lim-sw-in
|
||||
net Xmin hm2_5i20.0.gpio.026.in => joint.0.neg-lim-sw-in
|
||||
net Zmax hm2_5i20.0.gpio.028.in => joint.2.pos-lim-sw-in
|
||||
net Zmin hm2_5i20.0.gpio.030.in => joint.2.neg-lim-sw-in
|
||||
|
||||
#connect positive limit signals to home inputs
|
||||
net Xmax => axis.0.home-sw-in
|
||||
net Zmax => axis.2.home-sw-in
|
||||
net Xmax => joint.0.home-sw-in
|
||||
net Zmax => joint.2.home-sw-in
|
||||
|
||||
# Main Contactors - True when both contactors are energized
|
||||
net ACOK hm2_5i20.0.gpio.035.in_not
|
||||
|
|
|
|||
|
|
@ -93,14 +93,14 @@ setp stepgen.0.stepspace 0
|
|||
setp stepgen.0.dirhold 45000
|
||||
setp stepgen.0.dirsetup 26000
|
||||
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 xpos-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
|
||||
net xpos-fb stepgen.0.position-fb => joint.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 both-home-x => axis.0.home-sw-in
|
||||
net both-home-x => axis.0.neg-lim-sw-in
|
||||
net both-home-x => axis.0.pos-lim-sw-in
|
||||
net xenable joint.0.amp-enable-out => stepgen.0.enable
|
||||
net both-home-x => joint.0.home-sw-in
|
||||
net both-home-x => joint.0.neg-lim-sw-in
|
||||
net both-home-x => joint.0.pos-lim-sw-in
|
||||
|
||||
setp stepgen.1.position-scale [AXIS_1]SCALE
|
||||
setp stepgen.1.steplen 1
|
||||
|
|
@ -108,14 +108,14 @@ setp stepgen.1.stepspace 0
|
|||
setp stepgen.1.dirhold 45000
|
||||
setp stepgen.1.dirsetup 26000
|
||||
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 ypos-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd
|
||||
net ypos-fb stepgen.1.position-fb => joint.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 both-home-y => axis.1.home-sw-in
|
||||
net both-home-y => axis.1.neg-lim-sw-in
|
||||
net both-home-y => axis.1.pos-lim-sw-in
|
||||
net yenable joint.1.amp-enable-out => stepgen.1.enable
|
||||
net both-home-y => joint.1.home-sw-in
|
||||
net both-home-y => joint.1.neg-lim-sw-in
|
||||
net both-home-y => joint.1.pos-lim-sw-in
|
||||
|
||||
setp stepgen.2.position-scale [AXIS_2]SCALE
|
||||
setp stepgen.2.steplen 1
|
||||
|
|
@ -123,14 +123,14 @@ setp stepgen.2.stepspace 0
|
|||
setp stepgen.2.dirhold 45000
|
||||
setp stepgen.2.dirsetup 26000
|
||||
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
|
||||
net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
|
||||
net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
|
||||
net zpos-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd
|
||||
net zpos-fb stepgen.2.position-fb => joint.2.motor-pos-fb
|
||||
net zstep <= stepgen.2.step
|
||||
net zdir <= stepgen.2.dir
|
||||
net zenable axis.2.amp-enable-out => stepgen.2.enable
|
||||
net both-home-z => axis.2.home-sw-in
|
||||
net both-home-z => axis.2.neg-lim-sw-in
|
||||
net both-home-z => axis.2.pos-lim-sw-in
|
||||
net zenable joint.2.amp-enable-out => stepgen.2.enable
|
||||
net both-home-z => joint.2.home-sw-in
|
||||
net both-home-z => joint.2.neg-lim-sw-in
|
||||
net both-home-z => joint.2.pos-lim-sw-in
|
||||
|
||||
setp stepgen.3.position-scale [AXIS_3]SCALE
|
||||
setp stepgen.3.steplen 1
|
||||
|
|
@ -138,12 +138,12 @@ setp stepgen.3.stepspace 0
|
|||
setp stepgen.3.dirhold 45000
|
||||
setp stepgen.3.dirsetup 26000
|
||||
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
|
||||
net apos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
|
||||
net apos-fb stepgen.3.position-fb => axis.3.motor-pos-fb
|
||||
net apos-cmd joint.3.motor-pos-cmd => stepgen.3.position-cmd
|
||||
net apos-fb stepgen.3.position-fb => joint.3.motor-pos-fb
|
||||
net astep <= stepgen.3.step
|
||||
net adir <= stepgen.3.dir
|
||||
net aenable axis.3.amp-enable-out => stepgen.3.enable
|
||||
net home-a => axis.3.home-sw-in
|
||||
net aenable joint.3.amp-enable-out => stepgen.3.enable
|
||||
net home-a => joint.3.home-sw-in
|
||||
|
||||
#linksp xenable estop-latch.0.ok-out
|
||||
net estop-out <= iocontrol.0.user-enable-out
|
||||
|
|
|
|||
15
configs/max/jogwheel.hal
Normal file
15
configs/max/jogwheel.hal
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
net jogA parport.0.pin-10-in => encoder.1.phase-A
|
||||
net jogB parport.0.pin-11-in => encoder.1.phase-B
|
||||
|
||||
net jogX axisui.jog.x => joint.0.jog-enable
|
||||
net jogY axisui.jog.y => joint.1.jog-enable
|
||||
net jogZ axisui.jog.z => joint.2.jog-enable
|
||||
|
||||
net jogcounts encoder.1.counts => joint.0.jog-counts joint.1.jog-counts joint.2.jog-counts
|
||||
|
||||
sets jogscale .00002
|
||||
net jogscale joint.0.jog-scale
|
||||
net jogscale joint.1.jog-scale
|
||||
net jogscale joint.2.jog-scale
|
||||
|
||||
224
configs/max/max.hal
Normal file
224
configs/max/max.hal
Normal file
|
|
@ -0,0 +1,224 @@
|
|||
# HAL config file for MAX NC test machine
|
||||
#######################################################
|
||||
# first load all the HAL modules we're going to need
|
||||
#######################################################
|
||||
# kinematics
|
||||
loadrt trivkins
|
||||
# main motion controller module
|
||||
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
|
||||
# using steppers....
|
||||
loadrt stepgen step_type=0,0,0,0
|
||||
# I/O thru the parport
|
||||
loadrt hal_parport cfg="0x0378"
|
||||
# counting the spindle encoder in software
|
||||
loadrt encoder num_chan=2
|
||||
# simulate the encoder
|
||||
loadrt sim_encoder num_chan=1
|
||||
# misc blocks needed to do fun things
|
||||
loadrt ddt count=8
|
||||
|
||||
#######################################################
|
||||
# add realtime functions to the threads
|
||||
# first the high speed thread
|
||||
#######################################################
|
||||
# first we read parport inputs
|
||||
addf parport.0.read base-thread
|
||||
addf sim-encoder.make-pulses base-thread
|
||||
# update encoder counter
|
||||
addf encoder.update-counters base-thread
|
||||
# generate step and dir signals
|
||||
addf stepgen.make-pulses base-thread
|
||||
# write to outputs
|
||||
addf parport.0.write base-thread
|
||||
|
||||
|
||||
|
||||
# now the servo thread
|
||||
########################################################
|
||||
# capture axis and spindle positions
|
||||
addf stepgen.capture-position servo-thread
|
||||
addf encoder.capture-position servo-thread
|
||||
# process motion commands coming from user space
|
||||
addf motion-command-handler servo-thread
|
||||
# run main motion controller
|
||||
addf motion-controller servo-thread
|
||||
# differentiators to make vel and acc signals
|
||||
addf ddt.0 servo-thread
|
||||
addf ddt.1 servo-thread
|
||||
addf ddt.2 servo-thread
|
||||
addf ddt.3 servo-thread
|
||||
addf ddt.4 servo-thread
|
||||
addf ddt.5 servo-thread
|
||||
addf ddt.6 servo-thread
|
||||
addf ddt.7 servo-thread
|
||||
# update output info, axis and spindle
|
||||
addf stepgen.update-freq servo-thread
|
||||
addf sim-encoder.update-speed servo-thread
|
||||
|
||||
|
||||
|
||||
#######################################################
|
||||
# interconnections
|
||||
#
|
||||
# first, the basic stepper machine connections
|
||||
#######################################################
|
||||
|
||||
# connect position commands from motion module to step generator
|
||||
net Xpos-cmd <= joint.0.motor-pos-cmd
|
||||
net Xpos-cmd => stepgen.0.position-cmd
|
||||
net Ypos-cmd <= joint.1.motor-pos-cmd
|
||||
net Ypos-cmd => stepgen.1.position-cmd
|
||||
net Zpos-cmd <= joint.2.motor-pos-cmd
|
||||
net Zpos-cmd => stepgen.2.position-cmd
|
||||
net Apos-cmd <= joint.3.motor-pos-cmd
|
||||
net Apos-cmd => stepgen.3.position-cmd
|
||||
|
||||
# connect position feedback from step generators
|
||||
# to motion module
|
||||
net Xpos-fb <= stepgen.0.position-fb
|
||||
net Xpos-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb <= stepgen.1.position-fb
|
||||
net Ypos-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb <= stepgen.2.position-fb
|
||||
net Zpos-fb => joint.2.motor-pos-fb
|
||||
net Apos-fb <= stepgen.3.position-fb
|
||||
net Apos-fb => joint.3.motor-pos-fb
|
||||
|
||||
# connect enable signals for step generators
|
||||
net Xen <= joint.0.amp-enable-out
|
||||
net Xen => stepgen.0.enable
|
||||
net Yen <= joint.1.amp-enable-out
|
||||
net Yen => stepgen.1.enable
|
||||
net Zen <= joint.2.amp-enable-out
|
||||
net Zen => stepgen.2.enable
|
||||
net Aen <= joint.3.amp-enable-out
|
||||
net Aen => stepgen.3.enable
|
||||
|
||||
# connect signals to step pulse generator outputs
|
||||
net Xstep <= stepgen.0.step
|
||||
net Xdir <= stepgen.0.dir
|
||||
net Ystep <= stepgen.1.step
|
||||
net Ydir <= stepgen.1.dir
|
||||
net Zstep <= stepgen.2.step
|
||||
net Zdir <= stepgen.2.dir
|
||||
net Astep <= stepgen.3.step
|
||||
net Adir <= stepgen.3.dir
|
||||
|
||||
# create a signal for the estop loopback
|
||||
net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
|
||||
|
||||
# create signals for tool loading loopback
|
||||
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
||||
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
|
||||
|
||||
# create a signal for "spindle on"
|
||||
net spindle_on <= motion.spindle-on
|
||||
|
||||
# connect physical pins to the signals
|
||||
net Xstep => parport.0.pin-03-out
|
||||
net Xdir => parport.0.pin-02-out
|
||||
net Ystep => parport.0.pin-05-out
|
||||
net Ydir => parport.0.pin-04-out
|
||||
net Zstep => parport.0.pin-07-out
|
||||
net Zdir => parport.0.pin-06-out
|
||||
net Astep => parport.0.pin-09-out
|
||||
net Adir => parport.0.pin-08-out
|
||||
# amp enable (active lo)
|
||||
net Xen => parport.0.pin-01-out
|
||||
setp parport.0.pin-01-out-invert 1
|
||||
# spindle enable (active lo)
|
||||
net spindle_on => parport.0.pin-14-out
|
||||
setp parport.0.pin-14-out-invert 1
|
||||
|
||||
#######################################################
|
||||
# set scaling and other parameters of the basic machine
|
||||
|
||||
# set stepgen module scaling - get values from ini file
|
||||
setp stepgen.0.position-scale [AXIS_0]SCALE
|
||||
setp stepgen.1.position-scale [AXIS_1]SCALE
|
||||
setp stepgen.2.position-scale [AXIS_2]SCALE
|
||||
setp stepgen.3.position-scale [AXIS_3]SCALE
|
||||
|
||||
# set stepgen module accel limits - get values from ini file
|
||||
# jmk said to set these to ini value + 5% to avoid stepgen bug
|
||||
setp stepgen.0.maxaccel [AXIS_0]HAL_MAXACCEL
|
||||
setp stepgen.1.maxaccel [AXIS_1]HAL_MAXACCEL
|
||||
setp stepgen.2.maxaccel [AXIS_2]HAL_MAXACCEL
|
||||
setp stepgen.3.maxaccel [AXIS_3]HAL_MAXACCEL
|
||||
|
||||
# end of basic machine
|
||||
|
||||
#######################################################
|
||||
# Beginning of threading related stuff
|
||||
#######################################################
|
||||
|
||||
# spindle speed control
|
||||
net spindle-speed-cmd <= motion.spindle-speed-out
|
||||
net spindle-speed-cmd => sim-encoder.0.speed
|
||||
|
||||
# spindle encoder
|
||||
# connect encoder signals to encoder counter
|
||||
net spindle-phase-A => encoder.0.phase-A
|
||||
net spindle-phase-B => encoder.0.phase-B
|
||||
net spindle-phase-Z => encoder.0.phase-Z
|
||||
|
||||
net spindle-phase-A <= sim-encoder.0.phase-A
|
||||
net spindle-phase-B <= sim-encoder.0.phase-B
|
||||
net spindle-phase-Z <= sim-encoder.0.phase-Z
|
||||
|
||||
# assume 120 ppr = 480 counts/rev for the spindle
|
||||
setp sim-encoder.0.ppr 120
|
||||
# iocontrol output is in rpm, but sim-encoder speed is rps
|
||||
setp sim-encoder.0.scale 60
|
||||
# scale encoder output to read in revolutions
|
||||
# (that way thread pitches can be straightforward,
|
||||
# a 20 tpi thread would multiply the encoder output
|
||||
# by 1/20, etc)
|
||||
setp encoder.0.position-scale 480
|
||||
|
||||
# encoder reset control
|
||||
net spindle-index-enable <= motion.spindle-index-enable
|
||||
net spindle-index-enable <=> encoder.0.index-enable
|
||||
|
||||
|
||||
# report our revolution count to the motion controller
|
||||
net spindle-pos <= encoder.0.position
|
||||
net spindle-pos => motion.spindle-revs
|
||||
|
||||
|
||||
#######################################################
|
||||
# make vel and accel sigs for testing
|
||||
#######################################################
|
||||
|
||||
# send the position commands thru differentiators to
|
||||
# generate velocity and accel signals (for testing)
|
||||
|
||||
# define the signals, and hook them up
|
||||
net Xpos-cmd => ddt.0.in
|
||||
net Xvel <= ddt.0.out
|
||||
net Xvel => ddt.1.in
|
||||
net Xacc <= ddt.1.out
|
||||
|
||||
net Ypos-cmd => ddt.2.in
|
||||
net Yvel <= ddt.2.out
|
||||
net Yvel => ddt.3.in
|
||||
net Yacc <= ddt.3.out
|
||||
|
||||
net Zpos-cmd => ddt.4.in
|
||||
net Zvel <= ddt.4.out
|
||||
net Zvel => ddt.5.in
|
||||
net Zacc <= ddt.5.out
|
||||
|
||||
net Apos-cmd => ddt.6.in
|
||||
net Avel <= ddt.6.out
|
||||
net Avel => ddt.7.in
|
||||
net Aacc <= ddt.7.out
|
||||
|
||||
# for spindle velocity estimate
|
||||
loadrt lowpass count=1
|
||||
net spindle-rpm-raw encoder.0.velocity
|
||||
net spindle-rpm-raw lowpass.0.in
|
||||
net spindle-rpm-filtered lowpass.0.out
|
||||
setp lowpass.0.gain .03
|
||||
addf lowpass.0 servo-thread
|
||||
|
||||
190
configs/plasma-thc/mp1000A.hal
Normal file
190
configs/plasma-thc/mp1000A.hal
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
###################### Torch Height Control ##########################
|
||||
|
||||
# Load realtime hal components for THC
|
||||
loadrt and2 count=9
|
||||
loadrt comp count=3
|
||||
loadrt updown
|
||||
loadrt flipflop count=3
|
||||
loadrt hypot
|
||||
loadrt logic personality=0x203
|
||||
loadrt minmax
|
||||
loadrt mult2 count=2
|
||||
loadrt mux2 count=7
|
||||
loadrt not count=3
|
||||
loadrt oneshot count=4
|
||||
loadrt or2 count=9
|
||||
loadrt scale
|
||||
loadrt sum2 count=5
|
||||
loadrt xor2 count=4
|
||||
loadrt conv_s32_float
|
||||
loadrt edge count=2
|
||||
|
||||
# Attach realtime hal components to a realtime thread
|
||||
addf and2.0 servo-thread
|
||||
addf and2.1 servo-thread
|
||||
addf and2.2 servo-thread
|
||||
addf and2.3 servo-thread
|
||||
addf and2.4 servo-thread
|
||||
addf and2.5 servo-thread
|
||||
addf and2.6 servo-thread
|
||||
addf and2.7 servo-thread
|
||||
addf and2.8 servo-thread
|
||||
addf comp.0 servo-thread
|
||||
addf comp.1 servo-thread
|
||||
addf comp.2 servo-thread
|
||||
addf conv-s32-float.0 servo-thread
|
||||
addf edge.0 servo-thread
|
||||
addf edge.1 servo-thread
|
||||
addf flipflop.0 servo-thread
|
||||
addf flipflop.1 servo-thread
|
||||
addf flipflop.2 servo-thread
|
||||
addf hypot.0 servo-thread
|
||||
addf logic.0 servo-thread
|
||||
addf minmax.0 servo-thread
|
||||
addf mult2.0 servo-thread
|
||||
addf mult2.1 servo-thread
|
||||
addf mux2.0 servo-thread
|
||||
addf mux2.1 servo-thread
|
||||
addf mux2.2 servo-thread
|
||||
addf mux2.3 servo-thread
|
||||
addf mux2.4 servo-thread
|
||||
addf mux2.5 servo-thread
|
||||
addf mux2.6 servo-thread
|
||||
addf not.0 servo-thread
|
||||
addf not.1 servo-thread
|
||||
addf not.2 servo-thread
|
||||
addf oneshot.0 servo-thread
|
||||
addf oneshot.1 servo-thread
|
||||
addf oneshot.2 servo-thread
|
||||
addf oneshot.3 servo-thread
|
||||
addf or2.0 servo-thread
|
||||
addf or2.1 servo-thread
|
||||
addf or2.2 servo-thread
|
||||
addf or2.3 servo-thread
|
||||
addf or2.4 servo-thread
|
||||
addf or2.5 servo-thread
|
||||
addf or2.6 servo-thread
|
||||
addf or2.7 servo-thread
|
||||
addf or2.8 servo-thread
|
||||
addf updown.0 servo-thread
|
||||
addf scale.0 servo-thread
|
||||
addf sum2.0 servo-thread
|
||||
addf sum2.1 servo-thread
|
||||
addf sum2.2 servo-thread
|
||||
addf sum2.3 servo-thread
|
||||
addf sum2.4 servo-thread
|
||||
addf xor2.0 servo-thread
|
||||
addf xor2.1 servo-thread
|
||||
addf xor2.2 servo-thread
|
||||
|
||||
# Set static values and default values
|
||||
setp oneshot.1.width [PLASMA]IGNITION_TIMEOUT
|
||||
setp oneshot.2.width [PLASMA]ARC_OK_FILTER_TIME
|
||||
setp oneshot.3.width [PLASMA]EXTINGUISH_TIMEOUT
|
||||
setp oneshot.3.falling 1
|
||||
setp oneshot.3.rising 0
|
||||
setp comp.2.in0 [PLASMA]MAX_FAILED_IGNITIONS
|
||||
setp mux2.1.in0 -1
|
||||
setp mux2.1.in1 1
|
||||
setp mux2.3.in0 0
|
||||
|
||||
# Set the lowest value the THC will try to move the torch
|
||||
setp sum2.4.in0 [AXIS_2]MIN_LIMIT
|
||||
|
||||
# Set default gains for sum, positive for addition and negative for subtraction
|
||||
# Setting positive gains will become implicit and those can be removed safely in a later version
|
||||
setp sum2.0.gain0 1
|
||||
setp sum2.0.gain1 1
|
||||
setp sum2.1.gain0 1
|
||||
setp sum2.1.gain1 1
|
||||
setp sum2.2.gain0 1
|
||||
setp sum2.2.gain1 -1
|
||||
setp sum2.3.gain0 1
|
||||
setp sum2.3.gain1 -1
|
||||
setp sum2.4.gain0 1
|
||||
setp sum2.4.gain1 -1
|
||||
|
||||
# Set Hysterisis for float comp
|
||||
setp comp.1.hyst 0.001
|
||||
|
||||
# Set percentage multiplier for scale
|
||||
setp scale.0.gain 0.01
|
||||
|
||||
# Set edge detectors to work on falling edges to detect Ignition Timeouts
|
||||
setp edge.0.in-edge 1
|
||||
setp edge.1.in-edge 1
|
||||
|
||||
# Hook up parallel port pins
|
||||
net MoveDown parport.1.pin-11-in-not => or2.0.in0
|
||||
net MoveUp parport.1.pin-12-in-not => or2.0.in1 mux2.1.sel
|
||||
|
||||
# Hook up component pins using the net command
|
||||
net FloatSwitch parport.1.pin-03-in => or2.1.in1 and2.4.in0 and2.5.in1 and2.6.in1
|
||||
net ArcOK parport.1.pin-15-in-not => or2.4.in1 xor2.1.in1 oneshot.2.in
|
||||
net FilteredArcOK xor2.1.out => or2.1.in0 or2.6.in0 not.1.in and2.4.in1 flipflop.1.set oneshot.3.in flipflop.2.set and2.2.in0
|
||||
net TimersOrArcOK or2.4.out => or2.5.in0 or2.3.in0
|
||||
net LockHeight and2.0.out => xor2.2.in0
|
||||
net EnabledAdjustHeight and2.1.out => mux2.3.sel
|
||||
net ReleaseFeedHold and2.2.out => xor2.0.in1
|
||||
net TorchOn => and2.3.out parport.1.pin-01-out oneshot.1.in not.2.in
|
||||
net FloatSwitchEstop and2.4.out => logic.0.in-02
|
||||
net FloatAndTorchOn and2.5.out => or2.2.in1
|
||||
net TorchAndFloat and2.6.out => flipflop.0.set
|
||||
net PosAndFloat and2.7.out => or2.5.in1
|
||||
net IgnitionEstop comp.2.out => logic.0.in-01
|
||||
net StartTorchOn and2.8.out => and2.3.in0
|
||||
net OriginalPosZ-cmd joint.2.motor-pos-cmd => mux2.5.in0 sum2.2.in1
|
||||
net JointPoz-cmd joint.2.pos-cmd => sum2.2.in0
|
||||
net CHLTriggered comp.0.out => and2.0.in0
|
||||
net AtPosition comp.1.equal => and2.7.in0
|
||||
net VelX ddt.0.out => hypot.0.in0
|
||||
net VelY ddt.1.out => hypot.0.in1
|
||||
net FloatSwitchSet flipflop.0.out => or2.3.in1 and2.7.in1
|
||||
net ModeIsAuto halui.mode.is-auto => mux2.5.sel
|
||||
net VelXY hypot.0.out => minmax.0.in comp.0.in0
|
||||
net TriggerEStop logic.0.or => estop-latch.0.fault-in
|
||||
net MaximumVelocity minmax.0.max => mult2.1.in0
|
||||
net TurnTorchOn motion.spindle-forward => xor2.0.in0 and2.8.in0 and2.6.in0 mux2.4.sel not.0.in
|
||||
net HeightAdjustment mult2.0.out => mux2.3.in1
|
||||
net VelocityThreshold mult2.1.out => comp.0.in1
|
||||
net HeightOffset mux2.0.out => sum2.1.in1
|
||||
net AdjustmentDirection mux2.1.out => mult2.0.in1
|
||||
net PositionSnapshot mux2.2.out => sum2.1.in0 mux2.2.in0
|
||||
net SelectedAdjustment mux2.3.out => mux2.0.in1
|
||||
net PosZ-cmd mux2.4.out => stepgen.2.position-cmd comp.1.in1
|
||||
net PosSelectB mux2.5.out => mux2.4.in0
|
||||
net PosSelectC mux2.6.out => mux2.4.in1
|
||||
net TurnTorchOff not.0.out => and2.5.in0 or2.7.in0 updown.0.reset
|
||||
net ReversedArcOK not.1.out => minmax.0.reset
|
||||
net PierceDelayElapsed oneshot.0.out-not => and2.2.in1
|
||||
net IgnitionTimer oneshot.1.out => edge.0.in or2.8.in0
|
||||
net AdjustHeight or2.0.out => xor2.2.in1 and2.1.in0
|
||||
net TakeSnapshot or2.1.out => mux2.2.sel
|
||||
net TriggerLimit or2.2.out => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
|
||||
net ProbeOrArcOK or2.3.out => mux2.6.sel
|
||||
net PAFOrArcOK or2.5.out => and2.3.in1
|
||||
net EstopOrArcOK or2.6.out => flipflop.0.reset
|
||||
net ExtEStop parport.0.pin-10-in => logic.0.in-00
|
||||
net ExtEStop => logic.0.in-00
|
||||
net LimitZ parport.0.pin-13-in => or2.2.in0
|
||||
net ThresholdPercentage scale.0.out => mult2.1.in1
|
||||
net PosZ-fb stepgen.2.position-fb => joint.2.motor-pos-fb mux2.2.in1 comp.1.in0
|
||||
net PierceOffset sum2.0.out => mux2.0.in0
|
||||
net DestinationHeight sum2.1.out => mux2.6.in1
|
||||
net JointAxisDiff sum2.2.out => sum2.3.in1 sum2.4.in1
|
||||
net StepCordsTH sum2.3.out => mux2.5.in1
|
||||
net StepCordsML sum2.4.out => mux2.6.in0
|
||||
net FeedHold xor2.0.out => motion.feed-hold
|
||||
net CHLSwitched xor2.2.out => and2.1.in1
|
||||
net ArcOKTimer oneshot.2.out => xor2.1.in0
|
||||
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
|
||||
net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
|
||||
net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
|
||||
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
|
||||
net TorchOff not.2.out => flipflop.1.reset
|
||||
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1
|
||||
net IgnitionTimeout edge.0.out => or2.7.in1
|
||||
net ExtinguishTimer oneshot.3.out edge.1.in
|
||||
net ExtinguishLatch flipflop.2.out or2.8.in1
|
||||
net ExtinguishTimeout edge.1.out flipflop.2.reset
|
||||
net Timers or2.8.out => or2.4.in0
|
||||
32
configs/plasma-thc/mp1000A_parport.hal
Normal file
32
configs/plasma-thc/mp1000A_parport.hal
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
############################# Parallel Ports ##############################################
|
||||
|
||||
# Load Driver for Two Parallel Ports, one for Breakout Board, other for Plasma Torch Height Control
|
||||
loadrt hal_parport cfg="0xa400 0xac00 in"
|
||||
|
||||
# Connect both Paralell Ports to Threads for Read / Write
|
||||
addf parport.0.read base-thread 1
|
||||
addf parport.0.write base-thread -1
|
||||
addf parport.1.read base-thread 1
|
||||
addf parport.1.write base-thread -1
|
||||
|
||||
# Invert pins to make motors move in right direction
|
||||
setp parport.0.pin-03-out-invert 1
|
||||
setp parport.0.pin-05-out-invert 1
|
||||
|
||||
# Hook up the step and dir signals to the parport pins
|
||||
# Axis A and Y are the same axis but different motors
|
||||
net StepX stepgen.0.step => parport.0.pin-02-out
|
||||
net DirX stepgen.0.dir => parport.0.pin-03-out
|
||||
net StepY stepgen.1.step => parport.0.pin-04-out
|
||||
net DirY stepgen.1.dir => parport.0.pin-05-out
|
||||
net StepZ stepgen.2.step => parport.0.pin-06-out
|
||||
net DirZ stepgen.2.dir => parport.0.pin-07-out
|
||||
net StepA stepgen.3.step => parport.0.pin-08-out
|
||||
net DirA stepgen.3.dir => parport.0.pin-09-out
|
||||
|
||||
# Hook up limit and home switches, each axis shares a common pin for homing, limit min and limit max
|
||||
net LimitX parport.1.pin-06-in-not => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in joint.0.home-sw-in
|
||||
net LimitY parport.1.pin-07-in-not => joint.1.neg-lim-sw-in joint.1.pos-lim-sw-in joint.1.home-sw-in
|
||||
# Z axis Limit switch handled by THC, see thc.hal
|
||||
#net LimitZ parport.1.pin-13-in => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
|
||||
net LimitA parport.1.pin-09-in-not => joint.3.neg-lim-sw-in joint.3.pos-lim-sw-in joint.3.home-sw-in
|
||||
190
configs/plasma-thc/mp1000B.hal
Normal file
190
configs/plasma-thc/mp1000B.hal
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
###################### Torch Height Control ##########################
|
||||
|
||||
# Load realtime hal components for THC
|
||||
loadrt and2 count=9
|
||||
loadrt comp count=3
|
||||
loadrt updown
|
||||
loadrt flipflop count=3
|
||||
loadrt hypot
|
||||
loadrt logic personality=0x203
|
||||
loadrt minmax
|
||||
loadrt mult2 count=2
|
||||
loadrt mux2 count=7
|
||||
loadrt not count=3
|
||||
loadrt oneshot count=4
|
||||
loadrt or2 count=9
|
||||
loadrt scale
|
||||
loadrt sum2 count=5
|
||||
loadrt xor2 count=4
|
||||
loadrt conv_s32_float
|
||||
loadrt edge count=2
|
||||
|
||||
# Attach realtime hal components to a realtime thread
|
||||
addf and2.0 servo-thread
|
||||
addf and2.1 servo-thread
|
||||
addf and2.2 servo-thread
|
||||
addf and2.3 servo-thread
|
||||
addf and2.4 servo-thread
|
||||
addf and2.5 servo-thread
|
||||
addf and2.6 servo-thread
|
||||
addf and2.7 servo-thread
|
||||
addf and2.8 servo-thread
|
||||
addf comp.0 servo-thread
|
||||
addf comp.1 servo-thread
|
||||
addf comp.2 servo-thread
|
||||
addf conv-s32-float.0 servo-thread
|
||||
addf edge.0 servo-thread
|
||||
addf edge.1 servo-thread
|
||||
addf flipflop.0 servo-thread
|
||||
addf flipflop.1 servo-thread
|
||||
addf flipflop.2 servo-thread
|
||||
addf hypot.0 servo-thread
|
||||
addf logic.0 servo-thread
|
||||
addf minmax.0 servo-thread
|
||||
addf mult2.0 servo-thread
|
||||
addf mult2.1 servo-thread
|
||||
addf mux2.0 servo-thread
|
||||
addf mux2.1 servo-thread
|
||||
addf mux2.2 servo-thread
|
||||
addf mux2.3 servo-thread
|
||||
addf mux2.4 servo-thread
|
||||
addf mux2.5 servo-thread
|
||||
addf mux2.6 servo-thread
|
||||
addf not.0 servo-thread
|
||||
addf not.1 servo-thread
|
||||
addf not.2 servo-thread
|
||||
addf oneshot.0 servo-thread
|
||||
addf oneshot.1 servo-thread
|
||||
addf oneshot.2 servo-thread
|
||||
addf oneshot.3 servo-thread
|
||||
addf or2.0 servo-thread
|
||||
addf or2.1 servo-thread
|
||||
addf or2.2 servo-thread
|
||||
addf or2.3 servo-thread
|
||||
addf or2.4 servo-thread
|
||||
addf or2.5 servo-thread
|
||||
addf or2.6 servo-thread
|
||||
addf or2.7 servo-thread
|
||||
addf or2.8 servo-thread
|
||||
addf updown.0 servo-thread
|
||||
addf scale.0 servo-thread
|
||||
addf sum2.0 servo-thread
|
||||
addf sum2.1 servo-thread
|
||||
addf sum2.2 servo-thread
|
||||
addf sum2.3 servo-thread
|
||||
addf sum2.4 servo-thread
|
||||
addf xor2.0 servo-thread
|
||||
addf xor2.1 servo-thread
|
||||
addf xor2.2 servo-thread
|
||||
|
||||
# Set static values and default values
|
||||
setp oneshot.1.width [PLASMA]IGNITION_TIMEOUT
|
||||
setp oneshot.2.width [PLASMA]ARC_OK_FILTER_TIME
|
||||
setp oneshot.3.width [PLASMA]EXTINGUISH_TIMEOUT
|
||||
setp oneshot.3.falling 1
|
||||
setp oneshot.3.rising 0
|
||||
setp comp.2.in0 [PLASMA]MAX_FAILED_IGNITIONS
|
||||
setp mux2.1.in0 -1
|
||||
setp mux2.1.in1 1
|
||||
setp mux2.3.in0 0
|
||||
|
||||
# Set the lowest value the THC will try to move the torch
|
||||
setp sum2.4.in0 [AXIS_2]MIN_LIMIT
|
||||
|
||||
# Set default gains for sum, positive for addition and negative for subtraction
|
||||
# Setting positive gains will become implicit and those can be removed safely in a later version
|
||||
setp sum2.0.gain0 1
|
||||
setp sum2.0.gain1 1
|
||||
setp sum2.1.gain0 1
|
||||
setp sum2.1.gain1 1
|
||||
setp sum2.2.gain0 1
|
||||
setp sum2.2.gain1 -1
|
||||
setp sum2.3.gain0 1
|
||||
setp sum2.3.gain1 -1
|
||||
setp sum2.4.gain0 1
|
||||
setp sum2.4.gain1 -1
|
||||
|
||||
# Set Hysterisis for float comp
|
||||
setp comp.1.hyst 0.001
|
||||
|
||||
# Set percentage multiplier for scale
|
||||
setp scale.0.gain 0.01
|
||||
|
||||
# Set edge detectors to work on falling edges to detect Ignition Timeouts
|
||||
setp edge.0.in-edge 1
|
||||
setp edge.1.in-edge 1
|
||||
|
||||
# Hook up parallel port pins
|
||||
net MoveDown parport.1.pin-06-in-not => or2.0.in0
|
||||
net MoveUp parport.1.pin-07-in-not => or2.0.in1 mux2.1.sel
|
||||
|
||||
# Hook up component pins using the net command
|
||||
net FloatSwitch parport.1.pin-03-in => or2.1.in1 and2.4.in0 and2.5.in1 and2.6.in1
|
||||
net ArcOK parport.1.pin-08-in-not => or2.4.in1 xor2.1.in1 oneshot.2.in
|
||||
net FilteredArcOK xor2.1.out => or2.1.in0 or2.6.in0 not.1.in and2.4.in1 flipflop.1.set oneshot.3.in flipflop.2.set and2.2.in0
|
||||
net TimersOrArcOK or2.4.out => or2.5.in0 or2.3.in0
|
||||
net LockHeight and2.0.out => xor2.2.in0
|
||||
net EnabledAdjustHeight and2.1.out => mux2.3.sel
|
||||
net ReleaseFeedHold and2.2.out => xor2.0.in1
|
||||
net TorchOn => and2.3.out parport.1.pin-01-out oneshot.1.in not.2.in
|
||||
net FloatSwitchEstop and2.4.out => logic.0.in-02
|
||||
net FloatAndTorchOn and2.5.out => or2.2.in1
|
||||
net TorchAndFloat and2.6.out => flipflop.0.set
|
||||
net PosAndFloat and2.7.out => or2.5.in1
|
||||
net IgnitionEstop comp.2.out => logic.0.in-01
|
||||
net StartTorchOn and2.8.out => and2.3.in0
|
||||
net OriginalPosZ-cmd joint.2.motor-pos-cmd => mux2.5.in0 sum2.2.in1
|
||||
net JointPoz-cmd joint.2.pos-cmd => sum2.2.in0
|
||||
net CHLTriggered comp.0.out => and2.0.in0
|
||||
net AtPosition comp.1.equal => and2.7.in0
|
||||
net VelX ddt.0.out => hypot.0.in0
|
||||
net VelY ddt.1.out => hypot.0.in1
|
||||
net FloatSwitchSet flipflop.0.out => or2.3.in1 and2.7.in1
|
||||
net ModeIsAuto halui.mode.is-auto => mux2.5.sel
|
||||
net VelXY hypot.0.out => minmax.0.in comp.0.in0
|
||||
net TriggerEStop logic.0.or => estop-latch.0.fault-in
|
||||
net MaximumVelocity minmax.0.max => mult2.1.in0
|
||||
net TurnTorchOn motion.spindle-forward => xor2.0.in0 and2.8.in0 and2.6.in0 mux2.4.sel not.0.in
|
||||
net HeightAdjustment mult2.0.out => mux2.3.in1
|
||||
net VelocityThreshold mult2.1.out => comp.0.in1
|
||||
net HeightOffset mux2.0.out => sum2.1.in1
|
||||
net AdjustmentDirection mux2.1.out => mult2.0.in1
|
||||
net PositionSnapshot mux2.2.out => sum2.1.in0 mux2.2.in0
|
||||
net SelectedAdjustment mux2.3.out => mux2.0.in1
|
||||
net PosZ-cmd mux2.4.out => stepgen.2.position-cmd comp.1.in1
|
||||
net PosSelectB mux2.5.out => mux2.4.in0
|
||||
net PosSelectC mux2.6.out => mux2.4.in1
|
||||
net TurnTorchOff not.0.out => and2.5.in0 or2.7.in0 updown.0.reset
|
||||
net ReversedArcOK not.1.out => minmax.0.reset
|
||||
net PierceDelayElapsed oneshot.0.out-not => and2.2.in1
|
||||
net IgnitionTimer oneshot.1.out => edge.0.in or2.8.in0
|
||||
net AdjustHeight or2.0.out => xor2.2.in1 and2.1.in0
|
||||
net TakeSnapshot or2.1.out => mux2.2.sel
|
||||
net TriggerLimit or2.2.out => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
|
||||
net ProbeOrArcOK or2.3.out => mux2.6.sel
|
||||
net PAFOrArcOK or2.5.out => and2.3.in1
|
||||
net EstopOrArcOK or2.6.out => flipflop.0.reset
|
||||
net ExtEStop parport.0.pin-10-in => logic.0.in-00
|
||||
net ExtEStop => logic.0.in-00
|
||||
net LimitZ parport.0.pin-13-in => or2.2.in0
|
||||
net ThresholdPercentage scale.0.out => mult2.1.in1
|
||||
net PosZ-fb stepgen.2.position-fb => joint.2.motor-pos-fb mux2.2.in1 comp.1.in0
|
||||
net PierceOffset sum2.0.out => mux2.0.in0
|
||||
net DestinationHeight sum2.1.out => mux2.6.in1
|
||||
net JointAxisDiff sum2.2.out => sum2.3.in1 sum2.4.in1
|
||||
net StepCordsTH sum2.3.out => mux2.5.in1
|
||||
net StepCordsML sum2.4.out => mux2.6.in0
|
||||
net FeedHold xor2.0.out => motion.feed-hold
|
||||
net CHLSwitched xor2.2.out => and2.1.in1
|
||||
net ArcOKTimer oneshot.2.out => xor2.1.in0
|
||||
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
|
||||
net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
|
||||
net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
|
||||
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
|
||||
net TorchOff not.2.out => flipflop.1.reset
|
||||
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1
|
||||
net IgnitionTimeout edge.0.out => or2.7.in1
|
||||
net ExtinguishTimer oneshot.3.out edge.1.in
|
||||
net ExtinguishLatch flipflop.2.out or2.8.in1
|
||||
net ExtinguishTimeout edge.1.out flipflop.2.reset
|
||||
net Timers or2.8.out => or2.4.in0
|
||||
32
configs/plasma-thc/mp1000B_parport.hal
Normal file
32
configs/plasma-thc/mp1000B_parport.hal
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
############################# Parallel Ports ##############################################
|
||||
|
||||
# Load Driver for Two Parallel Ports, one for Breakout Board, other for Plasma Torch Height Control
|
||||
loadrt hal_parport cfg="0xa400 0xac00 in"
|
||||
|
||||
# Connect both Paralell Ports to Threads for Read / Write
|
||||
addf parport.0.read base-thread 1
|
||||
addf parport.0.write base-thread -1
|
||||
addf parport.1.read base-thread 1
|
||||
addf parport.1.write base-thread -1
|
||||
|
||||
# Invert pins to make motors move in right direction
|
||||
setp parport.0.pin-03-out-invert 1
|
||||
setp parport.0.pin-05-out-invert 1
|
||||
|
||||
# Hook up the step and dir signals to the parport pins
|
||||
# Axis A and Y are the same axis but different motors
|
||||
net StepX stepgen.0.step => parport.0.pin-02-out
|
||||
net DirX stepgen.0.dir => parport.0.pin-03-out
|
||||
net StepY stepgen.1.step => parport.0.pin-04-out
|
||||
net DirY stepgen.1.dir => parport.0.pin-05-out
|
||||
net StepZ stepgen.2.step => parport.0.pin-06-out
|
||||
net DirZ stepgen.2.dir => parport.0.pin-07-out
|
||||
net StepA stepgen.3.step => parport.0.pin-08-out
|
||||
net DirA stepgen.3.dir => parport.0.pin-09-out
|
||||
|
||||
# Hook up limit and home switches, each axis shares a common pin for homing, limit min and limit max
|
||||
net LimitX parport.0.pin-11-in => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in joint.0.home-sw-in
|
||||
net LimitY parport.0.pin-12-in => joint.1.neg-lim-sw-in joint.1.pos-lim-sw-in joint.1.home-sw-in
|
||||
# Z axis Limit switch handled by THC, see thc.hal
|
||||
#net LimitZ parport.1.pin-13-in => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
|
||||
net LimitA parport.0.pin-15-in => joint.3.neg-lim-sw-in joint.3.pos-lim-sw-in joint.3.home-sw-in
|
||||
54
configs/plasma-thc/stepper.hal
Normal file
54
configs/plasma-thc/stepper.hal
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
############################ Step Generators #########################################
|
||||
|
||||
# Stepper module, four step generators, all using step/dir
|
||||
loadrt stepgen step_type=0,0,0,0
|
||||
|
||||
# Load realtime ddt for velocity calculations used for CHL
|
||||
loadrt ddt count=2
|
||||
|
||||
# Hook functions to base thread (high speed thread for step generation)
|
||||
addf stepgen.make-pulses base-thread
|
||||
|
||||
# Hook functions to servo 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 ddt.0 servo-thread
|
||||
addf ddt.1 servo-thread
|
||||
|
||||
# Configure signals for Z axis to be twice the size of the signals for other axis because
|
||||
# Z axis has a slo-syn driver which can't handle smaller step sizes
|
||||
setp stepgen.2.steplen 35200
|
||||
setp stepgen.2.stepspace 35200
|
||||
setp stepgen.2.dirsetup 35200
|
||||
setp stepgen.2.dirhold 35200
|
||||
|
||||
# Set stepgen module scaling - get values from ini file
|
||||
setp stepgen.0.position-scale [AXIS_0]SCALE
|
||||
setp stepgen.1.position-scale [AXIS_1]SCALE
|
||||
setp stepgen.2.position-scale [AXIS_2]SCALE
|
||||
setp stepgen.3.position-scale [AXIS_3]SCALE
|
||||
|
||||
# Set stepgen module accel limits - get values from ini file
|
||||
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
|
||||
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
|
||||
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
|
||||
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
|
||||
|
||||
# Hook up stepgen to motion modules
|
||||
net PosX-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
|
||||
net PosX-fb stepgen.0.position-fb => joint.0.motor-pos-fb ddt.0.in
|
||||
net PosY-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd
|
||||
net PosY-fb stepgen.1.position-fb => joint.1.motor-pos-fb ddt.1.in
|
||||
# Z Axis Position and feedback signals handled by THC, see thc.hal
|
||||
#net PosZ-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd
|
||||
#net PosZ-fb stepgen.2.position-fb => joint.2.motor-pos-fb
|
||||
net PosA-cmd joint.3.motor-pos-cmd => stepgen.3.position-cmd
|
||||
net PosA-fb stepgen.3.position-fb => joint.3.motor-pos-fb
|
||||
|
||||
# Hook up enable signals for step generators
|
||||
net EnableX joint.0.amp-enable-out => stepgen.0.enable
|
||||
net EnableY joint.1.amp-enable-out => stepgen.1.enable
|
||||
net EnableZ joint.2.amp-enable-out => stepgen.2.enable
|
||||
net EnableA joint.3.amp-enable-out => stepgen.3.enable
|
||||
190
configs/plasma-thc/thc300.hal
Normal file
190
configs/plasma-thc/thc300.hal
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
###################### Torch Height Control ##########################
|
||||
|
||||
# Load realtime hal components for THC
|
||||
loadrt and2 count=9
|
||||
loadrt comp count=3
|
||||
loadrt updown
|
||||
loadrt flipflop count=3
|
||||
loadrt hypot
|
||||
loadrt logic personality=0x203
|
||||
loadrt minmax
|
||||
loadrt mult2 count=2
|
||||
loadrt mux2 count=7
|
||||
loadrt not count=3
|
||||
loadrt oneshot count=4
|
||||
loadrt or2 count=9
|
||||
loadrt scale
|
||||
loadrt sum2 count=5
|
||||
loadrt xor2 count=4
|
||||
loadrt conv_s32_float
|
||||
loadrt edge count=2
|
||||
|
||||
# Attach realtime hal components to a realtime thread
|
||||
addf and2.0 servo-thread
|
||||
addf and2.1 servo-thread
|
||||
addf and2.2 servo-thread
|
||||
addf and2.3 servo-thread
|
||||
addf and2.4 servo-thread
|
||||
addf and2.5 servo-thread
|
||||
addf and2.6 servo-thread
|
||||
addf and2.7 servo-thread
|
||||
addf and2.8 servo-thread
|
||||
addf comp.0 servo-thread
|
||||
addf comp.1 servo-thread
|
||||
addf comp.2 servo-thread
|
||||
addf conv-s32-float.0 servo-thread
|
||||
addf edge.0 servo-thread
|
||||
addf edge.1 servo-thread
|
||||
addf flipflop.0 servo-thread
|
||||
addf flipflop.1 servo-thread
|
||||
addf flipflop.2 servo-thread
|
||||
addf hypot.0 servo-thread
|
||||
addf logic.0 servo-thread
|
||||
addf minmax.0 servo-thread
|
||||
addf mult2.0 servo-thread
|
||||
addf mult2.1 servo-thread
|
||||
addf mux2.0 servo-thread
|
||||
addf mux2.1 servo-thread
|
||||
addf mux2.2 servo-thread
|
||||
addf mux2.3 servo-thread
|
||||
addf mux2.4 servo-thread
|
||||
addf mux2.5 servo-thread
|
||||
addf mux2.6 servo-thread
|
||||
addf not.0 servo-thread
|
||||
addf not.1 servo-thread
|
||||
addf not.2 servo-thread
|
||||
addf oneshot.0 servo-thread
|
||||
addf oneshot.1 servo-thread
|
||||
addf oneshot.2 servo-thread
|
||||
addf oneshot.3 servo-thread
|
||||
addf or2.0 servo-thread
|
||||
addf or2.1 servo-thread
|
||||
addf or2.2 servo-thread
|
||||
addf or2.3 servo-thread
|
||||
addf or2.4 servo-thread
|
||||
addf or2.5 servo-thread
|
||||
addf or2.6 servo-thread
|
||||
addf or2.7 servo-thread
|
||||
addf or2.8 servo-thread
|
||||
addf updown.0 servo-thread
|
||||
addf scale.0 servo-thread
|
||||
addf sum2.0 servo-thread
|
||||
addf sum2.1 servo-thread
|
||||
addf sum2.2 servo-thread
|
||||
addf sum2.3 servo-thread
|
||||
addf sum2.4 servo-thread
|
||||
addf xor2.0 servo-thread
|
||||
addf xor2.1 servo-thread
|
||||
addf xor2.2 servo-thread
|
||||
|
||||
# Set static values and default values
|
||||
setp oneshot.1.width [PLASMA]IGNITION_TIMEOUT
|
||||
setp oneshot.2.width [PLASMA]ARC_OK_FILTER_TIME
|
||||
setp oneshot.3.width [PLASMA]EXTINGUISH_TIMEOUT
|
||||
setp oneshot.3.falling 1
|
||||
setp oneshot.3.rising 0
|
||||
setp comp.2.in0 [PLASMA]MAX_FAILED_IGNITIONS
|
||||
setp mux2.1.in0 -1
|
||||
setp mux2.1.in1 1
|
||||
setp mux2.3.in0 0
|
||||
|
||||
# Set the lowest value the THC will try to move the torch
|
||||
setp sum2.4.in0 [AXIS_2]MIN_LIMIT
|
||||
|
||||
# Set default gains for sum, positive for addition and negative for subtraction
|
||||
# Setting positive gains will become implicit and those can be removed safely in a later version
|
||||
setp sum2.0.gain0 1
|
||||
setp sum2.0.gain1 1
|
||||
setp sum2.1.gain0 1
|
||||
setp sum2.1.gain1 1
|
||||
setp sum2.2.gain0 1
|
||||
setp sum2.2.gain1 -1
|
||||
setp sum2.3.gain0 1
|
||||
setp sum2.3.gain1 -1
|
||||
setp sum2.4.gain0 1
|
||||
setp sum2.4.gain1 -1
|
||||
|
||||
# Set Hysterisis for float comp
|
||||
setp comp.1.hyst 0.001
|
||||
|
||||
# Set percentage multiplier for scale
|
||||
setp scale.0.gain 0.01
|
||||
|
||||
# Set edge detectors to work on falling edges to detect Ignition Timeouts
|
||||
setp edge.0.in-edge 1
|
||||
setp edge.1.in-edge 1
|
||||
|
||||
# Hook up parallel port pins
|
||||
net MoveDown parport.1.pin-06-in-not => or2.0.in0
|
||||
net MoveUp parport.1.pin-07-in-not => or2.0.in1 mux2.1.sel
|
||||
|
||||
# Hook up component pins using the net command
|
||||
net FloatSwitch parport.1.pin-13-in => or2.1.in1 and2.4.in0 and2.5.in1 and2.6.in1
|
||||
net ArcOK parport.1.pin-08-in-not => or2.4.in1 xor2.1.in1 oneshot.2.in
|
||||
net FilteredArcOK xor2.1.out => or2.1.in0 or2.6.in0 not.1.in and2.4.in1 flipflop.1.set oneshot.3.in flipflop.2.set and2.2.in0
|
||||
net TimersOrArcOK or2.4.out => or2.5.in0 or2.3.in0
|
||||
net LockHeight and2.0.out => xor2.2.in0
|
||||
net EnabledAdjustHeight and2.1.out => mux2.3.sel
|
||||
net ReleaseFeedHold and2.2.out => xor2.0.in1
|
||||
net TorchOn => and2.3.out parport.1.pin-01-out oneshot.1.in not.2.in
|
||||
net FloatSwitchEstop and2.4.out => logic.0.in-02
|
||||
net FloatAndTorchOn and2.5.out => or2.2.in1
|
||||
net TorchAndFloat and2.6.out => flipflop.0.set
|
||||
net PosAndFloat and2.7.out => or2.5.in1
|
||||
net IgnitionEstop comp.2.out => logic.0.in-01
|
||||
net StartTorchOn and2.8.out => and2.3.in0
|
||||
net OriginalPosZ-cmd joint.2.motor-pos-cmd => mux2.5.in0 sum2.2.in1
|
||||
net JointPoz-cmd joint.2.pos-cmd => sum2.2.in0
|
||||
net CHLTriggered comp.0.out => and2.0.in0
|
||||
net AtPosition comp.1.equal => and2.7.in0
|
||||
net VelX ddt.0.out => hypot.0.in0
|
||||
net VelY ddt.1.out => hypot.0.in1
|
||||
net FloatSwitchSet flipflop.0.out => or2.3.in1 and2.7.in1
|
||||
net ModeIsAuto halui.mode.is-auto => mux2.5.sel
|
||||
net VelXY hypot.0.out => minmax.0.in comp.0.in0
|
||||
net TriggerEStop logic.0.or => estop-latch.0.fault-in
|
||||
net MaximumVelocity minmax.0.max => mult2.1.in0
|
||||
net TurnTorchOn motion.spindle-forward => xor2.0.in0 and2.8.in0 and2.6.in0 mux2.4.sel not.0.in
|
||||
net HeightAdjustment mult2.0.out => mux2.3.in1
|
||||
net VelocityThreshold mult2.1.out => comp.0.in1
|
||||
net HeightOffset mux2.0.out => sum2.1.in1
|
||||
net AdjustmentDirection mux2.1.out => mult2.0.in1
|
||||
net PositionSnapshot mux2.2.out => sum2.1.in0 mux2.2.in0
|
||||
net SelectedAdjustment mux2.3.out => mux2.0.in1
|
||||
net PosZ-cmd mux2.4.out => stepgen.2.position-cmd comp.1.in1
|
||||
net PosSelectB mux2.5.out => mux2.4.in0
|
||||
net PosSelectC mux2.6.out => mux2.4.in1
|
||||
net TurnTorchOff not.0.out => and2.5.in0 or2.7.in0 updown.0.reset
|
||||
net ReversedArcOK not.1.out => minmax.0.reset
|
||||
net PierceDelayElapsed oneshot.0.out-not => and2.2.in1
|
||||
net IgnitionTimer oneshot.1.out => edge.0.in or2.8.in0
|
||||
net AdjustHeight or2.0.out => xor2.2.in1 and2.1.in0
|
||||
net TakeSnapshot or2.1.out => mux2.2.sel
|
||||
net TriggerLimit or2.2.out => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
|
||||
net ProbeOrArcOK or2.3.out => mux2.6.sel
|
||||
net PAFOrArcOK or2.5.out => and2.3.in1
|
||||
net EstopOrArcOK or2.6.out => flipflop.0.reset
|
||||
net ExtEStop parport.0.pin-10-in => logic.0.in-00
|
||||
net ExtEStop => logic.0.in-00
|
||||
net LimitZ parport.0.pin-13-in => or2.2.in0
|
||||
net ThresholdPercentage scale.0.out => mult2.1.in1
|
||||
net PosZ-fb stepgen.2.position-fb => joint.2.motor-pos-fb mux2.2.in1 comp.1.in0
|
||||
net PierceOffset sum2.0.out => mux2.0.in0
|
||||
net DestinationHeight sum2.1.out => mux2.6.in1
|
||||
net JointAxisDiff sum2.2.out => sum2.3.in1 sum2.4.in1
|
||||
net StepCordsTH sum2.3.out => mux2.5.in1
|
||||
net StepCordsML sum2.4.out => mux2.6.in0
|
||||
net FeedHold xor2.0.out => motion.feed-hold
|
||||
net CHLSwitched xor2.2.out => and2.1.in1
|
||||
net ArcOKTimer oneshot.2.out => xor2.1.in0
|
||||
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
|
||||
net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
|
||||
net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
|
||||
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
|
||||
net TorchOff not.2.out => flipflop.1.reset
|
||||
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1
|
||||
net IgnitionTimeout edge.0.out => or2.7.in1
|
||||
net ExtinguishTimer oneshot.3.out edge.1.in
|
||||
net ExtinguishLatch flipflop.2.out or2.8.in1
|
||||
net ExtinguishTimeout edge.1.out flipflop.2.reset
|
||||
net Timers or2.8.out => or2.4.in0
|
||||
|
|
@ -126,16 +126,29 @@ COORDINATES = X Y Z
|
|||
HOME = 0 0 0
|
||||
LINEAR_UNITS = inch
|
||||
ANGULAR_UNITS = degree
|
||||
CYCLE_TIME = 0.010
|
||||
DEFAULT_VELOCITY = 5
|
||||
DEFAULT_VELOCITY = 10
|
||||
MAX_LINEAR_VELOCITY = 10
|
||||
DEFAULT_LINEAR_ACCEL = 100
|
||||
MAX_LINEAR_ACCEL = 100
|
||||
POSITION_FILE = position.txt
|
||||
MAX_LINEAR_VELOCITY = 5
|
||||
|
||||
[KINS]
|
||||
JOINTS = 3
|
||||
KINEMATICS = trivkins
|
||||
|
||||
# Axes sections ---------------------------------------------------------------
|
||||
[AXIS_X]
|
||||
HOME = 0.000
|
||||
|
||||
# First axis
|
||||
[AXIS_0]
|
||||
[AXIS_Y]
|
||||
HOME = 0.000
|
||||
|
||||
[AXIS_Z]
|
||||
HOME = 0.000
|
||||
|
||||
# Joints sections
|
||||
|
||||
[JOINT_0]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.000
|
||||
MAX_VELOCITY = 5
|
||||
|
|
@ -155,9 +168,7 @@ HOME_IGNORE_LIMITS = NO
|
|||
HOME_SEQUENCE = 1
|
||||
HOME_IS_SHARED = 1
|
||||
|
||||
# Second axis
|
||||
[AXIS_1]
|
||||
|
||||
[JOINT_1]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.000
|
||||
MAX_VELOCITY = 5
|
||||
|
|
@ -176,9 +187,7 @@ HOME_USE_INDEX = NO
|
|||
HOME_IGNORE_LIMITS = NO
|
||||
HOME_SEQUENCE = 1
|
||||
|
||||
# Third axis
|
||||
[AXIS_2]
|
||||
|
||||
[JOINT_2]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.0
|
||||
MAX_VELOCITY = 5
|
||||
|
|
|
|||
|
|
@ -119,19 +119,52 @@ HALUI = halui
|
|||
|
||||
AXES = 9
|
||||
COORDINATES = X Y Z A B C U V W
|
||||
HOME = 0 0 0 0 0 0 0 0 0
|
||||
LINEAR_UNITS = inch
|
||||
ANGULAR_UNITS = degree
|
||||
CYCLE_TIME = 0.010
|
||||
DEFAULT_VELOCITY = 1.0
|
||||
DEFAULT_LINEAR_VELOCITY = 1.0
|
||||
DEFAULT_LINEAR_ACCEL = 20.0
|
||||
DEFAULT_ANGULAR_VELOCITY = 45.0
|
||||
POSITION_FILE = position9.txt
|
||||
MAX_LINEAR_VELOCITY = 1.2
|
||||
MAX_LINEAR_ACCEL = 20.0
|
||||
MAX_ANGULAR_VELOCITY = 90.0
|
||||
|
||||
# Axes sections ---------------------------------------------------------------
|
||||
POSITION_FILE = position9.txt
|
||||
|
||||
[AXIS_0]
|
||||
[KINS]
|
||||
JOINTS = 9
|
||||
KINEMATICS = trivkins
|
||||
|
||||
# Axes sections ---------------------------------------------------------------
|
||||
[AXIS_X]
|
||||
HOME = 0.000
|
||||
|
||||
[AXIS_Y]
|
||||
HOME = 0.000
|
||||
|
||||
[AXIS_Z]
|
||||
HOME = 0.000
|
||||
|
||||
[AXIS_A]
|
||||
HOME = 0.000
|
||||
|
||||
[AXIS_B]
|
||||
HOME = 0.000
|
||||
|
||||
[AXIS_C]
|
||||
HOME = 0.000
|
||||
|
||||
[AXIS_U]
|
||||
HOME = 0.000
|
||||
|
||||
[AXIS_V]
|
||||
HOME = 0.000
|
||||
|
||||
[AXIS_W]
|
||||
HOME = 0.000
|
||||
|
||||
|
||||
[JOINT_0]
|
||||
|
||||
TYPE = LINEAR
|
||||
HOME = 0.000
|
||||
|
|
@ -152,8 +185,7 @@ HOME_IGNORE_LIMITS = NO
|
|||
HOME_SEQUENCE = 1
|
||||
HOME_IS_SHARED = 1
|
||||
|
||||
[AXIS_1]
|
||||
|
||||
[JOINT_1]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.000
|
||||
MAX_VELOCITY = 1.2
|
||||
|
|
@ -172,8 +204,7 @@ HOME_USE_INDEX = NO
|
|||
HOME_IGNORE_LIMITS = NO
|
||||
HOME_SEQUENCE = 1
|
||||
|
||||
[AXIS_2]
|
||||
|
||||
[JOINT_2]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.0
|
||||
MAX_VELOCITY = 1.2
|
||||
|
|
@ -193,8 +224,7 @@ HOME_IGNORE_LIMITS = NO
|
|||
HOME_SEQUENCE = 0
|
||||
HOME_IS_SHARED = 1
|
||||
|
||||
[AXIS_3]
|
||||
|
||||
[JOINT_3]
|
||||
TYPE = ANGULAR
|
||||
HOME = 0.0
|
||||
MAX_VELOCITY = 90.0
|
||||
|
|
@ -211,8 +241,7 @@ HOME_USE_INDEX = NO
|
|||
HOME_IGNORE_LIMITS = NO
|
||||
HOME_SEQUENCE = 1
|
||||
|
||||
[AXIS_4]
|
||||
|
||||
[JOINT_4]
|
||||
TYPE = ANGULAR
|
||||
HOME = 0.0
|
||||
MAX_VELOCITY = 90.0
|
||||
|
|
@ -230,8 +259,7 @@ HOME_IGNORE_LIMITS = NO
|
|||
HOME_SEQUENCE = 1
|
||||
LOCKING_INDEXER = 0
|
||||
|
||||
[AXIS_5]
|
||||
|
||||
[JOINT_5]
|
||||
TYPE = ANGULAR
|
||||
HOME = 0.0
|
||||
MAX_VELOCITY = 90.0
|
||||
|
|
@ -248,8 +276,7 @@ HOME_USE_INDEX = NO
|
|||
HOME_IGNORE_LIMITS = NO
|
||||
HOME_SEQUENCE = 1
|
||||
|
||||
[AXIS_6]
|
||||
|
||||
[JOINT_6]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.000
|
||||
MAX_VELOCITY = 1.2
|
||||
|
|
@ -269,8 +296,7 @@ HOME_IGNORE_LIMITS = NO
|
|||
HOME_SEQUENCE = 0
|
||||
HOME_IS_SHARED = 0
|
||||
|
||||
[AXIS_7]
|
||||
|
||||
[JOINT_7]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.000
|
||||
MAX_VELOCITY = 1.2
|
||||
|
|
@ -290,8 +316,7 @@ HOME_IGNORE_LIMITS = NO
|
|||
HOME_SEQUENCE = 0
|
||||
HOME_IS_SHARED = 0
|
||||
|
||||
[AXIS_8]
|
||||
|
||||
[JOINT_8]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.0
|
||||
MAX_VELOCITY = 1.2
|
||||
|
|
|
|||
|
|
@ -116,14 +116,12 @@ HALUI = halui
|
|||
|
||||
AXES = 3
|
||||
COORDINATES = X Y Z
|
||||
HOME = 0 0 0
|
||||
LINEAR_UNITS = mm
|
||||
ANGULAR_UNITS = degree
|
||||
CYCLE_TIME = 0.010
|
||||
DEFAULT_VELOCITY = 30.48
|
||||
MAX_VELOCITY = 53.34
|
||||
DEFAULT_ACCELERATION = 508
|
||||
MAX_ACCELERATION = 508
|
||||
DEFAULT_LINEAR_VELOCITY = 30.48
|
||||
MAX_LINEAR_VELOCITY = 53.34
|
||||
DEFAULT_LINEAR_ACCEL = 508
|
||||
MAX_LINEAR_ACCEL = 508
|
||||
POSITION_FILE = position_mm.txt
|
||||
ARC_BLEND_ENABLE = 1
|
||||
ARC_BLEND_FALLBACK_ENABLE = 1
|
||||
|
|
@ -133,11 +131,25 @@ ARC_BLEND_SMOOTHING_THRESHOLD = .75
|
|||
#Use this setting for "normal" smoothing, i.e. if we blend over more than 40% of a segment
|
||||
#ARC_BLEND_SMOOTHING_THRESHOLD = 0.40
|
||||
|
||||
[KINS]
|
||||
JOINTS = 3
|
||||
KINEMATICS = trivkins
|
||||
|
||||
# Axes sections ---------------------------------------------------------------
|
||||
|
||||
# First axis
|
||||
[AXIS_0]
|
||||
[AXIS_X]
|
||||
HOME = 0.000
|
||||
|
||||
[AXIS_Y]
|
||||
HOME = 0.000
|
||||
|
||||
[AXIS_Z]
|
||||
HOME = 0.000
|
||||
|
||||
# Joints sections
|
||||
|
||||
# First joint
|
||||
[JOINT_0]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.000
|
||||
MAX_VELOCITY = 30.48
|
||||
|
|
@ -158,8 +170,7 @@ HOME_SEQUENCE = 1
|
|||
HOME_IS_SHARED = 1
|
||||
|
||||
# Second axis
|
||||
[AXIS_1]
|
||||
|
||||
[JOINT_1]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.000
|
||||
MAX_VELOCITY = 30.48
|
||||
|
|
@ -179,8 +190,7 @@ HOME_IGNORE_LIMITS = NO
|
|||
HOME_SEQUENCE = 1
|
||||
|
||||
# Third axis
|
||||
[AXIS_2]
|
||||
|
||||
[JOINT_2]
|
||||
TYPE = LINEAR
|
||||
HOME = 0.0
|
||||
MAX_VELOCITY = 30.48
|
||||
|
|
@ -202,7 +212,6 @@ HOME_IS_SHARED = 1
|
|||
|
||||
# section for main IO controller parameters -----------------------------------
|
||||
[EMCIO]
|
||||
|
||||
# Name of IO controller program, e.g., io
|
||||
EMCIO = io
|
||||
|
||||
|
|
|
|||
|
|
@ -19,23 +19,23 @@ addf ddt.7 servo-thread
|
|||
addf ddt.8 servo-thread
|
||||
|
||||
# create HAL signals for position commands from motion module
|
||||
net J0pos <= axis.0.motor-pos-cmd
|
||||
net J1pos <= axis.1.motor-pos-cmd
|
||||
net J2pos <= axis.2.motor-pos-cmd
|
||||
net J3pos <= axis.3.motor-pos-cmd
|
||||
net J4pos <= axis.4.motor-pos-cmd
|
||||
net J5pos <= axis.5.motor-pos-cmd
|
||||
net J8pos <= axis.8.motor-pos-cmd
|
||||
net J0pos <= joint.0.motor-pos-cmd
|
||||
net J1pos <= joint.1.motor-pos-cmd
|
||||
net J2pos <= joint.2.motor-pos-cmd
|
||||
net J3pos <= joint.3.motor-pos-cmd
|
||||
net J4pos <= joint.4.motor-pos-cmd
|
||||
net J5pos <= joint.5.motor-pos-cmd
|
||||
net J8pos <= joint.8.motor-pos-cmd
|
||||
|
||||
|
||||
# loop position commands back to motion module feedback
|
||||
net J0pos => axis.0.motor-pos-fb
|
||||
net J1pos => axis.1.motor-pos-fb
|
||||
net J2pos => axis.2.motor-pos-fb
|
||||
net J3pos => axis.3.motor-pos-fb
|
||||
net J4pos => axis.4.motor-pos-fb
|
||||
net J5pos => axis.5.motor-pos-fb
|
||||
net J8pos => axis.8.motor-pos-fb
|
||||
net J0pos => joint.0.motor-pos-fb
|
||||
net J1pos => joint.1.motor-pos-fb
|
||||
net J2pos => joint.2.motor-pos-fb
|
||||
net J3pos => joint.3.motor-pos-fb
|
||||
net J4pos => joint.4.motor-pos-fb
|
||||
net J5pos => joint.5.motor-pos-fb
|
||||
net J8pos => joint.8.motor-pos-fb
|
||||
|
||||
# send the position commands thru differentiators to
|
||||
# generate velocity and accel signals
|
||||
|
|
@ -68,29 +68,29 @@ net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
|||
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
|
||||
|
||||
# amp control
|
||||
net xena axis.0.amp-enable-out
|
||||
net yena axis.1.amp-enable-out
|
||||
net zena axis.2.amp-enable-out
|
||||
net aena axis.3.amp-enable-out
|
||||
net bena axis.4.amp-enable-out
|
||||
net cena axis.5.amp-enable-out
|
||||
net wena axis.8.amp-enable-out
|
||||
net xena joint.0.amp-enable-out
|
||||
net yena joint.1.amp-enable-out
|
||||
net zena joint.2.amp-enable-out
|
||||
net aena joint.3.amp-enable-out
|
||||
net bena joint.4.amp-enable-out
|
||||
net cena joint.5.amp-enable-out
|
||||
net wena joint.8.amp-enable-out
|
||||
|
||||
net xflt axis.0.amp-fault-in
|
||||
net yflt axis.1.amp-fault-in
|
||||
net zflt axis.2.amp-fault-in
|
||||
net aflt axis.3.amp-fault-in
|
||||
net bflt axis.4.amp-fault-in
|
||||
net cflt axis.5.amp-fault-in
|
||||
net wflt axis.8.amp-fault-in
|
||||
net xflt joint.0.amp-fault-in
|
||||
net yflt joint.1.amp-fault-in
|
||||
net zflt joint.2.amp-fault-in
|
||||
net aflt joint.3.amp-fault-in
|
||||
net bflt joint.4.amp-fault-in
|
||||
net cflt joint.5.amp-fault-in
|
||||
net wflt joint.8.amp-fault-in
|
||||
|
||||
loadusr -W 5axisgui
|
||||
|
||||
net j0 axis.0.joint-pos-fb 5axisgui.joint0
|
||||
net j1 axis.1.joint-pos-fb 5axisgui.joint1
|
||||
net j2 axis.2.joint-pos-fb 5axisgui.joint2
|
||||
net j3 axis.3.joint-pos-fb 5axisgui.joint3
|
||||
net j4 axis.4.joint-pos-fb 5axisgui.joint4
|
||||
net j5 axis.5.joint-pos-fb 5axisgui.joint5
|
||||
net j0 joint.0.pos-fb 5axisgui.joint0
|
||||
net j1 joint.1.pos-fb 5axisgui.joint1
|
||||
net j2 joint.2.pos-fb 5axisgui.joint2
|
||||
net j3 joint.3.pos-fb 5axisgui.joint3
|
||||
net j4 joint.4.pos-fb 5axisgui.joint4
|
||||
net j5 joint.5.pos-fb 5axisgui.joint5
|
||||
|
||||
net tool-len motion.tooloffset.w 5axisgui.tool_length
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ addf not.3 servo-thread
|
|||
|
||||
# create HAL signals for position commands from motion module
|
||||
# send them to limit blocks so it will ferror if it exceeds a limit
|
||||
net table-pos-cmd axis.0.motor-pos-cmd => limit3.0.in
|
||||
net head-pos-cmd axis.1.motor-pos-cmd => limit3.1.in
|
||||
net saddle-pos-cmd axis.2.motor-pos-cmd => limit3.2.in
|
||||
net quill-pos-cmd axis.8.motor-pos-cmd => limit3.3.in
|
||||
net table-pos-cmd joint.0.motor-pos-cmd => limit3.0.in
|
||||
net head-pos-cmd joint.1.motor-pos-cmd => limit3.1.in
|
||||
net saddle-pos-cmd joint.2.motor-pos-cmd => limit3.2.in
|
||||
net quill-pos-cmd joint.8.motor-pos-cmd => limit3.3.in
|
||||
|
||||
# set the limit block parameters from the ini file
|
||||
setp limit3.0.maxv [AXIS_0]MAX_VELOCITY
|
||||
|
|
@ -55,20 +55,20 @@ setp limit3.3.maxa [AXIS_8]MAX_ACCELERATION
|
|||
|
||||
# loop limited position commands back to motion module feedback
|
||||
# also send them to the vismach model and to the "limit switches"
|
||||
net table-pos-fb limit3.0.out => axis.0.motor-pos-fb hbmgui.table wcomp.0.in
|
||||
net head-pos-fb limit3.1.out => axis.1.motor-pos-fb hbmgui.head wcomp.1.in
|
||||
net saddle-pos-fb limit3.2.out => axis.2.motor-pos-fb hbmgui.saddle wcomp.2.in
|
||||
net quill-pos-fb limit3.3.out => axis.8.motor-pos-fb hbmgui.quill wcomp.3.in
|
||||
net table-pos-fb limit3.0.out => joint.0.motor-pos-fb hbmgui.table wcomp.0.in
|
||||
net head-pos-fb limit3.1.out => joint.1.motor-pos-fb hbmgui.head wcomp.1.in
|
||||
net saddle-pos-fb limit3.2.out => joint.2.motor-pos-fb hbmgui.saddle wcomp.2.in
|
||||
net quill-pos-fb limit3.3.out => joint.8.motor-pos-fb hbmgui.quill wcomp.3.in
|
||||
|
||||
# route home/limit switch signals to EMC
|
||||
net table-limits-ok wcomp.0.out => not.0.in
|
||||
net table-limits-tripped not.0.out => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in axis.0.home-sw-in
|
||||
net table-limits-tripped not.0.out => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in joint.0.home-sw-in
|
||||
net head-limits-ok wcomp.1.out => not.1.in
|
||||
net head-limits-tripped not.1.out => axis.1.neg-lim-sw-in axis.1.pos-lim-sw-in axis.1.home-sw-in
|
||||
net head-limits-tripped not.1.out => joint.1.neg-lim-sw-in joint.1.pos-lim-sw-in joint.1.home-sw-in
|
||||
net saddle-limits-ok wcomp.2.out => not.2.in
|
||||
net saddle-limits-tripped not.2.out => axis.2.neg-lim-sw-in axis.2.pos-lim-sw-in axis.2.home-sw-in
|
||||
net saddle-limits-tripped not.2.out => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
|
||||
net quill-limits-ok wcomp.3.out => not.3.in
|
||||
net quill-limits-tripped not.3.out => axis.8.neg-lim-sw-in axis.8.pos-lim-sw-in axis.8.home-sw-in
|
||||
net quill-limits-tripped not.3.out => joint.8.neg-lim-sw-in joint.8.pos-lim-sw-in joint.8.home-sw-in
|
||||
|
||||
# set location of switches
|
||||
# these positions are in vismach coords - they can be are offset from machine coords
|
||||
|
|
@ -83,11 +83,11 @@ setp wcomp.3.min -42.5
|
|||
setp wcomp.3.max 0.5
|
||||
|
||||
# this foolishness is needed because EMC thinks that 9 axes means 9 joints
|
||||
net Aloop axis.3.motor-pos-cmd axis.3.motor-pos-fb
|
||||
net Bloop axis.4.motor-pos-cmd axis.4.motor-pos-fb
|
||||
net Cloop axis.5.motor-pos-cmd axis.5.motor-pos-fb
|
||||
net Uloop axis.6.motor-pos-cmd axis.6.motor-pos-fb
|
||||
net Vloop axis.7.motor-pos-cmd axis.7.motor-pos-fb
|
||||
net Aloop joint.3.motor-pos-cmd joint.3.motor-pos-fb
|
||||
net Bloop joint.4.motor-pos-cmd joint.4.motor-pos-fb
|
||||
net Cloop joint.5.motor-pos-cmd joint.5.motor-pos-fb
|
||||
net Uloop joint.6.motor-pos-cmd joint.6.motor-pos-fb
|
||||
net Vloop joint.7.motor-pos-cmd joint.7.motor-pos-fb
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,21 +19,21 @@ addf ddt.7 servo-thread
|
|||
addf ddt.8 servo-thread
|
||||
|
||||
# create HAL signals for position commands from motion module
|
||||
net Xpos <= axis.0.motor-pos-cmd
|
||||
net Ypos <= axis.1.motor-pos-cmd
|
||||
net Zpos <= axis.2.motor-pos-cmd
|
||||
net Apos <= axis.3.motor-pos-cmd
|
||||
net Bpos <= axis.4.motor-pos-cmd
|
||||
net Cpos <= axis.5.motor-pos-cmd
|
||||
net Xpos <= joint.0.motor-pos-cmd
|
||||
net Ypos <= joint.1.motor-pos-cmd
|
||||
net Zpos <= joint.2.motor-pos-cmd
|
||||
net Apos <= joint.3.motor-pos-cmd
|
||||
net Bpos <= joint.4.motor-pos-cmd
|
||||
net Cpos <= joint.5.motor-pos-cmd
|
||||
|
||||
|
||||
# loop position commands back to motion module feedback
|
||||
net Xpos => axis.0.motor-pos-fb
|
||||
net Ypos => axis.1.motor-pos-fb
|
||||
net Zpos => axis.2.motor-pos-fb
|
||||
net Apos => axis.3.motor-pos-fb
|
||||
net Bpos => axis.4.motor-pos-fb
|
||||
net Cpos => axis.5.motor-pos-fb
|
||||
net Xpos => joint.0.motor-pos-fb
|
||||
net Ypos => joint.1.motor-pos-fb
|
||||
net Zpos => joint.2.motor-pos-fb
|
||||
net Apos => joint.3.motor-pos-fb
|
||||
net Bpos => joint.4.motor-pos-fb
|
||||
net Cpos => joint.5.motor-pos-fb
|
||||
|
||||
# send the position commands thru differentiators to
|
||||
# generate velocity and accel signals
|
||||
|
|
@ -65,16 +65,16 @@ net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
|||
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
|
||||
|
||||
# amp control
|
||||
net xena axis.0.amp-enable-out
|
||||
net yena axis.1.amp-enable-out
|
||||
net zena axis.2.amp-enable-out
|
||||
net aena axis.3.amp-enable-out
|
||||
net bena axis.4.amp-enable-out
|
||||
net cena axis.5.amp-enable-out
|
||||
net xena joint.0.amp-enable-out
|
||||
net yena joint.1.amp-enable-out
|
||||
net zena joint.2.amp-enable-out
|
||||
net aena joint.3.amp-enable-out
|
||||
net bena joint.4.amp-enable-out
|
||||
net cena joint.5.amp-enable-out
|
||||
|
||||
net xflt axis.0.amp-fault-in
|
||||
net yflt axis.1.amp-fault-in
|
||||
net zflt axis.2.amp-fault-in
|
||||
net aflt axis.3.amp-fault-in
|
||||
net bflt axis.4.amp-fault-in
|
||||
net cflt axis.5.amp-fault-in
|
||||
net xflt joint.0.amp-fault-in
|
||||
net yflt joint.1.amp-fault-in
|
||||
net zflt joint.2.amp-fault-in
|
||||
net aflt joint.3.amp-fault-in
|
||||
net bflt joint.4.amp-fault-in
|
||||
net cflt joint.5.amp-fault-in
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
loadusr -W hexagui
|
||||
|
||||
net j0 axis.0.joint-pos-fb hexagui.joint.0
|
||||
net j1 axis.1.joint-pos-fb hexagui.joint.1
|
||||
net j2 axis.2.joint-pos-fb hexagui.joint.2
|
||||
net j3 axis.3.joint-pos-fb hexagui.joint.3
|
||||
net j4 axis.4.joint-pos-fb hexagui.joint.4
|
||||
net j5 axis.5.joint-pos-fb hexagui.joint.5
|
||||
net j0 joint.0.pos-fb hexagui.joint.0
|
||||
net j1 joint.1.pos-fb hexagui.joint.1
|
||||
net j2 joint.2.pos-fb hexagui.joint.2
|
||||
net j3 joint.3.pos-fb hexagui.joint.3
|
||||
net j4 joint.4.pos-fb hexagui.joint.4
|
||||
net j5 joint.5.pos-fb hexagui.joint.5
|
||||
#get tool position from emc
|
||||
net x-fb halui.axis.0.pos-feedback hexagui.axis.0
|
||||
net y-fb halui.axis.1.pos-feedback hexagui.axis.1
|
||||
|
|
|
|||
|
|
@ -41,11 +41,11 @@ addf not.4 servo-thread
|
|||
|
||||
# create HAL signals for position commands from motion module
|
||||
# send them to limit blocks so it will ferror if it exceeds a limit
|
||||
net table-pos-cmd axis.0.motor-pos-cmd => limit3.0.in
|
||||
net saddle-pos-cmd axis.1.motor-pos-cmd => limit3.1.in
|
||||
net head-pos-cmd axis.2.motor-pos-cmd => limit3.2.in
|
||||
net tilt-pos-cmd axis.4.motor-pos-cmd => limit3.3.in
|
||||
net rotate-pos-cmd axis.5.motor-pos-cmd => limit3.4.in
|
||||
net table-pos-cmd joint.0.motor-pos-cmd => limit3.0.in
|
||||
net saddle-pos-cmd joint.1.motor-pos-cmd => limit3.1.in
|
||||
net head-pos-cmd joint.2.motor-pos-cmd => limit3.2.in
|
||||
net tilt-pos-cmd joint.4.motor-pos-cmd => limit3.3.in
|
||||
net rotate-pos-cmd joint.5.motor-pos-cmd => limit3.4.in
|
||||
|
||||
# set the limit block parameters from the ini file
|
||||
setp limit3.0.maxv [AXIS_0]MAX_VELOCITY
|
||||
|
|
@ -61,28 +61,28 @@ setp limit3.4.maxa [AXIS_5]MAX_ACCELERATION
|
|||
|
||||
# loop limited position commands back to motion module feedback
|
||||
# also send them to the vismach model and to the "limit switches"
|
||||
net table-pos-fb limit3.0.out => axis.0.motor-pos-fb max5gui.table wcomp.0.in
|
||||
net saddle-pos-fb limit3.1.out => axis.1.motor-pos-fb max5gui.saddle wcomp.1.in
|
||||
net head-pos-fb limit3.2.out => axis.2.motor-pos-fb max5gui.head wcomp.2.in
|
||||
net tilt-pos-fb limit3.3.out => axis.4.motor-pos-fb max5gui.tilt wcomp.3.in
|
||||
net rotate-pos-fb limit3.4.out => axis.5.motor-pos-fb max5gui.rotate wcomp.4.in
|
||||
net table-pos-fb limit3.0.out => joint.0.motor-pos-fb max5gui.table wcomp.0.in
|
||||
net saddle-pos-fb limit3.1.out => joint.1.motor-pos-fb max5gui.saddle wcomp.1.in
|
||||
net head-pos-fb limit3.2.out => joint.2.motor-pos-fb max5gui.head wcomp.2.in
|
||||
net tilt-pos-fb limit3.3.out => joint.4.motor-pos-fb max5gui.tilt wcomp.3.in
|
||||
net rotate-pos-fb limit3.4.out => joint.5.motor-pos-fb max5gui.rotate wcomp.4.in
|
||||
|
||||
# this foolishness is needed because EMC thinks that 9 axes means 9 joints
|
||||
net Aloop axis.3.motor-pos-cmd axis.3.motor-pos-fb
|
||||
net Uloop axis.6.motor-pos-cmd axis.6.motor-pos-fb
|
||||
net Vloop axis.7.motor-pos-cmd axis.7.motor-pos-fb
|
||||
net Wloop axis.8.motor-pos-cmd axis.8.motor-pos-fb
|
||||
net Aloop joint.3.motor-pos-cmd joint.3.motor-pos-fb
|
||||
net Uloop joint.6.motor-pos-cmd joint.6.motor-pos-fb
|
||||
net Vloop joint.7.motor-pos-cmd joint.7.motor-pos-fb
|
||||
net Wloop joint.8.motor-pos-cmd joint.8.motor-pos-fb
|
||||
|
||||
# route home/limit switch signals to EMC
|
||||
net table-limits-ok wcomp.0.out => not.0.in
|
||||
net table-limits-tripped not.0.out => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in axis.0.home-sw-in
|
||||
net table-limits-tripped not.0.out => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in joint.0.home-sw-in
|
||||
net saddle-limits-ok wcomp.1.out => not.1.in
|
||||
net saddle-limits-tripped not.1.out => axis.1.neg-lim-sw-in axis.1.pos-lim-sw-in axis.1.home-sw-in
|
||||
net saddle-limits-tripped not.1.out => joint.1.neg-lim-sw-in joint.1.pos-lim-sw-in joint.1.home-sw-in
|
||||
net head-limits-ok wcomp.2.out => not.2.in
|
||||
net head-limits-tripped not.2.out => axis.2.neg-lim-sw-in axis.2.pos-lim-sw-in axis.2.home-sw-in
|
||||
net head-limits-tripped not.2.out => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
|
||||
net tilt-limits-ok wcomp.3.out => not.3.in
|
||||
net tilt-limits-tripped not.3.out => axis.4.neg-lim-sw-in axis.4.pos-lim-sw-in axis.4.home-sw-in
|
||||
net rotate-home-tripped wcomp.4.out => axis.5.home-sw-in
|
||||
net tilt-limits-tripped not.3.out => joint.4.neg-lim-sw-in joint.4.pos-lim-sw-in joint.4.home-sw-in
|
||||
net rotate-home-tripped wcomp.4.out => joint.5.home-sw-in
|
||||
|
||||
# set location of switches
|
||||
# these positions are in vismach coords - they can be are offset from machine coords
|
||||
|
|
|
|||
|
|
@ -41,11 +41,11 @@ addf not.4 servo-thread
|
|||
|
||||
# create HAL signals for position commands from motion module
|
||||
# send them to limit blocks so it will ferror if it exceeds a limit
|
||||
net table-pos-cmd axis.0.motor-pos-cmd => limit3.0.in
|
||||
net saddle-pos-cmd axis.1.motor-pos-cmd => limit3.1.in
|
||||
net head-pos-cmd axis.2.motor-pos-cmd => limit3.2.in
|
||||
net tilt-pos-cmd axis.4.motor-pos-cmd => limit3.3.in
|
||||
net rotate-pos-cmd axis.5.motor-pos-cmd => limit3.4.in
|
||||
net table-pos-cmd joint.0.motor-pos-cmd => limit3.0.in
|
||||
net saddle-pos-cmd joint.1.motor-pos-cmd => limit3.1.in
|
||||
net head-pos-cmd joint.2.motor-pos-cmd => limit3.2.in
|
||||
net tilt-pos-cmd joint.4.motor-pos-cmd => limit3.3.in
|
||||
net rotate-pos-cmd joint.5.motor-pos-cmd => limit3.4.in
|
||||
|
||||
# set the limit block parameters from the ini file
|
||||
setp limit3.0.maxv [AXIS_0]MAX_VELOCITY
|
||||
|
|
@ -61,22 +61,22 @@ setp limit3.4.maxa [AXIS_5]MAX_ACCELERATION
|
|||
|
||||
# loop limited position commands back to motion module feedback
|
||||
# also send them to the vismach model and to the "limit switches"
|
||||
net table-pos-fb limit3.0.out => axis.0.motor-pos-fb max5gui.table wcomp.0.in
|
||||
net saddle-pos-fb limit3.1.out => axis.1.motor-pos-fb max5gui.saddle wcomp.1.in
|
||||
net head-pos-fb limit3.2.out => axis.2.motor-pos-fb max5gui.head wcomp.2.in
|
||||
net tilt-pos-fb limit3.3.out => axis.4.motor-pos-fb max5gui.tilt wcomp.3.in
|
||||
net rotate-pos-fb limit3.4.out => axis.5.motor-pos-fb max5gui.rotate wcomp.4.in
|
||||
net table-pos-fb limit3.0.out => joint.0.motor-pos-fb max5gui.table wcomp.0.in
|
||||
net saddle-pos-fb limit3.1.out => joint.1.motor-pos-fb max5gui.saddle wcomp.1.in
|
||||
net head-pos-fb limit3.2.out => joint.2.motor-pos-fb max5gui.head wcomp.2.in
|
||||
net tilt-pos-fb limit3.3.out => joint.4.motor-pos-fb max5gui.tilt wcomp.3.in
|
||||
net rotate-pos-fb limit3.4.out => joint.5.motor-pos-fb max5gui.rotate wcomp.4.in
|
||||
|
||||
# route home/limit switch signals to EMC
|
||||
net table-limits-ok wcomp.0.out => not.0.in
|
||||
net table-limits-tripped not.0.out => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in axis.0.home-sw-in
|
||||
net table-limits-tripped not.0.out => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in joint.0.home-sw-in
|
||||
net saddle-limits-ok wcomp.1.out => not.1.in
|
||||
net saddle-limits-tripped not.1.out => axis.1.neg-lim-sw-in axis.1.pos-lim-sw-in axis.1.home-sw-in
|
||||
net saddle-limits-tripped not.1.out => joint.1.neg-lim-sw-in joint.1.pos-lim-sw-in joint.1.home-sw-in
|
||||
net head-limits-ok wcomp.2.out => not.2.in
|
||||
net head-limits-tripped not.2.out => axis.2.neg-lim-sw-in axis.2.pos-lim-sw-in axis.2.home-sw-in
|
||||
net head-limits-tripped not.2.out => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
|
||||
net tilt-limits-ok wcomp.3.out => not.3.in
|
||||
net tilt-limits-tripped not.3.out => axis.4.neg-lim-sw-in axis.4.pos-lim-sw-in axis.4.home-sw-in
|
||||
net rotate-home-tripped wcomp.4.out => axis.5.home-sw-in
|
||||
net tilt-limits-tripped not.3.out => joint.4.neg-lim-sw-in joint.4.pos-lim-sw-in joint.4.home-sw-in
|
||||
net rotate-home-tripped wcomp.4.out => joint.5.home-sw-in
|
||||
|
||||
# set location of switches
|
||||
# these positions are in vismach coords - they can be are offset from machine coords
|
||||
|
|
|
|||
|
|
@ -19,21 +19,21 @@ addf ddt.7 servo-thread
|
|||
addf ddt.8 servo-thread
|
||||
|
||||
# create HAL signals for position commands from motion module
|
||||
net J0pos <= axis.0.motor-pos-cmd
|
||||
net J1pos <= axis.1.motor-pos-cmd
|
||||
net J2pos <= axis.2.motor-pos-cmd
|
||||
net J3pos <= axis.3.motor-pos-cmd
|
||||
net J4pos <= axis.4.motor-pos-cmd
|
||||
net J5pos <= axis.5.motor-pos-cmd
|
||||
net J0pos <= joint.0.motor-pos-cmd
|
||||
net J1pos <= joint.1.motor-pos-cmd
|
||||
net J2pos <= joint.2.motor-pos-cmd
|
||||
net J3pos <= joint.3.motor-pos-cmd
|
||||
net J4pos <= joint.4.motor-pos-cmd
|
||||
net J5pos <= joint.5.motor-pos-cmd
|
||||
|
||||
|
||||
# loop position commands back to motion module feedback
|
||||
net J0pos => axis.0.motor-pos-fb
|
||||
net J1pos => axis.1.motor-pos-fb
|
||||
net J2pos => axis.2.motor-pos-fb
|
||||
net J3pos => axis.3.motor-pos-fb
|
||||
net J4pos => axis.4.motor-pos-fb
|
||||
net J5pos => axis.5.motor-pos-fb
|
||||
net J0pos => joint.0.motor-pos-fb
|
||||
net J1pos => joint.1.motor-pos-fb
|
||||
net J2pos => joint.2.motor-pos-fb
|
||||
net J3pos => joint.3.motor-pos-fb
|
||||
net J4pos => joint.4.motor-pos-fb
|
||||
net J5pos => joint.5.motor-pos-fb
|
||||
|
||||
# send the position commands thru differentiators to
|
||||
# generate velocity and accel signals
|
||||
|
|
@ -76,19 +76,19 @@ net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
|||
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
|
||||
|
||||
# amp control
|
||||
net xena axis.0.amp-enable-out
|
||||
net yena axis.1.amp-enable-out
|
||||
net zena axis.2.amp-enable-out
|
||||
net aena axis.3.amp-enable-out
|
||||
net bena axis.4.amp-enable-out
|
||||
net cena axis.5.amp-enable-out
|
||||
net xena joint.0.amp-enable-out
|
||||
net yena joint.1.amp-enable-out
|
||||
net zena joint.2.amp-enable-out
|
||||
net aena joint.3.amp-enable-out
|
||||
net bena joint.4.amp-enable-out
|
||||
net cena joint.5.amp-enable-out
|
||||
|
||||
net xflt axis.0.amp-fault-in
|
||||
net yflt axis.1.amp-fault-in
|
||||
net zflt axis.2.amp-fault-in
|
||||
net aflt axis.3.amp-fault-in
|
||||
net bflt axis.4.amp-fault-in
|
||||
net cflt axis.5.amp-fault-in
|
||||
net xflt joint.0.amp-fault-in
|
||||
net yflt joint.1.amp-fault-in
|
||||
net zflt joint.2.amp-fault-in
|
||||
net aflt joint.3.amp-fault-in
|
||||
net bflt joint.4.amp-fault-in
|
||||
net cflt joint.5.amp-fault-in
|
||||
|
||||
loadusr -W pumagui
|
||||
|
||||
|
|
@ -122,10 +122,10 @@ net J3scaled scale.3.out pumagui.joint4
|
|||
net J4scaled scale.4.out pumagui.joint5
|
||||
net J5scaled scale.5.out pumagui.joint6
|
||||
|
||||
#net j0 axis.0.joint-pos-fb pumagui.joint1
|
||||
#net j1 axis.1.joint-pos-fb pumagui.joint2
|
||||
#net j2 axis.2.joint-pos-fb pumagui.joint3
|
||||
#net j3 axis.3.joint-pos-fb pumagui.joint4
|
||||
#net j4 axis.4.joint-pos-fb pumagui.joint5
|
||||
#net j5 axis.5.joint-pos-fb pumagui.joint6
|
||||
#net j6 axis.6.joint-pos-fb pumagui.grip
|
||||
#net j0 joint.0.pos-fb pumagui.joint1
|
||||
#net j1 joint.1.pos-fb pumagui.joint2
|
||||
#net j2 joint.2.pos-fb pumagui.joint3
|
||||
#net j3 joint.3.pos-fb pumagui.joint4
|
||||
#net j4 joint.4.pos-fb pumagui.joint5
|
||||
#net j5 joint.5.pos-fb pumagui.joint6
|
||||
#net j6 joint.6.pos-fb pumagui.grip
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ VERSION = $Revision$
|
|||
MACHINE = LinuxCNC-HAL-SIM-SCARA
|
||||
|
||||
#+ Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others
|
||||
DEBUG = 0
|
||||
#DEBUG = 0
|
||||
# DEBUG = 0x00000007
|
||||
#DEBUG = 0x7FFFFFFF
|
||||
DEBUG = 0x7FFFFFFF
|
||||
|
||||
###############################################################################
|
||||
# Sections for display options
|
||||
|
|
@ -30,10 +30,10 @@ DEBUG = 0
|
|||
[DISPLAY]
|
||||
|
||||
#+ Name of display program, e.g., xemc
|
||||
DISPLAY = axis
|
||||
# DISPLAY = axis
|
||||
# DISPLAY = usrmot
|
||||
# DISPLAY = mini
|
||||
# DISPLAY = tkemc
|
||||
DISPLAY = tkemc
|
||||
|
||||
#- Cycle time, in seconds, that display will sleep between polls
|
||||
CYCLE_TIME = 0.200
|
||||
|
|
@ -79,6 +79,7 @@ CYCLE_TIME = 0.010
|
|||
|
||||
#- File containing interpreter variables
|
||||
PARAMETER_FILE = scara.var
|
||||
RS274NGC_STARTUP_CODE = G21
|
||||
|
||||
###############################################################################
|
||||
# Motion control section
|
||||
|
|
@ -126,22 +127,51 @@ HALUI = halui
|
|||
[TRAJ]
|
||||
#+ machine specific settings
|
||||
AXES = 6
|
||||
COORDINATES = X Y Z C
|
||||
HOME = 0 0 0 0
|
||||
LINEAR_UNITS = 1.0
|
||||
ANGULAR_UNITS = 1.0
|
||||
COORDINATES = X Y Z C # could pick these up from the [AXIS_*] sections
|
||||
HOME = 0 0 0 0 # ditto - " -
|
||||
CYCLE_TIME = 0.010
|
||||
DEFAULT_VELOCITY = 1.0
|
||||
MAX_VELOCITY = 600.0
|
||||
DEFAULT_ACCELERATION = 100.0
|
||||
MAX_ACCELERATION = 200.0
|
||||
LINEAR_UNITS = mm
|
||||
DEFAULT_LINEAR_VELOCITY = 1.0
|
||||
MAX_LINEAR_VELOCITY = 600.0
|
||||
DEFAULT_LINEAR_ACCELERATION = 100.0
|
||||
MAX_LINEAR_ACCELERATION = 200.0
|
||||
ANGULAR_UNITS = degree
|
||||
DEFAULT_ANGULAR_VELOCITY = 1.0
|
||||
MAX_ANGULAR_VELOCITY = 600.0
|
||||
DEFAULT_ANGULAR_ACCELERATION = 100.0
|
||||
MAX_ANGULAR_ACCELERATION = 200.0
|
||||
|
||||
###############################################################################
|
||||
# Axes sections
|
||||
###############################################################################
|
||||
|
||||
#+ First axis
|
||||
[AXIS_0]
|
||||
[AXIS_X]
|
||||
# do we need this?
|
||||
|
||||
[AXIS_Y]
|
||||
# do we need this?
|
||||
|
||||
[AXIS_Z]
|
||||
# do we need this?
|
||||
|
||||
[AXIS_C]
|
||||
# do we need this?
|
||||
|
||||
###############################################################################
|
||||
# Kinematics section
|
||||
###############################################################################
|
||||
|
||||
[KINS]
|
||||
JOINTS = 4
|
||||
KINEMATICS = scarakins
|
||||
|
||||
###############################################################################
|
||||
# Joints sections
|
||||
###############################################################################
|
||||
|
||||
#+ First joint
|
||||
[JOINT_0]
|
||||
NAME = shoulder
|
||||
TYPE = ANGULAR
|
||||
HOME = 0.000
|
||||
MAX_VELOCITY = 30.0
|
||||
|
|
@ -160,8 +190,9 @@ HOME_USE_INDEX = NO
|
|||
HOME_IGNORE_LIMITS = NO
|
||||
HOME_SEQUENCE = 0
|
||||
|
||||
#+ Second axis
|
||||
[AXIS_1]
|
||||
#+ Second joint
|
||||
[JOINT_1]
|
||||
NAME = elbow
|
||||
TYPE = ANGULAR
|
||||
HOME = 0.000
|
||||
MAX_VELOCITY = 30.0
|
||||
|
|
@ -180,8 +211,9 @@ HOME_USE_INDEX = NO
|
|||
HOME_IGNORE_LIMITS = NO
|
||||
HOME_SEQUENCE = 0
|
||||
|
||||
#+ Third axis
|
||||
[AXIS_2]
|
||||
#+ Third joint
|
||||
[JOINT_2]
|
||||
NAME = z-slide
|
||||
TYPE = LINEAR
|
||||
HOME = 25.000
|
||||
MAX_VELOCITY = 30.0
|
||||
|
|
@ -200,8 +232,9 @@ HOME_USE_INDEX = NO
|
|||
HOME_IGNORE_LIMITS = NO
|
||||
HOME_SEQUENCE = 0
|
||||
|
||||
#+ Fourth axis
|
||||
[AXIS_5]
|
||||
#+ Fourth joint
|
||||
[JOINT_3]
|
||||
NAME = wrist
|
||||
TYPE = ANGULAR
|
||||
HOME = 0.000
|
||||
MAX_VELOCITY = 30.0
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
# core HAL config file for simulation - 4 axis
|
||||
|
||||
# load RT modules
|
||||
loadrt scarakins
|
||||
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]TRAJ_PERIOD num_joints=[TRAJ]AXES
|
||||
loadrt [KINS]KINEMATICS
|
||||
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]TRAJ_PERIOD key=[EMCMOT]SHMEM_KEY num_joints=[KINS]JOINTS
|
||||
loadrt ddt count=12
|
||||
|
||||
# add motion controller functions to servo thread
|
||||
|
|
@ -19,17 +19,17 @@ addf ddt.7 servo-thread
|
|||
addf ddt.8 servo-thread
|
||||
|
||||
# create HAL signals for position commands from motion module
|
||||
net J0pos <= axis.0.motor-pos-cmd
|
||||
net J1pos <= axis.1.motor-pos-cmd
|
||||
net J2pos <= axis.2.motor-pos-cmd
|
||||
net J3pos <= axis.3.motor-pos-cmd
|
||||
net J0pos <= joint.0.motor-pos-cmd
|
||||
net J1pos <= joint.1.motor-pos-cmd
|
||||
net J2pos <= joint.2.motor-pos-cmd
|
||||
net J3pos <= joint.3.motor-pos-cmd
|
||||
|
||||
|
||||
# loop position commands back to motion module feedback
|
||||
net J0pos => axis.0.motor-pos-fb
|
||||
net J1pos => axis.1.motor-pos-fb
|
||||
net J2pos => axis.2.motor-pos-fb
|
||||
net J3pos => axis.3.motor-pos-fb
|
||||
net J0pos => joint.0.motor-pos-fb
|
||||
net J1pos => joint.1.motor-pos-fb
|
||||
net J2pos => joint.2.motor-pos-fb
|
||||
net J3pos => joint.3.motor-pos-fb
|
||||
|
||||
# send the position commands thru differentiators to
|
||||
# generate velocity and accel signals
|
||||
|
|
@ -62,19 +62,19 @@ net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
|||
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
|
||||
|
||||
# amp control
|
||||
net xena axis.0.amp-enable-out
|
||||
net yena axis.1.amp-enable-out
|
||||
net zena axis.2.amp-enable-out
|
||||
net aena axis.3.amp-enable-out
|
||||
net xena joint.0.amp-enable-out
|
||||
net yena joint.1.amp-enable-out
|
||||
net zena joint.2.amp-enable-out
|
||||
net aena joint.3.amp-enable-out
|
||||
|
||||
net xflt axis.0.amp-fault-in
|
||||
net yflt axis.1.amp-fault-in
|
||||
net zflt axis.2.amp-fault-in
|
||||
net aflt axis.3.amp-fault-in
|
||||
net xflt joint.0.amp-fault-in
|
||||
net yflt joint.1.amp-fault-in
|
||||
net zflt joint.2.amp-fault-in
|
||||
net aflt joint.3.amp-fault-in
|
||||
|
||||
loadusr -W scaragui
|
||||
|
||||
net j0 axis.0.joint-pos-fb scaragui.joint0
|
||||
net j1 axis.1.joint-pos-fb scaragui.joint1
|
||||
net j2 axis.2.joint-pos-fb scaragui.joint2
|
||||
net j3 axis.3.joint-pos-fb scaragui.joint3
|
||||
net j0 joint.0.pos-fb scaragui.joint0
|
||||
net j1 joint.1.pos-fb scaragui.joint1
|
||||
net j2 joint.2.pos-fb scaragui.joint2
|
||||
net j3 joint.3.pos-fb scaragui.joint3
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ addf pid.1.do-pid-calcs servo-thread
|
|||
addf pid.2.do-pid-calcs servo-thread
|
||||
|
||||
# connect position feedback
|
||||
net Xpos-fb axis.0.motor-pos-fb => pid.0.feedback
|
||||
net Ypos-fb axis.1.motor-pos-fb => pid.1.feedback
|
||||
net Zpos-fb axis.2.motor-pos-fb => pid.2.feedback
|
||||
net Xpos-fb joint.0.motor-pos-fb => pid.0.feedback
|
||||
net Ypos-fb joint.1.motor-pos-fb => pid.1.feedback
|
||||
net Zpos-fb joint.2.motor-pos-fb => pid.2.feedback
|
||||
|
||||
# create PID to DAC output signals
|
||||
net Xoutput <= pid.0.output
|
||||
|
|
@ -64,11 +64,11 @@ setp pid.2.FF2 [AXIS_2]FF2
|
|||
setp pid.2.deadband [AXIS_2]DEADBAND
|
||||
|
||||
# position command signals
|
||||
net Xpos-cmd axis.0.motor-pos-cmd => pid.0.command
|
||||
net Ypos-cmd axis.1.motor-pos-cmd => pid.1.command
|
||||
net Zpos-cmd axis.2.motor-pos-cmd => pid.2.command
|
||||
net Xpos-cmd joint.0.motor-pos-cmd => pid.0.command
|
||||
net Ypos-cmd joint.1.motor-pos-cmd => pid.1.command
|
||||
net Zpos-cmd joint.2.motor-pos-cmd => pid.2.command
|
||||
|
||||
# axis enable signals
|
||||
net Xenable axis.0.amp-enable-out => pid.0.enable
|
||||
net Yenable axis.1.amp-enable-out => pid.1.enable
|
||||
net Zenable axis.2.amp-enable-out => pid.2.enable
|
||||
net Xenable joint.0.amp-enable-out => pid.0.enable
|
||||
net Yenable joint.1.amp-enable-out => pid.1.enable
|
||||
net Zenable joint.2.amp-enable-out => pid.2.enable
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ addf vel_xyz servo-thread
|
|||
|
||||
# create HAL signals for position commands from motion module
|
||||
# loop position commands back to motion module feedback
|
||||
net Xpos axis.0.motor-pos-cmd => axis.0.motor-pos-fb ddt_x.in
|
||||
net Ypos axis.1.motor-pos-cmd => axis.1.motor-pos-fb ddt_y.in
|
||||
net Zpos axis.2.motor-pos-cmd => axis.2.motor-pos-fb ddt_z.in
|
||||
net Xpos joint.0.motor-pos-cmd => joint.0.motor-pos-fb ddt_x.in
|
||||
net Ypos joint.1.motor-pos-cmd => joint.1.motor-pos-fb ddt_y.in
|
||||
net Zpos joint.2.motor-pos-cmd => joint.2.motor-pos-fb ddt_z.in
|
||||
|
||||
# send the position commands thru differentiators to
|
||||
# generate velocity and accel signals
|
||||
|
|
|
|||
|
|
@ -25,15 +25,15 @@ addf vel_xyz servo-thread
|
|||
|
||||
# create HAL signals for position commands from motion module
|
||||
# loop position commands back to motion module feedback
|
||||
net Xpos axis.0.motor-pos-cmd => axis.0.motor-pos-fb ddt_x.in
|
||||
net Ypos axis.1.motor-pos-cmd => axis.1.motor-pos-fb ddt_y.in
|
||||
net Zpos axis.2.motor-pos-cmd => axis.2.motor-pos-fb ddt_z.in
|
||||
net Apos axis.3.motor-pos-cmd => axis.3.motor-pos-fb
|
||||
net Bpos axis.4.motor-pos-cmd => axis.4.motor-pos-fb
|
||||
net Cpos axis.5.motor-pos-cmd => axis.5.motor-pos-fb
|
||||
net Upos axis.6.motor-pos-cmd => axis.6.motor-pos-fb
|
||||
net Vpos axis.7.motor-pos-cmd => axis.7.motor-pos-fb
|
||||
net Wpos axis.8.motor-pos-cmd => axis.8.motor-pos-fb
|
||||
net Xpos joint.0.motor-pos-cmd => joint.0.motor-pos-fb ddt_x.in
|
||||
net Ypos joint.1.motor-pos-cmd => joint.1.motor-pos-fb ddt_y.in
|
||||
net Zpos joint.2.motor-pos-cmd => joint.2.motor-pos-fb ddt_z.in
|
||||
net Apos joint.3.motor-pos-cmd => joint.3.motor-pos-fb
|
||||
net Bpos joint.4.motor-pos-cmd => joint.4.motor-pos-fb
|
||||
net Cpos joint.5.motor-pos-cmd => joint.5.motor-pos-fb
|
||||
net Upos joint.6.motor-pos-cmd => joint.6.motor-pos-fb
|
||||
net Vpos joint.7.motor-pos-cmd => joint.7.motor-pos-fb
|
||||
net Wpos joint.8.motor-pos-cmd => joint.8.motor-pos-fb
|
||||
|
||||
# send the position commands thru differentiators to
|
||||
# generate velocity and accel signals
|
||||
|
|
|
|||
|
|
@ -18,20 +18,20 @@ addf motion-controller servo-thread
|
|||
addf stepgen.update-freq servo-thread
|
||||
|
||||
# connect position commands from motion module to step generator
|
||||
net Xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
|
||||
net Ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
|
||||
net Zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
|
||||
net Xpos-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
|
||||
net Ypos-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd
|
||||
net Zpos-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd
|
||||
|
||||
# connect position feedback from step generators
|
||||
# to motion module
|
||||
net Xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
|
||||
net Ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
|
||||
net Zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
|
||||
net Xpos-fb stepgen.0.position-fb => joint.0.motor-pos-fb
|
||||
net Ypos-fb stepgen.1.position-fb => joint.1.motor-pos-fb
|
||||
net Zpos-fb stepgen.2.position-fb => joint.2.motor-pos-fb
|
||||
|
||||
# connect enable signals for step generators
|
||||
net Xen axis.0.amp-enable-out => stepgen.0.enable
|
||||
net Yen axis.1.amp-enable-out => stepgen.1.enable
|
||||
net Zen axis.2.amp-enable-out => stepgen.2.enable
|
||||
net Xen joint.0.amp-enable-out => stepgen.0.enable
|
||||
net Yen joint.1.amp-enable-out => stepgen.1.enable
|
||||
net Zen joint.2.amp-enable-out => stepgen.2.enable
|
||||
|
||||
# connect signals to step pulse generator outputs
|
||||
net Xstep <= stepgen.0.step
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ addf motion-controller servo-thread
|
|||
|
||||
# create HAL signals for position commands from motion module
|
||||
# loop position commands back to motion module feedback
|
||||
net J0pos axis.0.motor-pos-cmd => axis.0.motor-pos-fb
|
||||
net J1pos axis.1.motor-pos-cmd => axis.1.motor-pos-fb
|
||||
net J2pos axis.2.motor-pos-cmd => axis.2.motor-pos-fb
|
||||
net J3pos axis.3.motor-pos-cmd => axis.3.motor-pos-fb
|
||||
net J0pos joint.0.motor-pos-cmd => joint.0.motor-pos-fb
|
||||
net J1pos joint.1.motor-pos-cmd => joint.1.motor-pos-fb
|
||||
net J2pos joint.2.motor-pos-cmd => joint.2.motor-pos-fb
|
||||
net J3pos joint.3.motor-pos-cmd => joint.3.motor-pos-fb
|
||||
|
||||
# estop loopback
|
||||
net estop-loop iocontrol.0.user-enable-out => iocontrol.0.emc-enable-in
|
||||
|
|
@ -24,12 +24,12 @@ net tool-change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed
|
|||
|
||||
# amp control - these nets are not used, but are placeholders for
|
||||
# converting this sample config to actual machines
|
||||
net J0ena <= axis.0.amp-enable-out
|
||||
net J1ena <= axis.1.amp-enable-out
|
||||
net J2ena <= axis.2.amp-enable-out
|
||||
net J3ena <= axis.3.amp-enable-out
|
||||
net J0ena <= joint.0.amp-enable-out
|
||||
net J1ena <= joint.1.amp-enable-out
|
||||
net J2ena <= joint.2.amp-enable-out
|
||||
net J3ena <= joint.3.amp-enable-out
|
||||
|
||||
net J0flt => axis.0.amp-fault-in
|
||||
net J1flt => axis.1.amp-fault-in
|
||||
net J2flt => axis.2.amp-fault-in
|
||||
net J3flt => axis.3.amp-fault-in
|
||||
net J0flt => joint.0.amp-fault-in
|
||||
net J1flt => joint.1.amp-fault-in
|
||||
net J2flt => joint.2.amp-fault-in
|
||||
net J3flt => joint.3.amp-fault-in
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
loadrt timedelay names=timedelay_unlock
|
||||
addf timedelay_unlock servo-thread
|
||||
|
||||
net B-unlock axis.4.unlock => timedelay_unlock.in
|
||||
net B-is-unlocked timedelay_unlock.out => axis.4.is-unlocked
|
||||
net B-unlock joint.4.unlock => timedelay_unlock.in
|
||||
net B-is-unlocked timedelay_unlock.out => joint.4.is-unlocked
|
||||
|
||||
setp timedelay_unlock.on-delay 0.75
|
||||
setp timedelay_unlock.off-delay 0.5
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@ addf ddt_zv servo-thread
|
|||
|
||||
# get position feedback from encoder module
|
||||
# connect position feedback to PID loop and motion module
|
||||
net Xpos-fb encoder_px.position => pid_x.feedback axis.0.motor-pos-fb
|
||||
net Ypos-fb encoder_py.position => pid_y.feedback axis.1.motor-pos-fb
|
||||
net Zpos-fb encoder_pz.position => pid_z.feedback axis.2.motor-pos-fb
|
||||
net Xpos-fb encoder_px.position => pid_x.feedback joint.0.motor-pos-fb
|
||||
net Ypos-fb encoder_py.position => pid_y.feedback joint.1.motor-pos-fb
|
||||
net Zpos-fb encoder_pz.position => pid_z.feedback joint.2.motor-pos-fb
|
||||
|
||||
# set position feedback scaling
|
||||
setp encoder_px.position-scale [AXIS_0]INPUT_SCALE
|
||||
|
|
@ -68,19 +68,19 @@ setp encoder_py.position-scale [AXIS_1]INPUT_SCALE
|
|||
setp encoder_pz.position-scale [AXIS_2]INPUT_SCALE
|
||||
|
||||
# connect encoder index-enables for homing on index
|
||||
net Xindex-enable encoder_px.index-enable <=> axis.0.index-enable pid_x.index-enable
|
||||
net Yindex-enable encoder_py.index-enable <=> axis.1.index-enable
|
||||
net Zindex-enable encoder_pz.index-enable <=> axis.2.index-enable
|
||||
net Xindex-enable encoder_px.index-enable <=> joint.0.index-enable pid_x.index-enable
|
||||
net Yindex-enable encoder_py.index-enable <=> joint.1.index-enable
|
||||
net Zindex-enable encoder_pz.index-enable <=> joint.2.index-enable
|
||||
|
||||
# connect position commands from motion controller to PID input
|
||||
net Xpos-cmd <= axis.0.motor-pos-cmd => pid_x.command
|
||||
net Ypos-cmd <= axis.1.motor-pos-cmd => pid_y.command
|
||||
net Zpos-cmd <= axis.2.motor-pos-cmd => pid_z.command
|
||||
net Xpos-cmd <= joint.0.motor-pos-cmd => pid_x.command
|
||||
net Ypos-cmd <= joint.1.motor-pos-cmd => pid_y.command
|
||||
net Zpos-cmd <= joint.2.motor-pos-cmd => pid_z.command
|
||||
|
||||
# connect motion controller enables to PID blocks
|
||||
net Xenable axis.0.amp-enable-out => pid_x.enable
|
||||
net Yenable axis.1.amp-enable-out => pid_y.enable
|
||||
net Zenable axis.2.amp-enable-out => pid_z.enable
|
||||
net Xenable joint.0.amp-enable-out => pid_x.enable
|
||||
net Yenable joint.1.amp-enable-out => pid_y.enable
|
||||
net Zenable joint.2.amp-enable-out => pid_z.enable
|
||||
|
||||
# connect PID loops to scale blocks that translate to motor revs per sec
|
||||
net Xoutput pid_x.output => scale_x.in
|
||||
|
|
@ -193,9 +193,9 @@ net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
|
|||
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
|
||||
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
|
||||
|
||||
net xflt => axis.0.amp-fault-in
|
||||
net yflt => axis.1.amp-fault-in
|
||||
net zflt => axis.2.amp-fault-in
|
||||
net xflt => joint.0.amp-fault-in
|
||||
net yflt => joint.1.amp-fault-in
|
||||
net zflt => joint.2.amp-fault-in
|
||||
|
||||
# a second set of encoder counters keeps track of position
|
||||
net XphA => encoder_x.phase-A
|
||||
|
|
@ -216,17 +216,17 @@ net Yaxis-pos encoder_y.position => wcomp_yneg.in wcomp_ypos.in wcomp_yhome.in
|
|||
net Zaxis-pos encoder_z.position => wcomp_zneg.in wcomp_zpos.in wcomp_zhome.in
|
||||
|
||||
# connect simulated switch outputs to motion controller
|
||||
net Xminlim wcomp_xneg.out => axis.0.neg-lim-sw-in
|
||||
net Xmaxlim wcomp_xpos.out => axis.0.pos-lim-sw-in
|
||||
net Xhome wcomp_xhome.out => axis.0.home-sw-in
|
||||
net Xminlim wcomp_xneg.out => joint.0.neg-lim-sw-in
|
||||
net Xmaxlim wcomp_xpos.out => joint.0.pos-lim-sw-in
|
||||
net Xhome wcomp_xhome.out => joint.0.home-sw-in
|
||||
|
||||
net Yminlim wcomp_yneg.out => axis.1.neg-lim-sw-in
|
||||
net Ymaxlim wcomp_ypos.out => axis.1.pos-lim-sw-in
|
||||
net Yhome wcomp_yhome.out => axis.1.home-sw-in
|
||||
net Yminlim wcomp_yneg.out => joint.1.neg-lim-sw-in
|
||||
net Ymaxlim wcomp_ypos.out => joint.1.pos-lim-sw-in
|
||||
net Yhome wcomp_yhome.out => joint.1.home-sw-in
|
||||
|
||||
net Zminlim wcomp_zneg.out => axis.2.neg-lim-sw-in
|
||||
net Zmaxlim wcomp_zpos.out => axis.2.pos-lim-sw-in
|
||||
net Zhome wcomp_zhome.out => axis.2.home-sw-in
|
||||
net Zminlim wcomp_zneg.out => joint.2.neg-lim-sw-in
|
||||
net Zmaxlim wcomp_zpos.out => joint.2.pos-lim-sw-in
|
||||
net Zhome wcomp_zhome.out => joint.2.home-sw-in
|
||||
|
||||
# configure the points at which the simulated switches trip
|
||||
# X axis first
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@ setp comp_y.hyst .02
|
|||
setp comp_z.hyst .02
|
||||
|
||||
net Xhomesw <= comp_x.out
|
||||
net Yhomesw <= comp_y.out => axis.1.home-sw-in
|
||||
net Yhomesw <= comp_y.out => joint.1.home-sw-in
|
||||
net Zhomesw <= comp_z.out
|
||||
|
||||
net Xhomesw => or2_0.in0
|
||||
net Zhomesw => or2_0.in1
|
||||
net XZhomesw or2_0.out => axis.0.home-sw-in axis.2.home-sw-in
|
||||
net XZhomesw or2_0.out => joint.0.home-sw-in joint.2.home-sw-in
|
||||
|
||||
addf comp_x servo-thread
|
||||
addf comp_y servo-thread
|
||||
|
|
|
|||
|
|
@ -28,17 +28,17 @@ net Zpos-fb => wcomp_zmax.in
|
|||
net Zpos-fb => wcomp_zhome.in
|
||||
|
||||
# connect simulated switch outputs to motion controller
|
||||
net Xminlim wcomp_xmin.out => axis.0.neg-lim-sw-in
|
||||
net Xmaxlim wcomp_xmax.out => axis.0.pos-lim-sw-in
|
||||
net Xhome wcomp_xhome.out => axis.0.home-sw-in
|
||||
net Xminlim wcomp_xmin.out => joint.0.neg-lim-sw-in
|
||||
net Xmaxlim wcomp_xmax.out => joint.0.pos-lim-sw-in
|
||||
net Xhome wcomp_xhome.out => joint.0.home-sw-in
|
||||
|
||||
net Yminlim wcomp_ymin.out => axis.1.neg-lim-sw-in
|
||||
net Ymaxlim wcomp_ymax.out => axis.1.pos-lim-sw-in
|
||||
net Yhome wcomp_yhome.out => axis.1.home-sw-in
|
||||
net Yminlim wcomp_ymin.out => joint.1.neg-lim-sw-in
|
||||
net Ymaxlim wcomp_ymax.out => joint.1.pos-lim-sw-in
|
||||
net Yhome wcomp_yhome.out => joint.1.home-sw-in
|
||||
|
||||
net Zminlim wcomp_zmin.out => axis.2.neg-lim-sw-in
|
||||
net Zmaxlim wcomp_zmax.out => axis.2.pos-lim-sw-in
|
||||
net Zhome wcomp_zhome.out => axis.2.home-sw-in
|
||||
net Zminlim wcomp_zmin.out => joint.2.neg-lim-sw-in
|
||||
net Zmaxlim wcomp_zmax.out => joint.2.pos-lim-sw-in
|
||||
net Zhome wcomp_zhome.out => joint.2.home-sw-in
|
||||
|
||||
# configure the points at which the simulated switches trip
|
||||
# X axis first
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ addf ddt_j2v servo-thread
|
|||
|
||||
# create HAL signals for position commands from motion module
|
||||
# loop position commands back to motion module feedback
|
||||
net J0pos axis.0.motor-pos-cmd => axis.0.motor-pos-fb ddt_j0.in
|
||||
net J1pos axis.1.motor-pos-cmd => axis.1.motor-pos-fb ddt_j1.in
|
||||
net J2pos axis.2.motor-pos-cmd => axis.2.motor-pos-fb ddt_j2.in
|
||||
net J0pos joint.0.motor-pos-cmd => joint.0.motor-pos-fb ddt_j0.in
|
||||
net J1pos joint.1.motor-pos-cmd => joint.1.motor-pos-fb ddt_j1.in
|
||||
net J2pos joint.2.motor-pos-cmd => joint.2.motor-pos-fb ddt_j2.in
|
||||
|
||||
# send the position commands thru differentiators to
|
||||
# generate velocity and accel signals
|
||||
|
|
@ -46,10 +46,10 @@ net tool-prep-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
|
|||
net tool-change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed
|
||||
|
||||
# amp control
|
||||
net J0ena <= axis.0.amp-enable-out
|
||||
net J1ena <= axis.1.amp-enable-out
|
||||
net J2ena <= axis.2.amp-enable-out
|
||||
net J0ena <= joint.0.amp-enable-out
|
||||
net J1ena <= joint.1.amp-enable-out
|
||||
net J2ena <= joint.2.amp-enable-out
|
||||
|
||||
net J0flt => axis.0.amp-fault-in
|
||||
net J1flt => axis.1.amp-fault-in
|
||||
net J2flt => axis.2.amp-fault-in
|
||||
net J0flt => joint.0.amp-fault-in
|
||||
net J1flt => joint.1.amp-fault-in
|
||||
net J2flt => joint.2.amp-fault-in
|
||||
|
|
|
|||
|
|
@ -267,6 +267,7 @@ HEADERS := \
|
|||
config.h \
|
||||
emc/ini/emcIniFile.hh \
|
||||
emc/ini/iniaxis.hh \
|
||||
emc/ini/inijoint.hh \
|
||||
emc/ini/initool.hh \
|
||||
emc/ini/initraj.hh \
|
||||
emc/ini/inihal.hh \
|
||||
|
|
@ -943,6 +944,7 @@ motmod-objs += emc/motion/motion.o
|
|||
motmod-objs += emc/motion/command.o
|
||||
motmod-objs += emc/motion/control.o
|
||||
motmod-objs += emc/motion/homing.o
|
||||
motmod-objs += emc/motion/simple_tp.o
|
||||
motmod-objs += emc/motion/emcmotutil.o
|
||||
motmod-objs += emc/motion/stashf.o
|
||||
motmod-objs += emc/motion/dbuf.o
|
||||
|
|
|
|||
|
|
@ -33,17 +33,17 @@
|
|||
#include "emcIniFile.hh"
|
||||
|
||||
|
||||
IniFile::StrIntPair EmcIniFile::axisTypeMap[] = {
|
||||
{"LINEAR", EMC_AXIS_LINEAR},
|
||||
{"ANGULAR", EMC_AXIS_ANGULAR},
|
||||
IniFile::StrIntPair EmcIniFile::jointTypeMap[] = {
|
||||
{"LINEAR", EMC_LINEAR},
|
||||
{"ANGULAR", EMC_ANGULAR},
|
||||
{ NULL, 0 },
|
||||
};
|
||||
|
||||
EmcIniFile::ErrorCode
|
||||
EmcIniFile::Find(EmcAxisType *result,
|
||||
EmcIniFile::Find(EmcJointType *result,
|
||||
const char *tag, const char *section, int num)
|
||||
{
|
||||
return(IniFile::Find((int *)result, axisTypeMap, tag, section, num));
|
||||
return(IniFile::Find((int *)result, jointTypeMap, tag, section, num));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class EmcIniFile : public IniFile {
|
|||
public:
|
||||
EmcIniFile(int errMask=0):IniFile(errMask){}
|
||||
|
||||
ErrorCode Find(EmcAxisType *result, const char *tag,
|
||||
ErrorCode Find(EmcJointType *result, const char *tag,
|
||||
const char *section=NULL, int num = 1);
|
||||
ErrorCode Find(bool *result, const char *tag,
|
||||
const char *section, int num=1);
|
||||
|
|
@ -82,7 +82,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
static StrIntPair axisTypeMap[];
|
||||
static StrIntPair jointTypeMap[];
|
||||
static StrIntPair boolMap[];
|
||||
static StrDoublePair linearUnitsMap[];
|
||||
static StrDoublePair angularUnitsMap[];
|
||||
|
|
|
|||
|
|
@ -33,48 +33,23 @@
|
|||
/*
|
||||
loadAxis(int axis)
|
||||
|
||||
Loads ini file params for axis, axis = 0, ...
|
||||
Loads ini file params for axis, axis = X, Y, Z, A, B, C, U, V, W
|
||||
|
||||
TYPE <LINEAR ANGULAR> type of axis
|
||||
UNITS <float> units per mm or deg
|
||||
TYPE <LINEAR ANGULAR> type of axis (hardcoded: X,Y,Z,U,V,W: LINEAR, A,B,C: ANGULAR)
|
||||
MAX_VELOCITY <float> max vel for axis
|
||||
MAX_ACCELERATION <float> max accel for axis
|
||||
BACKLASH <float> backlash
|
||||
INPUT_SCALE <float> <float> scale, offset
|
||||
OUTPUT_SCALE <float> <float> scale, offset
|
||||
MIN_LIMIT <float> minimum soft position limit
|
||||
MAX_LIMIT <float> maximum soft position limit
|
||||
FERROR <float> maximum following error, scaled to max vel
|
||||
MIN_FERROR <float> minimum following error
|
||||
HOME <float> home position (where to go after home)
|
||||
HOME_FINAL_VEL <float> speed to move from HOME_OFFSET to HOME location (at the end of homing)
|
||||
HOME_OFFSET <float> home switch/index pulse location
|
||||
HOME_SEARCH_VEL <float> homing speed, search phase
|
||||
HOME_LATCH_VEL <float> homing speed, latch phase
|
||||
HOME_USE_INDEX <bool> use index pulse when homing?
|
||||
HOME_IGNORE_LIMITS <bool> ignore limit switches when homing?
|
||||
COMP_FILE <filename> file of axis compensation points
|
||||
HOME <float> home position in carthesian space (where to go after home) //FIXME-AJ: needed?
|
||||
|
||||
calls:
|
||||
|
||||
emcAxisSetAxis(int axis, unsigned char axisType);
|
||||
emcAxisSetUnits(int axis, double units);
|
||||
emcAxisSetBacklash(int axis, double backlash);
|
||||
emcAxisSetInterpolationRate(int axis, int rate);
|
||||
emcAxisSetInputScale(int axis, double scale, double offset);
|
||||
emcAxisSetOutputScale(int axis, double scale, double offset);
|
||||
emcAxisSetMinPositionLimit(int axis, double limit);
|
||||
emcAxisSetMaxPositionLimit(int axis, double limit);
|
||||
emcAxisSetFerror(int axis, double ferror);
|
||||
emcAxisSetMinFerror(int axis, double ferror);
|
||||
emcAxisSetHomingParams(int axis, double home, double offset,
|
||||
double search_vel, double latch_vel, int use_index, int ignore_limits );
|
||||
emcAxisActivate(int axis);
|
||||
emcAxisDeactivate(int axis);
|
||||
emcAxisSetMaxVelocity(int axis, double vel);
|
||||
emcAxisSetMaxAcceleration(int axis, double acc);
|
||||
emcAxisLoadComp(int axis, const char * file);
|
||||
emcAxisLoadComp(int axis, const char * file);
|
||||
*/
|
||||
|
||||
extern value_inihal_data old_inihal_data;
|
||||
|
|
@ -82,76 +57,35 @@ extern value_inihal_data old_inihal_data;
|
|||
static int loadAxis(int axis, EmcIniFile *axisIniFile)
|
||||
{
|
||||
char axisString[16];
|
||||
const char *inistring;
|
||||
EmcAxisType axisType;
|
||||
double units;
|
||||
double backlash;
|
||||
double offset;
|
||||
int axisType=0;
|
||||
double limit;
|
||||
double home;
|
||||
double search_vel;
|
||||
double latch_vel;
|
||||
double home_final_vel; // moving from OFFSET to HOME
|
||||
bool use_index;
|
||||
bool ignore_limits;
|
||||
bool is_shared;
|
||||
int sequence;
|
||||
int volatile_home;
|
||||
int locking_indexer;
|
||||
int comp_file_type; //type for the compensation file. type==0 means nom, forw, rev.
|
||||
double maxVelocity;
|
||||
double maxAcceleration;
|
||||
double ferror;
|
||||
|
||||
// compose string to match, axis = 0 -> AXIS_0, etc.
|
||||
sprintf(axisString, "AXIS_%d", axis);
|
||||
// compose string to match, axis = 0 -> AXIS_X etc.
|
||||
switch (axis) {
|
||||
case 0: sprintf(axisString, "AXIS_X");axisType=EMC_LINEAR;break;
|
||||
case 1: sprintf(axisString, "AXIS_Y");axisType=EMC_LINEAR;break;
|
||||
case 2: sprintf(axisString, "AXIS_Z");axisType=EMC_LINEAR;break;
|
||||
case 3: sprintf(axisString, "AXIS_A");axisType=EMC_ANGULAR;break;
|
||||
case 4: sprintf(axisString, "AXIS_B");axisType=EMC_ANGULAR;break;
|
||||
case 5: sprintf(axisString, "AXIS_C");axisType=EMC_ANGULAR;break;
|
||||
case 6: sprintf(axisString, "AXIS_U");axisType=EMC_LINEAR;break;
|
||||
case 7: sprintf(axisString, "AXIS_V");axisType=EMC_LINEAR;break;
|
||||
case 8: sprintf(axisString, "AXIS_W");axisType=EMC_LINEAR;break;
|
||||
}
|
||||
|
||||
axisIniFile->EnableExceptions(EmcIniFile::ERR_CONVERSION);
|
||||
|
||||
try {
|
||||
// set axis type
|
||||
axisType = EMC_AXIS_LINEAR; // default
|
||||
axisIniFile->Find(&axisType, "TYPE", axisString);
|
||||
|
||||
if (0 != emcAxisSetAxis(axis, axisType)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("bad return from emcAxisSetAxis\n");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// set units
|
||||
if(axisType == EMC_AXIS_LINEAR){
|
||||
units = emcTrajGetLinearUnits();
|
||||
axisIniFile->FindLinearUnits(&units, "UNITS", axisString);
|
||||
}else{
|
||||
units = emcTrajGetAngularUnits();
|
||||
axisIniFile->FindAngularUnits(&units, "UNITS", axisString);
|
||||
}
|
||||
|
||||
if (0 != emcAxisSetUnits(axis, units)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("bad return from emcAxisSetUnits\n");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// set backlash
|
||||
backlash = 0; // default
|
||||
axisIniFile->Find(&backlash, "BACKLASH", axisString);
|
||||
|
||||
if (0 != emcAxisSetBacklash(axis, backlash)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("bad return from emcAxisSetBacklash\n");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
old_inihal_data.backlash[axis] = backlash;
|
||||
home = 0;
|
||||
axisIniFile->Find(&home, "HOME", axisString);
|
||||
AXIS_WORLD_HOME[axis] = home;
|
||||
|
||||
// set min position limit
|
||||
limit = -1e99; // default
|
||||
axisIniFile->Find(&limit, "MIN_LIMIT", axisString);
|
||||
|
||||
if (0 != emcAxisSetMinPositionLimit(axis, limit)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("bad return from emcAxisSetMinPositionLimit\n");
|
||||
|
|
@ -163,7 +97,6 @@ static int loadAxis(int axis, EmcIniFile *axisIniFile)
|
|||
// set max position limit
|
||||
limit = 1e99; // default
|
||||
axisIniFile->Find(&limit, "MAX_LIMIT", axisString);
|
||||
|
||||
if (0 != emcAxisSetMaxPositionLimit(axis, limit)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("bad return from emcAxisSetMaxPositionLimit\n");
|
||||
|
|
@ -172,67 +105,9 @@ static int loadAxis(int axis, EmcIniFile *axisIniFile)
|
|||
}
|
||||
old_inihal_data.max_limit[axis] = limit;
|
||||
|
||||
// set following error limit (at max speed)
|
||||
ferror = 1; // default
|
||||
axisIniFile->Find(&ferror, "FERROR", axisString);
|
||||
|
||||
if (0 != emcAxisSetFerror(axis, ferror)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("bad return from emcAxisSetFerror\n");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
old_inihal_data.ferror[axis] = ferror;
|
||||
|
||||
// do MIN_FERROR, if it's there. If not, use value of maxFerror above
|
||||
axisIniFile->Find(&ferror, "MIN_FERROR", axisString);
|
||||
|
||||
if (0 != emcAxisSetMinFerror(axis, ferror)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("bad return from emcAxisSetMinFerror\n");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
old_inihal_data.min_ferror[axis] = ferror;
|
||||
|
||||
// set homing paramsters (total of 6)
|
||||
home = 0; // default
|
||||
axisIniFile->Find(&home, "HOME", axisString);
|
||||
offset = 0; // default
|
||||
axisIniFile->Find(&offset, "HOME_OFFSET", axisString);
|
||||
search_vel = 0; // default
|
||||
axisIniFile->Find(&search_vel, "HOME_SEARCH_VEL", axisString);
|
||||
latch_vel = 0; // default
|
||||
axisIniFile->Find(&latch_vel, "HOME_LATCH_VEL", axisString);
|
||||
home_final_vel = -1; // default (rapid)
|
||||
axisIniFile->Find(&home_final_vel, "HOME_FINAL_VEL", axisString);
|
||||
is_shared = false; // default
|
||||
axisIniFile->Find(&is_shared, "HOME_IS_SHARED", axisString);
|
||||
use_index = false; // default
|
||||
axisIniFile->Find(&use_index, "HOME_USE_INDEX", axisString);
|
||||
ignore_limits = false; // default
|
||||
axisIniFile->Find(&ignore_limits, "HOME_IGNORE_LIMITS", axisString);
|
||||
sequence = -1; // default
|
||||
axisIniFile->Find(&sequence, "HOME_SEQUENCE", axisString);
|
||||
volatile_home = 0; // default
|
||||
axisIniFile->Find(&volatile_home, "VOLATILE_HOME", axisString);
|
||||
locking_indexer = false;
|
||||
axisIniFile->Find(&locking_indexer, "LOCKING_INDEXER", axisString);
|
||||
|
||||
// issue NML message to set all params
|
||||
if (0 != emcAxisSetHomingParams(axis, home, offset, home_final_vel, search_vel,
|
||||
latch_vel, (int)use_index, (int)ignore_limits,
|
||||
(int)is_shared, sequence, volatile_home, locking_indexer)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("bad return from emcAxisSetHomingParams\n");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// set maximum velocity
|
||||
maxVelocity = DEFAULT_AXIS_MAX_VELOCITY;
|
||||
axisIniFile->Find(&maxVelocity, "MAX_VELOCITY", axisString);
|
||||
|
||||
if (0 != emcAxisSetMaxVelocity(axis, maxVelocity)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("bad return from emcAxisSetMaxVelocity\n");
|
||||
|
|
@ -244,27 +119,12 @@ static int loadAxis(int axis, EmcIniFile *axisIniFile)
|
|||
|
||||
maxAcceleration = DEFAULT_AXIS_MAX_ACCELERATION;
|
||||
axisIniFile->Find(&maxAcceleration, "MAX_ACCELERATION", axisString);
|
||||
|
||||
if (0 != emcAxisSetMaxAcceleration(axis, maxAcceleration)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("bad return from emcAxisSetMaxAcceleration\n");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
old_inihal_data.max_acceleration[axis] = maxAcceleration;
|
||||
|
||||
comp_file_type = 0; // default
|
||||
axisIniFile->Find(&comp_file_type, "COMP_FILE_TYPE", axisString);
|
||||
|
||||
if (NULL != (inistring = axisIniFile->Find("COMP_FILE", axisString))) {
|
||||
if (0 != emcAxisLoadComp(axis, inistring, comp_file_type)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("bad return from emcAxisLoadComp\n");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -273,14 +133,9 @@ static int loadAxis(int axis, EmcIniFile *axisIniFile)
|
|||
return -1;
|
||||
}
|
||||
|
||||
// lastly, activate axis. Do this last so that the motion controller
|
||||
// won't flag errors midway during configuration
|
||||
emcAxisActivate(axis);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
iniAxis(int axis, const char *filename)
|
||||
|
||||
|
|
@ -291,7 +146,6 @@ static int loadAxis(int axis, EmcIniFile *axisIniFile)
|
|||
*/
|
||||
int iniAxis(int axis, const char *filename)
|
||||
{
|
||||
int axes;
|
||||
EmcIniFile axisIniFile(EmcIniFile::ERR_TAG_NOT_FOUND |
|
||||
EmcIniFile::ERR_SECTION_NOT_FOUND |
|
||||
EmcIniFile::ERR_CONVERSION);
|
||||
|
|
@ -300,79 +154,9 @@ int iniAxis(int axis, const char *filename)
|
|||
return -1;
|
||||
}
|
||||
|
||||
try {
|
||||
axisIniFile.Find(&axes, "AXES", "TRAJ");
|
||||
}
|
||||
|
||||
catch(EmcIniFile::Exception &e){
|
||||
e.Print();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (axis < 0 || axis >= axes) {
|
||||
// requested axis exceeds machine axes
|
||||
return -1;
|
||||
}
|
||||
|
||||
// load its values
|
||||
if (0 != loadAxis(axis, &axisIniFile)) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! \todo FIXME-- begin temporary insert of ini file stuff */
|
||||
|
||||
#define INIFILE_MIN_FLOAT_PRECISION 3
|
||||
#define INIFILE_BACKUP_SUFFIX ".bak"
|
||||
|
||||
int iniGetFloatPrec(const char *str)
|
||||
{
|
||||
const char *ptr = str;
|
||||
int prec = 0;
|
||||
|
||||
// find '.', return min precision if no decimal point
|
||||
while (1) {
|
||||
if (*ptr == 0) {
|
||||
return INIFILE_MIN_FLOAT_PRECISION;
|
||||
}
|
||||
if (*ptr == '.') {
|
||||
break;
|
||||
}
|
||||
ptr++;
|
||||
}
|
||||
|
||||
// ptr is on '.', so step over
|
||||
ptr++;
|
||||
|
||||
// count number of digits until whitespace or end or non-digit
|
||||
while (1) {
|
||||
if (*ptr == 0) {
|
||||
break;
|
||||
}
|
||||
if (!isdigit(*ptr)) {
|
||||
break;
|
||||
}
|
||||
// else it's a digit
|
||||
prec++;
|
||||
ptr++;
|
||||
}
|
||||
|
||||
return prec >
|
||||
INIFILE_MIN_FLOAT_PRECISION ? prec : INIFILE_MIN_FLOAT_PRECISION;
|
||||
}
|
||||
|
||||
// end temporary insert of ini file stuff
|
||||
|
||||
/*
|
||||
dumpAxis(int axis, const char *filename, EMC_AXIS_STAT *status)
|
||||
|
||||
This used to rewrite an AXIS_n section of the ini file. Everyone
|
||||
now seems to think this is a bad idea. It's certainly incompatible
|
||||
with template/sample configurations that should not be changed by
|
||||
the user OR the program.
|
||||
*/
|
||||
int dumpAxis(int axis, const char *filename, EMC_AXIS_STAT * status)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,4 @@
|
|||
/* initializes axis modules from ini file */
|
||||
extern int iniAxis(int axis, const char *filename);
|
||||
|
||||
/* dump axis stat to ini file */
|
||||
extern int dumpAxis(int axis, const char *filename,
|
||||
EMC_AXIS_STAT * status);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -264,63 +264,63 @@ int check_ini_hal_items()
|
|||
if (CHANGED_IDX(backlash,idx) ) {
|
||||
if (debug) SHOW_CHANGE_IDX(backlash,idx);
|
||||
UPDATE_IDX(backlash,idx);
|
||||
if (0 != emcAxisSetBacklash(idx,NEW(backlash[idx]))) {
|
||||
if (0 != emcJointSetBacklash(idx,NEW(backlash[idx]))) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print("check_ini_hal_items:bad return value from emcAxisSetBacklash\n");
|
||||
rcs_print("check_ini_hal_items:bad return value from emcJointSetBacklash\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CHANGED_IDX(min_limit,idx) ) {
|
||||
if (debug) SHOW_CHANGE_IDX(min_limit,idx);
|
||||
UPDATE_IDX(min_limit,idx);
|
||||
if (0 != emcAxisSetMinPositionLimit(idx,NEW(min_limit[idx]))) {
|
||||
if (0 != emcJointSetMinPositionLimit(idx,NEW(min_limit[idx]))) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("check_ini_hal_items:bad return from emcAxisSetMinPositionLimit\n");
|
||||
rcs_print_error("check_ini_hal_items:bad return from emcJointSetMinPositionLimit\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CHANGED_IDX(max_limit,idx) ) {
|
||||
if (debug) SHOW_CHANGE_IDX(max_limit,idx);
|
||||
UPDATE_IDX(max_limit,idx);
|
||||
if (0 != emcAxisSetMaxPositionLimit(idx,NEW(max_limit[idx]))) {
|
||||
if (0 != emcJointSetMaxPositionLimit(idx,NEW(max_limit[idx]))) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("check_ini_hal_items:bad return from emcAxisSetMaxPositionLimit\n");
|
||||
rcs_print_error("check_ini_hal_items:bad return from emcJointSetMaxPositionLimit\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CHANGED_IDX(max_velocity,idx) ) {
|
||||
if (debug) SHOW_CHANGE_IDX(max_velocity,idx);
|
||||
UPDATE_IDX(max_velocity,idx);
|
||||
if (0 != emcAxisSetMaxVelocity(idx, NEW(max_velocity[idx]))) {
|
||||
if (0 != emcJointSetMaxVelocity(idx, NEW(max_velocity[idx]))) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("check_ini_hal_items:bad return from emcAxisSetMaxVelocity\n");
|
||||
rcs_print_error("check_ini_hal_items:bad return from emcJointSetMaxVelocity\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CHANGED_IDX(max_acceleration,idx) ) {
|
||||
if (debug) SHOW_CHANGE_IDX(max_acceleration,idx);
|
||||
UPDATE_IDX(max_acceleration,idx);
|
||||
if (0 != emcAxisSetMaxAcceleration(idx, NEW(max_acceleration[idx]))) {
|
||||
if (0 != emcJointSetMaxAcceleration(idx, NEW(max_acceleration[idx]))) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("check_ini_hal_items:bad return from emcAxisSetMaxAcceleration\n");
|
||||
rcs_print_error("check_ini_hal_items:bad return from emcJointSetMaxAcceleration\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CHANGED_IDX(ferror,idx) ) {
|
||||
if (debug) SHOW_CHANGE_IDX(ferror,idx);
|
||||
UPDATE_IDX(ferror,idx);
|
||||
if (0 != emcAxisSetFerror(idx,NEW(ferror[idx]))) {
|
||||
if (0 != emcJointSetFerror(idx,NEW(ferror[idx]))) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("check_ini_hal_items:bad return from emcAxisSetFerror\n");
|
||||
rcs_print_error("check_ini_hal_items:bad return from emcJointSetFerror\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CHANGED_IDX(min_ferror,idx) ) {
|
||||
if (debug) SHOW_CHANGE_IDX(min_ferror,idx);
|
||||
UPDATE_IDX(min_ferror,idx);
|
||||
if (0 != emcAxisSetMinFerror(idx,NEW(min_ferror[idx]))) {
|
||||
if (0 != emcJointSetMinFerror(idx,NEW(min_ferror[idx]))) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print_error("check_ini_hal_items:bad return from emcAxisSetMinFerror\n");
|
||||
rcs_print_error("check_ini_hal_items:bad return from emcJointSetMinFerror\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
242
src/emc/ini/inijoint.cc
Normal file
242
src/emc/ini/inijoint.cc
Normal file
|
|
@ -0,0 +1,242 @@
|
|||
/********************************************************************
|
||||
* Description: inijoint.cc
|
||||
* INI file initialization routines for joint/axis NML
|
||||
*
|
||||
* Derived from a work by Fred Proctor & Will Shackleford
|
||||
*
|
||||
* Author:
|
||||
* License: GPL Version 2
|
||||
* System: Linux
|
||||
*
|
||||
* Copyright (c) 2004-2009 All rights reserved.
|
||||
********************************************************************/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdio.h> // NULL
|
||||
#include <stdlib.h> // atol(), _itoa()
|
||||
#include <string.h> // strcmp()
|
||||
#include <ctype.h> // isdigit()
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "emc.hh"
|
||||
#include "rcs_print.hh"
|
||||
#include "emcIniFile.hh"
|
||||
#include "inijoint.hh" // these decls
|
||||
#include "emcglb.h" // EMC_DEBUG
|
||||
#include "emccfg.h" // default values for globals
|
||||
|
||||
|
||||
/*
|
||||
loadJoint(int joint)
|
||||
|
||||
Loads ini file params for joint, joint = 0, ...
|
||||
|
||||
TYPE <LINEAR ANGULAR> type of joint
|
||||
MAX_VELOCITY <float> max vel for joint
|
||||
MAX_ACCELERATION <float> max accel for joint
|
||||
BACKLASH <float> backlash
|
||||
MIN_LIMIT <float> minimum soft position limit
|
||||
MAX_LIMIT <float> maximum soft position limit
|
||||
FERROR <float> maximum following error, scaled to max vel
|
||||
MIN_FERROR <float> minimum following error
|
||||
HOME <float> home position (where to go after home)
|
||||
HOME_FINAL_VEL <float> speed to move from HOME_OFFSET to HOME location (at the end of homing)
|
||||
HOME_OFFSET <float> home switch/index pulse location
|
||||
HOME_SEARCH_VEL <float> homing speed, search phase
|
||||
HOME_LATCH_VEL <float> homing speed, latch phase
|
||||
HOME_USE_INDEX <bool> use index pulse when homing
|
||||
HOME_IGNORE_LIMITS <bool> ignore limit switches when homing
|
||||
COMP_FILE <filename> file of joint compensation points
|
||||
|
||||
calls:
|
||||
|
||||
emcJointSetJoint(int joint, unsigned char jointType);
|
||||
emcJointSetUnits(int joint, double units);
|
||||
emcJointSetBacklash(int joint, double backlash);
|
||||
emcJointSetMinPositionLimit(int joint, double limit);
|
||||
emcJointSetMaxPositionLimit(int joint, double limit);
|
||||
emcJointSetFerror(int joint, double ferror);
|
||||
emcJointSetMinFerror(int joint, double ferror);
|
||||
emcJointSetHomingParams(int joint, double home, double offset, double home_vel,
|
||||
double search_vel, double latch_vel, int use_index,
|
||||
int ignore_limits, int is_shared, int sequence, int volatile_home));
|
||||
emcJointActivate(int joint);
|
||||
emcJointSetMaxVelocity(int joint, double vel);
|
||||
emcJointSetMaxAcceleration(int joint, double acc);
|
||||
emcJointLoadComp(int joint, const char * file, int comp_file_type);
|
||||
*/
|
||||
|
||||
static int loadJoint(int joint, EmcIniFile *jointIniFile)
|
||||
{
|
||||
char jointString[16];
|
||||
const char *inistring;
|
||||
EmcJointType jointType;
|
||||
double units;
|
||||
double backlash;
|
||||
double offset;
|
||||
double limit;
|
||||
double home;
|
||||
double search_vel;
|
||||
double latch_vel;
|
||||
double home_vel; // moving from OFFSET to HOME
|
||||
bool use_index;
|
||||
bool ignore_limits;
|
||||
bool is_shared;
|
||||
int sequence;
|
||||
int volatile_home;
|
||||
int locking_indexer;
|
||||
int comp_file_type; //type for the compensation file. type==0 means nom, forw, rev.
|
||||
double maxVelocity;
|
||||
double maxAcceleration;
|
||||
double ferror;
|
||||
|
||||
// compose string to match, joint = 0 -> JOINT_0, etc.
|
||||
sprintf(jointString, "JOINT_%d", joint);
|
||||
|
||||
jointIniFile->EnableExceptions(EmcIniFile::ERR_CONVERSION);
|
||||
|
||||
try {
|
||||
// set joint type
|
||||
jointType = EMC_LINEAR; // default
|
||||
jointIniFile->Find(&jointType, "TYPE", jointString);
|
||||
if (0 != emcJointSetJoint(joint, jointType)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// set units
|
||||
if(jointType == EMC_LINEAR){
|
||||
units = emcTrajGetLinearUnits();
|
||||
}else{
|
||||
units = emcTrajGetAngularUnits();
|
||||
}
|
||||
if (0 != emcJointSetUnits(joint, units)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// set backlash
|
||||
backlash = 0; // default
|
||||
jointIniFile->Find(&backlash, "BACKLASH", jointString);
|
||||
if (0 != emcJointSetBacklash(joint, backlash)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// set min position limit
|
||||
limit = -1e99; // default
|
||||
jointIniFile->Find(&limit, "MIN_LIMIT", jointString);
|
||||
if (0 != emcJointSetMinPositionLimit(joint, limit)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// set max position limit
|
||||
limit = 1e99; // default
|
||||
jointIniFile->Find(&limit, "MAX_LIMIT", jointString);
|
||||
if (0 != emcJointSetMaxPositionLimit(joint, limit)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// set following error limit (at max speed)
|
||||
ferror = 1; // default
|
||||
jointIniFile->Find(&ferror, "FERROR", jointString);
|
||||
if (0 != emcJointSetFerror(joint, ferror)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// do MIN_FERROR, if it's there. If not, use value of maxFerror above
|
||||
jointIniFile->Find(&ferror, "MIN_FERROR", jointString);
|
||||
if (0 != emcJointSetMinFerror(joint, ferror)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// set homing paramsters (total of 6)
|
||||
home = 0; // default
|
||||
jointIniFile->Find(&home, "HOME", jointString);
|
||||
offset = 0; // default
|
||||
jointIniFile->Find(&offset, "HOME_OFFSET", jointString);
|
||||
search_vel = 0; // default
|
||||
jointIniFile->Find(&search_vel, "HOME_SEARCH_VEL", jointString);
|
||||
latch_vel = 0; // default
|
||||
jointIniFile->Find(&latch_vel, "HOME_LATCH_VEL", jointString);
|
||||
home_vel = -1; // default (rapid)
|
||||
jointIniFile->Find(&home_vel, "HOME_VEL", jointString);
|
||||
is_shared = false; // default
|
||||
jointIniFile->Find(&is_shared, "HOME_IS_SHARED", jointString);
|
||||
use_index = false; // default
|
||||
jointIniFile->Find(&use_index, "HOME_USE_INDEX", jointString);
|
||||
ignore_limits = false; // default
|
||||
jointIniFile->Find(&ignore_limits, "HOME_IGNORE_LIMITS", jointString);
|
||||
sequence = -1; // default
|
||||
jointIniFile->Find(&sequence, "HOME_SEQUENCE", jointString);
|
||||
volatile_home = 0; // default
|
||||
jointIniFile->Find(&volatile_home, "VOLATILE_HOME", jointString);
|
||||
locking_indexer = false;
|
||||
jointIniFile->Find(&locking_indexer, "LOCKING_INDEXER", jointString);
|
||||
// issue NML message to set all params
|
||||
if (0 != emcJointSetHomingParams(joint, home, offset, home_vel, search_vel,
|
||||
latch_vel, (int)use_index, (int)ignore_limits,
|
||||
(int)is_shared, sequence, volatile_home, locking_indexer)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// set maximum velocity
|
||||
maxVelocity = DEFAULT_JOINT_MAX_VELOCITY;
|
||||
jointIniFile->Find(&maxVelocity, "MAX_VELOCITY", jointString);
|
||||
if (0 != emcJointSetMaxVelocity(joint, maxVelocity)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
maxAcceleration = DEFAULT_JOINT_MAX_ACCELERATION;
|
||||
jointIniFile->Find(&maxAcceleration, "MAX_ACCELERATION", jointString);
|
||||
if (0 != emcJointSetMaxAcceleration(joint, maxAcceleration)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
comp_file_type = 0; // default
|
||||
jointIniFile->Find(&comp_file_type, "COMP_FILE_TYPE", jointString);
|
||||
if (NULL != (inistring = jointIniFile->Find("COMP_FILE", jointString))) {
|
||||
if (0 != emcJointLoadComp(joint, inistring, comp_file_type)) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch (EmcIniFile::Exception &e) {
|
||||
e.Print();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// lastly, activate joint. Do this last so that the motion controller
|
||||
// won't flag errors midway during configuration
|
||||
if (0 != emcJointActivate(joint)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
iniJoint(int joint, const char *filename)
|
||||
|
||||
Loads ini file parameters for specified joint, [0 .. AXES - 1]
|
||||
|
||||
Looks for AXES in TRAJ section for how many to do, up to
|
||||
EMC_JOINT_MAX.
|
||||
*/
|
||||
int iniJoint(int joint, const char *filename)
|
||||
{
|
||||
EmcIniFile jointIniFile(EmcIniFile::ERR_TAG_NOT_FOUND |
|
||||
EmcIniFile::ERR_SECTION_NOT_FOUND |
|
||||
EmcIniFile::ERR_CONVERSION);
|
||||
|
||||
if (jointIniFile.Open(filename) == false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// load its values
|
||||
if (0 != loadJoint(joint, &jointIniFile)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
18
src/emc/ini/inijoint.hh
Normal file
18
src/emc/ini/inijoint.hh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/********************************************************************
|
||||
* Description: inijoint.hh
|
||||
*
|
||||
* Derived from a work by Fred Proctor & Will Shackleford
|
||||
*
|
||||
* Author:
|
||||
* License: GPL Version 2
|
||||
* System: Linux
|
||||
*
|
||||
* Copyright (c) 2004-2009 All rights reserved.
|
||||
********************************************************************/
|
||||
#ifndef INIJOINT_HH
|
||||
#define INIJOINT_HH
|
||||
|
||||
/* initializes joint modules from ini file */
|
||||
extern int iniJoint(int joint, const char *filename);
|
||||
|
||||
#endif
|
||||
|
|
@ -9,8 +9,6 @@
|
|||
* System: Linux
|
||||
*
|
||||
* Copyright (c) 2004 All rights reserved.
|
||||
*
|
||||
* Last change:
|
||||
********************************************************************/
|
||||
|
||||
#include <stdio.h> // NULL
|
||||
|
|
@ -29,6 +27,38 @@
|
|||
|
||||
extern value_inihal_data old_inihal_data;
|
||||
|
||||
/*
|
||||
loadKins()
|
||||
|
||||
JOINTS <int> number of joints (DOF) in system
|
||||
|
||||
calls:
|
||||
|
||||
emcTrajSetJoints(int joints);
|
||||
*/
|
||||
|
||||
static int loadKins(EmcIniFile *trajInifile)
|
||||
{
|
||||
trajInifile->EnableExceptions(EmcIniFile::ERR_CONVERSION);
|
||||
|
||||
try {
|
||||
int joints = 0;
|
||||
trajInifile->Find(&joints, "JOINTS", "KINS");
|
||||
|
||||
if (0 != emcTrajSetJoints(joints)) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
catch (EmcIniFile::Exception &e) {
|
||||
e.Print();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
loadTraj()
|
||||
|
||||
|
|
@ -37,39 +67,27 @@ extern value_inihal_data old_inihal_data;
|
|||
AXES <int> number of axes in system
|
||||
LINEAR_UNITS <float> units per mm
|
||||
ANGULAR_UNITS <float> units per degree
|
||||
CYCLE_TIME <float> cycle time for traj calculations
|
||||
DEFAULT_VELOCITY <float> default velocity
|
||||
MAX_VELOCITY <float> max velocity
|
||||
MAX_ACCELERATION <float> max acceleration
|
||||
DEFAULT_ACCELERATION <float> default acceleration
|
||||
HOME <float> ... world coords of home, in X Y Z R P W
|
||||
DEFAULT_LINEAR_VELOCITY <float> default linear velocity
|
||||
MAX_LINEAR_VELOCITY <float> max linear velocity
|
||||
DEFAULT_LINEAR_ACCEL <float> default linear acceleration
|
||||
MAX_LINEAR_ACCEL <float> max linear acceleration
|
||||
|
||||
calls:
|
||||
|
||||
emcTrajSetAxes(int axes);
|
||||
emcTrajSetJoints(int joints);
|
||||
emcTrajSetUnits(double linearUnits, double angularUnits);
|
||||
emcTrajSetCycleTime(double cycleTime);
|
||||
emcTrajSetVelocity(double vel);
|
||||
emcTrajSetVelocity(double vel, double ini_maxvel);
|
||||
emcTrajSetAcceleration(double acc);
|
||||
emcTrajSetMaxVelocity(double vel);
|
||||
emcTrajSetMaxAcceleration(double acc);
|
||||
emcTrajSetHome(EmcPose home);
|
||||
*/
|
||||
|
||||
static int loadTraj(EmcIniFile *trajInifile)
|
||||
{
|
||||
const char *inistring;
|
||||
EmcLinearUnits linearUnits;
|
||||
EmcAngularUnits angularUnits;
|
||||
double vel;
|
||||
double acc;
|
||||
unsigned char coordinateMark[6] = { 1, 1, 1, 0, 0, 0 };
|
||||
int t;
|
||||
int len;
|
||||
char homes[LINELEN];
|
||||
char home[LINELEN];
|
||||
EmcPose homePose = { {0.0, 0.0, 0.0}, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
|
||||
double d;
|
||||
|
||||
trajInifile->EnableExceptions(EmcIniFile::ERR_CONVERSION);
|
||||
|
||||
|
|
@ -91,7 +109,6 @@ static int loadTraj(EmcIniFile *trajInifile)
|
|||
axismask = 1 | 2 | 4; // default: XYZ machine
|
||||
}
|
||||
trajInifile->Find(&axes, "AXES", "TRAJ");
|
||||
|
||||
if (0 != emcTrajSetAxes(axes, axismask)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print("bad return value from emcTrajSetAxes\n");
|
||||
|
|
@ -103,7 +120,6 @@ static int loadTraj(EmcIniFile *trajInifile)
|
|||
trajInifile->FindLinearUnits(&linearUnits, "LINEAR_UNITS", "TRAJ");
|
||||
angularUnits = 0;
|
||||
trajInifile->FindAngularUnits(&angularUnits, "ANGULAR_UNITS", "TRAJ");
|
||||
|
||||
if (0 != emcTrajSetUnits(linearUnits, angularUnits)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print("bad return value from emcTrajSetUnits\n");
|
||||
|
|
@ -112,8 +128,7 @@ static int loadTraj(EmcIniFile *trajInifile)
|
|||
}
|
||||
|
||||
vel = 1.0;
|
||||
trajInifile->Find(&vel, "DEFAULT_VELOCITY", "TRAJ");
|
||||
|
||||
trajInifile->Find(&vel, "DEFAULT_LINEAR_VELOCITY", "TRAJ");
|
||||
// set the corresponding global
|
||||
traj_default_velocity = vel;
|
||||
old_inihal_data.traj_default_velocity = vel;
|
||||
|
|
@ -127,8 +142,7 @@ static int loadTraj(EmcIniFile *trajInifile)
|
|||
}
|
||||
|
||||
vel = 1e99; // by default, use AXIS limit
|
||||
trajInifile->Find(&vel, "MAX_VELOCITY", "TRAJ");
|
||||
|
||||
trajInifile->Find(&vel, "MAX_LINEAR_VELOCITY", "TRAJ");
|
||||
// set the corresponding global
|
||||
traj_max_velocity = vel;
|
||||
old_inihal_data.traj_max_velocity = vel;
|
||||
|
|
@ -142,8 +156,7 @@ static int loadTraj(EmcIniFile *trajInifile)
|
|||
}
|
||||
|
||||
acc = 1e99; // let the axis values apply
|
||||
trajInifile->Find(&acc, "DEFAULT_ACCELERATION", "TRAJ");
|
||||
|
||||
trajInifile->Find(&acc, "DEFAULT_LINEAR_ACCEL", "TRAJ");
|
||||
if (0 != emcTrajSetAcceleration(acc)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print("bad return value from emcTrajSetAcceleration\n");
|
||||
|
|
@ -153,8 +166,7 @@ static int loadTraj(EmcIniFile *trajInifile)
|
|||
old_inihal_data.traj_default_acceleration = acc;
|
||||
|
||||
acc = 1e99; // let the axis values apply
|
||||
trajInifile->Find(&acc, "MAX_ACCELERATION", "TRAJ");
|
||||
|
||||
trajInifile->Find(&acc, "MAX_LINEAR_ACCEL", "TRAJ");
|
||||
if (0 != emcTrajSetMaxAcceleration(acc)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print("bad return value from emcTrajSetMaxAcceleration\n");
|
||||
|
|
@ -215,87 +227,11 @@ static int loadTraj(EmcIniFile *trajInifile)
|
|||
}
|
||||
}
|
||||
|
||||
catch(EmcIniFile::Exception &e){
|
||||
catch (EmcIniFile::Exception &e) {
|
||||
e.Print();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// set coordinateMark[] to hold 1's for each coordinate present,
|
||||
// so that home position can be interpreted properly
|
||||
if ((inistring = trajInifile->Find("COORDINATES", "TRAJ")) != NULL) {
|
||||
len = strlen(inistring);
|
||||
// there's an entry in ini file, so clear all the marks out first
|
||||
// so that defaults don't apply at all
|
||||
for (t = 0; t < 6; t++) {
|
||||
coordinateMark[t] = 0;
|
||||
}
|
||||
// now set actual marks
|
||||
for (t = 0; t < len; t++) {
|
||||
if (inistring[t] == 'X')
|
||||
coordinateMark[0] = 1;
|
||||
else if (inistring[t] == 'Y')
|
||||
coordinateMark[1] = 1;
|
||||
else if (inistring[t] == 'Z')
|
||||
coordinateMark[2] = 1;
|
||||
else if (inistring[t] == 'R')
|
||||
coordinateMark[3] = 1;
|
||||
else if (inistring[t] == 'P')
|
||||
coordinateMark[4] = 1;
|
||||
else if (inistring[t] == 'W')
|
||||
coordinateMark[5] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL != (inistring = trajInifile->Find("HOME", "TRAJ"))) {
|
||||
// found it, now interpret it according to coordinateMark[]
|
||||
strcpy(homes, inistring);
|
||||
len = 0;
|
||||
for (t = 0; t < 6; t++) {
|
||||
if (!coordinateMark[t]) {
|
||||
continue; // position t at index of next non-zero mark
|
||||
}
|
||||
// there is a mark, so read the string for a value
|
||||
if (1 == sscanf(&homes[len], "%s", home) &&
|
||||
1 == sscanf(home, "%lf", &d)) {
|
||||
// got an entry, index into coordinateMark[] is 't'
|
||||
if (t == 0)
|
||||
homePose.tran.x = d;
|
||||
else if (t == 1)
|
||||
homePose.tran.y = d;
|
||||
else if (t == 2)
|
||||
homePose.tran.z = d;
|
||||
else if (t == 3)
|
||||
homePose.a = d;
|
||||
else if (t == 4)
|
||||
homePose.b = d;
|
||||
else
|
||||
homePose.c = d;
|
||||
|
||||
// position string ptr past this value
|
||||
len += strlen(home);
|
||||
// and at start of next value
|
||||
while ((len < LINELEN) && (homes[len] == ' ' || homes[len] == '\t')) {
|
||||
len++;
|
||||
}
|
||||
if (len >= LINELEN) {
|
||||
break; // out of for loop
|
||||
}
|
||||
} else {
|
||||
// badly formatted entry
|
||||
rcs_print("invalid inifile value for [TRAJ] HOME: %s\n",
|
||||
inistring);
|
||||
return -1;
|
||||
}
|
||||
} // end of for-loop on coordinateMark[]
|
||||
}
|
||||
|
||||
if (0 != emcTrajSetHome(homePose)) {
|
||||
if (emc_debug & EMC_DEBUG_CONFIG) {
|
||||
rcs_print("bad return value from emcTrajSetHome\n");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -312,6 +248,10 @@ int iniTraj(const char *filename)
|
|||
return -1;
|
||||
}
|
||||
// load trajectory values
|
||||
if (0 != loadKins(&trajInifile)) {
|
||||
return -1;
|
||||
}
|
||||
// load trajectory values
|
||||
if (0 != loadTraj(&trajInifile)) {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -372,12 +372,12 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
|
||||
/* ...and process command */
|
||||
|
||||
/* Many commands uses "command->axis" to indicate which joint they
|
||||
/* Many commands uses "command->joint" to indicate which joint they
|
||||
wish to operate on. This code eliminates the need to copy
|
||||
command->axis to "joint_num", limit check it, and then set "joint"
|
||||
command->joint to "joint_num", limit check it, and then set "joint"
|
||||
to point to the joint data. All the individual commands need to do
|
||||
is verify that "joint" is non-zero. */
|
||||
joint_num = emcmotCommand->axis;
|
||||
joint_num = emcmotCommand->joint;
|
||||
if (joint_num >= 0 && joint_num < num_joints) {
|
||||
/* valid joint, point to it's data */
|
||||
joint = &joints[joint_num];
|
||||
|
|
@ -412,7 +412,7 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
/* point to joint struct */
|
||||
joint = &joints[joint_num];
|
||||
/* tell joint planner to stop */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
/* stop homing if in progress */
|
||||
if ( joint->home_state != HOME_IDLE ) {
|
||||
joint->home_state = HOME_ABORT;
|
||||
|
|
@ -431,13 +431,13 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
emcmotStatus->paused = 0;
|
||||
break;
|
||||
|
||||
case EMCMOT_AXIS_ABORT: //FIXME-AJ: rename
|
||||
case EMCMOT_JOINT_ABORT:
|
||||
/* abort one joint */
|
||||
/* can happen at any time */
|
||||
/* this command stops a single joint. It is only usefull
|
||||
in free mode, so in coord or teleop mode it does
|
||||
nothing. */
|
||||
rtapi_print_msg(RTAPI_MSG_DBG, "AXIS_ABORT");
|
||||
rtapi_print_msg(RTAPI_MSG_DBG, "JOINT_ABORT");
|
||||
rtapi_print_msg(RTAPI_MSG_DBG, " %d", joint_num);
|
||||
if (GET_MOTION_TELEOP_FLAG()) {
|
||||
/* do nothing in teleop mode */
|
||||
|
|
@ -449,7 +449,7 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
break;
|
||||
}
|
||||
/* tell joint planner to stop */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
/* stop homing if in progress */
|
||||
if ( joint->home_state != HOME_IDLE ) {
|
||||
joint->home_state = HOME_ABORT;
|
||||
|
|
@ -514,18 +514,18 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
}
|
||||
break;
|
||||
|
||||
case EMCMOT_SET_NUM_AXES: //FIXME-AJ: we'll want to rename this to EMCMOT_SET_NUM_JOINTS
|
||||
case EMCMOT_SET_NUM_JOINTS:
|
||||
/* set the global NUM_JOINTS, which must be between 1 and
|
||||
EMCMOT_MAX_JOINTS, inclusive */
|
||||
/* this sets a global - I hate globals - hopefully this can be
|
||||
moved into the config structure, or dispensed with completely */
|
||||
rtapi_print_msg(RTAPI_MSG_DBG, "SET_NUM_AXES");
|
||||
rtapi_print_msg(RTAPI_MSG_DBG, " %d", emcmotCommand->axis);
|
||||
if (( emcmotCommand->axis <= 0 ) ||
|
||||
( emcmotCommand->axis > EMCMOT_MAX_JOINTS )) {
|
||||
rtapi_print_msg(RTAPI_MSG_DBG, "SET_NUM_JOINTS");
|
||||
rtapi_print_msg(RTAPI_MSG_DBG, " %d", emcmotCommand->joint);
|
||||
if (( emcmotCommand->joint <= 0 ) ||
|
||||
( emcmotCommand->joint > EMCMOT_MAX_JOINTS )) {
|
||||
break;
|
||||
}
|
||||
num_joints = emcmotCommand->axis;
|
||||
num_joints = emcmotCommand->joint;
|
||||
emcmotConfig->numJoints = num_joints;
|
||||
break;
|
||||
|
||||
|
|
@ -657,7 +657,7 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
if (joint == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
//FIXME-AJ: this command is used for teleop too, check for TELEOP mode, etc..
|
||||
/* must be in free mode and enabled */
|
||||
if (GET_MOTION_COORD_FLAG()) {
|
||||
reportError(_("Can't jog joint in coordinated mode."));
|
||||
|
|
@ -695,16 +695,18 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
/* set destination of jog */
|
||||
refresh_jog_limits(joint);
|
||||
if (emcmotCommand->vel > 0.0) {
|
||||
joint->free_pos_cmd = joint->max_jog_limit;
|
||||
joint->free_tp.pos_cmd = joint->max_jog_limit;
|
||||
} else {
|
||||
joint->free_pos_cmd = joint->min_jog_limit;
|
||||
joint->free_tp.pos_cmd = joint->min_jog_limit;
|
||||
}
|
||||
/* set velocity of jog */
|
||||
joint->free_vel_lim = fabs(emcmotCommand->vel);
|
||||
joint->free_tp.max_vel = fabs(emcmotCommand->vel);
|
||||
/* use max joint accel */
|
||||
joint->free_tp.max_acc = joint->acc_limit;
|
||||
/* lock out other jog sources */
|
||||
joint->kb_jog_active = 1;
|
||||
/* and let it go */
|
||||
joint->free_tp_enable = 1;
|
||||
joint->free_tp.enable = 1;
|
||||
/*! \todo FIXME - should we really be clearing errors here? */
|
||||
SET_JOINT_ERROR_FLAG(joint, 0);
|
||||
/* clear joints homed flag(s) if we don't have forward kins.
|
||||
|
|
@ -723,7 +725,7 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
if (joint == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
//FIXME-AJ: this command is used for teleop too, check for TELEOP mode, etc..
|
||||
/* must be in free mode and enabled */
|
||||
if (GET_MOTION_COORD_FLAG()) {
|
||||
reportError(_("Can't jog joint in coordinated mode."));
|
||||
|
|
@ -760,9 +762,9 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
}
|
||||
/* set target position for jog */
|
||||
if (emcmotCommand->vel > 0.0) {
|
||||
tmp1 = joint->free_pos_cmd + emcmotCommand->offset;
|
||||
tmp1 = joint->free_tp.pos_cmd + emcmotCommand->offset;
|
||||
} else {
|
||||
tmp1 = joint->free_pos_cmd - emcmotCommand->offset;
|
||||
tmp1 = joint->free_tp.pos_cmd - emcmotCommand->offset;
|
||||
}
|
||||
/* don't jog past limits */
|
||||
refresh_jog_limits(joint);
|
||||
|
|
@ -773,13 +775,15 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
break;
|
||||
}
|
||||
/* set target position */
|
||||
joint->free_pos_cmd = tmp1;
|
||||
joint->free_tp.pos_cmd = tmp1;
|
||||
/* set velocity of jog */
|
||||
joint->free_vel_lim = fabs(emcmotCommand->vel);
|
||||
joint->free_tp.max_vel = fabs(emcmotCommand->vel);
|
||||
/* use max joint accel */
|
||||
joint->free_tp.max_acc = joint->acc_limit;
|
||||
/* lock out other jog sources */
|
||||
joint->kb_jog_active = 1;
|
||||
/* and let it go */
|
||||
joint->free_tp_enable = 1;
|
||||
joint->free_tp.enable = 1;
|
||||
SET_JOINT_ERROR_FLAG(joint, 0);
|
||||
/* clear joint homed flag(s) if we don't have forward kins.
|
||||
Otherwise, a transition into coordinated mode will incorrectly
|
||||
|
|
@ -797,6 +801,7 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
if (joint == 0) {
|
||||
break;
|
||||
}
|
||||
//FIXME-AJ: this command is used for teleop too, check for TELEOP mode, etc..
|
||||
/* must be in free mode and enabled */
|
||||
if (GET_MOTION_COORD_FLAG()) {
|
||||
reportError(_("Can't jog joint in coordinated mode."));
|
||||
|
|
@ -827,21 +832,23 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
break;
|
||||
}
|
||||
/*! \todo FIXME-- use 'goal' instead */
|
||||
joint->free_pos_cmd = emcmotCommand->offset;
|
||||
joint->free_tp.pos_cmd = emcmotCommand->offset;
|
||||
/* don't jog past limits */
|
||||
refresh_jog_limits(joint);
|
||||
if (joint->free_pos_cmd > joint->max_jog_limit) {
|
||||
joint->free_pos_cmd = joint->max_jog_limit;
|
||||
if (joint->free_tp.pos_cmd > joint->max_jog_limit) {
|
||||
joint->free_tp.pos_cmd = joint->max_jog_limit;
|
||||
}
|
||||
if (joint->free_pos_cmd < joint->min_jog_limit) {
|
||||
joint->free_pos_cmd = joint->min_jog_limit;
|
||||
if (joint->free_tp.pos_cmd < joint->min_jog_limit) {
|
||||
joint->free_tp.pos_cmd = joint->min_jog_limit;
|
||||
}
|
||||
/* set velocity of jog */
|
||||
joint->free_vel_lim = fabs(emcmotCommand->vel);
|
||||
joint->free_tp.max_vel = fabs(emcmotCommand->vel);
|
||||
/* use max joint accel */
|
||||
joint->free_tp.max_acc = joint->acc_limit;
|
||||
/* lock out other jog sources */
|
||||
joint->kb_jog_active = 1;
|
||||
/* and let it go */
|
||||
joint->free_tp_enable = 1;
|
||||
joint->free_tp.enable = 1;
|
||||
SET_JOINT_ERROR_FLAG(joint, 0);
|
||||
/* clear joint homed flag(s) if we don't have forward kins.
|
||||
Otherwise, a transition into coordinated mode will incorrectly
|
||||
|
|
@ -1252,7 +1259,7 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
reportError(_("homing sequence already in progress"));
|
||||
} else {
|
||||
/* abort any movement (jog, etc) that is in progress */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
|
||||
/* prime the homing state machine */
|
||||
joint->home_state = HOME_START;
|
||||
|
|
@ -1446,41 +1453,6 @@ void emcmotCommandHandler(void *arg, long period)
|
|||
}
|
||||
break;
|
||||
|
||||
case EMCMOT_SET_TELEOP_VECTOR:
|
||||
rtapi_print_msg(RTAPI_MSG_DBG, "SET_TELEOP_VECTOR");
|
||||
if (!GET_MOTION_TELEOP_FLAG() || !GET_MOTION_ENABLE_FLAG()) {
|
||||
reportError
|
||||
(_("need to be enabled, in teleop mode for teleop move"));
|
||||
} else {
|
||||
double velmag;
|
||||
emcmotDebug->teleop_data.desiredVel = emcmotCommand->pos;
|
||||
pmCartMag(&emcmotDebug->teleop_data.desiredVel.tran, &velmag);
|
||||
if (fabs(emcmotDebug->teleop_data.desiredVel.a) > velmag) {
|
||||
velmag = fabs(emcmotDebug->teleop_data.desiredVel.a);
|
||||
}
|
||||
if (fabs(emcmotDebug->teleop_data.desiredVel.b) > velmag) {
|
||||
velmag = fabs(emcmotDebug->teleop_data.desiredVel.b);
|
||||
}
|
||||
if (fabs(emcmotDebug->teleop_data.desiredVel.c) > velmag) {
|
||||
velmag = fabs(emcmotDebug->teleop_data.desiredVel.c);
|
||||
}
|
||||
if (velmag > emcmotConfig->limitVel) {
|
||||
pmCartScalMult(&emcmotDebug->teleop_data.desiredVel.tran,
|
||||
emcmotConfig->limitVel / velmag,
|
||||
&emcmotDebug->teleop_data.desiredVel.tran);
|
||||
emcmotDebug->teleop_data.desiredVel.a *=
|
||||
emcmotConfig->limitVel / velmag;
|
||||
emcmotDebug->teleop_data.desiredVel.b *=
|
||||
emcmotConfig->limitVel / velmag;
|
||||
emcmotDebug->teleop_data.desiredVel.c *=
|
||||
emcmotConfig->limitVel / velmag;
|
||||
}
|
||||
/* flag that all joints need to be homed, if any joint is
|
||||
jogged individually later */
|
||||
rehomeAll = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case EMCMOT_SET_DEBUG:
|
||||
rtapi_print_msg(RTAPI_MSG_DBG, "SET_DEBUG");
|
||||
emcmotConfig->debug = emcmotCommand->debug;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "rtapi_math.h"
|
||||
#include "tp.h"
|
||||
#include "tc.h"
|
||||
#include "simple_tp.h"
|
||||
#include "motion_debug.h"
|
||||
#include "config.h"
|
||||
#include "motion_types.h"
|
||||
|
|
@ -689,7 +690,7 @@ static void set_operating_mode(void)
|
|||
/* point to joint data */
|
||||
joint = &joints[joint_num];
|
||||
/* disable free mode planner */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
/* drain coord mode interpolators */
|
||||
cubicDrain(&(joint->cubic));
|
||||
if (GET_JOINT_ACTIVE_FLAG(joint)) {
|
||||
|
|
@ -721,7 +722,7 @@ static void set_operating_mode(void)
|
|||
/* point to joint data */
|
||||
joint = &joints[joint_num];
|
||||
|
||||
joint->free_pos_cmd = joint->pos_cmd;
|
||||
joint->free_tp.pos_cmd = joint->pos_cmd;
|
||||
if (GET_JOINT_ACTIVE_FLAG(joint)) {
|
||||
SET_JOINT_ENABLE_FLAG(joint, 1);
|
||||
SET_JOINT_HOMING_FLAG(joint, 0);
|
||||
|
|
@ -769,7 +770,7 @@ static void set_operating_mode(void)
|
|||
/* point to joint data */
|
||||
joint = &joints[joint_num];
|
||||
/* update free planner positions */
|
||||
joint->free_pos_cmd = joint->pos_cmd;
|
||||
joint->free_tp.pos_cmd = joint->pos_cmd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -805,9 +806,9 @@ static void set_operating_mode(void)
|
|||
/* point to joint data */
|
||||
joint = &joints[joint_num];
|
||||
/* set joint planner pos cmd to current location */
|
||||
joint->free_pos_cmd = joint->pos_cmd;
|
||||
joint->free_tp.pos_cmd = joint->pos_cmd;
|
||||
/* but it can stay disabled until a move is required */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
}
|
||||
SET_MOTION_COORD_FLAG(0);
|
||||
SET_MOTION_TELEOP_FLAG(0);
|
||||
|
|
@ -896,7 +897,7 @@ static void handle_jogwheels(void)
|
|||
continue;
|
||||
}
|
||||
/* calc target position for jog */
|
||||
pos = joint->free_pos_cmd + distance;
|
||||
pos = joint->free_tp.pos_cmd + distance;
|
||||
/* don't jog past limits */
|
||||
refresh_jog_limits(joint);
|
||||
if (pos > joint->max_jog_limit) {
|
||||
|
|
@ -924,13 +925,14 @@ static void handle_jogwheels(void)
|
|||
pos = joint->pos_cmd - stop_dist;
|
||||
}
|
||||
}
|
||||
/* set target position and use full velocity */
|
||||
joint->free_pos_cmd = pos;
|
||||
joint->free_vel_lim = joint->vel_limit;
|
||||
/* set target position and use full velocity and accel */
|
||||
joint->free_tp.pos_cmd = pos;
|
||||
joint->free_tp.max_vel = joint->vel_limit;
|
||||
joint->free_tp.max_acc = joint->acc_limit;
|
||||
/* lock out other jog sources */
|
||||
joint->wheel_jog_active = 1;
|
||||
/* and let it go */
|
||||
joint->free_tp_enable = 1;
|
||||
joint->free_tp.enable = 1;
|
||||
SET_JOINT_ERROR_FLAG(joint, 0);
|
||||
/* clear joint homed flag(s) if we don't have forward kins.
|
||||
Otherwise, a transition into coordinated mode will incorrectly
|
||||
|
|
@ -953,7 +955,7 @@ static void get_pos_cmds(long period)
|
|||
static int interpolationCounter = 0;
|
||||
#endif
|
||||
double old_pos_cmd;
|
||||
double max_dv, tiny_dp, pos_err, vel_req, vel_lim;
|
||||
double vel_lim;
|
||||
|
||||
/* used in teleop mode to compute the max accell requested */
|
||||
double accell_mag;
|
||||
|
|
@ -978,12 +980,6 @@ static void get_pos_cmds(long period)
|
|||
switch ( emcmotStatus->motion_state) {
|
||||
case EMCMOT_MOTION_FREE:
|
||||
/* in free mode, each joint is planned independently */
|
||||
/* Each joint has a very simple "trajectory planner". If the planner
|
||||
is enabled (free_tp_enable), then it moves toward free_pos_cmd at
|
||||
free_vel_lim, obeying the joint's accel and velocity limits, and
|
||||
stopping when it gets there. If it is not enabled, it stops as
|
||||
quickly as possible, again obeying the accel limit. When
|
||||
disabled, free_pos_cmd is set to the current position. */
|
||||
/* initial value for flag, if needed it will be cleared below */
|
||||
SET_MOTION_INPOS_FLAG(1);
|
||||
for (joint_num = 0; joint_num < num_joints; joint_num++) {
|
||||
|
|
@ -993,83 +989,33 @@ static void get_pos_cmds(long period)
|
|||
joint->acc_limit = emcmotStatus->acc;
|
||||
//AJ: only need to worry about free mode if joint is active
|
||||
if (GET_JOINT_ACTIVE_FLAG(joint)) {
|
||||
joint->free_tp_active = 0;
|
||||
/* compute max change in velocity per servo period */
|
||||
max_dv = joint->acc_limit * servo_period;
|
||||
/* compute a tiny position range, to be treated as zero */
|
||||
tiny_dp = max_dv * servo_period * 0.001;
|
||||
/* calculate desired velocity */
|
||||
if (joint->free_tp_enable) {
|
||||
/* planner enabled, request a velocity that tends to drive
|
||||
pos_err to zero, but allows for stopping without position
|
||||
overshoot */
|
||||
pos_err = joint->free_pos_cmd - joint->pos_cmd;
|
||||
/* positive and negative errors require some sign flipping to
|
||||
avoid sqrt(negative) */
|
||||
if (pos_err > tiny_dp) {
|
||||
vel_req =
|
||||
-max_dv + sqrt(2.0 * joint->acc_limit * pos_err +
|
||||
max_dv * max_dv);
|
||||
/* mark joint active */
|
||||
joint->free_tp_active = 1;
|
||||
} else if (pos_err < -tiny_dp) {
|
||||
vel_req =
|
||||
max_dv - sqrt(-2.0 * joint->acc_limit * pos_err +
|
||||
max_dv * max_dv);
|
||||
/* mark joint active */
|
||||
joint->free_tp_active = 1;
|
||||
} else {
|
||||
/* within 'tiny_dp' of desired pos, no need to move */
|
||||
vel_req = 0.0;
|
||||
}
|
||||
} else {
|
||||
/* planner disabled, request zero velocity */
|
||||
vel_req = 0.0;
|
||||
/* and set command to present position to avoid movement when
|
||||
next enabled */
|
||||
joint->free_pos_cmd = joint->pos_cmd;
|
||||
}
|
||||
/* if we move at all, clear AT_HOME flag */
|
||||
if (joint->free_tp_active) {
|
||||
SET_JOINT_AT_HOME_FLAG(joint, 0);
|
||||
}
|
||||
/* compute joint velocity limit */
|
||||
if ( joint->home_state == HOME_IDLE ) {
|
||||
/* velocity limit = planner limit * global scale factor */
|
||||
/* velocity limit = joint limit * global scale factor */
|
||||
/* the global factor is used for feedrate override */
|
||||
vel_lim = joint->free_vel_lim * emcmotStatus->net_feed_scale;
|
||||
vel_lim = joint->vel_limit * emcmotStatus->net_feed_scale;
|
||||
} else {
|
||||
/* except if homing, when we ignore FO */
|
||||
vel_lim = joint->free_vel_lim;
|
||||
vel_lim = joint->vel_limit;
|
||||
}
|
||||
/* must not be greater than the joint physical limit */
|
||||
if (vel_lim > joint->vel_limit) {
|
||||
vel_lim = joint->vel_limit;
|
||||
}
|
||||
/* limit velocity request */
|
||||
if (vel_req > vel_lim) {
|
||||
vel_req = vel_lim;
|
||||
} else if (vel_req < -vel_lim) {
|
||||
vel_req = -vel_lim;
|
||||
/* set limits in free TP */
|
||||
joint->free_tp.max_vel = vel_lim;
|
||||
joint->free_tp.max_acc = joint->acc_limit;
|
||||
/* execute free TP */
|
||||
simple_tp_update(&(joint->free_tp), servo_period );
|
||||
/* if we move at all, clear AT_HOME flag */
|
||||
if (joint->free_tp.active) {
|
||||
SET_JOINT_AT_HOME_FLAG(joint, 0);
|
||||
}
|
||||
/* ramp velocity toward request at joint accel limit */
|
||||
if (vel_req > joint->vel_cmd + max_dv) {
|
||||
joint->vel_cmd += max_dv;
|
||||
} else if (vel_req < joint->vel_cmd - max_dv) {
|
||||
joint->vel_cmd -= max_dv;
|
||||
} else {
|
||||
joint->vel_cmd = vel_req;
|
||||
}
|
||||
/* check for still moving */
|
||||
if (joint->vel_cmd != 0.0) {
|
||||
/* yes, mark joint active */
|
||||
joint->free_tp_active = 1;
|
||||
}
|
||||
/* integrate velocity to get new position */
|
||||
joint->pos_cmd += joint->vel_cmd * servo_period;
|
||||
/* copy to coarse_pos */
|
||||
joint->coarse_pos = joint->pos_cmd;
|
||||
/* copy free TP output to pos_cmd and coarse_pos */
|
||||
joint->pos_cmd = joint->free_tp.curr_pos;
|
||||
joint->coarse_pos = joint->free_tp.curr_pos;
|
||||
/* update joint status flag and overall status flag */
|
||||
if ( joint->free_tp_active ) {
|
||||
if ( joint->free_tp.active ) {
|
||||
/* active TP means we're moving, so not in position */
|
||||
SET_JOINT_INPOS_FLAG(joint, 0);
|
||||
SET_MOTION_INPOS_FLAG(0);
|
||||
|
|
@ -1710,7 +1656,7 @@ static void output_to_hal(void)
|
|||
int i;
|
||||
double v2 = 0.0;
|
||||
for(i=0; i<num_joints; i++)
|
||||
if(GET_JOINT_ACTIVE_FLAG(&(joints[i])) && joints[i].free_tp_active)
|
||||
if(GET_JOINT_ACTIVE_FLAG(&(joints[i])) && joints[i].free_tp.active)
|
||||
v2 += joints[i].vel_cmd * joints[i].vel_cmd;
|
||||
if(v2 > 0.0)
|
||||
emcmotStatus->current_vel = (*emcmot_hal_data->current_vel) = sqrt(v2);
|
||||
|
|
@ -1724,7 +1670,7 @@ static void output_to_hal(void)
|
|||
to one of the debug parameters. You can also comment out these lines
|
||||
and copy elsewhere if you want to observe an automatic variable that
|
||||
isn't in scope here. */
|
||||
emcmot_hal_data->debug_bit_0 = joints[1].free_tp_active;
|
||||
emcmot_hal_data->debug_bit_0 = joints[1].free_tp.active;
|
||||
emcmot_hal_data->debug_bit_1 = emcmotStatus->enables_new & AF_ENABLED;
|
||||
emcmot_hal_data->debug_float_0 = emcmotStatus->net_feed_scale;
|
||||
emcmot_hal_data->debug_float_1 = emcmotStatus->spindleRevs;
|
||||
|
|
@ -1772,7 +1718,6 @@ static void output_to_hal(void)
|
|||
*(joint_data->amp_enable) = GET_JOINT_ENABLE_FLAG(joint);
|
||||
*(joint_data->index_enable) = joint->index_enable;
|
||||
*(joint_data->homing) = GET_JOINT_HOMING_FLAG(joint);
|
||||
|
||||
*(joint_data->coarse_pos_cmd) = joint->coarse_pos;
|
||||
*(joint_data->joint_vel_cmd) = joint->vel_cmd;
|
||||
*(joint_data->backlash_corr) = joint->backlash_corr;
|
||||
|
|
@ -1781,9 +1726,9 @@ static void output_to_hal(void)
|
|||
*(joint_data->f_error) = joint->ferror;
|
||||
*(joint_data->f_error_lim) = joint->ferror_limit;
|
||||
|
||||
*(joint_data->free_pos_cmd) = joint->free_pos_cmd;
|
||||
*(joint_data->free_vel_lim) = joint->free_vel_lim;
|
||||
*(joint_data->free_tp_enable) = joint->free_tp_enable;
|
||||
*(joint_data->free_pos_cmd) = joint->free_tp.pos_cmd;
|
||||
*(joint_data->free_vel_lim) = joint->free_tp.max_vel;
|
||||
*(joint_data->free_tp_enable) = joint->free_tp.enable;
|
||||
*(joint_data->kb_jog_active) = joint->kb_jog_active;
|
||||
*(joint_data->wheel_jog_active) = joint->wheel_jog_active;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
char EMCMOT_INIFILE[EMCMOT_INIFILE_LEN] = DEFAULT_EMCMOT_INIFILE;
|
||||
|
||||
|
||||
unsigned int SHMEM_KEY = DEFAULT_SHMEM_KEY;
|
||||
|
||||
double EMCMOT_COMM_TIMEOUT = DEFAULT_EMCMOT_COMM_TIMEOUT;
|
||||
|
|
|
|||
|
|
@ -56,13 +56,13 @@ static void home_start_move(emcmot_joint_t * joint, double vel)
|
|||
/* set up a long move */
|
||||
joint_range = joint->max_pos_limit - joint->min_pos_limit;
|
||||
if (vel > 0.0) {
|
||||
joint->free_pos_cmd = joint->pos_cmd + 2.0 * joint_range;
|
||||
joint->free_tp.pos_cmd = joint->pos_cmd + 2.0 * joint_range;
|
||||
} else {
|
||||
joint->free_pos_cmd = joint->pos_cmd - 2.0 * joint_range;
|
||||
joint->free_tp.pos_cmd = joint->pos_cmd - 2.0 * joint_range;
|
||||
}
|
||||
joint->free_vel_lim = fabs(vel);
|
||||
joint->free_tp.max_vel = fabs(vel);
|
||||
/* start the move */
|
||||
joint->free_tp_enable = 1;
|
||||
joint->free_tp.enable = 1;
|
||||
}
|
||||
|
||||
/* 'home_do_moving_checks()' is called from states where the machine
|
||||
|
|
@ -84,9 +84,9 @@ static void home_do_moving_checks(emcmot_joint_t * joint)
|
|||
}
|
||||
}
|
||||
/* check for reached end of move */
|
||||
if (!joint->free_tp_active) {
|
||||
if (!joint->free_tp.active) {
|
||||
/* reached end of move without hitting switch */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
reportError(_("end of move in home state %d"), joint->home_state);
|
||||
joint->home_state = HOME_ABORT;
|
||||
immediate_state = 1;
|
||||
|
|
@ -138,7 +138,7 @@ void do_homing_sequence(void)
|
|||
joint = &joints[i];
|
||||
if(joint->home_sequence == home_sequence) {
|
||||
/* start this joint */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
joint->home_state = HOME_START;
|
||||
seen++;
|
||||
}
|
||||
|
|
@ -252,7 +252,7 @@ void do_homing(void)
|
|||
SET_JOINT_HOMED_FLAG(joint, 0);
|
||||
SET_JOINT_AT_HOME_FLAG(joint, 0);
|
||||
/* stop any existing motion */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
/* reset delay counter */
|
||||
joint->home_pause_timer = 0;
|
||||
/* figure out exactly what homing sequence is needed */
|
||||
|
|
@ -307,7 +307,7 @@ void do_homing(void)
|
|||
location where the home switch is already tripped. It
|
||||
starts a move away from the switch. */
|
||||
/* is the joint still moving? */
|
||||
if (joint->free_tp_active) {
|
||||
if (joint->free_tp.active) {
|
||||
/* yes, reset delay, wait until joint stops */
|
||||
joint->home_pause_timer = 0;
|
||||
break;
|
||||
|
|
@ -333,7 +333,7 @@ void do_homing(void)
|
|||
/* are we off home switch yet? */
|
||||
if (! home_sw_active) {
|
||||
/* yes, stop motion */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
/* begin initial search */
|
||||
joint->home_state = HOME_INITIAL_SEARCH_START;
|
||||
immediate_state = 1;
|
||||
|
|
@ -348,7 +348,7 @@ void do_homing(void)
|
|||
fairly fast, because once the switch is found another
|
||||
slower move will be used to set the exact home position. */
|
||||
/* is the joint already moving? */
|
||||
if (joint->free_tp_active) {
|
||||
if (joint->free_tp.active) {
|
||||
/* yes, reset delay, wait until joint stops */
|
||||
joint->home_pause_timer = 0;
|
||||
break;
|
||||
|
|
@ -381,7 +381,7 @@ void do_homing(void)
|
|||
/* have we hit home switch yet? */
|
||||
if (home_sw_active) {
|
||||
/* yes, stop motion */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
/* go to next step */
|
||||
joint->home_state = HOME_SET_COARSE_POSITION;
|
||||
immediate_state = 1;
|
||||
|
|
@ -403,7 +403,7 @@ void do_homing(void)
|
|||
motor position */
|
||||
joint->pos_cmd += offset;
|
||||
joint->pos_fb += offset;
|
||||
joint->free_pos_cmd += offset;
|
||||
joint->free_tp.curr_pos += offset;
|
||||
joint->motor_offset -= offset;
|
||||
/* The next state depends on the signs of 'search_vel' and
|
||||
'latch_vel'. If they are the same, that means we must
|
||||
|
|
@ -429,7 +429,7 @@ void do_homing(void)
|
|||
move that will back off of the switch in preparation for a
|
||||
final slow move that captures the exact switch location. */
|
||||
/* is the joint already moving? */
|
||||
if (joint->free_tp_active) {
|
||||
if (joint->free_tp.active) {
|
||||
/* yes, reset delay, wait until joint stops */
|
||||
joint->home_pause_timer = 0;
|
||||
break;
|
||||
|
|
@ -463,7 +463,7 @@ void do_homing(void)
|
|||
/* are we off home switch yet? */
|
||||
if (! home_sw_active) {
|
||||
/* yes, stop motion */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
/* begin final search */
|
||||
joint->home_state = HOME_RISE_SEARCH_START;
|
||||
immediate_state = 1;
|
||||
|
|
@ -477,7 +477,7 @@ void do_homing(void)
|
|||
point where the home switch trips. It moves at
|
||||
'latch_vel' and looks for a rising edge on the switch */
|
||||
/* is the joint already moving? */
|
||||
if (joint->free_tp_active) {
|
||||
if (joint->free_tp.active) {
|
||||
/* yes, reset delay, wait until joint stops */
|
||||
joint->home_pause_timer = 0;
|
||||
break;
|
||||
|
|
@ -518,7 +518,7 @@ void do_homing(void)
|
|||
break;
|
||||
} else {
|
||||
/* no index pulse, stop motion */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
/* go to next step */
|
||||
joint->home_state = HOME_SET_SWITCH_POSITION;
|
||||
immediate_state = 1;
|
||||
|
|
@ -533,7 +533,7 @@ void do_homing(void)
|
|||
point where the home switch releases. It moves at
|
||||
'latch_vel' and looks for a falling edge on the switch */
|
||||
/* is the joint already moving? */
|
||||
if (joint->free_tp_active) {
|
||||
if (joint->free_tp.active) {
|
||||
/* yes, reset delay, wait until joint stops */
|
||||
joint->home_pause_timer = 0;
|
||||
break;
|
||||
|
|
@ -574,7 +574,7 @@ void do_homing(void)
|
|||
break;
|
||||
} else {
|
||||
/* no index pulse, stop motion */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
/* go to next step */
|
||||
joint->home_state = HOME_SET_SWITCH_POSITION;
|
||||
immediate_state = 1;
|
||||
|
|
@ -595,7 +595,7 @@ void do_homing(void)
|
|||
motor position */
|
||||
joint->pos_cmd += offset;
|
||||
joint->pos_fb += offset;
|
||||
joint->free_pos_cmd += offset;
|
||||
joint->free_tp.curr_pos += offset;
|
||||
joint->motor_offset -= offset;
|
||||
/* next state */
|
||||
joint->home_state = HOME_FINAL_MOVE_START;
|
||||
|
|
@ -610,7 +610,7 @@ void do_homing(void)
|
|||
reset its counter to zero and clear the enable when the
|
||||
next index pulse arrives. */
|
||||
/* is the joint already moving? */
|
||||
if (joint->free_tp_active) {
|
||||
if (joint->free_tp.active) {
|
||||
/* yes, reset delay, wait until joint stops */
|
||||
joint->home_pause_timer = 0;
|
||||
break;
|
||||
|
|
@ -632,7 +632,7 @@ void do_homing(void)
|
|||
motor position */
|
||||
joint->pos_cmd += offset;
|
||||
joint->pos_fb += offset;
|
||||
joint->free_pos_cmd += offset;
|
||||
joint->free_tp.curr_pos += offset;
|
||||
joint->motor_offset -= offset;
|
||||
/* set the index enable */
|
||||
joint->index_enable = 1;
|
||||
|
|
@ -667,7 +667,7 @@ void do_homing(void)
|
|||
enable when it does */
|
||||
if ( joint->index_enable == 0 ) {
|
||||
/* yes, stop motion */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
/* go to next step */
|
||||
joint->home_state = HOME_SET_INDEX_POSITION;
|
||||
immediate_state = 1;
|
||||
|
|
@ -686,7 +686,7 @@ void do_homing(void)
|
|||
joint->pos_fb = joint->motor_pos_fb -
|
||||
(joint->backlash_filt + joint->motor_offset);
|
||||
joint->pos_cmd = joint->pos_fb;
|
||||
joint->free_pos_cmd = joint->pos_fb;
|
||||
joint->free_tp.curr_pos = joint->pos_fb;
|
||||
/* next state */
|
||||
joint->home_state = HOME_FINAL_MOVE_START;
|
||||
immediate_state = 1;
|
||||
|
|
@ -698,7 +698,7 @@ void do_homing(void)
|
|||
which is not neccessarily the position of the home switch
|
||||
or index pulse. */
|
||||
/* is the joint already moving? */
|
||||
if (joint->free_tp_active) {
|
||||
if (joint->free_tp.active) {
|
||||
/* yes, reset delay, wait until joint stops */
|
||||
joint->home_pause_timer = 0;
|
||||
break;
|
||||
|
|
@ -711,19 +711,18 @@ void do_homing(void)
|
|||
}
|
||||
joint->home_pause_timer = 0;
|
||||
/* plan a move to home position */
|
||||
joint->free_pos_cmd = joint->home;
|
||||
/* do the move at max speed */
|
||||
joint->free_tp.pos_cmd = joint->home;
|
||||
/* if home_vel is set (>0) then we use that, otherwise we rapid there */
|
||||
if (joint->home_final_vel > 0) {
|
||||
joint->free_vel_lim = fabs(joint->home_final_vel);
|
||||
joint->free_tp.max_vel = fabs(joint->home_final_vel);
|
||||
/* clamp on max vel for this joint */
|
||||
if (joint->free_vel_lim > joint->vel_limit)
|
||||
joint->free_vel_lim = joint->vel_limit;
|
||||
if (joint->free_tp.max_vel > joint->vel_limit)
|
||||
joint->free_tp.max_vel = joint->vel_limit;
|
||||
} else {
|
||||
joint->free_vel_lim = joint->vel_limit;
|
||||
joint->free_tp.max_vel = joint->vel_limit;
|
||||
}
|
||||
/* start the move */
|
||||
joint->free_tp_enable = 1;
|
||||
joint->free_tp.enable = 1;
|
||||
joint->home_state = HOME_FINAL_MOVE_WAIT;
|
||||
break;
|
||||
|
||||
|
|
@ -733,9 +732,9 @@ void do_homing(void)
|
|||
arrives at the final location. If the move hits a limit
|
||||
before it arrives, the home is aborted. */
|
||||
/* have we arrived (and stopped) at home? */
|
||||
if (!joint->free_tp_active) {
|
||||
if (!joint->free_tp.active) {
|
||||
/* yes, stop motion */
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
/* we're finally done */
|
||||
joint->home_state = HOME_LOCK;
|
||||
immediate_state = 1;
|
||||
|
|
@ -786,7 +785,7 @@ void do_homing(void)
|
|||
SET_JOINT_HOMING_FLAG(joint, 0);
|
||||
SET_JOINT_HOMED_FLAG(joint, 0);
|
||||
SET_JOINT_AT_HOME_FLAG(joint, 0);
|
||||
joint->free_tp_enable = 0;
|
||||
joint->free_tp.enable = 0;
|
||||
joint->home_state = HOME_IDLE;
|
||||
joint->index_enable = 0;
|
||||
immediate_state = 1;
|
||||
|
|
|
|||
|
|
@ -633,177 +633,175 @@ static int export_joint(int num, joint_hal_t * addr)
|
|||
|
||||
/* export joint pins */ //FIXME-AJ: changing these will bork configs, still we should do it
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->joint_pos_cmd), mot_comp_id, "axis.%d.joint-pos-cmd", num);
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->joint_pos_cmd), mot_comp_id, "joint.%d.pos-cmd", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->joint_pos_fb), mot_comp_id, "axis.%d.joint-pos-fb", num);
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->joint_pos_fb), mot_comp_id, "joint.%d.pos-fb", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->motor_pos_cmd), mot_comp_id, "axis.%d.motor-pos-cmd", num);
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->motor_pos_cmd), mot_comp_id, "joint.%d.motor-pos-cmd", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->motor_offset), mot_comp_id, "axis.%d.motor-offset", num);
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->motor_offset), mot_comp_id, "joint.%d.motor-offset", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_IN, &(addr->motor_pos_fb), mot_comp_id, "axis.%d.motor-pos-fb", num);
|
||||
hal_pin_float_newf(HAL_IN, &(addr->motor_pos_fb), mot_comp_id, "joint.%d.motor-pos-fb", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->pos_lim_sw), mot_comp_id, "axis.%d.pos-lim-sw-in", num);
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->pos_lim_sw), mot_comp_id, "joint.%d.pos-lim-sw-in", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->neg_lim_sw), mot_comp_id, "axis.%d.neg-lim-sw-in", num);
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->neg_lim_sw), mot_comp_id, "joint.%d.neg-lim-sw-in", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->home_sw), mot_comp_id, "axis.%d.home-sw-in", num);
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->home_sw), mot_comp_id, "joint.%d.home-sw-in", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_IO, &(addr->index_enable), mot_comp_id, "axis.%d.index-enable", num);
|
||||
retval = hal_pin_bit_newf(HAL_IO, &(addr->index_enable), mot_comp_id, "joint.%d.index-enable", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->amp_enable), mot_comp_id, "axis.%d.amp-enable-out", num);
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->amp_enable), mot_comp_id, "joint.%d.amp-enable-out", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->amp_fault), mot_comp_id, "axis.%d.amp-fault-in", num);
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->amp_fault), mot_comp_id, "joint.%d.amp-fault-in", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_s32_newf(HAL_IN, &(addr->jog_counts), mot_comp_id, "axis.%d.jog-counts", num);
|
||||
retval = hal_pin_s32_newf(HAL_IN, &(addr->jog_counts), mot_comp_id, "joint.%d.jog-counts", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->jog_enable), mot_comp_id, "axis.%d.jog-enable", num);
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->jog_enable), mot_comp_id, "joint.%d.jog-enable", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_float_newf(HAL_IN, &(addr->jog_scale), mot_comp_id, "axis.%d.jog-scale", num);
|
||||
retval = hal_pin_float_newf(HAL_IN, &(addr->jog_scale), mot_comp_id, "joint.%d.jog-scale", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->jog_vel_mode), mot_comp_id, "axis.%d.jog-vel-mode", num);
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->jog_vel_mode), mot_comp_id, "joint.%d.jog-vel-mode", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->homing), mot_comp_id, "axis.%d.homing", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
/* export joint parameters */ //FIXME-AJ: changing these to joints will break configs.
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->coarse_pos_cmd),
|
||||
mot_comp_id, "axis.%d.coarse-pos-cmd", num);
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->homing), mot_comp_id, "joint.%d.homing", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->joint_vel_cmd), mot_comp_id, "axis.%d.joint-vel-cmd", num);
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->coarse_pos_cmd), mot_comp_id, "joint.%d.coarse-pos-cmd", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->backlash_corr), mot_comp_id, "axis.%d.backlash-corr", num);
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->joint_vel_cmd), mot_comp_id, "joint.%d.vel-cmd", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->backlash_filt), mot_comp_id, "axis.%d.backlash-filt", num);
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->backlash_corr), mot_comp_id, "joint.%d.backlash-corr", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->backlash_vel), mot_comp_id, "axis.%d.backlash-vel", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_float_newf(HAL_OUT, &(addr->f_error), mot_comp_id, "axis.%d.f-error", num);
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->backlash_filt), mot_comp_id, "joint.%d.backlash-filt", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->f_error_lim), mot_comp_id, "axis.%d.f-error-lim", num);
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->backlash_vel), mot_comp_id, "joint.%d.backlash-vel", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_float_newf(HAL_OUT, &(addr->f_error), mot_comp_id, "joint.%d.f-error", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->free_pos_cmd), mot_comp_id, "axis.%d.free-pos-cmd", num);
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->f_error_lim), mot_comp_id, "joint.%d.f-error-lim", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->free_vel_lim), mot_comp_id, "axis.%d.free-vel-lim", num);
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->free_pos_cmd), mot_comp_id, "joint.%d.free-pos-cmd", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_bit_newf(HAL_OUT, &(addr->free_tp_enable), mot_comp_id, "axis.%d.free-tp-enable", num);
|
||||
hal_pin_float_newf(HAL_OUT, &(addr->free_vel_lim), mot_comp_id, "joint.%d.free-vel-lim", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_bit_newf(HAL_OUT, &(addr->kb_jog_active), mot_comp_id, "axis.%d.kb-jog-active", num);
|
||||
hal_pin_bit_newf(HAL_OUT, &(addr->free_tp_enable), mot_comp_id, "joint.%d.free-tp-enable", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_bit_newf(HAL_OUT, &(addr->wheel_jog_active), mot_comp_id, "axis.%d.wheel-jog-active", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->active), mot_comp_id, "axis.%d.active", num);
|
||||
hal_pin_bit_newf(HAL_OUT, &(addr->kb_jog_active), mot_comp_id, "joint.%d.kb-jog-active", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval =
|
||||
hal_pin_bit_newf(HAL_OUT, &(addr->in_position), mot_comp_id, "axis.%d.in-position", num);
|
||||
hal_pin_bit_newf(HAL_OUT, &(addr->wheel_jog_active), mot_comp_id, "joint.%d.wheel-jog-active", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->error), mot_comp_id, "axis.%d.error", num);
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->active), mot_comp_id, "joint.%d.active", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->phl), mot_comp_id, "axis.%d.pos-hard-limit", num);
|
||||
retval =
|
||||
hal_pin_bit_newf(HAL_OUT, &(addr->in_position), mot_comp_id, "joint.%d.in-position", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->nhl), mot_comp_id, "axis.%d.neg-hard-limit", num);
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->error), mot_comp_id, "joint.%d.error", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->homed), mot_comp_id, "axis.%d.homed", num);
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->phl), mot_comp_id, "joint.%d.pos-hard-limit", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->f_errored), mot_comp_id, "axis.%d.f-errored", num);
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->nhl), mot_comp_id, "joint.%d.neg-hard-limit", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->faulted), mot_comp_id, "axis.%d.faulted", num);
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->homed), mot_comp_id, "joint.%d.homed", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_s32_newf(HAL_OUT, &(addr->home_state), mot_comp_id, "axis.%d.home-state", num);
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->f_errored), mot_comp_id, "joint.%d.f-errored", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->faulted), mot_comp_id, "joint.%d.faulted", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
retval = hal_pin_s32_newf(HAL_OUT, &(addr->home_state), mot_comp_id, "joint.%d.home-state", num);
|
||||
if (retval != 0) {
|
||||
return retval;
|
||||
}
|
||||
if(num >=3 && num <= 5) {
|
||||
// for rotaries only...
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->unlock), mot_comp_id, "axis.%d.unlock", num);
|
||||
retval = hal_pin_bit_newf(HAL_OUT, &(addr->unlock), mot_comp_id, "joint.%d.unlock", num);
|
||||
if (retval != 0) return retval;
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->is_unlocked), mot_comp_id, "axis.%d.is-unlocked", num);
|
||||
retval = hal_pin_bit_newf(HAL_IN, &(addr->is_unlocked), mot_comp_id, "joint.%d.is-unlocked", num);
|
||||
if (retval != 0) return retval;
|
||||
}
|
||||
/* restore saved message level */
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ to another.
|
|||
#include "cubic.h" /* CUBIC_STRUCT, CUBIC_COEFF */
|
||||
#include "emcmotcfg.h" /* EMCMOT_MAX_JOINTS */
|
||||
#include "kinematics.h"
|
||||
#include "simple_tp.h"
|
||||
#include "rtapi_limits.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
|
|
@ -104,7 +105,7 @@ extern "C" {
|
|||
|
||||
typedef enum {
|
||||
EMCMOT_ABORT = 1, /* abort all motion */
|
||||
EMCMOT_AXIS_ABORT, /* abort one axis */ //FIXME-AJ: replace command name to EMCMOT_JOINT_ABORT
|
||||
EMCMOT_JOINT_ABORT, /* abort one axis */
|
||||
EMCMOT_ENABLE, /* enable servos for active joints */
|
||||
EMCMOT_DISABLE, /* disable servos for active joints */
|
||||
EMCMOT_ENABLE_AMPLIFIER, /* enable amp outputs */
|
||||
|
|
@ -137,10 +138,6 @@ extern "C" {
|
|||
EMCMOT_JOG_ABS, /* absolute jog */
|
||||
EMCMOT_SET_LINE, /* queue up a linear move */
|
||||
EMCMOT_SET_CIRCLE, /* queue up a circular move */
|
||||
EMCMOT_SET_TELEOP_VECTOR, /* Move at a given velocity but in
|
||||
world cartesian coordinates, not
|
||||
in joint space like EMCMOT_JOG_* */
|
||||
|
||||
EMCMOT_CLEAR_PROBE_FLAGS, /* clears probeTripped flag */
|
||||
EMCMOT_PROBE, /* go to pos, stop if probe trips, record
|
||||
trip pos */
|
||||
|
|
@ -157,7 +154,7 @@ extern "C" {
|
|||
EMCMOT_SET_JOINT_ACC_LIMIT, /* set the max joint accel */
|
||||
EMCMOT_SET_ACC, /* set the max accel for moves (tooltip) */
|
||||
EMCMOT_SET_TERM_COND, /* set termination condition (stop, blend) */
|
||||
EMCMOT_SET_NUM_AXES, /* set the number of joints */ //FIXME-AJ: function needs to get renamed
|
||||
EMCMOT_SET_NUM_JOINTS, /* set the number of joints */
|
||||
EMCMOT_SET_WORLD_HOME, /* set pose for world home */
|
||||
EMCMOT_SET_HOMING_PARAMS, /* sets joint homing parameters */
|
||||
EMCMOT_SET_DEBUG, /* sets the debug level */
|
||||
|
|
@ -223,7 +220,7 @@ extern "C" {
|
|||
int id; /* id for motion */
|
||||
int termCond; /* termination condition */
|
||||
double tolerance; /* tolerance for path deviation in CONTINUOUS mode */
|
||||
int axis; /* which index to use for below */ //FIXME-AJ: replace with joint
|
||||
int joint; /* which index to use for below */
|
||||
double scale; /* velocity scale or spindle_speed scale arg */
|
||||
double offset; /* input, output, or home offset arg */
|
||||
double home; /* joint home position */
|
||||
|
|
@ -520,10 +517,7 @@ Suggestion: Split this in to an Error and a Status flag register..
|
|||
double ferror; /* following error */
|
||||
double ferror_limit; /* limit depends on speed */
|
||||
double ferror_high_mark; /* max following error */
|
||||
double free_pos_cmd; /* position command for free mode TP */
|
||||
double free_vel_lim; /* velocity limit for free mode TP */
|
||||
int free_tp_enable; /* if zero, joint stops ASAP */
|
||||
int free_tp_active; /* if non-zero, move in progress */
|
||||
simple_tp_t free_tp; /* planner for free mode motion */
|
||||
int kb_jog_active; /* non-zero during a keyboard jog */
|
||||
int wheel_jog_active; /* non-zero during a wheel jog */
|
||||
|
||||
|
|
|
|||
|
|
@ -751,7 +751,7 @@ int usrmotLoadComp(int joint, const char *file, int type)
|
|||
int ret = 0;
|
||||
emcmot_command_t emcmotCommand;
|
||||
|
||||
/* check axis range */
|
||||
/* check joint range */
|
||||
if (joint < 0 || joint >= EMCMOT_MAX_JOINTS) {
|
||||
fprintf(stderr, "joint out of range for compensation\n");
|
||||
return -1;
|
||||
|
|
@ -785,7 +785,7 @@ int usrmotLoadComp(int joint, const char *file, int type)
|
|||
emcmotCommand.comp_forward = fwd;
|
||||
emcmotCommand.comp_reverse = rev;
|
||||
}
|
||||
emcmotCommand.axis = joint;
|
||||
emcmotCommand.joint = joint;
|
||||
emcmotCommand.command = EMCMOT_SET_JOINT_COMP;
|
||||
ret |= usrmotWriteEmcmotCommand(&emcmotCommand);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ LIBEMCSRCS := \
|
|||
emc/nml_intf/canon_position.cc \
|
||||
emc/ini/emcIniFile.cc \
|
||||
emc/ini/iniaxis.cc \
|
||||
emc/ini/inijoint.cc \
|
||||
emc/ini/initool.cc \
|
||||
emc/ini/initraj.cc \
|
||||
emc/ini/inihal.cc \
|
||||
|
|
|
|||
|
|
@ -63,77 +63,80 @@ int emcFormat(NMLTYPE type, void *buffer, CMS * cms)
|
|||
case EMC_AUX_STAT_TYPE:
|
||||
((EMC_AUX_STAT *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_ABORT_TYPE:
|
||||
((EMC_AXIS_ABORT *) buffer)->update(cms);
|
||||
case EMC_JOINT_ABORT_TYPE:
|
||||
((EMC_JOINT_ABORT *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_ABS_JOG_TYPE:
|
||||
((EMC_AXIS_ABS_JOG *) buffer)->update(cms);
|
||||
case EMC_JOINT_ACTIVATE_TYPE:
|
||||
((EMC_JOINT_ACTIVATE *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_ACTIVATE_TYPE:
|
||||
((EMC_AXIS_ACTIVATE *) buffer)->update(cms);
|
||||
case EMC_JOINT_DEACTIVATE_TYPE:
|
||||
((EMC_JOINT_DEACTIVATE *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_DEACTIVATE_TYPE:
|
||||
((EMC_AXIS_DEACTIVATE *) buffer)->update(cms);
|
||||
case EMC_JOINT_DISABLE_TYPE:
|
||||
((EMC_JOINT_DISABLE *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_DISABLE_TYPE:
|
||||
((EMC_AXIS_DISABLE *) buffer)->update(cms);
|
||||
case EMC_JOINT_ENABLE_TYPE:
|
||||
((EMC_JOINT_ENABLE *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_ENABLE_TYPE:
|
||||
((EMC_AXIS_ENABLE *) buffer)->update(cms);
|
||||
case EMC_JOINT_HALT_TYPE:
|
||||
((EMC_JOINT_HALT *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_HALT_TYPE:
|
||||
((EMC_AXIS_HALT *) buffer)->update(cms);
|
||||
case EMC_JOINT_HOME_TYPE:
|
||||
((EMC_JOINT_HOME *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_HOME_TYPE:
|
||||
((EMC_AXIS_HOME *) buffer)->update(cms);
|
||||
case EMC_JOINT_UNHOME_TYPE:
|
||||
((EMC_JOINT_UNHOME *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_UNHOME_TYPE:
|
||||
((EMC_AXIS_UNHOME *) buffer)->update(cms);
|
||||
case EMC_JOINT_INIT_TYPE:
|
||||
((EMC_JOINT_INIT *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_INCR_JOG_TYPE:
|
||||
((EMC_AXIS_INCR_JOG *) buffer)->update(cms);
|
||||
case EMC_JOG_CONT_TYPE:
|
||||
((EMC_JOG_CONT *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_INIT_TYPE:
|
||||
((EMC_AXIS_INIT *) buffer)->update(cms);
|
||||
case EMC_JOG_INCR_TYPE:
|
||||
((EMC_JOG_INCR *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_JOG_TYPE:
|
||||
((EMC_AXIS_JOG *) buffer)->update(cms);
|
||||
case EMC_JOG_ABS_TYPE:
|
||||
((EMC_JOG_ABS *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_LOAD_COMP_TYPE:
|
||||
((EMC_AXIS_LOAD_COMP *) buffer)->update(cms);
|
||||
case EMC_JOG_STOP_TYPE:
|
||||
((EMC_JOG_STOP *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_OVERRIDE_LIMITS_TYPE:
|
||||
((EMC_AXIS_OVERRIDE_LIMITS *) buffer)->update(cms);
|
||||
case EMC_JOINT_LOAD_COMP_TYPE:
|
||||
((EMC_JOINT_LOAD_COMP *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_SET_AXIS_TYPE:
|
||||
((EMC_AXIS_SET_AXIS *) buffer)->update(cms);
|
||||
case EMC_JOINT_OVERRIDE_LIMITS_TYPE:
|
||||
((EMC_JOINT_OVERRIDE_LIMITS *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_SET_FERROR_TYPE:
|
||||
((EMC_AXIS_SET_FERROR *) buffer)->update(cms);
|
||||
case EMC_JOINT_SET_JOINT_TYPE:
|
||||
((EMC_JOINT_SET_JOINT *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_SET_BACKLASH_TYPE:
|
||||
((EMC_AXIS_SET_BACKLASH *) buffer)->update(cms);
|
||||
case EMC_JOINT_SET_FERROR_TYPE:
|
||||
((EMC_JOINT_SET_FERROR *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_SET_HOMING_PARAMS_TYPE:
|
||||
((EMC_AXIS_SET_HOMING_PARAMS *) buffer)->update(cms);
|
||||
case EMC_JOINT_SET_BACKLASH_TYPE:
|
||||
((EMC_JOINT_SET_BACKLASH *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_SET_MAX_POSITION_LIMIT_TYPE:
|
||||
((EMC_AXIS_SET_MAX_POSITION_LIMIT *) buffer)->update(cms);
|
||||
case EMC_JOINT_SET_HOMING_PARAMS_TYPE:
|
||||
((EMC_JOINT_SET_HOMING_PARAMS *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_SET_MAX_VELOCITY_TYPE:
|
||||
((EMC_AXIS_SET_MAX_VELOCITY *) buffer)->update(cms);
|
||||
case EMC_JOINT_SET_MAX_POSITION_LIMIT_TYPE:
|
||||
((EMC_JOINT_SET_MAX_POSITION_LIMIT *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_SET_MIN_FERROR_TYPE:
|
||||
((EMC_AXIS_SET_MIN_FERROR *) buffer)->update(cms);
|
||||
case EMC_JOINT_SET_MAX_VELOCITY_TYPE:
|
||||
((EMC_JOINT_SET_MAX_VELOCITY *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_SET_MIN_POSITION_LIMIT_TYPE:
|
||||
((EMC_AXIS_SET_MIN_POSITION_LIMIT *) buffer)->update(cms);
|
||||
case EMC_JOINT_SET_MIN_FERROR_TYPE:
|
||||
((EMC_JOINT_SET_MIN_FERROR *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_SET_UNITS_TYPE:
|
||||
((EMC_AXIS_SET_UNITS *) buffer)->update(cms);
|
||||
case EMC_JOINT_SET_MIN_POSITION_LIMIT_TYPE:
|
||||
((EMC_JOINT_SET_MIN_POSITION_LIMIT *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_AXIS_STAT_TYPE:
|
||||
((EMC_AXIS_STAT *) buffer)->update(cms);
|
||||
case EMC_JOINT_SET_UNITS_TYPE:
|
||||
((EMC_JOINT_SET_UNITS *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_JOINT_STAT_TYPE:
|
||||
((EMC_JOINT_STAT *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_COOLANT_FLOOD_OFF_TYPE:
|
||||
((EMC_COOLANT_FLOOD_OFF *) buffer)->update(cms);
|
||||
|
|
@ -447,9 +450,6 @@ int emcFormat(NMLTYPE type, void *buffer, CMS * cms)
|
|||
case EMC_TRAJ_SET_TELEOP_ENABLE_TYPE:
|
||||
((EMC_TRAJ_SET_TELEOP_ENABLE *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_TRAJ_SET_TELEOP_VECTOR_TYPE:
|
||||
((EMC_TRAJ_SET_TELEOP_VECTOR *) buffer)->update(cms);
|
||||
break;
|
||||
case EMC_TRAJ_SET_TERM_COND_TYPE:
|
||||
((EMC_TRAJ_SET_TERM_COND *) buffer)->update(cms);
|
||||
break;
|
||||
|
|
@ -491,54 +491,56 @@ const char *emc_symbol_lookup(uint32_t type)
|
|||
return "EMC_AUX_ESTOP_ON";
|
||||
case EMC_AUX_STAT_TYPE:
|
||||
return "EMC_AUX_STAT";
|
||||
case EMC_AXIS_ABORT_TYPE:
|
||||
return "EMC_AXIS_ABORT";
|
||||
case EMC_AXIS_ABS_JOG_TYPE:
|
||||
return "EMC_AXIS_ABS_JOG";
|
||||
case EMC_AXIS_ACTIVATE_TYPE:
|
||||
return "EMC_AXIS_ACTIVATE";
|
||||
case EMC_AXIS_DEACTIVATE_TYPE:
|
||||
return "EMC_AXIS_DEACTIVATE";
|
||||
case EMC_AXIS_DISABLE_TYPE:
|
||||
return "EMC_AXIS_DISABLE";
|
||||
case EMC_AXIS_ENABLE_TYPE:
|
||||
return "EMC_AXIS_ENABLE";
|
||||
case EMC_AXIS_HALT_TYPE:
|
||||
return "EMC_AXIS_HALT";
|
||||
case EMC_AXIS_HOME_TYPE:
|
||||
return "EMC_AXIS_HOME";
|
||||
case EMC_AXIS_UNHOME_TYPE:
|
||||
return "EMC_AXIS_UNHOME";
|
||||
case EMC_AXIS_INCR_JOG_TYPE:
|
||||
return "EMC_AXIS_INCR_JOG";
|
||||
case EMC_AXIS_INIT_TYPE:
|
||||
return "EMC_AXIS_INIT";
|
||||
case EMC_AXIS_JOG_TYPE:
|
||||
return "EMC_AXIS_JOG";
|
||||
case EMC_AXIS_LOAD_COMP_TYPE:
|
||||
return "EMC_AXIS_LOAD_COMP";
|
||||
case EMC_AXIS_OVERRIDE_LIMITS_TYPE:
|
||||
return "EMC_AXIS_OVERRIDE_LIMITS";
|
||||
case EMC_AXIS_SET_AXIS_TYPE:
|
||||
return "EMC_AXIS_SET_AXIS";
|
||||
case EMC_AXIS_SET_FERROR_TYPE:
|
||||
return "EMC_AXIS_SET_FERROR";
|
||||
case EMC_AXIS_SET_BACKLASH_TYPE:
|
||||
return "EMC_AXIS_SET_BACKLASH";
|
||||
case EMC_AXIS_SET_HOMING_PARAMS_TYPE:
|
||||
return "EMC_AXIS_SET_HOMING_PARAMS";
|
||||
case EMC_AXIS_SET_MAX_POSITION_LIMIT_TYPE:
|
||||
return "EMC_AXIS_SET_MAX_POSITION_LIMIT";
|
||||
case EMC_AXIS_SET_MAX_VELOCITY_TYPE:
|
||||
return "EMC_AXIS_SET_MAX_VELOCITY";
|
||||
case EMC_AXIS_SET_MIN_FERROR_TYPE:
|
||||
return "EMC_AXIS_SET_MIN_FERROR";
|
||||
case EMC_AXIS_SET_MIN_POSITION_LIMIT_TYPE:
|
||||
return "EMC_AXIS_SET_MIN_POSITION_LIMIT";
|
||||
case EMC_AXIS_SET_UNITS_TYPE:
|
||||
return "EMC_AXIS_SET_UNITS";
|
||||
case EMC_AXIS_STAT_TYPE:
|
||||
return "EMC_AXIS_STAT";
|
||||
case EMC_JOINT_ABORT_TYPE:
|
||||
return "EMC_JOINT_ABORT";
|
||||
case EMC_JOINT_ACTIVATE_TYPE:
|
||||
return "EMC_JOINT_ACTIVATE";
|
||||
case EMC_JOINT_DEACTIVATE_TYPE:
|
||||
return "EMC_JOINT_DEACTIVATE";
|
||||
case EMC_JOINT_DISABLE_TYPE:
|
||||
return "EMC_JOINT_DISABLE";
|
||||
case EMC_JOINT_ENABLE_TYPE:
|
||||
return "EMC_JOINT_ENABLE";
|
||||
case EMC_JOINT_HALT_TYPE:
|
||||
return "EMC_JOINT_HALT";
|
||||
case EMC_JOINT_HOME_TYPE:
|
||||
return "EMC_JOINT_HOME";
|
||||
case EMC_JOINT_UNHOME_TYPE:
|
||||
return "EMC_JOINT_UNHOME";
|
||||
case EMC_JOG_CONT_TYPE:
|
||||
return "EMC_JOG_CONT";
|
||||
case EMC_JOG_INCR_TYPE:
|
||||
return "EMC_JOG_INCR";
|
||||
case EMC_JOG_ABS_TYPE:
|
||||
return "EMC_JOG_ABS";
|
||||
case EMC_JOG_STOP_TYPE:
|
||||
return "EMC_JOG_STOP";
|
||||
case EMC_JOINT_INIT_TYPE:
|
||||
return "EMC_JOINT_INIT";
|
||||
case EMC_JOINT_LOAD_COMP_TYPE:
|
||||
return "EMC_JOINT_LOAD_COMP";
|
||||
case EMC_JOINT_OVERRIDE_LIMITS_TYPE:
|
||||
return "EMC_JOINT_OVERRIDE_LIMITS";
|
||||
case EMC_JOINT_SET_JOINT_TYPE:
|
||||
return "EMC_JOINT_SET_AXIS";
|
||||
case EMC_JOINT_SET_FERROR_TYPE:
|
||||
return "EMC_JOINT_SET_FERROR";
|
||||
case EMC_JOINT_SET_BACKLASH_TYPE:
|
||||
return "EMC_JOINT_SET_BACKLASH";
|
||||
case EMC_JOINT_SET_HOMING_PARAMS_TYPE:
|
||||
return "EMC_JOINT_SET_HOMING_PARAMS";
|
||||
case EMC_JOINT_SET_MAX_POSITION_LIMIT_TYPE:
|
||||
return "EMC_JOINT_SET_MAX_POSITION_LIMIT";
|
||||
case EMC_JOINT_SET_MAX_VELOCITY_TYPE:
|
||||
return "EMC_JOINT_SET_MAX_VELOCITY";
|
||||
case EMC_JOINT_SET_MIN_FERROR_TYPE:
|
||||
return "EMC_JOINT_SET_MIN_FERROR";
|
||||
case EMC_JOINT_SET_MIN_POSITION_LIMIT_TYPE:
|
||||
return "EMC_JOINT_SET_MIN_POSITION_LIMIT";
|
||||
case EMC_JOINT_SET_UNITS_TYPE:
|
||||
return "EMC_JOINT_SET_UNITS";
|
||||
case EMC_JOINT_STAT_TYPE:
|
||||
return "EMC_JOINT_STAT";
|
||||
case EMC_COOLANT_FLOOD_OFF_TYPE:
|
||||
return "EMC_COOLANT_FLOOD_OFF";
|
||||
case EMC_COOLANT_FLOOD_ON_TYPE:
|
||||
|
|
@ -747,8 +749,6 @@ const char *emc_symbol_lookup(uint32_t type)
|
|||
return "EMC_TRAJ_SET_FH_ENABLE";
|
||||
case EMC_TRAJ_SET_TELEOP_ENABLE_TYPE:
|
||||
return "EMC_TRAJ_SET_TELEOP_ENABLE";
|
||||
case EMC_TRAJ_SET_TELEOP_VECTOR_TYPE:
|
||||
return "EMC_TRAJ_SET_TELEOP_VECTOR";
|
||||
case EMC_TRAJ_SET_TERM_COND_TYPE:
|
||||
return "EMC_TRAJ_SET_TERM_COND";
|
||||
case EMC_TRAJ_SET_SPINDLESYNC_TYPE:
|
||||
|
|
@ -919,14 +919,14 @@ void EMC_MOTION_INIT::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_SET_UNITS
|
||||
* NML/CMS Update function for EMC_JOINT_SET_UNITS
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_SET_UNITS::update(CMS * cms)
|
||||
void EMC_JOINT_SET_UNITS::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
cms->update(units);
|
||||
|
||||
}
|
||||
|
|
@ -968,11 +968,9 @@ void EMC_TRAJ_DELAY::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_ABS_JOG
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
* NML/CMS Update function for EMC_JOG_ABS
|
||||
*/
|
||||
void EMC_AXIS_ABS_JOG::update(CMS * cms)
|
||||
void EMC_JOG_ABS::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
|
|
@ -981,6 +979,16 @@ void EMC_AXIS_ABS_JOG::update(CMS * cms)
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_JOG_STOP
|
||||
*/
|
||||
void EMC_JOG_STOP::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_LUBE_CMD_MSG
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
|
|
@ -1063,14 +1071,14 @@ void EMC_TOOL_LOAD::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_OVERRIDE_LIMITS
|
||||
* NML/CMS Update function for EMC_JOINT_OVERRIDE_LIMITS
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_OVERRIDE_LIMITS::update(CMS * cms)
|
||||
void EMC_JOINT_OVERRIDE_LIMITS::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1088,40 +1096,40 @@ void PmCartesian_update(CMS * cms, PmCartesian * x)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_SET_FERROR
|
||||
* NML/CMS Update function for EMC_JOINT_SET_FERROR
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_SET_FERROR::update(CMS * cms)
|
||||
void EMC_JOINT_SET_FERROR::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
cms->update(ferror);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_SET_MIN_POSITION_LIMIT
|
||||
* NML/CMS Update function for EMC_JOINT_SET_MIN_POSITION_LIMIT
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_SET_MIN_POSITION_LIMIT::update(CMS * cms)
|
||||
void EMC_JOINT_SET_MIN_POSITION_LIMIT::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
cms->update(limit);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_DEACTIVATE
|
||||
* NML/CMS Update function for EMC_JOINT_DEACTIVATE
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_DEACTIVATE::update(CMS * cms)
|
||||
void EMC_JOINT_DEACTIVATE::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1249,10 +1257,17 @@ void EMC_IO_CMD_MSG::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_CMD_MSG
|
||||
* NML/CMS Update function for EMC_JOINT_CMD_MSG
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_JOINT_CMD_MSG::update(CMS * cms)
|
||||
{
|
||||
cms->update(joint);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void EMC_AXIS_CMD_MSG::update(CMS * cms)
|
||||
{
|
||||
cms->update(axis);
|
||||
|
|
@ -1288,11 +1303,9 @@ void EMC_STAT::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_JOG
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
* NML/CMS Update function for EMC_JOG_CONT
|
||||
*/
|
||||
void EMC_AXIS_JOG::update(CMS * cms)
|
||||
void EMC_JOG_CONT::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
|
|
@ -1388,15 +1401,15 @@ void EMC_TRAJ_RESUME::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_SET_AXIS
|
||||
* NML/CMS Update function for EMC_JOINT_SET_JOINT
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_SET_AXIS::update(CMS * cms)
|
||||
void EMC_JOINT_SET_JOINT::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
cms->update(axisType);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
cms->update(jointType);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1473,14 +1486,14 @@ void EMC_SPINDLE_STAT::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_SET_MAX_POSITION_LIMIT
|
||||
* NML/CMS Update function for EMC_JOINT_SET_MAX_POSITION_LIMIT
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_SET_MAX_POSITION_LIMIT::update(CMS * cms)
|
||||
void EMC_JOINT_SET_MAX_POSITION_LIMIT::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
cms->update(limit);
|
||||
|
||||
}
|
||||
|
|
@ -1777,15 +1790,15 @@ void EMC_TOOL_STAT_MSG::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_STAT
|
||||
* NML/CMS Update function for EMC_JOINT_STAT
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_STAT::update(CMS * cms)
|
||||
void EMC_JOINT_STAT::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_STAT_MSG::update(cms);
|
||||
cms->update(axisType);
|
||||
EMC_JOINT_STAT_MSG::update(cms);
|
||||
cms->update(jointType);
|
||||
cms->update(units);
|
||||
cms->update(backlash);
|
||||
cms->update(minPositionLimit);
|
||||
|
|
@ -1810,6 +1823,28 @@ void EMC_AXIS_STAT::update(CMS * cms)
|
|||
cms->update(overrideLimits);
|
||||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_STAT
|
||||
* Automatically generated by micges
|
||||
* on 13.08.2009 23:43:26
|
||||
*/
|
||||
void EMC_AXIS_STAT::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_STAT_MSG::update(cms);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_JOINT_STAT_MSG
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_STAT_MSG::update(CMS * cms)
|
||||
{
|
||||
cms->update(axis);
|
||||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_INIT
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
|
|
@ -2005,25 +2040,25 @@ void EMC_SPINDLE_BRAKE_RELEASE::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_STAT_MSG
|
||||
* NML/CMS Update function for EMC_JOINT_STAT_MSG
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_STAT_MSG::update(CMS * cms)
|
||||
void EMC_JOINT_STAT_MSG::update(CMS * cms)
|
||||
{
|
||||
cms->update(axis);
|
||||
cms->update(joint);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_LOAD_COMP
|
||||
* NML/CMS Update function for EMC_JOINT_LOAD_COMP
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_LOAD_COMP::update(CMS * cms)
|
||||
void EMC_JOINT_LOAD_COMP::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
cms->update(file, 256);
|
||||
cms->update(type);
|
||||
|
||||
|
|
@ -2067,11 +2102,9 @@ void EMC_TASK_SET_MODE::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_INCR_JOG
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
* NML/CMS Update function for EMC_JOG_INCR
|
||||
*/
|
||||
void EMC_AXIS_INCR_JOG::update(CMS * cms)
|
||||
void EMC_JOG_INCR::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
|
|
@ -2081,14 +2114,14 @@ void EMC_AXIS_INCR_JOG::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_ACTIVATE
|
||||
* NML/CMS Update function for EMC_JOINT_ACTIVATE
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_ACTIVATE::update(CMS * cms)
|
||||
void EMC_JOINT_ACTIVATE::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -2173,14 +2206,14 @@ void EMC_TRAJ_SET_OFFSET::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_ABORT
|
||||
* NML/CMS Update function for EMC_JOINT_ABORT
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:16 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_ABORT::update(CMS * cms)
|
||||
void EMC_JOINT_ABORT::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -2207,14 +2240,14 @@ void EMC_OPERATOR_ERROR::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_SET_MAX_VELOCITY
|
||||
* NML/CMS Update function for EMC_JOINT_SET_MAX_VELOCITY
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:17 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_SET_MAX_VELOCITY::update(CMS * cms)
|
||||
void EMC_JOINT_SET_MAX_VELOCITY::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
cms->update(vel);
|
||||
|
||||
}
|
||||
|
|
@ -2255,25 +2288,25 @@ void EMC_TASK_PLAN_STEP::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_DISABLE
|
||||
* NML/CMS Update function for EMC_JOINT_DISABLE
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:17 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_DISABLE::update(CMS * cms)
|
||||
void EMC_JOINT_DISABLE::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_SET_BACKLASH
|
||||
* NML/CMS Update function for EMC_JOINT_SET_BACKLASH
|
||||
* Manually generated - don't use NML CodeGen Java Applet.
|
||||
*/
|
||||
void EMC_AXIS_SET_BACKLASH::update(CMS * cms)
|
||||
void EMC_JOINT_SET_BACKLASH::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
cms->update(backlash);
|
||||
|
||||
}
|
||||
|
|
@ -2359,45 +2392,45 @@ void EMC_TRAJ_STAT::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_HOME
|
||||
* NML/CMS Update function for EMC_JOINT_HOME
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:17 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_HOME::update(CMS * cms)
|
||||
void EMC_JOINT_HOME::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
|
||||
}
|
||||
|
||||
void EMC_AXIS_UNHOME::update(CMS * cms)
|
||||
void EMC_JOINT_UNHOME::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_INIT
|
||||
* NML/CMS Update function for EMC_JOINT_INIT
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:17 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_INIT::update(CMS * cms)
|
||||
void EMC_JOINT_INIT::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_ENABLE
|
||||
* NML/CMS Update function for EMC_JOINT_ENABLE
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:17 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_ENABLE::update(CMS * cms)
|
||||
void EMC_JOINT_ENABLE::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -2474,27 +2507,14 @@ void EMC_AUX_CMD_MSG::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_TRAJ_SET_TELEOP_VECTOR
|
||||
* NML/CMS Update function for EMC_JOINT_SET_MIN_FERROR
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:17 UTC 2003
|
||||
*/
|
||||
void EMC_TRAJ_SET_TELEOP_VECTOR::update(CMS * cms)
|
||||
void EMC_JOINT_SET_MIN_FERROR::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_TRAJ_CMD_MSG::update(cms);
|
||||
EmcPose_update(cms, &vector);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_SET_MIN_FERROR
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:17 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_SET_MIN_FERROR::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
cms->update(ferror);
|
||||
|
||||
}
|
||||
|
|
@ -2559,8 +2579,8 @@ void EMC_MOTION_STAT::update(CMS * cms)
|
|||
|
||||
EMC_MOTION_STAT_MSG::update(cms);
|
||||
traj.update(cms);
|
||||
for (int i_axis = 0; i_axis < 8; i_axis++)
|
||||
axis[i_axis].update(cms);
|
||||
for (int i_joint = 0; i_joint < EMCMOT_MAX_JOINTS; i_joint++)
|
||||
joint[i_joint].update(cms);
|
||||
cms->update(debug);
|
||||
|
||||
spindle.update(cms); //FIXME - is this needed ?
|
||||
|
|
@ -2616,13 +2636,13 @@ void EMC_TASK_PLAN_OPEN::update(CMS * cms)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_SET_HOMING_PARAMS
|
||||
* NML/CMS Update function for EMC_JOINT_SET_HOMING_PARAMS
|
||||
* Manually generated - do not use NML CodeGen Java Applet.
|
||||
*/
|
||||
void EMC_AXIS_SET_HOMING_PARAMS::update(CMS * cms)
|
||||
void EMC_JOINT_SET_HOMING_PARAMS::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
cms->update(home);
|
||||
cms->update(offset);
|
||||
cms->update(home_final_vel);
|
||||
|
|
@ -2717,14 +2737,14 @@ void CANON_POSITION_update(CMS * cms, CANON_POSITION * x)
|
|||
}
|
||||
|
||||
/*
|
||||
* NML/CMS Update function for EMC_AXIS_HALT
|
||||
* NML/CMS Update function for EMC_JOINT_HALT
|
||||
* Automatically generated by NML CodeGen Java Applet.
|
||||
* on Sat Oct 11 13:45:17 UTC 2003
|
||||
*/
|
||||
void EMC_AXIS_HALT::update(CMS * cms)
|
||||
void EMC_JOINT_HALT::update(CMS * cms)
|
||||
{
|
||||
|
||||
EMC_AXIS_CMD_MSG::update(cms);
|
||||
EMC_JOINT_CMD_MSG::update(cms);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,12 +16,13 @@
|
|||
#define EMC_HH
|
||||
|
||||
#include "config.h"
|
||||
#include "emcglb.h" // EMC_AXIS_MAX
|
||||
#include "emcglb.h" // EMC_JOINT_MAX, EMC_AXIS_MAX
|
||||
#include "nml_type.hh"
|
||||
#include "motion_types.h"
|
||||
#include <stdint.h>
|
||||
|
||||
// Forward class declarations
|
||||
class EMC_JOINT_STAT;
|
||||
class EMC_AXIS_STAT;
|
||||
class EMC_TRAJ_STAT;
|
||||
class EMC_MOTION_STAT;
|
||||
|
|
@ -56,42 +57,44 @@ struct PM_CARTESIAN;
|
|||
|
||||
#define EMC_SYSTEM_CMD_TYPE ((NMLTYPE) 30)
|
||||
|
||||
// NML for EMC_AXIS
|
||||
// NML for EMC_JOINT
|
||||
|
||||
#define EMC_AXIS_SET_AXIS_TYPE ((NMLTYPE) 101)
|
||||
#define EMC_AXIS_SET_UNITS_TYPE ((NMLTYPE) 102)
|
||||
#define EMC_JOINT_SET_JOINT_TYPE ((NMLTYPE) 101)
|
||||
#define EMC_JOINT_SET_UNITS_TYPE ((NMLTYPE) 102)
|
||||
/* gap because of deleted message types */
|
||||
|
||||
|
||||
|
||||
|
||||
#define EMC_AXIS_SET_MIN_POSITION_LIMIT_TYPE ((NMLTYPE) 107)
|
||||
#define EMC_AXIS_SET_MAX_POSITION_LIMIT_TYPE ((NMLTYPE) 108)
|
||||
#define EMC_AXIS_SET_FERROR_TYPE ((NMLTYPE) 111)
|
||||
#define EMC_AXIS_SET_HOMING_PARAMS_TYPE ((NMLTYPE) 112)
|
||||
#define EMC_JOINT_SET_MIN_POSITION_LIMIT_TYPE ((NMLTYPE) 107)
|
||||
#define EMC_JOINT_SET_MAX_POSITION_LIMIT_TYPE ((NMLTYPE) 108)
|
||||
#define EMC_JOINT_SET_FERROR_TYPE ((NMLTYPE) 111)
|
||||
#define EMC_JOINT_SET_HOMING_PARAMS_TYPE ((NMLTYPE) 112)
|
||||
// gap because of deleted message types
|
||||
|
||||
#define EMC_AXIS_SET_MIN_FERROR_TYPE ((NMLTYPE) 115)
|
||||
#define EMC_AXIS_SET_MAX_VELOCITY_TYPE ((NMLTYPE) 116)
|
||||
#define EMC_JOINT_SET_MIN_FERROR_TYPE ((NMLTYPE) 115)
|
||||
#define EMC_JOINT_SET_MAX_VELOCITY_TYPE ((NMLTYPE) 116)
|
||||
// gap because of deleted message types
|
||||
|
||||
#define EMC_AXIS_INIT_TYPE ((NMLTYPE) 118)
|
||||
#define EMC_AXIS_HALT_TYPE ((NMLTYPE) 119)
|
||||
#define EMC_AXIS_ABORT_TYPE ((NMLTYPE) 120)
|
||||
#define EMC_AXIS_ENABLE_TYPE ((NMLTYPE) 121)
|
||||
#define EMC_AXIS_DISABLE_TYPE ((NMLTYPE) 122)
|
||||
#define EMC_AXIS_HOME_TYPE ((NMLTYPE) 123)
|
||||
#define EMC_AXIS_UNHOME_TYPE ((NMLTYPE) 135)
|
||||
#define EMC_AXIS_JOG_TYPE ((NMLTYPE) 124)
|
||||
#define EMC_AXIS_INCR_JOG_TYPE ((NMLTYPE) 125)
|
||||
#define EMC_AXIS_ABS_JOG_TYPE ((NMLTYPE) 126)
|
||||
#define EMC_AXIS_ACTIVATE_TYPE ((NMLTYPE) 127)
|
||||
#define EMC_AXIS_DEACTIVATE_TYPE ((NMLTYPE) 128)
|
||||
#define EMC_AXIS_OVERRIDE_LIMITS_TYPE ((NMLTYPE) 129)
|
||||
#define EMC_AXIS_LOAD_COMP_TYPE ((NMLTYPE) 131)
|
||||
#define EMC_JOINT_INIT_TYPE ((NMLTYPE) 118)
|
||||
#define EMC_JOINT_HALT_TYPE ((NMLTYPE) 119)
|
||||
#define EMC_JOINT_ABORT_TYPE ((NMLTYPE) 120)
|
||||
#define EMC_JOINT_ENABLE_TYPE ((NMLTYPE) 121)
|
||||
#define EMC_JOINT_DISABLE_TYPE ((NMLTYPE) 122)
|
||||
#define EMC_JOINT_HOME_TYPE ((NMLTYPE) 123)
|
||||
#define EMC_JOG_CONT_TYPE ((NMLTYPE) 124)
|
||||
#define EMC_JOG_INCR_TYPE ((NMLTYPE) 125)
|
||||
#define EMC_JOG_ABS_TYPE ((NMLTYPE) 126)
|
||||
#define EMC_JOINT_ACTIVATE_TYPE ((NMLTYPE) 127)
|
||||
#define EMC_JOINT_DEACTIVATE_TYPE ((NMLTYPE) 128)
|
||||
#define EMC_JOINT_OVERRIDE_LIMITS_TYPE ((NMLTYPE) 129)
|
||||
#define EMC_JOINT_LOAD_COMP_TYPE ((NMLTYPE) 131)
|
||||
// gap because of deleted message type (EMC_AXIS_ALTER_TYPE)
|
||||
#define EMC_AXIS_SET_BACKLASH_TYPE ((NMLTYPE) 134)
|
||||
#define EMC_JOINT_SET_BACKLASH_TYPE ((NMLTYPE) 134)
|
||||
#define EMC_JOINT_UNHOME_TYPE ((NMLTYPE) 135)
|
||||
#define EMC_JOG_STOP_TYPE ((NMLTYPE) 136)
|
||||
|
||||
#define EMC_JOINT_STAT_TYPE ((NMLTYPE) 198)
|
||||
#define EMC_AXIS_STAT_TYPE ((NMLTYPE) 199)
|
||||
|
||||
// NML for EMC_TRAJ
|
||||
|
|
@ -136,7 +139,7 @@ struct PM_CARTESIAN;
|
|||
#define EMC_TRAJ_CLEAR_PROBE_TRIPPED_FLAG_TYPE ((NMLTYPE) 228)
|
||||
#define EMC_TRAJ_PROBE_TYPE ((NMLTYPE) 229)
|
||||
#define EMC_TRAJ_SET_TELEOP_ENABLE_TYPE ((NMLTYPE) 230)
|
||||
#define EMC_TRAJ_SET_TELEOP_VECTOR_TYPE ((NMLTYPE) 231)
|
||||
/* gap because of removed message EMC_TRAJ_SET_TELEOP_VECTOR (now handled by regular jog commands) */
|
||||
#define EMC_TRAJ_SET_SPINDLESYNC_TYPE ((NMLTYPE) 232)
|
||||
#define EMC_TRAJ_SET_SPINDLE_SCALE_TYPE ((NMLTYPE) 233)
|
||||
#define EMC_TRAJ_SET_FO_ENABLE_TYPE ((NMLTYPE) 234)
|
||||
|
|
@ -376,46 +379,57 @@ extern int emcOperatorDisplay(int id, const char *fmt, ...) __attribute__((forma
|
|||
|
||||
// implementation functions for EMC_AXIS types
|
||||
|
||||
extern int emcAxisSetAxis(int axis, unsigned char axisType);
|
||||
extern int emcAxisSetUnits(int axis, double units);
|
||||
extern int emcAxisSetBacklash(int axis, double backlash);
|
||||
extern int emcAxisSetMinPositionLimit(int axis, double limit);
|
||||
extern int emcAxisSetMaxPositionLimit(int axis, double limit);
|
||||
extern int emcAxisSetMotorOffset(int axis, double offset);
|
||||
extern int emcAxisSetFerror(int axis, double ferror);
|
||||
extern int emcAxisSetMinFerror(int axis, double ferror);
|
||||
extern int emcAxisSetHomingParams(int axis, double home, double offset, double home_final_vel,
|
||||
double search_vel, double latch_vel,
|
||||
int use_index, int ignore_limits,
|
||||
int is_shared, int home_sequence, int volatile_home, int locking_indexer);
|
||||
extern int emcAxisSetMaxVelocity(int axis, double vel);
|
||||
extern int emcAxisSetMaxAcceleration(int axis, double acc);
|
||||
|
||||
extern int emcAxisInit(int axis);
|
||||
extern int emcAxisHalt(int axis);
|
||||
extern int emcAxisAbort(int axis);
|
||||
extern int emcAxisEnable(int axis);
|
||||
extern int emcAxisDisable(int axis);
|
||||
extern int emcAxisHome(int axis);
|
||||
extern int emcAxisUnhome(int axis);
|
||||
extern int emcAxisJog(int axis, double vel);
|
||||
extern int emcAxisIncrJog(int axis, double incr, double vel);
|
||||
extern int emcAxisAbsJog(int axis, double pos, double vel);
|
||||
extern int emcAxisActivate(int axis);
|
||||
extern int emcAxisDeactivate(int axis);
|
||||
extern int emcAxisOverrideLimits(int axis);
|
||||
extern int emcAxisLoadComp(int axis, const char *file, int type);
|
||||
|
||||
|
||||
extern int emcAxisUpdate(EMC_AXIS_STAT stat[], int numAxes);
|
||||
|
||||
// implementation functions for EMC_JOINT types
|
||||
|
||||
extern int emcJointSetJoint(int joint, unsigned char jointType);
|
||||
extern int emcJointSetUnits(int joint, double units);
|
||||
extern int emcJointSetBacklash(int joint, double backlash);
|
||||
extern int emcJointSetMinPositionLimit(int joint, double limit);
|
||||
extern int emcJointSetMaxPositionLimit(int joint, double limit);
|
||||
extern int emcJointSetMotorOffset(int joint, double offset);
|
||||
extern int emcJointSetFerror(int joint, double ferror);
|
||||
extern int emcJointSetMinFerror(int joint, double ferror);
|
||||
extern int emcJointSetHomingParams(int joint, double home, double offset, double home_vel,
|
||||
double search_vel, double latch_vel,
|
||||
int use_index, int ignore_limits,
|
||||
int is_shared, int home_sequence, int volatile_home, int locking_indexer);
|
||||
extern int emcJointSetMaxVelocity(int joint, double vel);
|
||||
extern int emcJointSetMaxAcceleration(int joint, double acc);
|
||||
|
||||
extern int emcJointInit(int joint);
|
||||
extern int emcJointHalt(int joint);
|
||||
extern int emcJointEnable(int joint);
|
||||
extern int emcJointDisable(int joint);
|
||||
extern int emcJointHome(int joint);
|
||||
extern int emcJointUnhome(int joint);
|
||||
extern int emcJointActivate(int joint);
|
||||
extern int emcJointDeactivate(int joint);
|
||||
extern int emcJointOverrideLimits(int joint);
|
||||
extern int emcJointLoadComp(int joint, const char *file, int type);
|
||||
extern int emcJogStop(int nr);
|
||||
extern int emcJogCont(int nr, double vel);
|
||||
extern int emcJogIncr(int nr, double incr, double vel);
|
||||
extern int emcJogAbs(int nr, double pos, double vel);
|
||||
|
||||
|
||||
extern int emcJointUpdate(EMC_JOINT_STAT stat[], int numJoints);
|
||||
|
||||
// implementation functions for EMC_TRAJ types
|
||||
|
||||
extern int emcTrajSetJoints(int joints);
|
||||
extern int emcTrajSetAxes(int axes, int axismask);
|
||||
extern int emcTrajSetUnits(double linearUnits, double angularUnits);
|
||||
extern int emcTrajSetCycleTime(double cycleTime);
|
||||
extern int emcTrajSetMode(int traj_mode);
|
||||
extern int emcTrajSetTeleopVector(EmcPose vel);
|
||||
extern int emcTrajSetVelocity(double vel, double ini_maxvel);
|
||||
extern int emcTrajSetAcceleration(double acc);
|
||||
extern int emcTrajSetMaxVelocity(double vel);
|
||||
|
|
@ -567,15 +581,15 @@ extern EMC_IO_STAT *emcIoStatus;
|
|||
// EMC MOTION status
|
||||
extern EMC_MOTION_STAT *emcMotionStatus;
|
||||
|
||||
// values for EMC_AXIS_SET_AXIS, axisType
|
||||
enum EmcAxisType {
|
||||
EMC_AXIS_LINEAR = 1,
|
||||
EMC_AXIS_ANGULAR = 2,
|
||||
// values for EMC_JOINT_SET_JOINT, jointType
|
||||
enum EmcJointType {
|
||||
EMC_LINEAR = 1,
|
||||
EMC_ANGULAR = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the units conversion factor.
|
||||
* @see EMC_AXIS_SET_INPUT_SCALE
|
||||
* @see EMC_JOINT_SET_INPUT_SCALE
|
||||
*/
|
||||
typedef double EmcLinearUnits;
|
||||
typedef double EmcAngularUnits;
|
||||
|
|
|
|||
|
|
@ -145,31 +145,73 @@ class EMC_AXIS_CMD_MSG:public RCS_CMD_MSG {
|
|||
int axis;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the axis type to linear or angular.
|
||||
* Similiar to the AXIS_TYPE field in the ".ini" file.
|
||||
*/
|
||||
class EMC_AXIS_SET_AXIS:public EMC_AXIS_CMD_MSG {
|
||||
// AIXS status base class
|
||||
class EMC_AXIS_STAT_MSG:public RCS_STAT_MSG {
|
||||
public:
|
||||
EMC_AXIS_SET_AXIS():EMC_AXIS_CMD_MSG(EMC_AXIS_SET_AXIS_TYPE,
|
||||
sizeof(EMC_AXIS_SET_AXIS)) {
|
||||
EMC_AXIS_STAT_MSG(NMLTYPE t, size_t s):RCS_STAT_MSG(t, s) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
|
||||
// EMC_AXIS_LINEAR, EMC_AXIS_ANGULAR
|
||||
unsigned char axisType;
|
||||
int axis;
|
||||
};
|
||||
|
||||
class EMC_AXIS_STAT:public EMC_AXIS_STAT_MSG {
|
||||
public:
|
||||
EMC_AXIS_STAT();
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
};
|
||||
|
||||
// declarations for EMC_JOINT classes
|
||||
|
||||
/*
|
||||
* JOINT command base class.
|
||||
* This is the base class for all commands that operate on a single joint.
|
||||
* The joint parameter specifies which joint the command affects.
|
||||
* These commands are sent to the emcCommand buffer to be read by the
|
||||
* TASK program that will then pass along corresponding messages to the
|
||||
* motion system.
|
||||
*/
|
||||
class EMC_JOINT_CMD_MSG:public RCS_CMD_MSG {
|
||||
public:
|
||||
EMC_JOINT_CMD_MSG(NMLTYPE t, size_t s):RCS_CMD_MSG(t, s) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
|
||||
// 0 = X, 1 = Y, 2 = Z, etc.
|
||||
int joint;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the joint type to linear or angular.
|
||||
* Similiar to the JOINT_TYPE field in the ".ini" file.
|
||||
*/
|
||||
class EMC_JOINT_SET_JOINT:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_JOINT_SET_JOINT():EMC_JOINT_CMD_MSG(EMC_JOINT_SET_JOINT_TYPE,
|
||||
sizeof(EMC_JOINT_SET_JOINT)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
|
||||
// EMC_JOINT_LINEAR, EMC_JOINT_ANGULAR
|
||||
unsigned char jointType;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the units conversion factor.
|
||||
* @see EMC_AXIS_SET_INPUT_SCALE
|
||||
* @see EMC_JOINT_SET_INPUT_SCALE
|
||||
*/
|
||||
class EMC_AXIS_SET_UNITS:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_SET_UNITS:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_SET_UNITS():EMC_AXIS_CMD_MSG(EMC_AXIS_SET_UNITS_TYPE,
|
||||
sizeof(EMC_AXIS_SET_UNITS)) {
|
||||
EMC_JOINT_SET_UNITS():EMC_JOINT_CMD_MSG(EMC_JOINT_SET_UNITS_TYPE,
|
||||
sizeof(EMC_JOINT_SET_UNITS)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
|
|
@ -179,15 +221,14 @@ class EMC_AXIS_SET_UNITS:public EMC_AXIS_CMD_MSG {
|
|||
double units;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Set the Axis backlash.
|
||||
* This command sets the backlash value.
|
||||
*/
|
||||
class EMC_AXIS_SET_BACKLASH:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_SET_BACKLASH:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_SET_BACKLASH():EMC_AXIS_CMD_MSG(EMC_AXIS_SET_BACKLASH_TYPE,
|
||||
sizeof(EMC_AXIS_SET_BACKLASH))
|
||||
EMC_JOINT_SET_BACKLASH():EMC_JOINT_CMD_MSG(EMC_JOINT_SET_BACKLASH_TYPE,
|
||||
sizeof(EMC_JOINT_SET_BACKLASH))
|
||||
{
|
||||
};
|
||||
|
||||
|
|
@ -197,11 +238,11 @@ class EMC_AXIS_SET_BACKLASH:public EMC_AXIS_CMD_MSG {
|
|||
double backlash;
|
||||
};
|
||||
|
||||
class EMC_AXIS_SET_MIN_POSITION_LIMIT:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_SET_MIN_POSITION_LIMIT:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_SET_MIN_POSITION_LIMIT():EMC_AXIS_CMD_MSG
|
||||
(EMC_AXIS_SET_MIN_POSITION_LIMIT_TYPE,
|
||||
sizeof(EMC_AXIS_SET_MIN_POSITION_LIMIT)) {
|
||||
EMC_JOINT_SET_MIN_POSITION_LIMIT():EMC_JOINT_CMD_MSG
|
||||
(EMC_JOINT_SET_MIN_POSITION_LIMIT_TYPE,
|
||||
sizeof(EMC_JOINT_SET_MIN_POSITION_LIMIT)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
|
|
@ -210,11 +251,11 @@ class EMC_AXIS_SET_MIN_POSITION_LIMIT:public EMC_AXIS_CMD_MSG {
|
|||
double limit;
|
||||
};
|
||||
|
||||
class EMC_AXIS_SET_MAX_POSITION_LIMIT:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_SET_MAX_POSITION_LIMIT:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_SET_MAX_POSITION_LIMIT():EMC_AXIS_CMD_MSG
|
||||
(EMC_AXIS_SET_MAX_POSITION_LIMIT_TYPE,
|
||||
sizeof(EMC_AXIS_SET_MAX_POSITION_LIMIT)) {
|
||||
EMC_JOINT_SET_MAX_POSITION_LIMIT():EMC_JOINT_CMD_MSG
|
||||
(EMC_JOINT_SET_MAX_POSITION_LIMIT_TYPE,
|
||||
sizeof(EMC_JOINT_SET_MAX_POSITION_LIMIT)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
|
|
@ -223,10 +264,10 @@ class EMC_AXIS_SET_MAX_POSITION_LIMIT:public EMC_AXIS_CMD_MSG {
|
|||
double limit;
|
||||
};
|
||||
|
||||
class EMC_AXIS_SET_FERROR:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_SET_FERROR:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_SET_FERROR():EMC_AXIS_CMD_MSG(EMC_AXIS_SET_FERROR_TYPE,
|
||||
sizeof(EMC_AXIS_SET_FERROR)) {
|
||||
EMC_JOINT_SET_FERROR():EMC_JOINT_CMD_MSG(EMC_JOINT_SET_FERROR_TYPE,
|
||||
sizeof(EMC_JOINT_SET_FERROR)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
|
|
@ -235,10 +276,10 @@ class EMC_AXIS_SET_FERROR:public EMC_AXIS_CMD_MSG {
|
|||
double ferror;
|
||||
};
|
||||
|
||||
class EMC_AXIS_SET_MIN_FERROR:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_SET_MIN_FERROR:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_SET_MIN_FERROR():EMC_AXIS_CMD_MSG
|
||||
(EMC_AXIS_SET_MIN_FERROR_TYPE, sizeof(EMC_AXIS_SET_MIN_FERROR)) {
|
||||
EMC_JOINT_SET_MIN_FERROR():EMC_JOINT_CMD_MSG
|
||||
(EMC_JOINT_SET_MIN_FERROR_TYPE, sizeof(EMC_JOINT_SET_MIN_FERROR)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
|
|
@ -247,11 +288,11 @@ class EMC_AXIS_SET_MIN_FERROR:public EMC_AXIS_CMD_MSG {
|
|||
double ferror;
|
||||
};
|
||||
|
||||
class EMC_AXIS_SET_HOMING_PARAMS:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_SET_HOMING_PARAMS:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_SET_HOMING_PARAMS():EMC_AXIS_CMD_MSG
|
||||
(EMC_AXIS_SET_HOMING_PARAMS_TYPE,
|
||||
sizeof(EMC_AXIS_SET_HOMING_PARAMS)) {
|
||||
EMC_JOINT_SET_HOMING_PARAMS():EMC_JOINT_CMD_MSG
|
||||
(EMC_JOINT_SET_HOMING_PARAMS_TYPE,
|
||||
sizeof(EMC_JOINT_SET_HOMING_PARAMS)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
|
|
@ -270,11 +311,11 @@ class EMC_AXIS_SET_HOMING_PARAMS:public EMC_AXIS_CMD_MSG {
|
|||
int locking_indexer;
|
||||
};
|
||||
|
||||
class EMC_AXIS_SET_MAX_VELOCITY:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_SET_MAX_VELOCITY:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_SET_MAX_VELOCITY():EMC_AXIS_CMD_MSG
|
||||
(EMC_AXIS_SET_MAX_VELOCITY_TYPE,
|
||||
sizeof(EMC_AXIS_SET_MAX_VELOCITY)) {
|
||||
EMC_JOINT_SET_MAX_VELOCITY():EMC_JOINT_CMD_MSG
|
||||
(EMC_JOINT_SET_MAX_VELOCITY_TYPE,
|
||||
sizeof(EMC_JOINT_SET_MAX_VELOCITY)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
|
|
@ -283,80 +324,80 @@ class EMC_AXIS_SET_MAX_VELOCITY:public EMC_AXIS_CMD_MSG {
|
|||
double vel;
|
||||
};
|
||||
|
||||
class EMC_AXIS_INIT:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_INIT:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_INIT():EMC_AXIS_CMD_MSG(EMC_AXIS_INIT_TYPE,
|
||||
sizeof(EMC_AXIS_INIT)) {
|
||||
EMC_JOINT_INIT():EMC_JOINT_CMD_MSG(EMC_JOINT_INIT_TYPE,
|
||||
sizeof(EMC_JOINT_INIT)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
};
|
||||
|
||||
class EMC_AXIS_HALT:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_HALT:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_HALT():EMC_AXIS_CMD_MSG(EMC_AXIS_HALT_TYPE,
|
||||
sizeof(EMC_AXIS_HALT)) {
|
||||
EMC_JOINT_HALT():EMC_JOINT_CMD_MSG(EMC_JOINT_HALT_TYPE,
|
||||
sizeof(EMC_JOINT_HALT)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
};
|
||||
|
||||
class EMC_AXIS_ABORT:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_ABORT:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_ABORT():EMC_AXIS_CMD_MSG(EMC_AXIS_ABORT_TYPE,
|
||||
sizeof(EMC_AXIS_ABORT)) {
|
||||
EMC_JOINT_ABORT():EMC_JOINT_CMD_MSG(EMC_JOINT_ABORT_TYPE,
|
||||
sizeof(EMC_JOINT_ABORT)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
};
|
||||
|
||||
class EMC_AXIS_ENABLE:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_ENABLE:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_ENABLE():EMC_AXIS_CMD_MSG(EMC_AXIS_ENABLE_TYPE,
|
||||
sizeof(EMC_AXIS_ENABLE)) {
|
||||
EMC_JOINT_ENABLE():EMC_JOINT_CMD_MSG(EMC_JOINT_ENABLE_TYPE,
|
||||
sizeof(EMC_JOINT_ENABLE)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
};
|
||||
|
||||
class EMC_AXIS_DISABLE:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_DISABLE:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_DISABLE():EMC_AXIS_CMD_MSG(EMC_AXIS_DISABLE_TYPE,
|
||||
sizeof(EMC_AXIS_DISABLE)) {
|
||||
EMC_JOINT_DISABLE():EMC_JOINT_CMD_MSG(EMC_JOINT_DISABLE_TYPE,
|
||||
sizeof(EMC_JOINT_DISABLE)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
};
|
||||
|
||||
class EMC_AXIS_HOME:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_HOME:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_HOME():EMC_AXIS_CMD_MSG(EMC_AXIS_HOME_TYPE,
|
||||
sizeof(EMC_AXIS_HOME)) {
|
||||
EMC_JOINT_HOME():EMC_JOINT_CMD_MSG(EMC_JOINT_HOME_TYPE,
|
||||
sizeof(EMC_JOINT_HOME)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
};
|
||||
|
||||
class EMC_AXIS_UNHOME:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_UNHOME:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_UNHOME():EMC_AXIS_CMD_MSG(EMC_AXIS_UNHOME_TYPE,
|
||||
sizeof(EMC_AXIS_UNHOME)) {
|
||||
EMC_JOINT_UNHOME():EMC_JOINT_CMD_MSG(EMC_JOINT_UNHOME_TYPE,
|
||||
sizeof(EMC_JOINT_UNHOME)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
};
|
||||
|
||||
class EMC_AXIS_JOG:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOG_CONT:public EMC_AXIS_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_JOG():EMC_AXIS_CMD_MSG(EMC_AXIS_JOG_TYPE,
|
||||
sizeof(EMC_AXIS_JOG)) {
|
||||
EMC_JOG_CONT():EMC_AXIS_CMD_MSG(EMC_JOG_CONT_TYPE,
|
||||
sizeof(EMC_JOG_CONT)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
|
|
@ -365,10 +406,10 @@ class EMC_AXIS_JOG:public EMC_AXIS_CMD_MSG {
|
|||
double vel;
|
||||
};
|
||||
|
||||
class EMC_AXIS_INCR_JOG:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOG_INCR:public EMC_AXIS_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_INCR_JOG():EMC_AXIS_CMD_MSG(EMC_AXIS_INCR_JOG_TYPE,
|
||||
sizeof(EMC_AXIS_INCR_JOG)) {
|
||||
EMC_JOG_INCR():EMC_AXIS_CMD_MSG(EMC_JOG_INCR_TYPE,
|
||||
sizeof(EMC_JOG_INCR)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
|
|
@ -378,10 +419,10 @@ class EMC_AXIS_INCR_JOG:public EMC_AXIS_CMD_MSG {
|
|||
double vel;
|
||||
};
|
||||
|
||||
class EMC_AXIS_ABS_JOG:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOG_ABS:public EMC_AXIS_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_ABS_JOG():EMC_AXIS_CMD_MSG(EMC_AXIS_ABS_JOG_TYPE,
|
||||
sizeof(EMC_AXIS_ABS_JOG)) {
|
||||
EMC_JOG_ABS():EMC_AXIS_CMD_MSG(EMC_JOG_ABS_TYPE,
|
||||
sizeof(EMC_JOG_ABS)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
|
|
@ -391,40 +432,50 @@ class EMC_AXIS_ABS_JOG:public EMC_AXIS_CMD_MSG {
|
|||
double vel;
|
||||
};
|
||||
|
||||
class EMC_AXIS_ACTIVATE:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOG_STOP:public EMC_AXIS_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_ACTIVATE():EMC_AXIS_CMD_MSG(EMC_AXIS_ACTIVATE_TYPE,
|
||||
sizeof(EMC_AXIS_ACTIVATE)) {
|
||||
EMC_JOG_STOP():EMC_AXIS_CMD_MSG(EMC_JOG_STOP_TYPE,
|
||||
sizeof(EMC_JOG_STOP)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
};
|
||||
|
||||
class EMC_AXIS_DEACTIVATE:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_ACTIVATE:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_DEACTIVATE():EMC_AXIS_CMD_MSG(EMC_AXIS_DEACTIVATE_TYPE,
|
||||
sizeof(EMC_AXIS_DEACTIVATE)) {
|
||||
EMC_JOINT_ACTIVATE():EMC_JOINT_CMD_MSG(EMC_JOINT_ACTIVATE_TYPE,
|
||||
sizeof(EMC_JOINT_ACTIVATE)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
};
|
||||
|
||||
class EMC_AXIS_OVERRIDE_LIMITS:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_DEACTIVATE:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_OVERRIDE_LIMITS():EMC_AXIS_CMD_MSG
|
||||
(EMC_AXIS_OVERRIDE_LIMITS_TYPE, sizeof(EMC_AXIS_OVERRIDE_LIMITS)) {
|
||||
EMC_JOINT_DEACTIVATE():EMC_JOINT_CMD_MSG(EMC_JOINT_DEACTIVATE_TYPE,
|
||||
sizeof(EMC_JOINT_DEACTIVATE)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
};
|
||||
|
||||
class EMC_AXIS_LOAD_COMP:public EMC_AXIS_CMD_MSG {
|
||||
class EMC_JOINT_OVERRIDE_LIMITS:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_AXIS_LOAD_COMP():EMC_AXIS_CMD_MSG(EMC_AXIS_LOAD_COMP_TYPE,
|
||||
sizeof(EMC_AXIS_LOAD_COMP)) {
|
||||
EMC_JOINT_OVERRIDE_LIMITS():EMC_JOINT_CMD_MSG
|
||||
(EMC_JOINT_OVERRIDE_LIMITS_TYPE, sizeof(EMC_JOINT_OVERRIDE_LIMITS)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
};
|
||||
|
||||
class EMC_JOINT_LOAD_COMP:public EMC_JOINT_CMD_MSG {
|
||||
public:
|
||||
EMC_JOINT_LOAD_COMP():EMC_JOINT_CMD_MSG(EMC_JOINT_LOAD_COMP_TYPE,
|
||||
sizeof(EMC_JOINT_LOAD_COMP)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
|
|
@ -436,27 +487,27 @@ class EMC_AXIS_LOAD_COMP:public EMC_AXIS_CMD_MSG {
|
|||
};
|
||||
|
||||
|
||||
// AXIS status base class
|
||||
class EMC_AXIS_STAT_MSG:public RCS_STAT_MSG {
|
||||
// JOINT status base class
|
||||
class EMC_JOINT_STAT_MSG:public RCS_STAT_MSG {
|
||||
public:
|
||||
EMC_AXIS_STAT_MSG(NMLTYPE t, size_t s):RCS_STAT_MSG(t, s) {
|
||||
EMC_JOINT_STAT_MSG(NMLTYPE t, size_t s):RCS_STAT_MSG(t, s) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
|
||||
int axis;
|
||||
int joint;
|
||||
};
|
||||
|
||||
class EMC_AXIS_STAT:public EMC_AXIS_STAT_MSG {
|
||||
class EMC_JOINT_STAT:public EMC_JOINT_STAT_MSG {
|
||||
public:
|
||||
EMC_AXIS_STAT();
|
||||
EMC_JOINT_STAT();
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
|
||||
// configuration parameters
|
||||
unsigned char axisType; // EMC_AXIS_LINEAR, EMC_AXIS_ANGULAR
|
||||
unsigned char jointType; // EMC_JOINT_LINEAR, EMC_JOINT_ANGULAR
|
||||
double units; // units per mm, deg for linear, angular
|
||||
double backlash;
|
||||
double minPositionLimit;
|
||||
|
|
@ -919,19 +970,6 @@ class EMC_TRAJ_SET_TELEOP_ENABLE:public EMC_TRAJ_CMD_MSG {
|
|||
int enable;
|
||||
};
|
||||
|
||||
class EMC_TRAJ_SET_TELEOP_VECTOR:public EMC_TRAJ_CMD_MSG {
|
||||
public:
|
||||
EMC_TRAJ_SET_TELEOP_VECTOR():EMC_TRAJ_CMD_MSG
|
||||
(EMC_TRAJ_SET_TELEOP_VECTOR_TYPE,
|
||||
sizeof(EMC_TRAJ_SET_TELEOP_VECTOR)) {
|
||||
};
|
||||
|
||||
// For internal NML/CMS use only.
|
||||
void update(CMS * cms);
|
||||
|
||||
EmcPose vector;
|
||||
};
|
||||
|
||||
class EMC_TRAJ_PROBE:public EMC_TRAJ_CMD_MSG {
|
||||
public:
|
||||
EMC_TRAJ_PROBE():EMC_TRAJ_CMD_MSG(EMC_TRAJ_PROBE_TYPE,
|
||||
|
|
@ -980,6 +1018,7 @@ class EMC_TRAJ_STAT:public EMC_TRAJ_STAT_MSG {
|
|||
double linearUnits; // units per mm
|
||||
double angularUnits; // units per degree
|
||||
double cycleTime; // cycle time, in seconds
|
||||
int joints; // maximum joint number
|
||||
int axes; // maximum axis number
|
||||
int axis_mask; // mask of axes actually present
|
||||
enum EMC_TRAJ_MODE_ENUM mode; // EMC_TRAJ_MODE_FREE,
|
||||
|
|
@ -1155,7 +1194,8 @@ class EMC_MOTION_STAT:public EMC_MOTION_STAT_MSG {
|
|||
|
||||
// aggregate of motion-related status classes
|
||||
EMC_TRAJ_STAT traj;
|
||||
EMC_AXIS_STAT axis[EMC_AXIS_MAX];
|
||||
EMC_JOINT_STAT joint[EMCMOT_MAX_JOINTS];
|
||||
EMC_AXIS_STAT axis[EMCMOT_MAX_AXIS];
|
||||
EMC_SPINDLE_STAT spindle;
|
||||
|
||||
int synch_di[EMC_MAX_DIO]; // motion inputs queried by interp
|
||||
|
|
|
|||
|
|
@ -45,7 +45,13 @@ extern "C" {
|
|||
/* default traverse rate, in user units per second */
|
||||
#define DEFAULT_TRAJ_MAX_VELOCITY 10.0
|
||||
|
||||
/* default axis traverse rate, in user units per second */
|
||||
/* default joint velocity, in user units per second */
|
||||
#define DEFAULT_JOINT_MAX_VELOCITY 1.0
|
||||
|
||||
/* default joint acceleration, in user units per second per second */
|
||||
#define DEFAULT_JOINT_MAX_ACCELERATION 1.0
|
||||
|
||||
/* default axis velocity, in user units per second */
|
||||
#define DEFAULT_AXIS_MAX_VELOCITY 1.0
|
||||
|
||||
/* default axis acceleration, in user units per second per second */
|
||||
|
|
|
|||
|
|
@ -38,10 +38,9 @@ char tool_table_file[LINELEN] = DEFAULT_TOOL_TABLE_FILE;
|
|||
double traj_default_velocity = DEFAULT_TRAJ_DEFAULT_VELOCITY;
|
||||
double traj_max_velocity = DEFAULT_TRAJ_MAX_VELOCITY;
|
||||
|
||||
double axis_max_velocity[EMC_AXIS_MAX] = { 1.0 }; /*! \todo FIXME - I think
|
||||
these should be
|
||||
0.0 */
|
||||
double axis_max_acceleration[EMC_AXIS_MAX] = { 1.0 };
|
||||
double AXIS_WORLD_HOME[EMCMOT_MAX_AXIS] = {0.0,};
|
||||
|
||||
struct AxisConfig_t AxisConfig[EMCMOT_MAX_AXIS];
|
||||
|
||||
EmcPose tool_change_position; /* no defaults */
|
||||
unsigned char have_tool_change_position = 0; /* default is 'not there' */
|
||||
|
|
@ -50,9 +49,5 @@ int taskplanopen = 0;
|
|||
|
||||
void emcInitGlobals()
|
||||
{
|
||||
int t;
|
||||
|
||||
for (t = 0; t < EMC_AXIS_MAX; t++) {
|
||||
axis_max_velocity[t] = DEFAULT_AXIS_MAX_VELOCITY;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define EMC_AXIS_MAX EMCMOT_MAX_AXIS
|
||||
|
||||
#define EMC_MAX_DIO EMCMOT_MAX_DIO
|
||||
#define EMC_MAX_AIO EMCMOT_MAX_AIO
|
||||
|
||||
|
|
@ -55,12 +53,11 @@ extern "C" {
|
|||
|
||||
extern char tool_table_file[LINELEN];
|
||||
|
||||
extern double AXIS_WORLD_HOME[EMCMOT_MAX_AXIS];
|
||||
|
||||
extern double traj_default_velocity;
|
||||
extern double traj_max_velocity;
|
||||
|
||||
extern double axis_max_velocity[EMC_AXIS_MAX];
|
||||
extern double axis_max_acceleration[EMC_AXIS_MAX];
|
||||
|
||||
extern struct EmcPose tool_change_position;
|
||||
extern unsigned char have_tool_change_position;
|
||||
|
||||
|
|
@ -70,6 +67,27 @@ extern "C" {
|
|||
extern int emcGetArgs(int argc, char *argv[]);
|
||||
extern void emcInitGlobals();
|
||||
|
||||
typedef struct JointConfig_t {
|
||||
int Inited;
|
||||
unsigned char Type; // non-zero means joint called init
|
||||
double Units;
|
||||
double MaxVel;
|
||||
double MaxAccel;
|
||||
double MinLimit;
|
||||
double MaxLimit;
|
||||
} JointConfig_t;
|
||||
|
||||
typedef struct AxisConfig_t {
|
||||
int Inited;
|
||||
unsigned char Type;
|
||||
double MaxVel;
|
||||
double MaxAccel;
|
||||
double MinLimit;
|
||||
double MaxLimit;
|
||||
} AxisConfig_t;
|
||||
|
||||
extern AxisConfig_t AxisConfig[EMCMOT_MAX_AXIS];
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* matches extern "C" at top */
|
||||
#endif
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue