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 6f99396 + 79cea5b commit 9bb927d
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 77 deletions.
23 changes: 19 additions & 4 deletions config/hal/01-modules.hal
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,33 @@ loadusr -W hal_manualtoolchange
loadrt [KINS](KINEMATICS)
loadrt [EMCMOT](EMCMOT) servo_period_nsec=[EMCMOT](SERVO_PERIOD) num_joints=[KINS](JOINTS)
loadrt pid names=pid.x,pid.y,pid.z debug=1
loadrt hostmot2
loadrt [HM2](DRIVER) board_ip=[HM2](IPADDRESS) config="sserial_port_0=20000000"

setp hm2_7i97.0.dpll.01.timer-us -50
setp hm2_7i97.0.watchdog.timeout_ns 5000000

addf hm2_7i97.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pid.x.do-pid-calcs servo-thread
addf pid.y.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf hm2_7i97.0.write servo-thread

loadrt odometer names=lube.odometer
loadrt estop_latch names=estop.latch
loadrt and2 names=tool-change.and
loadrt or2 names=lube.or,buttons.or.resume,buttons.or.pause,buttons.or.run,buttons.or.stop,spindle.on.or,spindle.off.or
loadrt not names=estop.not.0,estop.not.1,tool-change.not
loadrt lowpass names=feed-pot.lowpass
loadrt ilowpass names=jog.lowpass.x,jog.lowpass.y,jog.lowpass.z
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 names=spindle.encoder
loadrt near names=spindle.near
loadrt conv_float_s32 names=feed-pot.conv

addf motion-command-handler servo-thread
addf motion-controller servo-thread
8 changes: 0 additions & 8 deletions config/hal/02-7i97.hal
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
loadrt [HM2](DRIVER) board_ip=[HM2](IPADDRESS) config="sserial_port_0=20000000"
loadrt hostmot2

setp hm2_7i97.0.dpll.01.timer-us -50
setp hm2_7i97.0.watchdog.timeout_ns 5000000

addf hm2_7i97.0.read servo-thread
addf hm2_7i97.0.write servo-thread
2 changes: 0 additions & 2 deletions config/hal/07-axis-x.hal
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
addf pid.x.do-pid-calcs servo-thread

setp pid.x.Pgain [JOINT_0](P)
setp pid.x.Igain [JOINT_0](I)
setp pid.x.Dgain [JOINT_0](D)
Expand Down
2 changes: 0 additions & 2 deletions config/hal/07-axis-y.hal
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
addf pid.y.do-pid-calcs servo-thread

setp pid.y.Pgain [JOINT_1](P)
setp pid.y.Igain [JOINT_1](I)
setp pid.y.Dgain [JOINT_1](D)
Expand Down
2 changes: 0 additions & 2 deletions config/hal/07-axis-z.hal
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
addf pid.z.do-pid-calcs servo-thread

setp pid.z.Pgain [JOINT_2](P)
setp pid.z.Igain [JOINT_2](I)
setp pid.z.Dgain [JOINT_2](D)
Expand Down
11 changes: 6 additions & 5 deletions config/hal/20-spindle.hal
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ addf spindle.off.or servo-thread

addf spindle.encoder.update-counters base-thread
addf spindle.encoder.capture-position servo-thread
# 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 6

addf spindle.near servo-thread
Expand All @@ -14,13 +16,12 @@ net maho-inputs.spindle-ccw <= spindle.0.forward

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

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

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

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.in1
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 Down
16 changes: 0 additions & 16 deletions config/hal/30-panel-jog-speed.hal

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ addf spindle-pot.scale servo-thread
# setp spindle-pot.scale.gain 20
# setp spindle-pot.scale.offset 0

# net ssia-01-spindle-speed hm2_7i97.0.7i84.0.0.analogin2


# net ssia-01-spindle-speed hm2_7i97.0.7i84.0.0.analogin1
# net panel.spindle-speed pyvcp.spindle-speed


18 changes: 18 additions & 0 deletions config/hal/33-panel-jog-speed.hal
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
addf jog-pot.lowpass servo-thread
addf jog-pot.scale servo-thread
addf jog-pot.limit servo-thread


setp jog-pot.lowpass.gain 0.2
setp jog-pot.scale.gain 300.0
setp jog-pot.scale.offset 0
setp jog-pot.limit.max 1200.0


net panel.jog-speed.analog-in <= hm2_7i97.0.7i84.0.0.analogin2 => jog-pot.lowpass.in
net panel.jog-speed.filtered <= jog-pot.lowpass.out => jog-pot.scale.in
net panel.jog-speed.unlimited <= jog-pot.scale.out => jog-pot.limit.in
net panel.jog-speed => jog-pot.limit.out

net panel.jog-speed => halui.joint.jog-speed
net panel.jog-speed => halui.axis.jog-speed
10 changes: 5 additions & 5 deletions config/hal/51-xhc-whb04b-6-axis-x.hal
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
addf jog.lowpass.x servo-thread
addf jog.ilowpass.x servo-thread
addf jog.scale.x servo-thread

setp jog.lowpass.x.scale 100
setp jog.lowpass.x.gain 0.1
setp jog.ilowpass.x.scale 100
setp jog.ilowpass.x.gain 0.1
setp jog.scale.x.gain 0.01
setp jog.scale.x.offset 0

Expand All @@ -15,5 +15,5 @@ net pendant.x.jog-enable <= whb.axis.x.jog-enable => axis.x

net pendant.x.jog-scale <= whb.axis.x.jog-scale => jog.scale.x.in
net pendant.x.jog-scaled <= jog.scale.x.out => axis.x.jog-scale
net pendant.x.jog-counts <= whb.axis.x.jog-counts => jog.lowpass.x.in
net pendant.x.jog-counts-filtered <= jog.lowpass.x.out => axis.x.jog-counts
net pendant.x.jog-counts <= whb.axis.x.jog-counts => jog.ilowpass.x.in
net pendant.x.jog-counts-filtered <= jog.ilowpass.x.out => axis.x.jog-counts
10 changes: 5 additions & 5 deletions config/hal/52-xhc-whb04b-6-axis-y.hal
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
addf jog.lowpass.y servo-thread
addf jog.ilowpass.y servo-thread
addf jog.scale.y servo-thread

setp jog.lowpass.y.scale 100
setp jog.lowpass.y.gain 0.1
setp jog.ilowpass.y.scale 100
setp jog.ilowpass.y.gain 0.1
setp jog.scale.y.gain 0.01
setp jog.scale.y.offset 0

Expand All @@ -15,5 +15,5 @@ net pendant.y.jog-enable <= whb.axis.y.jog-enable => axis.y

net pendant.y.jog-scale <= whb.axis.y.jog-scale => jog.scale.y.in
net pendant.y.jog-scaled <= jog.scale.y.out => axis.y.jog-scale
net pendant.y.jog-counts <= whb.axis.y.jog-counts => jog.lowpass.y.in
net pendant.y.jog-counts-filtered <= jog.lowpass.y.out => axis.y.jog-counts
net pendant.y.jog-counts <= whb.axis.y.jog-counts => jog.ilowpass.y.in
net pendant.y.jog-counts-filtered <= jog.ilowpass.y.out => axis.y.jog-counts
10 changes: 5 additions & 5 deletions config/hal/53-xhc-whb04b-6-axis-z.hal
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
addf jog.lowpass.z servo-thread
addf jog.ilowpass.z servo-thread
addf jog.scale.z servo-thread

setp jog.lowpass.z.scale 100
setp jog.lowpass.z.gain 0.1
setp jog.ilowpass.z.scale 100
setp jog.ilowpass.z.gain 0.1
setp jog.scale.z.gain 0.01
setp jog.scale.z.offset 0

Expand All @@ -15,5 +15,5 @@ net pendant.z.jog-enable <= whb.axis.z.jog-enable => axis.z

net pendant.z.jog-scale <= whb.axis.z.jog-scale => jog.scale.z.in
net pendant.z.jog-scaled <= jog.scale.z.out => axis.z.jog-scale
net pendant.z.jog-counts <= whb.axis.z.jog-counts => jog.lowpass.z.in
net pendant.z.jog-counts-filtered <= jog.lowpass.z.out => axis.z.jog-counts
net pendant.z.jog-counts <= whb.axis.z.jog-counts => jog.ilowpass.z.in
net pendant.z.jog-counts-filtered <= jog.ilowpass.z.out => axis.z.jog-counts
36 changes: 22 additions & 14 deletions config/halshow.preferences
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
# Halshow settings
# This file is generated automatically.
wm geometry . 899x1057+1594+334
wm geometry . 936x1266+974+27
placeFrames 0.272145144076841
set ::ratio 0.272145144076841
set ::old_w_leftf 503
set ::watchlist {
pin+hm2_7i97.0.7i84.0.0.analogin0
pin+hm2_7i97.0.7i84.0.0.analogin1
pin+hm2_7i97.0.7i84.0.0.analogin2
sig+panel.feed-override.analog-in
sig+panel.feed-override.filtered
sig+panel.feed-override.counts
sig+panel.feed-override.value
pin+halui.feed-override.count-enable
pin+halui.feed-override.counts
pin+halui.feed-override.direct-value
pin+halui.feed-override.reset
pin+halui.feed-override.scale
pin+halui.feed-override.value
pin+spindle.encoder.counter-mode
pin+spindle.encoder.counts
pin+spindle.encoder.counts-latched
pin+spindle.encoder.index-enable
pin+spindle.encoder.latch-falling
pin+spindle.encoder.latch-input
pin+spindle.encoder.latch-rising
pin+spindle.encoder.min-speed-estimate
pin+spindle.encoder.missing-teeth
pin+spindle.encoder.phase-A
pin+spindle.encoder.phase-B
pin+spindle.encoder.phase-Z
pin+spindle.encoder.position
pin+spindle.encoder.position-interpolated
pin+spindle.encoder.position-latched
pin+spindle.encoder.position-scale
pin+spindle.encoder.rawcounts
pin+spindle.encoder.reset
pin+spindle.encoder.velocity
pin+spindle.encoder.velocity-rpm
pin+spindle.encoder.x4-mode
}
set ::workmode watchhal
set ::watchInterval 100
Expand Down
9 changes: 5 additions & 4 deletions config/maho.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ TOOL_TABLE = tool.tbl
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
BASE_PERIOD = 50000
SERVO_PERIOD = 1000000

[TASK]
Expand Down Expand Up @@ -54,9 +55,9 @@ HALFILE = hal/09-tool-change.hal
HALFILE = hal/16-coolant.hal
HALFILE = hal/19-lube.hal
HALFILE = hal/20-spindle.hal
HALFILE = hal/30-panel-feed-override.hal
HALFILE = hal/30-panel-jog-speed.hal
HALFILE = hal/30-panel-spindle-speed.hal
HALFILE = hal/31-panel-feed-override.hal
HALFILE = hal/32-panel-spindle-speed.hal
HALFILE = hal/33-panel-jog-speed.hal
HALFILE = hal/50-xhc-whb04b-6.hal
HALFILE = hal/51-xhc-whb04b-6-axis-x.hal
HALFILE = hal/52-xhc-whb04b-6-axis-y.hal
Expand All @@ -78,7 +79,7 @@ POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2.0
MIN_LINEAR_VELOCITY = 0.0
DEFAULT_LINEAR_VELOCITY = 1.0
DEFAULT_LINEAR_VELOCITY = 5.0
MAX_LINEAR_VELOCITY = 33.0
CYCLE_TIME = 0.1
INTRO_GRAPHIC = emc2.gif
Expand Down

0 comments on commit 9bb927d

Please sign in to comment.