Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
petmakris committed Jan 26, 2024
1 parent 4775684 commit e02810e
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 99 deletions.
5 changes: 3 additions & 2 deletions config/hal/0-base.hal
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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 num_chan=3 debug=1
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"

Expand All @@ -22,9 +22,10 @@ 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.button-on.or,spindle.button-off.or
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 scale names=jog.scale.x,jog.scale.y,jog.scale.z,feed-pot.scale,spindle-pot.scale,jog-pot.scale

Expand Down
20 changes: 10 additions & 10 deletions config/hal/1-axis-x.hal
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ setp hm2_7i97.0.encoder.00.index-mask 0
setp hm2_7i97.0.encoder.00.index-mask-invert 0
setp hm2_7i97.0.encoder.00.scale [JOINT_0](ENCODER_SCALE)

net joint.0.enable => pid.x.enable
net joint.0.enable => joint.0.amp-enable-out
net joint.0.enable => hm2_7i97.0.pwmgen.00.enable
net joint.net.0.enable => pid.x.enable
net joint.net.0.enable => joint.0.amp-enable-out
net joint.net.0.enable => hm2_7i97.0.pwmgen.00.enable

net joint.0.pos-cmd => pid.x.command
net joint.0.pos-cmd => joint.0.motor-pos-cmd
net joint.net.0.pos-cmd => pid.x.command
net joint.net.0.pos-cmd => joint.0.motor-pos-cmd

net joint.0.pos-fb => pid.x.feedback
net joint.0.pos-fb => joint.0.motor-pos-fb
net joint.0.pos-fb => hm2_7i97.0.encoder.00.position
net joint.net.0.pos-fb => pid.x.feedback
net joint.net.0.pos-fb => joint.0.motor-pos-fb
net joint.net.0.pos-fb => hm2_7i97.0.encoder.00.position

net joint.0.output => pid.x.output
net joint.0.output => hm2_7i97.0.pwmgen.00.value
net joint.net.0.output => pid.x.output
net joint.net.0.output => hm2_7i97.0.pwmgen.00.value
20 changes: 10 additions & 10 deletions config/hal/1-axis-y.hal
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ setp hm2_7i97.0.encoder.01.index-mask 0
setp hm2_7i97.0.encoder.01.index-mask-invert 0
setp hm2_7i97.0.encoder.01.scale [JOINT_1](ENCODER_SCALE)

net joint.1.enable => pid.y.enable
net joint.1.enable => joint.1.amp-enable-out
net joint.1.enable => hm2_7i97.0.pwmgen.01.enable
net joint.net.1.enable => pid.y.enable
net joint.net.1.enable => joint.1.amp-enable-out
net joint.net.1.enable => hm2_7i97.0.pwmgen.01.enable

net joint.1.pos-cmd => pid.y.command
net joint.1.pos-cmd => joint.1.motor-pos-cmd
net joint.net.1.pos-cmd => pid.y.command
net joint.net.1.pos-cmd => joint.1.motor-pos-cmd

net joint.1.pos-fb => pid.y.feedback
net joint.1.pos-fb => joint.1.motor-pos-fb
net joint.1.pos-fb => hm2_7i97.0.encoder.01.position
net joint.net.1.pos-fb => pid.y.feedback
net joint.net.1.pos-fb => joint.1.motor-pos-fb
net joint.net.1.pos-fb => hm2_7i97.0.encoder.01.position

net joint.1.output => pid.y.output
net joint.1.output => hm2_7i97.0.pwmgen.01.value
net joint.net.1.output => pid.y.output
net joint.net.1.output => hm2_7i97.0.pwmgen.01.value

20 changes: 10 additions & 10 deletions config/hal/1-axis-z.hal
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ setp hm2_7i97.0.encoder.02.index-mask 0
setp hm2_7i97.0.encoder.02.index-mask-invert 0
setp hm2_7i97.0.encoder.02.scale [JOINT_2](ENCODER_SCALE)

net joint.2.enable => pid.z.enable
net joint.2.enable => joint.2.amp-enable-out
net joint.2.enable => hm2_7i97.0.pwmgen.02.enable
net joint.net.2.enable => pid.z.enable
net joint.net.2.enable => joint.2.amp-enable-out
net joint.net.2.enable => hm2_7i97.0.pwmgen.02.enable

net joint.2.pos-cmd => pid.z.command
net joint.2.pos-cmd => joint.2.motor-pos-cmd
net joint.net.2.pos-cmd => pid.z.command
net joint.net.2.pos-cmd => joint.2.motor-pos-cmd

net joint.2.pos-fb => pid.z.feedback
net joint.2.pos-fb => joint.2.motor-pos-fb
net joint.2.pos-fb => hm2_7i97.0.encoder.02.position
net joint.net.2.pos-fb => pid.z.feedback
net joint.net.2.pos-fb => joint.2.motor-pos-fb
net joint.net.2.pos-fb => hm2_7i97.0.encoder.02.position

net joint.2.output => pid.z.output
net joint.2.output => hm2_7i97.0.pwmgen.02.value
net joint.net.2.output => pid.z.output
net joint.net.2.output => hm2_7i97.0.pwmgen.02.value

14 changes: 8 additions & 6 deletions config/hal/11-sserial.hal
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ net buttons.rpm-is-set <= hm2_7i97.0.7i84.0.0.input-09
net buttons.set-spindle-off <= hm2_7i97.0.7i84.0.0.input-10
net buttons.set-spindle-on <= hm2_7i97.0.7i84.0.0.input-11

net bootons.tool-change <= hm2_7i97.0.7i84.0.0.input-12
net buttons.tool-change <= hm2_7i97.0.7i84.0.0.input-12
net buttons.tool-change-completed <= hm2_7i97.0.7i84.0.0.input-13

net buttons.force-lubricator <= hm2_7i97.0.7i84.0.0.input-16

net buttons.set-x-zero <= hm2_7i97.0.7i84.0.0.input-05 => halui.mdi-command-05
net buttons.set-z-zero <= hm2_7i97.0.7i84.0.0.input-17 => halui.mdi-command-07
net buttons.set-y-zero <= hm2_7i97.0.7i84.0.0.input-21 => halui.mdi-command-06
net buttons.set-x-zero <= hm2_7i97.0.7i84.0.0.input-05 => halui.mdi-command-05
net buttons.set-z-zero <= hm2_7i97.0.7i84.0.0.input-17 => halui.mdi-command-07

net buttons.home-all <= hm2_7i97.0.7i84.0.0.input-20 => halui.home-all

net buttons.set-y-zero <= hm2_7i97.0.7i84.0.0.input-21 => halui.mdi-command-06

net buttons.resume <= hm2_7i97.0.7i84.0.0.input-23
net buttons.pause <= hm2_7i97.0.7i84.0.0.input-22
net buttons.run <= hm2_7i97.0.7i84.0.0.input-07
net buttons.stop <= hm2_7i97.0.7i84.0.0.input-06
net buttons.program-step <= hm2_7i97.0.7i84.0.0.input-19 => halui.program.step
net buttons.program-step <= hm2_7i97.0.7i84.0.0.input-19 => halui.program.step


# outputs 0->15 (0->5 are red, 6->11 are green)
Expand All @@ -32,4 +35,3 @@ net program.is-idle => hm2_7i97.0.7i84.0.0.output-07
net program.is-running => hm2_7i97.0.7i84.0.0.output-08
net maho-inputs.lube-pump => hm2_7i97.0.7i84.0.0.output-11


36 changes: 19 additions & 17 deletions config/hal/12-panel.hal
Original file line number Diff line number Diff line change
@@ -1,50 +1,52 @@
addf feed-pot.lowpass servo-thread
setp feed-pot.lowpass.gain 0.05


addf feed-pot.scale servo-thread
addf spindle-pot.scale servo-thread
addf jog-pot.scale servo-thread
addf feed-pot.conv servo-thread

setp feed-pot.scale.gain 20
setp feed-pot.scale.gain 50
setp feed-pot.scale.offset 0

setp spindle-pot.scale.gain 20
setp spindle-pot.scale.offset 0

setp jog-pot.scale.gain 20
setp jog-pot.scale.offset 0
# setp spindle-pot.scale.gain 20
# setp spindle-pot.scale.offset 0

# setp jog-pot.scale.gain 20
# setp jog-pot.scale.offset 0

# ======================================
# ======================================
# FEED OVERRIDE
# ======================================
# ======================================

setp halui.feed-override.scale 0.01
setp halui.feed-override.direct-value false
setp halui.feed-override.direct-value true
setp halui.feed-override.count-enable true

net panel.feed-override.analog-in <= hm2_7i97.0.7i84.0.0.analogin0 => feed-pot.scale.in
net panel.feed-override.scale-out-conv-in <= feed-pot.scale.out => feed-pot.conv.in

net panel.feed-override.analog-in <= hm2_7i97.0.7i84.0.0.analogin0 => feed-pot.lowpass.in
net panel.feed-override.filtered <= feed-pot.lowpass.out => feed-pot.scale.in
net panel.feed-override.scaled <= feed-pot.scale.out => feed-pot.conv.in
net panel.feed-override.counts <= feed-pot.conv.out => halui.feed-override.counts
net panel.feed-override.value <= halui.feed-override.value

# ======================================

# ======================================
# SPINDLE SPEED
# ======================================
# ======================================

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




# net pot-0-jog-speed-in hm2_7i97.0.7i84.0.0.analogin0 => scale.pot.0.in
# net pot-0-jog-speed-out scale.pot.0.in => halui.axis.jog-speed

# net panel.spindle-speed pyvcp.spindle-speed

# ======================================
# ======================================
# JOG SPEED
# ======================================
# ======================================

# net panel.jog-speed pyvcp.jog-speed
# net ssia-02-jog-speed hm2_7i97.0.7i84.0.0.analogin2
Expand Down
40 changes: 20 additions & 20 deletions config/hal/13-spindle.hal
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
addf spindle.button-on.or servo-thread
addf spindle.button-off.or servo-thread
addf spindle.on.or servo-thread
addf spindle.off.or servo-thread

addf spindle.encoder.update-counters base-thread
addf spindle.encoder.capture-position servo-thread
addf spindle.near servo-thread
# addf spindle.encoder.update-counters base-thread
# addf spindle.encoder.capture-position servo-thread
# setp spindle.encoder.position-scale 4

setp spindle.encoder.position-scale 4
setp spindle.counter-mode true
setp spindle.near.scale 1.02
# addf spindle.near servo-thread
# setp spindle.counter-mode true
# setp spindle.near.scale 1.02

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.position <= encoder.0.position => spindle.0.revs

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

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 => near.0.in1
net spindle.at-speed <= near.0.out => spindle.0.at-speed
# 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 => near.0.in1
# net spindle.at-speed <= near.0.out => spindle.0.at-speed

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

net buttons.set-spindle-on => spindle.button-on.or.in0
net pendant.spindle.on <= whb.halui.spindle.start => spindle.button-on.or.in1
net spindle.set-on <= spindle.button-on.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.button-off.or.in0
net pendant.spindle.off <= whb.halui.spindle.stop => spindle.button-off.or.in1
net spindle.set-off <= spindle.button-on.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
Expand Down
2 changes: 1 addition & 1 deletion config/hal/22-xhc-whb04b-6-axis-y.hal
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ setp jog.lowpass.y.gain 0.1
setp jog.scale.y.gain 0.01
setp jog.scale.y.offset 0

net pendant.y.is-homed <= halui.joint.0.is-homed => whb.halui.joint.y.is-homed
net pendant.y.is-homed <= halui.joint.1.is-homed => whb.halui.joint.y.is-homed
net pendant.y.select <= whb.halui.axis.y.select => halui.axis.y.select
net pendant.y.pos-feedback <= halui.axis.y.pos-feedback => whb.halui.axis.y.pos-feedback
net pendant.y.pos-relative <= halui.axis.y.pos-relative => whb.halui.axis.y.pos-relative
Expand Down
2 changes: 1 addition & 1 deletion config/hal/23-xhc-whb04b-6-axis-z.hal
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ setp jog.lowpass.z.gain 0.1
setp jog.scale.z.gain 0.01
setp jog.scale.z.offset 0

net pendant.z.is-homed <= halui.joint.0.is-homed => whb.halui.joint.z.is-homed
net pendant.z.is-homed <= halui.joint.2.is-homed => whb.halui.joint.z.is-homed
net pendant.z.select <= whb.halui.axis.z.select => halui.axis.z.select
net pendant.z.pos-feedback <= halui.axis.z.pos-feedback => whb.halui.axis.z.pos-feedback
net pendant.z.pos-relative <= halui.axis.z.pos-relative => whb.halui.axis.z.pos-relative
Expand Down
22 changes: 11 additions & 11 deletions config/halshow.preferences
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Halshow settings
# This file is generated automatically.
wm geometry . 1718x1267+704+74
wm geometry . 899x1057+1594+334
placeFrames 0.272145144076841
set ::ratio 0.272145144076841
set ::old_w_leftf 503
set ::watchlist {
sig+odometer-current-distance
sig+odometer-cycles
sig+odometer-total-distance
sig+odometer-velocity
sig+output-machine-power-on
pin+hm2_7i97.0.7i84.0.0.analogin0
pin+hm2_7i97.0.7i84.0.0.analogin1
pin+hm2_7i97.0.7i84.0.0.analogin2
pin+hm2_7i97.0.7i84.0.0.analogin3
pin+fto32.pot.feed.in
pin+fto32.pot.feed.out
pin+fto32.pot.feed.time
pin+fto32.pot.feed.out-of-range
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
}
set ::workmode watchhal
set ::watchInterval 100
Expand Down
7 changes: 0 additions & 7 deletions config/maho-pyvcp.xml

This file was deleted.

6 changes: 3 additions & 3 deletions config/maho.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ HALFILE = hal/0-base.hal
HALFILE = hal/1-axis-x.hal
HALFILE = hal/1-axis-y.hal
HALFILE = hal/1-axis-z.hal
HALFILE = hal/2-inputs.hal
HALFILE = hal/3-outputs.hal
HALFILE = hal/2-maho-outputs.hal
HALFILE = hal/3-maho-inputs.hal
HALFILE = hal/4-estop.hal
HALFILE = hal/5-limits.hal
HALFILE = hal/7-lube.hal
Expand Down Expand Up @@ -74,7 +74,7 @@ EDITOR = geany
PROGRAM_PREFIX = /home/pmakris/linuxcnc/nc_files
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.0
MAX_FEED_OVERRIDE = 2.0
MIN_LINEAR_VELOCITY = 0.0
DEFAULT_LINEAR_VELOCITY = 1.0
MAX_LINEAR_VELOCITY = 33.0
Expand Down
2 changes: 1 addition & 1 deletion config/panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<bar>
<halpin>"feed-override"</halpin>
<min_>0</min_>
<max_>1.2</max_>
<max_>2.0</max_>
</bar>

<!-- Jog Speed -->
Expand Down

0 comments on commit e02810e

Please sign in to comment.