Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions configs/sim/axis/external_offsets/dynamic_offsets_panel.hal
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
loadrt siggen names=gen
loadrt scale names=scalea
loadrt conv_real_sint names=cvt
loadrt not names=nota
loadrt or2 names=or2a

addf gen.update servo-thread
addf scalea servo-thread
addf cvt servo-thread
addf nota servo-thread
addf or2a servo-thread

Expand All @@ -23,8 +21,7 @@ net E:frequency <= pyvcp.gen-frequency => gen.frequency

# can also use sawtooth (others inappropriate on a reset)
net G:waveform <= gen.sine => scalea.in
net G:swaveform <= scalea.out => cvt.in
net G:counts <= cvt.out => axis.z.eoffset-counts
net G:counts <= scalea.out => axis.z.eoffset-counts

net E:enable <= pyvcp.z-enable => axis.z.eoffset-enable
net E:enable => nota.in
Expand Down
2 changes: 1 addition & 1 deletion configs/sim/axis/external_offsets/eoffsets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ Input hal pins:
axis.L.eoffset-enable (bool)
axis.L.eoffset-clear (bool)
axis.L.eoffset-scale (real)
axis.L.eoffset-counts (sint)
axis.L.eoffset-counts (real)

Requested offset == counts*scale
2 changes: 1 addition & 1 deletion configs/sim/axis/external_offsets/eoffsets_es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ Pines Input hal:
axis.L.eoffset-enable (bool)
axis.L.eoffset-clear (bool)
axis.L.eoffset-scale (real)
axis.L.eoffset-counts (sint)
axis.L.eoffset-counts (real)

Offset solicitado == counts*scale
5 changes: 4 additions & 1 deletion configs/sim/axis/external_offsets/jwp_z_panel.hal
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
loadrt updown names=zctr
addf zctr servo-thread
loadrt conv_sint_real names=zctr-real
addf zctr-real servo-thread

net E:z-plus <= pyvcp.z-plus => zctr.countup
net E:z-minus <= pyvcp.z-minus => zctr.countdown
net E:z-counts <= zctr.count => axis.z.eoffset-counts
net E:z-count <= zctr.count => zctr-real.in
net E:z-counts <= zctr-real.out => axis.z.eoffset-counts
net E:z-scale <= pyvcp.z-scale => axis.z.eoffset-scale
net E:z-offset <= axis.z.eoffset => pyvcp.z-offset-f
net E:limited <= motion.eoffset-limited => pyvcp.limited
Expand Down
13 changes: 7 additions & 6 deletions configs/sim/qtdragon_hd/qtdragon_hd_xyz/qtdragon_hd_postgui.hal
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ loadrt logic names=logic-and personality=0x102
addf logic-and servo-thread

# load a summing component for adding spindle lift and Z compensation
loadrt scaled_sint_sums
addf scaled-sint-sums.0 servo-thread
# (eoffset counts are floats, so sum2 rather than scaled_sint_sums)
loadrt sum2
addf sum2.0 servo-thread

loadusr -Wn z_level_compensation z_level_compensation
# method parameter must be one of nearest(2), linear(1), cubic (0)
Expand Down Expand Up @@ -51,8 +52,8 @@ net zpos-cmd z_level_compensation.z-pos <= axis.z.pos-cmd
net z_compensation_on z_level_compensation.enable-in <= qtdragon.comp-on
net eoffset-zlevel-count z_level_compensation.counts => qtdragon.eoffset-zlevel-count

net eoffset-spindle-count scaled-sint-sums.0.in0
net eoffset-zlevel-count scaled-sint-sums.0.in1
setp scaled-sint-sums.0.scale0 1000
net eoffset-counts scaled-sint-sums.0.out-s
net eoffset-spindle-count sum2.0.in0
net eoffset-zlevel-count sum2.0.in1
setp sum2.0.gain0 1000
net eoffset-counts sum2.0.out

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ loadrt logic names=logic-and personality=0x102
addf logic-and servo-thread

# load a summing component for adding spindle lift and Z compensation
loadrt scaled_sint_sums
addf scaled-sint-sums.0 servo-thread
# (eoffset counts are floats, so sum2 rather than scaled_sint_sums)
loadrt sum2
addf sum2.0 servo-thread

loadusr -Wn z_level_compensation z_level_compensation
# method parameter must be one of nearest(2), linear(1), cubic (0)
Expand Down Expand Up @@ -51,8 +52,8 @@ net zpos-cmd z_level_compensation.z-pos <= axis.z.pos-cmd
net z_compensation_on z_level_compensation.enable-in <= qtdragon.comp-on
net eoffset-zlevel-count z_level_compensation.counts => qtdragon.eoffset-zlevel-count

net eoffset-spindle-count scaled-sint-sums.0.in0
net eoffset-zlevel-count scaled-sint-sums.0.in1
setp scaled-sint-sums.0.scale0 1000
net eoffset-counts scaled-sint-sums.0.out-s
net eoffset-spindle-count sum2.0.in0
net eoffset-zlevel-count sum2.0.in1
setp sum2.0.gain0 1000
net eoffset-counts sum2.0.out

Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def init_pins(self):
QHAL.newpin("eoffset-enable", QHAL.HAL_BOOL, QHAL.HAL_OUT)
QHAL.newpin("eoffset-clear", QHAL.HAL_BOOL, QHAL.HAL_OUT)
self.h['eoffset-clear'] = True
QHAL.newpin("eoffset-spindle-count", QHAL.HAL_SINT, QHAL.HAL_OUT)
QHAL.newpin("eoffset-spindle-count", QHAL.HAL_REAL, QHAL.HAL_OUT)
pin = QHAL.newpin("eoffset-is-active", QHAL.HAL_BOOL, QHAL.HAL_IN)
pin.value_changed.connect(self.external_offset_state_changed)

Expand Down
10 changes: 5 additions & 5 deletions configs/sim/woodpecker/1280x1024_5axis/woodpecker_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,15 @@ def init_pins(self):
# external offset control pins
QHAL.newpin("eoffset-enable", QHAL.HAL_BOOL, QHAL.HAL_OUT)
QHAL.newpin("eoffset-clear", QHAL.HAL_BOOL, QHAL.HAL_OUT)
QHAL.newpin("eoffset-spindle-count", QHAL.HAL_SINT, QHAL.HAL_OUT)
QHAL.newpin("eoffset-count", QHAL.HAL_SINT, QHAL.HAL_OUT)
QHAL.newpin("eoffset-spindle-count", QHAL.HAL_REAL, QHAL.HAL_OUT)
QHAL.newpin("eoffset-count", QHAL.HAL_REAL, QHAL.HAL_OUT)

pin = QHAL.newpin("eoffset-value", QHAL.HAL_SINT, QHAL.HAL_IN)
pin = QHAL.newpin("eoffset-value", QHAL.HAL_REAL, QHAL.HAL_IN)
pin.value_changed.connect(self.eoffset_changed)

pin = QHAL.newpin("eoffset-zlevel-count", QHAL.HAL_SINT, QHAL.HAL_IN)
pin = QHAL.newpin("eoffset-zlevel-count", QHAL.HAL_REAL, QHAL.HAL_IN)
pin.value_changed.connect(self.comp_count_changed)
pin = QHAL.newpin("comp-count", QHAL.HAL_SINT, QHAL.HAL_IN)
pin = QHAL.newpin("comp-count", QHAL.HAL_REAL, QHAL.HAL_IN)
pin.value_changed.connect(self.compensate_count_changed)
pin = QHAL.newpin("map-ready", QHAL.HAL_BOOL, QHAL.HAL_IN)
pin.value_changed.connect(self.map_ready_changed)
Expand Down
6 changes: 3 additions & 3 deletions configs/sim/woodpecker/compensate.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,18 @@ def compensate(self):
self.Xn = self.xpos - self.xMin
self.Yn = self.ypos - self.yMin

# get the nearest compensation offset and convert to counts (s32) with a scale (float)
# get the nearest compensation offset and convert to counts (float) with a scale (float)
# Requested offset == counts * scale
zo = self.zi[self.Xn, self.Yn]
compensation = int(zo / self.scale)
compensation = float(zo / self.scale)
return compensation

def run(self):
self.h = hal.component("compensate")
self.h.newpin("enable-in", hal.Type.BOOL, hal.Dir.IN)
self.h.newpin("map-ready", hal.Type.BOOL, hal.Dir.OUT)
self.h.newpin("scale", hal.Type.REAL, hal.Dir.OUT)
self.h.newpin("counts", hal.Type.SINT, hal.Dir.OUT)
self.h.newpin("counts", hal.Type.REAL, hal.Dir.OUT)
self.h.newpin("clear", hal.Type.BOOL, hal.Dir.IN)
self.h.newpin("x-pos", hal.Type.REAL, hal.Dir.IN)
self.h.newpin("y-pos", hal.Type.REAL, hal.Dir.IN)
Expand Down
2 changes: 1 addition & 1 deletion configs/sim/woodpecker/woodpecker_/woodpecker_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def init_pins(self):
# external offset control pins
self.h.newpin("eoffset_enable", hal.Type.BOOL, hal.Dir.OUT)
self.h.newpin("eoffset_clear", hal.Type.BOOL, hal.Dir.OUT)
self.h.newpin("eoffset_count", hal.Type.SINT, hal.Dir.OUT)
self.h.newpin("eoffset_count", hal.Type.REAL, hal.Dir.OUT)
pin = self.h.newpin("eoffset_value", hal.Type.REAL, hal.Dir.IN)
pin.value_changed.connect(self.eoffset_changed)

Expand Down
2 changes: 1 addition & 1 deletion docs/src/config/ini-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ Example: `loadrt motmod ... unlock_joints_mask=0x38` creates unlock-pins for joi
[source,hal]
----
axis.<letter>.eoffset-enable
axis.<letter>.eoffset-count
axis.<letter>.eoffset-counts
axis.<letter>.eoffset-scale
----

Expand Down
22 changes: 22 additions & 0 deletions docs/src/getting-started/updating-linuxcnc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,28 @@ link:../man/man1/mesambccc.1.html[mesambccc(1)]. The 2.9 release retains
the framework, so its documentation remains available in the
http://linuxcnc.org/docs/2.9/html/drivers/mesa_modbus.html[2.9 docs].

External offsets: the *axis._L_.eoffset-counts* input is now a float
(real) pin instead of an integer (sint) one, so a computed offset can
be sent without rounding it to whole counts. The pins that feed it
changed with it:

* *eoffset_per_angle.N.kcounts*
* *plasmac.x-offset-counts*, *plasmac.y-offset-counts* and
*plasmac.z-offset-counts*
* *z_level_compensation.counts*
* the QtDragon, QtDragon_hd and Woodpecker screen pins
*eoffset-count*, *eoffset-spindle-count* and *eoffset-zlevel-count*

The stock configurations are updated. HAL does not connect an integer
signal to a float pin, so a configuration that feeds one of these pins
from an integer source, or connects one of them to an integer input,
fails to load with an error such as `Signal 'eoffset_count' of type
'sint' cannot add pin 'axis.z.eoffset-counts' of type 'real'`. Put a
link:../man/man9/conv_sint_real.9.html[conv_sint_real] component
between an integer source and the float pin, or a
link:../man/man9/conv_real_sint.9.html[conv_real_sint] component
between a float output and an integer input.


== Preview renderer now requires OpenGL 3.3 core

Expand Down
13 changes: 7 additions & 6 deletions docs/src/gui/qtdragon.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,9 @@ loadrt logic names=logic-and personality=0x102
addf logic-and servo-thread

# load a summing component for adding spindle lift and Z compensation
loadrt scaled_sint_sums
addf scaled-sint-sums.0 servo-thread
# (eoffset counts are floats, so sum2 rather than scaled_sint_sums)
loadrt sum2
addf sum2.0 servo-thread

loadusr -Wn z_level_compensation z_level_compensation
# method parameter must be one of nearest(2), linear(1), cubic (0)
Expand Down Expand Up @@ -872,10 +873,10 @@ net z_compensation_on z_level_compensation.enable-in <= qtdragon.comp-on
net eoffset-zlevel-count z_level_compensation.counts => qtdragon.eoffset-zlevel-count

# add Z level and scaled spindle raise level values together
net eoffset-spindle-count scaled-sint-sums.0.in0
net eoffset-zlevel-count scaled-sint-sums.0.in1
setp scaled-sint-sums.0.scale0 1000
net eoffset-counts scaled-sint-sums.0.out-s
net eoffset-spindle-count sum2.0.in0
net eoffset-zlevel-count sum2.0.in1
setp sum2.0.gain0 1000
net eoffset-counts sum2.0.out

----

Expand Down
5 changes: 3 additions & 2 deletions docs/src/man/man9/motion.9.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,14 @@ These pins represent the *commanded geometric intent* from the interpreter and a
Current external offset.
**axis.**_L_**.eoffset-clear** IN BOOL::
Clear external offset request
**axis.**_L_**.eoffset-counts** IN SINT::
**axis.**_L_**.eoffset-counts** IN REAL::
Counts input for external offset. The eoffset-counts are transferred
to an internal register. The applied external offset is the product of
the register counts and the eoffset-scale value. The register is
*reset to zero at each machine startup*. If the machine is turned off
with an external offset active, the eoffset-counts pin should be set
to zero before restarting.
to zero before restarting. Non-finite values (NaN, infinity) are
ignored.
**axis.**_L_**.eoffset-enable** IN BOOL::
Enable for external offset (also requires INI file setting for [AXIS_L]OFFSET_AV_RATIO)
**axis.**_L_**.eoffset-request** OUT REAL::
Expand Down
6 changes: 4 additions & 2 deletions docs/src/motion/external-offsets.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ For each axis letter (*_L_* in xyzabcuvw)

. *axis._L_.eoffset-enable* Input(bool): enable
. *axis._L_.eoffset-scale* Input(real): scale factor
. *axis._L_.eoffset-counts* Input(sint): input to counts register
. *axis._L_.eoffset-counts* Input(real): input to counts register
. *axis._L_.eoffset-clear* Input(bool): clear requested offset
. *axis._L_.eoffset* Output(real): current external offset
. *axis._L_.eoffset-request* Output(real): requested external offset
Expand All @@ -68,7 +68,9 @@ pins used for wheel jogging.
At each servo period, the 'axis._L_.eoffset-counts' pin is compared to
its value in the prior period. The increase or decrease (positive
or negative delta) of the 'axis._L_.eoffset-counts' pin is multiplied
by the current 'axis._L_.eoffset-scale' pin value. This product is
by the current 'axis._L_.eoffset-scale' pin value. The pin is a float,
so the counts need not be whole numbers; a non-finite value (NaN or
infinity) is ignored and leaves the register unchanged. This product is
accumulated in an internal register and exported to the
'axis._L_.eoffset-request' HAL pin. The accumulation register is reset
to zero at each machine-on.
Expand Down
2 changes: 1 addition & 1 deletion share/qtvcp/screens/qtdragon/qtdragon_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def init_pins(self):
QHAL.newPin("eoffset-enable", QHAL.HAL_BOOL, QHAL.HAL_OUT)
QHAL.newPin("eoffset-clear", QHAL.HAL_BOOL, QHAL.HAL_OUT)
self.h['eoffset-clear'] = True
QHAL.newPin("eoffset-spindle-count", QHAL.HAL_SINT, QHAL.HAL_OUT)
QHAL.newPin("eoffset-spindle-count", QHAL.HAL_REAL, QHAL.HAL_OUT)
pin = QHAL.newPin("eoffset-is-active", QHAL.HAL_BOOL, QHAL.HAL_IN)
pin.pinValueChanged.connect(lambda p,v: self.external_offset_state_changed(v))

Expand Down
6 changes: 3 additions & 3 deletions share/qtvcp/screens/qtdragon_hd/qtdragon_hd_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,16 +294,16 @@ def init_pins(self):
QHAL.newPin("eoffset-enable", QHAL.HAL_BOOL, QHAL.HAL_OUT)
QHAL.newPin("eoffset-clear", QHAL.HAL_BOOL, QHAL.HAL_OUT)
self.h['eoffset-clear'] = False
QHAL.newPin("eoffset-spindle-count", QHAL.HAL_SINT, QHAL.HAL_OUT)
QHAL.newPin("eoffset-count", QHAL.HAL_SINT, QHAL.HAL_OUT)
QHAL.newPin("eoffset-spindle-count", QHAL.HAL_REAL, QHAL.HAL_OUT)
QHAL.newPin("eoffset-count", QHAL.HAL_REAL, QHAL.HAL_OUT)
pin = QHAL.newPin("eoffset-is-active", QHAL.HAL_BOOL, QHAL.HAL_IN)


# total external offsets
pin = QHAL.newPin("eoffset-value", QHAL.HAL_REAL, QHAL.HAL_IN)
pin.pinValueChanged.connect(lambda p,v: self.external_offset_state_changed(v))

pin = QHAL.newPin("eoffset-zlevel-count", QHAL.HAL_SINT, QHAL.HAL_IN)
pin = QHAL.newPin("eoffset-zlevel-count", QHAL.HAL_REAL, QHAL.HAL_IN)
pin.pinValueChanged.connect(lambda p,v: self.comp_count_changed(v))
QHAL.newPin("comp-on", QHAL.HAL_BOOL, QHAL.HAL_OUT)
QHAL.newPin("spindle-lift-on", QHAL.HAL_BOOL, QHAL.HAL_OUT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,16 +294,16 @@ def init_pins(self):
QHAL.newPin("eoffset-enable", QHAL.HAL_BOOL, QHAL.HAL_OUT)
QHAL.newPin("eoffset-clear", QHAL.HAL_BOOL, QHAL.HAL_OUT)
self.h['eoffset-clear'] = False
QHAL.newPin("eoffset-spindle-count", QHAL.HAL_SINT, QHAL.HAL_OUT)
QHAL.newPin("eoffset-count", QHAL.HAL_SINT, QHAL.HAL_OUT)
QHAL.newPin("eoffset-spindle-count", QHAL.HAL_REAL, QHAL.HAL_OUT)
QHAL.newPin("eoffset-count", QHAL.HAL_REAL, QHAL.HAL_OUT)
pin = QHAL.newPin("eoffset-is-active", QHAL.HAL_BOOL, QHAL.HAL_IN)


# total external offsets
pin = QHAL.newPin("eoffset-value", QHAL.HAL_REAL, QHAL.HAL_IN)
pin.pinValueChanged.connect(lambda p,v: self.external_offset_state_changed(v))

pin = QHAL.newPin("eoffset-zlevel-count", QHAL.HAL_SINT, QHAL.HAL_IN)
pin = QHAL.newPin("eoffset-zlevel-count", QHAL.HAL_REAL, QHAL.HAL_IN)
pin.pinValueChanged.connect(lambda p,v: self.comp_count_changed(v))
QHAL.newPin("comp-on", QHAL.HAL_BOOL, QHAL.HAL_OUT)
QHAL.newPin("spindle-lift-on", QHAL.HAL_BOOL, QHAL.HAL_OUT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def init_pins(self):
QHAL.newPin("eoffset-enable", QHAL.HAL_BOOL, QHAL.HAL_OUT)
QHAL.newPin("eoffset-clear", QHAL.HAL_BOOL, QHAL.HAL_OUT)
self.h['eoffset-clear'] = True
QHAL.newPin("eoffset-spindle-count", QHAL.HAL_SINT, QHAL.HAL_OUT)
QHAL.newPin("eoffset-spindle-count", QHAL.HAL_REAL, QHAL.HAL_OUT)
pin = QHAL.newPin("eoffset-is-active", QHAL.HAL_BOOL, QHAL.HAL_IN)
pin.pinValueChanged.connect(lambda p,v: self.external_offset_state_changed(v))

Expand Down
2 changes: 1 addition & 1 deletion share/qtvcp/screens/qtplasmac/qtplasmac_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ def make_hal_pins(self):
self.xOffsetPin = self.h.newpin('x_offset', hal.Type.REAL, hal.Dir.IN)
self.yOffsetPin = self.h.newpin('y_offset', hal.Type.REAL, hal.Dir.IN)
self.zHeightPin = self.h.newpin('z_height', hal.Type.REAL, hal.Dir.IN)
self.zOffsetPin = self.h.newpin('z_offset_counts', hal.Type.SINT, hal.Dir.IN)
self.zOffsetPin = self.h.newpin('z_offset_counts', hal.Type.REAL, hal.Dir.IN)
self.xMinPierceExtentPin = self.h.newpin('x_min_pierce_extent', hal.Type.REAL, hal.Dir.IN)
self.xMaxPierceExtentPin = self.h.newpin('x_max_pierce_extent', hal.Type.REAL, hal.Dir.IN)
self.yMinPierceExtentPin = self.h.newpin('y_min_pierce_extent', hal.Type.REAL, hal.Dir.IN)
Expand Down
2 changes: 1 addition & 1 deletion share/qtvcp/screens/woodpecker/woodpecker_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def init_pins(self):
# external offset control pins
QHAL.newpin("eoffset-enable", QHAL.HAL_BOOL, QHAL.HAL_OUT)
QHAL.newpin("eoffset-clear", QHAL.HAL_BOOL, QHAL.HAL_OUT)
QHAL.newpin("eoffset-count", QHAL.HAL_SINT, QHAL.HAL_OUT)
QHAL.newpin("eoffset-count", QHAL.HAL_REAL, QHAL.HAL_OUT)
pin = QHAL.newpin("eoffset-value", QHAL.HAL_REAL, QHAL.HAL_IN)

self.pin_mpg_in = self.h.newpin('mpg-in',hal.Type.SINT, hal.Dir.IN)
Expand Down
Loading
Loading