From 75b7dc5e373ca53e258a4b4eec35fe475012a431 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Mon, 9 Nov 2026 17:12:37 +1100 Subject: [PATCH 1/2] configs, docs: smooth wheel jogs with jog-accel-fraction, not ilowpass Motion plans wheel jogs itself under the axis and joint limits, and jog-accel-fraction lowers the acceleration of wheel jogs. With PLANNER_TYPE = 1 and a MAX_JERK they are also jerk limited. ilowpass in front of jog-counts only adds a lag after the wheel stops and defeats jog-vel-mode, as motion never sees the wheel stop. The pico pendants, shuttle.hal, the touchy example and the MPG example now feed the counts straight to jog-counts and set jog-accel-fraction to 0.25. The jog scales grow by the ilowpass scale they no longer divide. The scorbot-er-3 INI pointed at a shuttlexpress.hal that does not exist; it is shuttle.hal. --- configs/by_interface/pico/univpwm/pendant.hal | 18 ++--- .../by_interface/pico/univpwmv/pendant.hal | 18 ++--- .../by_machine/scorbot-er-3/scorbot-er-3.ini | 2 +- .../shuttlexpress-customization.hal | 12 ++- configs/common/shuttle.hal | 35 ++++----- docs/src/examples/mpg.adoc | 76 +++---------------- docs/src/gui/touchy.adoc | 3 +- src/emc/usr_intf/touchy/design.notes | 4 +- src/emc/usr_intf/touchy/touchy.hal.example | 14 ++-- 9 files changed, 55 insertions(+), 127 deletions(-) diff --git a/configs/by_interface/pico/univpwm/pendant.hal b/configs/by_interface/pico/univpwm/pendant.hal index 8fa72f57c2e..f7deb867a86 100644 --- a/configs/by_interface/pico/univpwm/pendant.hal +++ b/configs/by_interface/pico/univpwm/pendant.hal @@ -1,12 +1,12 @@ loadrt mux4 count=1 -loadrt ilowpass loadrt encoder num_chan=1 -setp ilowpass.0.scale 100 -setp ilowpass.0.gain 0.01 +# wheel jogs at a quarter of the INI acceleration for a smoother feel +setp axis.0.jog-accel-fraction 0.25 +setp axis.1.jog-accel-fraction 0.25 +setp axis.2.jog-accel-fraction 0.25 addf mux4.0 servo-thread -addf ilowpass.0 servo-thread addf encoder.update-counters servo-thread addf encoder.capture-position servo-thread @@ -17,9 +17,9 @@ net jog-z ppmc.0.din.08.in => axis.2.jog-enable net x10 ppmc.0.din.09.in => mux4.0.sel0 net x100 ppmc.0.din.10.in => mux4.0.sel1 -setp mux4.0.in1 .00000025 -setp mux4.0.in0 .0000025 -setp mux4.0.in2 .000025 +setp mux4.0.in1 .000025 +setp mux4.0.in0 .00025 +setp mux4.0.in2 .0025 setp mux4.0.in3 0 net jogscale mux4.0.out => axis.0.jog-scale @@ -28,8 +28,6 @@ net jogscale => axis.2.jog-scale net mpg-a ppmc.0.din.04.in => encoder.0.phase-A net mpg-b ppmc.0.din.05.in => encoder.0.phase-B -net mpg-out encoder.0.rawcounts => ilowpass.0.in - -net jogcounts ilowpass.0.out => axis.0.jog-counts +net jogcounts encoder.0.rawcounts => axis.0.jog-counts net jogcounts => axis.1.jog-counts net jogcounts => axis.2.jog-counts diff --git a/configs/by_interface/pico/univpwmv/pendant.hal b/configs/by_interface/pico/univpwmv/pendant.hal index b6d4a70e875..fa79593fa0b 100644 --- a/configs/by_interface/pico/univpwmv/pendant.hal +++ b/configs/by_interface/pico/univpwmv/pendant.hal @@ -1,12 +1,12 @@ loadrt mux4 count=1 -loadrt ilowpass loadrt encoder num_chan=1 -setp ilowpass.0.scale 100 -setp ilowpass.0.gain 0.01 +# wheel jogs at a quarter of the INI acceleration for a smoother feel +setp joint.0.jog-accel-fraction 0.25 +setp joint.1.jog-accel-fraction 0.25 +setp joint.2.jog-accel-fraction 0.25 addf mux4.0 servo-thread -addf ilowpass.0 servo-thread addf encoder.update-counters servo-thread addf encoder.capture-position servo-thread @@ -17,9 +17,9 @@ net jog-z ppmc.0.din.08.in => joint.2.jog-enable net x10 ppmc.0.din.09.in => mux4.0.sel0 net x100 ppmc.0.din.10.in => mux4.0.sel1 -setp mux4.0.in1 .00000025 -setp mux4.0.in0 .0000025 -setp mux4.0.in2 .000025 +setp mux4.0.in1 .000025 +setp mux4.0.in0 .00025 +setp mux4.0.in2 .0025 setp mux4.0.in3 0 net jogscale mux4.0.out => joint.0.jog-scale @@ -28,8 +28,6 @@ net jogscale => joint.2.jog-scale net mpg-a ppmc.0.din.04.in => encoder.0.phase-A net mpg-b ppmc.0.din.05.in => encoder.0.phase-B -net mpg-out encoder.0.rawcounts => ilowpass.0.in - -net jogcounts ilowpass.0.out => joint.0.jog-counts +net jogcounts encoder.0.rawcounts => joint.0.jog-counts net jogcounts => joint.1.jog-counts net jogcounts => joint.2.jog-counts diff --git a/configs/by_machine/scorbot-er-3/scorbot-er-3.ini b/configs/by_machine/scorbot-er-3/scorbot-er-3.ini index 3ba8fea37ae..940502d20c3 100644 --- a/configs/by_machine/scorbot-er-3/scorbot-er-3.ini +++ b/configs/by_machine/scorbot-er-3/scorbot-er-3.ini @@ -69,7 +69,7 @@ CYCLE_TIME = 0.001 [HAL] HALFILE = scorbot-er-3.hal -#HALFILE = ../../common/shuttlexpress.hal +#HALFILE = ../../common/shuttle.hal #HALFILE = shuttlexpress-customization.hal POSTGUI_HALFILE = pyvcp.hal diff --git a/configs/by_machine/scorbot-er-3/shuttlexpress-customization.hal b/configs/by_machine/scorbot-er-3/shuttlexpress-customization.hal index f33d0922ebd..09211b4b3d6 100644 --- a/configs/by_machine/scorbot-er-3/shuttlexpress-customization.hal +++ b/configs/by_machine/scorbot-er-3/shuttlexpress-customization.hal @@ -1,11 +1,9 @@ -# for each click of the jog-wheel there's 1000 simulated counts coming out -# of the ilowpass below, so these numbers are 1000x smaller than the jog -# increment size they encode -setp tristate-float.sxp-jog-increment-0.in 0.0005 -setp tristate-float.sxp-jog-increment-1.in 0.001 -setp tristate-float.sxp-jog-increment-2.in 0.005 -setp tristate-float.sxp-jog-increment-3.in 0.010 +# jog increment per click of the jog-wheel +setp tristate-float.sxp-jog-increment-0.in 0.5 +setp tristate-float.sxp-jog-increment-1.in 1 +setp tristate-float.sxp-jog-increment-2.in 5 +setp tristate-float.sxp-jog-increment-3.in 10 # each of the 8 tristate floats has a constant jog speed on it # speeds are specified as "fraction of machine max speed" diff --git a/configs/common/shuttle.hal b/configs/common/shuttle.hal index 153748fe5ac..290db9753b8 100644 --- a/configs/common/shuttle.hal +++ b/configs/common/shuttle.hal @@ -19,7 +19,6 @@ loadrt mux2 names=mux2.sxp-x-analog,mux2.sxp-y-analog,mux2.sxp-z-analog loadrt updown names=updown.sxp loadrt and2 names=and2.sxp-x-pos,and2.sxp-x-neg,and2.sxp-y-pos,and2.sxp-y-neg,and2.sxp-z-pos,and2.sxp-z-neg loadrt tristate_float names=tristate-float.sxp0,tristate-float.sxp1,tristate-float.sxp2,tristate-float.sxp3,tristate-float.sxp4,tristate-float.sxp5,tristate-float.sxp6,tristate-float.sxp7,tristate-float.sxp-jog-increment-0,tristate-float.sxp-jog-increment-1,tristate-float.sxp-jog-increment-2,tristate-float.sxp-jog-increment-3 -loadrt ilowpass names=ilowpass.sxp @@ -156,13 +155,11 @@ addf tristate-float.sxp-jog-increment-1 servo-thread addf tristate-float.sxp-jog-increment-2 servo-thread addf tristate-float.sxp-jog-increment-3 servo-thread -# for each click of the jog-wheel there's 1000 simulated counts coming out -# of the ilowpass below, so these numbers are 1000x smaller than the jog -# increment size they encode -setp tristate-float.sxp-jog-increment-0.in 0.0000001 -setp tristate-float.sxp-jog-increment-1.in 0.0000005 -setp tristate-float.sxp-jog-increment-2.in 0.000001 -setp tristate-float.sxp-jog-increment-3.in 0.000010 +# jog increment per click of the jog-wheel +setp tristate-float.sxp-jog-increment-0.in 0.0001 +setp tristate-float.sxp-jog-increment-1.in 0.0005 +setp tristate-float.sxp-jog-increment-2.in 0.001 +setp tristate-float.sxp-jog-increment-3.in 0.010 setp updown.sxp.wrap 1 setp updown.sxp.min 0 @@ -213,21 +210,15 @@ net sxp.y-button axis.y.jog-enable net sxp.z-button axis.z.jog-enable # The ShuttleXpress jog wheel has 10 clicks per revolution -# -# Low-pass filter the jogwheel, and scale it so one click is 1000 counts -# coming out of the ilowpass. # -# Then connect it to the jog input on all the axes. +# Connect it to the jog input on all the axes, and jog at a quarter of +# the INI acceleration for a smoother feel. -addf ilowpass.sxp servo-thread +net sxp.counts => axis.x.jog-counts +net sxp.counts => axis.y.jog-counts +net sxp.counts => axis.z.jog-counts -setp ilowpass.sxp.gain .02 -setp ilowpass.sxp.scale 1000 - -net sxp.counts => ilowpass.sxp.in - -net sxp.counts-smoothed <= ilowpass.sxp.out -net sxp.counts-smoothed => axis.x.jog-counts -net sxp.counts-smoothed => axis.y.jog-counts -net sxp.counts-smoothed => axis.z.jog-counts +setp axis.x.jog-accel-fraction 0.25 +setp axis.y.jog-accel-fraction 0.25 +setp axis.z.jog-accel-fraction 0.25 diff --git a/docs/src/examples/mpg.adoc b/docs/src/examples/mpg.adoc index 99ee3e5d861..c323fc4cbba 100644 --- a/docs/src/examples/mpg.adoc +++ b/docs/src/examples/mpg.adoc @@ -77,73 +77,19 @@ net encoder-counts => axis.y.jog-counts net encoder-counts => axis.z.jog-counts ---- -If the machine is capable of high acceleration to smooth out the moves -for each click of the MPG use the link:../man/man9/ilowpass.9.html[ilowpass] component to -limit the acceleration. - -.jog.hal with ilowpass +If the machine is capable of high acceleration, each click of the MPG can +jerk the machine. To smooth out the moves, lower the acceleration of wheel +jogs with the **axis**.__L__.**jog-accel-fraction** pins, as a fraction of the +INI acceleration. With `PLANNER_TYPE = 1` and a `MAX_JERK` for the axes in +the INI file, wheel jogs are also jerk limited. Add these lines to the +jog.hal above; the mux still selects the jog scale. + +.Smoother wheel jogs [source,hal] ---- -loadrt encoder num_chan=1 -loadrt mux4 count=1 -addf encoder.capture-position servo-thread -addf encoder.update-counters base-thread -addf mux4.0 servo-thread - -loadrt ilowpass -addf ilowpass.0 servo-thread - -setp ilowpass.0.scale 1000 -setp ilowpass.0.gain 0.01 - -# If your MPG outputs a quadrature signal per click set x4 to 1 -# If your MPG puts out 1 pulse per click set x4 to 0 -setp encoder.0.x4-mode 0 - -# For velocity mode, set to 1 -# In velocity mode the axis stops when the dial is stopped -# even if that means the commanded motion is not completed, -# For position mode (the default), set to 0 -# In position mode the axis will move exactly jog-scale -# units for each count, regardless of how long that might take, -setp axis.x.jog-vel-mode 0 -setp axis.y.jog-vel-mode 0 -setp axis.z.jog-vel-mode 0 - -# This sets the scale that will be used based on the input to the mux4 -# The scale used here has to be multiplied by the ilowpass scale -setp mux4.0.in0 0.0001 -setp mux4.0.in1 0.00001 -setp mux4.0.in2 0.000001 - -# The inputs to the mux4 component -net scale1 mux4.0.sel0 <= parport.1.pin-09-in -net scale2 mux4.0.sel1 <= parport.1.pin-10-in - -# The output from encoder counts is sent to ilowpass -net mpg-out ilowpass.0.in <= encoder.0.counts - -# The output from the mux4 is sent to each axis jog scale -net mpg-scale <= mux4.0.out -net mpg-scale => axis.x.jog-scale -net mpg-scale => axis.y.jog-scale -net mpg-scale => axis.z.jog-scale - -# The MPG inputs -net mpg-a encoder.0.phase-A <= parport.1.pin-02-in -net mpg-b encoder.0.phase-B <= parport.1.pin-03-in - -# The Axis select inputs -net mpg-x axis.x.jog-enable <= parport.1.pin-04-in -net mpg-y axis.y.jog-enable <= parport.1.pin-05-in -net mpg-z axis.z.jog-enable <= parport.1.pin-06-in - -# The output from the ilowpass is sent to each axis jog count -# Only the selected axis will move. -net encoder-counts <= ilowpass.0.out -net encoder-counts => axis.x.jog-counts -net encoder-counts => axis.y.jog-counts -net encoder-counts => axis.z.jog-counts +setp axis.x.jog-accel-fraction 0.25 +setp axis.y.jog-accel-fraction 0.25 +setp axis.z.jog-accel-fraction 0.25 ---- // vim: set syntax=asciidoc: diff --git a/docs/src/gui/touchy.adoc b/docs/src/gui/touchy.adoc index de647a00db4..76e02d0a95e 100644 --- a/docs/src/gui/touchy.adoc +++ b/docs/src/gui/touchy.adoc @@ -48,8 +48,7 @@ motion controller to control wheel jogging: - In addition to being connected to 'touchy.wheel-counts', the wheel counts should also be connected to 'axis._N_.jog-counts' for - each axis _N_. If you use HAL component 'ilowpass' to smooth wheel jogging, be - sure to smooth only 'axis._N_.jog-counts' and not 'touchy.wheel-counts'. + each axis _N_. To smooth wheel jogging, lower 'axis._N_.jog-accel-fraction'. .Required controls diff --git a/src/emc/usr_intf/touchy/design.notes b/src/emc/usr_intf/touchy/design.notes index ec1bd219400..2bae1f6cd9a 100644 --- a/src/emc/usr_intf/touchy/design.notes +++ b/src/emc/usr_intf/touchy/design.notes @@ -46,8 +46,8 @@ touchy.jog.wheel.x => joint.0.jog-enable ... z ... Also be sure to connect the wheel/mpg to joint.N.jog-counts as well as -to touchy.wheel-counts. If you use ilowpass to smooth wheel jogging, -be sure to smooth only joint.N.jog-counts and not touchy.wheel-counts. +to touchy.wheel-counts. To smooth wheel jogging, lower +joint.N.jog-accel-fraction. Touchy requires you to write a file named "touchy.hal" to make these connections. Touchy executes the hal commands in this file diff --git a/src/emc/usr_intf/touchy/touchy.hal.example b/src/emc/usr_intf/touchy/touchy.hal.example index 26304da4880..7788416ad43 100644 --- a/src/emc/usr_intf/touchy/touchy.hal.example +++ b/src/emc/usr_intf/touchy/touchy.hal.example @@ -4,14 +4,9 @@ # axis Y --> Joint 1 # ... -loadrt ilowpass loadrt scale count=1 -setp ilowpass.0.scale 1000 -setp ilowpass.0.gain .02 -addf ilowpass.0 servo-thread - -setp scale.0.gain .00025 +setp scale.0.gain .25 addf scale.0 servo-thread net JogIncr touchy.jog.wheel.increment => scale.0.in @@ -19,9 +14,12 @@ net JogIncrScaled scale.0.out => joint.0.jog-scale joint.1.jog-scale joint.2.jog net JogX touchy.jog.wheel.x => joint.0.jog-enable net JogY touchy.jog.wheel.y => joint.1.jog-enable net JogZ touchy.jog.wheel.z => joint.2.jog-enable -net WheelCounts hm2_5i20.0.encoder.00.count => ilowpass.0.in touchy.wheel-counts +net WheelCounts hm2_5i20.0.encoder.00.count => touchy.wheel-counts joint.0.jog-counts joint.1.jog-counts joint.2.jog-counts -net JogCountsLowpass ilowpass.0.out => joint.0.jog-counts joint.1.jog-counts joint.2.jog-counts +# wheel jogs at a quarter of the INI acceleration for a smoother feel +setp joint.0.jog-accel-fraction 0.25 +setp joint.1.jog-accel-fraction 0.25 +setp joint.2.jog-accel-fraction 0.25 net JogXPos hm2_5i20.0.gpio.020.in_not => touchy.jog.continuous.x.positive net JogXNeg hm2_5i20.0.gpio.019.in_not => touchy.jog.continuous.x.negative From 7f8816340d9af8a52f3cbdf044a5750856fc7e2a Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Mon, 9 Nov 2026 23:41:02 +1100 Subject: [PATCH 2/2] ilowpass: deprecate in favour of jog-accel-fraction No in-tree config uses ilowpass any more. Point its man page and the component list at jog-accel-fraction, so it can be removed a release later. --- docs/src/hal/components.adoc | 2 +- src/hal/components/ilowpass.comp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/src/hal/components.adoc b/docs/src/hal/components.adoc index 507070983cf..748856db517 100644 --- a/docs/src/hal/components.adoc +++ b/docs/src/hal/components.adoc @@ -230,7 +230,7 @@ To search in the man pages, use the UNIX tool `apropos`. | link:../man/man9/deadzone.9.html[deadzone] |Returns the center if within the threshold. || | link:../man/man9/div2.9.html[div2] |Quotient of two floating point inputs. || | link:../man/man9/hypot.9.html[hypot] |Three-input hypotenuse (Euclidean distance) calculator. || -| link:../man/man9/ilowpass.9.html[ilowpass] |Low-pass filter with integer inputs and outputs || +| link:../man/man9/ilowpass.9.html[ilowpass] |Low-pass filter with integer inputs and outputs (deprecated, see jog-accel-fraction) || | link:../man/man9/integ.9.html[integ] |Integrator || | link:../man/man9/invert.9.html[invert] |Computes the inverse of the input signal. || | link:../man/man9/filter_kalman.9.html[filter_kalman] |Unidimensional Kalman filter, also known as linear quadratic estimation (LQE) || diff --git a/src/hal/components/ilowpass.comp b/src/hal/components/ilowpass.comp index f6a01c57720..766636004a5 100644 --- a/src/hal/components/ilowpass.comp +++ b/src/hal/components/ilowpass.comp @@ -1,5 +1,9 @@ -component ilowpass "Low-pass filter with integer inputs and outputs"; -description """While it may find other applications, this component was written +component ilowpass "Low-pass filter with integer inputs and outputs (deprecated, see jog-accel-fraction)"; +description """*DEPRECATED*: motion plans wheel jogs itself under the axis and joint +limits. To smooth wheel jogging, lower **axis**.__L__.**jog-accel-fraction** +or **joint**.__N__.**jog-accel-fraction** instead, see motion(9). + +While it may find other applications, this component was written to create smoother motion while jogging with an MPG. In a machine with high acceleration, a short jog can behave almost like a step