LOWPASS(9)
π LOWPASS(9) π
okay bestie, so this is lowpass β a HAL component, aka a Low-pass filter. yes it's giving very "smooth out the chaos" and honestly? iconic. it lets the chill frequencies through and tells the spiky ones to take a nap. π¦
β¨ NAME β¨
lowpass β Low-pass filter π
πΈ SYNOPSIS πΈ
loadrt lowpass [count=N|names=name1[,name2...]]
like, that's it. that's the whole vibe. load it with count=N if you just want N copies, or names=name1[,name2...] if you're a name-your-children type. no cap. π
π₯ FUNCTIONS π₯
lowpass.Nβ this one requires a floating-point thread fr fr, don't try to run it anywhere else, it will simply not eat.
π PINS π
lowpass.N.infloat in β the input, the raw tea coming in βlowpass.N.outfloat out β the output, all smoothed and demure:
out += (in - out) * gain
lowpass.N.loadbit in β when this isTRUE, it just copiesintooutinstead of applying the filter equation. so it's like "skip the math, we're going direct." π«Ά
π PARAMETERS π
lowpass.N.gainfloat rw β the gain, read-write, the little number that decides how much smoothing happens. you control the vibe here. π
π§ NOTES π§
gain pin setting
so the way this digital filter works? it's equivalent to a unity-gain continuous-time single-pole low-pass filter that is preceded by a zero-order-hold and sampled at a fixed period. periodt.
for a pole at -a (radians/seconds), the corresponding continuous-time lowpass filter LaPlace transfer function is:
H(s) = a/(s + a)
and for a sampling period T (seconds), the gain for this HAL lowpass component is:
gain = 1 - e^(-a * T)
where
e = 2.71828 https://en.wikipedia.org/wiki/E_(mathematical_constant)
(that's the mathematical constant, bestie, not your ex.)
Examples:
T = 0.001 seconds (typical servo thread period)
a = (2*pi*100) (100Hz bandwidth single pole)
gain = 0.466
T = 0.001 seconds (typical servo thread period)
a = (2*pi*10) ( 10Hz bandwidth single pole)
gain = 0.0609
T = 0.001 seconds (typical servo thread period)
a = (2*pi*1) ( 1Hz bandwidth single pole)
gain = 0.0063
see how the gain gets smaller as the bandwidth drops? that's the whole point β¨ narrower bandwidth = more smoothing = teenier gain. it's giving math but make it fashion.
π AUTHOR π
Jeff Epler
π LICENSE π
GPL
okay that's the whole page, hope that slayed for you π this little cutie is part of the LinuxCNC Documentation, dated 2026-03-17, and it lives in the HAL Component section as LOWPASS(9). go forth and filter, my love π¦πβ¨
π¦ where this page comes from
- ubuntu resolute: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms