COMP(9)

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

πŸ’– comp β€” the manual page, but make it slay πŸ’–

okay bestie, sit down, hydrate, because we're about to talk about comp β€” a two input comparator with hysteresis from the HAL Component fam. it's in section 9 of the manual, which is giving "kernel/HAL interface" energy, and honestly? it ate. ✨


🌸 SYNOPSIS 🌸

loadrt comp [count=N|names=name1[,name2...]]

that's literally it. you load it, you get comparators. no cap. 🫢


πŸ¦‹ FUNCTIONS πŸ¦‹

  • comp.N β€” requires a floating-point thread, bestie, do not try to sneak it into an integer thread, it will simply not vibe. this is the function that updates the comparator. one function per instance, indexed by N. πŸ’…

πŸŽ€ PINS πŸŽ€

so every instance gets an N (that's the count index, iykyk) and here's what you're working with:

  • comp.N.in0 β€” float in β€” the inverting input. yes, in0 is the one that flips the vibe. okay so it's called inverting because the output is true when in1 is greater than it β€” the comparison is against in0 in the negative direction. main character inversion energy. πŸ™ˆ
  • comp.N.in1 β€” float in β€” the non-inverting input. the good one. the one whose side we're on. πŸ“
  • comp.N.out β€” bit out β€” the normal output! it's True when in1 > in0 β€” but wait, check parameter hyst for the details, because hysteresis changes the whole plotline. πŸ‘‘
  • comp.N.equal β€” bit out β€” the match output! it's True when the difference between in1 and in0 is less than hyst/2. so it's like... are these two basically the same rn. bestie energy. 🫢

⭐ PARAMETERS ⭐

  • comp.N.hyst β€” float rw (default: 0.0) β€” the hysteresis of the comparator. default 0.0, as stated. πŸ’–

so here's the tea on what hysteresis actually does:

  • with zero hysteresis, the output is true when in1 > in0. simple. iconic. no drama.
  • with nonzero hysteresis, the output switches on and off at two different values, separated by distance hyst around the point where in1 = in0. so it's not one line, it's two lines, and that gap is the whole point. that's the hysteresis. that's the girl. 😭
⚠️ warning bestie: keep in mind that floating point calculations are never absolute, and it is wise to always set hyst if you intend to use equal. like, actually. fr fr. don't skip this. πŸ’€

✨ AUTHOR ✨

Jeff Epler πŸ‘‘ β€” the legend who wrote this. we stan.


πŸ’œ LICENSE πŸ’œ

GPL β€” free as in freedom, slay as in slay. 🌈


and that's the whole page, bestie! πŸ’… this was the COMP(9) page from the LinuxCNC Documentation, dated 2026-03-17. now go set your hyst and live your truth. mwah! πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from