LIMIT3(9)
π NAME π
limit3 β bestie, it just follows your input signal while obeying limits π
Okay so real talk, this is the LIMIT3(9) page from the HAL Component manual, and it's genuinely one of the most useful little guys in the whole toolbox. Let's get into it β¨
πΈ SYNOPSIS πΈ
Limit the output signal to fall between min and max, limit its slew rate to less than maxv per second, and limit its second derivative to less than maxa per second squared. When the signal is a position, this means that the position, velocity, and acceleration are limited.
No cap, that's the whole vibe: clamp it, cap how fast it can move, and cap how hard it can yank on the accelerator ποΈ
π¦ FUNCTIONS π¦
limit3.Nβ requires a floating-point thread
Heads up bestie: that floating-point thread thing is not optional. Give it the wrong thread type and it's giving nothing. π
β¨ PINS β¨
limit3.N.infloat in β the signal you're feeding in πlimit3.N.enablebit in (default:1)1:outfollowsin0:outreturns to0(always per constraints)
Like, even when it's heading back to zero, it's still respecting the constraints. Iconic behaviour honestly π
limit3.N.outfloat out β the well-behaved output πlimit3.N.loadbit in (default:0)- When TRUE, immediately set
outtoin, ignoringmaxvandmaxa
- When TRUE, immediately set
She said "constraints? never met her" π It just teleports straight to the value. Only when you ask for it though.
limit3.N.minfloat in (default:-1e20) β the floor, literally π§limit3.N.maxfloat in (default:1e20) β the ceiling, also literally πlimit3.N.maxvfloat in (default:1e20) β fastest it's allowed to move per second β‘limit3.N.maxafloat in (default:1e7) β Max Acceleration. Note that the component becomes unstable withmaxagreater than about1e7in a 1kHz thread
BESTIE. Listen. Pushmaxaabove about1e7in a 1kHz thread and this thing goes full feral β unstable, wigging out, not okay. That's a documented hazard, not a vibe. π
limit3.N.smooth-stepsu32 in (default:2) β Smooth out acceleration this many periods before reaching input or max/min limit. Higher values avoid oscillation, but will accelerate slightly more slowly.
It's giving "slow down to speed up" π’β¨ Smoother landing, less wobble, slightly lazier takeoff. Pick your fighter.
π AUTHOR π
John Kasunich
π LICENSE π
GPL
And that's a wrap, bestie! This slice of the LinuxCNC Documentation is dated 2026-03-17 β go forth and limit responsibly, you absolute main character π«Άπβ¨
π¦ 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