Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
petmakris committed Jan 31, 2024
1 parent a2d4aa8 commit 9db0469
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 34 deletions.
4 changes: 1 addition & 3 deletions config/hal/01-modules.hal
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ loadrt not names=estop.not.0,estop.not.1,tool-change.not
loadrt lowpass names=feed-pot.lowpass,jog-pot.lowpass
loadrt ilowpass names=jog.ilowpass.x,jog.ilowpass.y,jog.ilowpass.z
loadrt scale names=jog.scale.x,jog.scale.y,jog.scale.z,feed-pot.scale,spindle-pot.scale,jog-pot.scale


loadrt limit1 names=jog-pot.limit

loadrt encoder
loadrt near names=spindle.near
# loadrt near names=spindle.near
loadrt conv_float_s32 names=feed-pot.conv

40 changes: 18 additions & 22 deletions config/hal/20-spindle.hal
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
addf spindle.on.or servo-thread
addf spindle.off.or servo-thread

addf encoder.update-counters servo-thread
addf encoder.capture-position servo-thread
# addf spindle.near servo-thread

# Note: 3 points on the horizontal spindle, but 6 because of the
# 2:1 gearing ration between horizontal and vertical spindle
setp hm2_7i97.0.encoder.05.counter-mode 1
setp hm2_7i97.0.encoder.05.filter 1
setp hm2_7i97.0.encoder.05.index-invert 0
setp hm2_7i97.0.encoder.05.index-mask 0
setp hm2_7i97.0.encoder.05.index-mask-invert 0
setp hm2_7i97.0.encoder.05.scale 3

setp encoder.0.position-scale 6
# setp spindle.near.scale 1.05

addf spindle.near servo-thread
setp encoder.0.counter-mode true
setp spindle.near.scale 1.05

net maho-inputs.spindle-cw <= spindle.0.reverse
net maho-inputs.spindle-ccw <= spindle.0.forward

net spindle.position <= encoder.0.position => spindle.0.revs

net spindle.velocity <= encoder.0.velocity
net spindle.velocity => spindle.0.speed-in
net spindle.velocity => spindle.near.in1
net spindle.position <= hm2_7i97.0.encoder.05.position => spindle.0.revs
net spindle.velocity <= hm2_7i97.0.encoder.05.velocity
net spindle.velocity => spindle.0.speed-in
# net spindle.velocity => spindle.near.in1

# To PyVCP
net spindle.velocity-rpm <= encoder.0.velocity-rpm

net spindle.phase-a <= hm2_7i97.0.inmux.00.input-12 => encoder.0.phase-A
net spindle.commanded-speed <= spindle.0.speed-out-rps-abs => spindle.near.in2
net spindle.at-speed <= spindle.near.out => spindle.0.at-speed
net spindle.velocity-rpm <= hm2_7i97.0.encoder.05.velocity-rpm

# net spindle.commanded-speed <= spindle.0.speed-out-rps-abs => spindle.near.in2
# net spindle.at-speed <= spindle.near.out => spindle.0.at-speed

net spindle.is-on => whb.halui.spindle.is-on

Expand All @@ -43,6 +36,9 @@ net spindle.set-off <= spindle.off.or.out => h
net pendant.spindle.forward <= whb.halui.spindle.forward => halui.spindle.0.forward
net pendant.spindle.reverse <= whb.halui.spindle.reverse => halui.spindle.0.reverse

net maho-inputs.spindle-cw <= spindle.0.reverse
net maho-inputs.spindle-ccw <= spindle.0.forward


# net pendant.spindle.increase whb.halui.spindle.increase halui.spindle.0.increase
# net pendant.spindle.decrease whb.halui.spindle.decrease halui.spindle.0.decrease
Expand Down
40 changes: 31 additions & 9 deletions config/halshow.preferences
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,41 @@ placeFrames 0.272145144076841
set ::ratio 0.272145144076841
set ::old_w_leftf 503
set ::watchlist {
sig+spindle.at-speed
sig+spindle.commanded-speed
sig+spindle.position
sig+spindle.velocity
sig+spindle.velocity-rpm
param+spindle.near.difference
pin+spindle.near.out
pin+spindle.near.in1
pin+spindle.near.in2
pin+hm2_7i97.0.encoder.05.count
pin+hm2_7i97.0.encoder.05.count-latched
pin+hm2_7i97.0.encoder.05.index-enable
pin+hm2_7i97.0.encoder.05.input-a
pin+hm2_7i97.0.encoder.05.input-b
pin+hm2_7i97.0.encoder.05.input-index
pin+hm2_7i97.0.encoder.05.position
pin+hm2_7i97.0.encoder.05.position-latched
pin+hm2_7i97.0.encoder.05.quad-error
pin+hm2_7i97.0.encoder.05.quad-error-enable
pin+hm2_7i97.0.encoder.05.rawcounts
pin+hm2_7i97.0.encoder.05.rawlatch
pin+hm2_7i97.0.encoder.05.reset
pin+hm2_7i97.0.encoder.05.velocity
pin+hm2_7i97.0.encoder.05.velocity-rpm
param+hm2_7i97.0.encoder.05.counter-mode
param+hm2_7i97.0.encoder.05.filter
param+hm2_7i97.0.encoder.05.index-invert
param+hm2_7i97.0.encoder.05.index-mask
param+hm2_7i97.0.encoder.05.index-mask-invert
param+hm2_7i97.0.encoder.05.scale
param+hm2_7i97.0.encoder.05.vel-timeout
pin+spindle.0.amp-fault-in
pin+spindle.0.at-speed
pin+spindle.0.brake
pin+spindle.0.forward
pin+spindle.0.index-enable
pin+spindle.0.inhibit
pin+spindle.0.is-oriented
pin+spindle.0.locked
pin+spindle.0.on
pin+spindle.0.orient
pin+spindle.0.orient-angle
pin+spindle.0.orient-fault
pin+spindle.0.orient-mode
pin+spindle.0.reverse
pin+spindle.0.revs
pin+spindle.0.speed-cmd-rps
Expand Down

0 comments on commit 9db0469

Please sign in to comment.