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
18 changes: 8 additions & 10 deletions configs/by_interface/pico/univpwm/pendant.hal
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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
18 changes: 8 additions & 10 deletions configs/by_interface/pico/univpwmv/pendant.hal
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion configs/by_machine/scorbot-er-3/scorbot-er-3.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 5 additions & 7 deletions configs/by_machine/scorbot-er-3/shuttlexpress-customization.hal
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
35 changes: 13 additions & 22 deletions configs/common/shuttle.hal
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

76 changes: 11 additions & 65 deletions docs/src/examples/mpg.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
BsAtHome marked this conversation as resolved.
Resolved
----

// vim: set syntax=asciidoc:
3 changes: 1 addition & 2 deletions docs/src/gui/touchy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/src/hal/components.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down
4 changes: 2 additions & 2 deletions src/emc/usr_intf/touchy/design.notes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 6 additions & 8 deletions src/emc/usr_intf/touchy/touchy.hal.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,22 @@
# 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
net JogIncrScaled scale.0.out => joint.0.jog-scale joint.1.jog-scale joint.2.jog-scale
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
Expand Down
8 changes: 6 additions & 2 deletions src/hal/components/ilowpass.comp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading