Skip to content

Commit

Permalink
Merge branch 'main' of github.com:petmakris/maho-mh500w
Browse files Browse the repository at this point in the history
  • Loading branch information
petmakris committed Jan 29, 2024
2 parents 1f6ac78 + 9bb927d commit a2d4aa8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 36 deletions.
2 changes: 1 addition & 1 deletion config/hal/01-modules.hal
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ loadrt scale names=jog.scale.x,jog.scale.y,jog.scale.z,feed-pot.s

loadrt limit1 names=jog-pot.limit

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

49 changes: 25 additions & 24 deletions config/hal/20-spindle.hal
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,45 @@ addf spindle.off.or servo-thread

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

# Note: 4 points on the horizontal spindle, but 8 because of the
# Note: 3 points on the horizontal spindle, but 6 because of the
# 2:1 gearing ration between horizontal and vertical spindle
setp spindle.encoder.position-scale 8

setp spindle.encoder.counter-mode true
setp spindle.near.scale 1.05
setp encoder.0.position-scale 6

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 maho-inputs.spindle-cw <= spindle.0.reverse
net maho-inputs.spindle-ccw <= spindle.0.forward

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

net spindle.velocity <= spindle.encoder.velocity
net spindle.velocity => spindle.0.speed-in
net spindle.velocity => spindle.near.in1
net spindle.velocity <= encoder.0.velocity
net spindle.velocity => spindle.0.speed-in
net spindle.velocity => spindle.near.in1

# To PyVCP
net spindle.velocity-rpm <= spindle.encoder.velocity-rpm
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.phase-a <= hm2_7i97.0.inmux.00.input-12 => spindle.encoder.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.is-on => whb.halui.spindle.is-on
net spindle.is-on => whb.halui.spindle.is-on

net buttons.set-spindle-on => spindle.on.or.in0
net pendant.spindle.on <= whb.halui.spindle.start => spindle.on.or.in1
net spindle.set-on <= spindle.on.or.out => halui.spindle.0.start
net buttons.set-spindle-on => spindle.on.or.in0
net pendant.spindle.on <= whb.halui.spindle.start => spindle.on.or.in1
net spindle.set-on <= spindle.on.or.out => halui.spindle.0.start

net buttons.set-spindle-off => spindle.off.or.in0
net pendant.spindle.off <= whb.halui.spindle.stop => spindle.off.or.in1
net spindle.set-off <= spindle.off.or.out => halui.spindle.0.stop
net buttons.set-spindle-off => spindle.off.or.in0
net pendant.spindle.off <= whb.halui.spindle.stop => spindle.off.or.in1
net spindle.set-off <= spindle.off.or.out => halui.spindle.0.stop

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 pendant.spindle.forward <= whb.halui.spindle.forward => halui.spindle.0.forward
net pendant.spindle.reverse <= whb.halui.spindle.reverse => halui.spindle.0.reverse


# net pendant.spindle.increase whb.halui.spindle.increase halui.spindle.0.increase
Expand Down
20 changes: 9 additions & 11 deletions config/halshow.preferences
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ placeFrames 0.272145144076841
set ::ratio 0.272145144076841
set ::old_w_leftf 503
set ::watchlist {
pin+spindle.encoder.counter-mode
pin+spindle.encoder.counts
pin+spindle.encoder.phase-A
pin+spindle.encoder.position
pin+spindle.encoder.position-scale
pin+spindle.encoder.rawcounts
pin+spindle.encoder.velocity
pin+spindle.encoder.velocity-rpm
pin+spindle.encoder.x4-mode
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+spindle.0.at-speed
pin+spindle.0.forward
pin+spindle.0.inhibit
Expand All @@ -26,8 +26,6 @@ set ::watchlist {
pin+spindle.0.speed-out-abs
pin+spindle.0.speed-out-rps
pin+spindle.0.speed-out-rps-abs
pin+spindle.near.in1
pin+spindle.near.in2
}
set ::workmode watchhal
set ::watchInterval 100
Expand Down

0 comments on commit a2d4aa8

Please sign in to comment.