LIMIT3(9)

πŸ“¦
version 2.9.4 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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.in float in β€” the signal you're feeding in πŸ’Œ
  • limit3.N.enable bit in (default: 1)
    • 1: out follows in
    • 0: out returns to 0 (always per constraints)
Like, even when it's heading back to zero, it's still respecting the constraints. Iconic behaviour honestly πŸ‘‘
  • limit3.N.out float out β€” the well-behaved output 🌈
  • limit3.N.load bit in (default: 0)
    • When TRUE, immediately set out to in, ignoring maxv and maxa
She said "constraints? never met her" πŸ’… It just teleports straight to the value. Only when you ask for it though.
  • limit3.N.min float in (default: -1e20) β€” the floor, literally 🧊
  • limit3.N.max float in (default: 1e20) β€” the ceiling, also literally 🎈
  • limit3.N.maxv float in (default: 1e20) β€” fastest it's allowed to move per second ⚑
  • limit3.N.maxa float in (default: 1e7) β€” Max Acceleration. Note that the component becomes unstable with maxa greater than about 1e7 in a 1kHz thread
BESTIE. Listen. Push maxa above about 1e7 in 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-steps u32 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