Skip to content

Commit

Permalink
early Joints/Axes work
Browse files Browse the repository at this point in the history
This starts the Joints/Axes branch.  Squashed work by:

    Alex Joni
    Chris Radek
    John Kasunich
    Michael Geszkiewicz
  • Loading branch information
alex-joni authored and SebKuzminsky committed Jun 27, 2016
1 parent 928b7f2 commit 0f0d50a
Show file tree
Hide file tree
Showing 115 changed files with 4,105 additions and 2,956 deletions.
7 changes: 7 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.0~pre1
2.8.0~pre1-ja
18 changes: 9 additions & 9 deletions configs/attic/dallur-thc/dallur-advanced.hal
Original file line number Diff line number Diff line change
Expand Up @@ -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 #########
Expand Down Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions configs/attic/dallur-thc/dallur-core_stepper.hal
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
44 changes: 22 additions & 22 deletions configs/attic/demo_mazak/demo_mazak.hal
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
18 changes: 9 additions & 9 deletions configs/by_interface/mesa/hm2-servo/hm2-servo.hal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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


Expand All @@ -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
Expand All @@ -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
Expand All @@ -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


Expand All @@ -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
Expand All @@ -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
Expand All @@ -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


Expand Down
18 changes: 9 additions & 9 deletions configs/by_interface/mesa/hm2-stepper/hm2-stepper.hal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
36 changes: 18 additions & 18 deletions configs/by_interface/parport/classicladder/cl-estop/cl-estop.hal
Original file line number Diff line number Diff line change
Expand Up @@ -38,44 +38,44 @@ 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
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
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Loading

0 comments on commit 0f0d50a

Please sign in to comment.