ORIENT(9)

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

✨ ORIENT(9) ✨

okay bestie, gather round, because this is the orient HAL component and she is literally the moment πŸ’…

πŸŽ€ NAME πŸŽ€

orient β€” she provides a PID command input for orientation mode, based on the current spindle position, the target angle and the orient mode. that's it, that's the job, and she does it flawlessly ✨


🌸 SYNOPSIS 🌸

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

πŸ’– DESCRIPTION πŸ’–

so the whole vibe here: this component exists to support a spindle orientation PID loop by handing it a command value, and to fit with the motion spindle-orient support pins so the M19 code can do its thing. no cap 🫢

here's the scenario, bestie: the spindle has stopped. somewhere. anywhere. arbitrary position, we don't know her. the spindle encoder position gets linked to the position pin. then β€” on a positive edge on the enable pin β€” we sample whatever position is at that moment, and the command gets computed and set like this:

floor(number of full spindle revolutions in the position sampled on positive edge) plus angle/360 (the fractional revolution) +1/-1/0 depending on mode.

like, that's the formula, she's iconic, she's precise πŸ’…

and now the mode pin, which gets interpreted like this:

  • 0: the spindle rotates in the direction with the lesser angle, which may be clockwise or counterclockwise.
  • 1: the spindle rotates always rotates clockwise to the new angle.
  • 2: the spindle rotates always rotates counterclockwise to the new angle.

πŸ¦‹ HAL USAGE πŸ¦‹

okay so on spindle.N.orient you disconnect the spindle control and connect to the orient-pid loop. like, out with the old, in with the slay:

loadrt orient names=orient
loadrt pid names=orient-pid
net orient-angle spindle.N.orient-angle orient.angle
net orient-mode spindle.N.orient-mode orient.mode
net orient-enable spindle.N.orient orient.enable orient-pid.enable
net spindle-in-pos orient.is-oriented spindle.N.is-oriented
net spindle-pos encoder.position orient.position orient-pid.feedback
net orient-command orient.command orient-pid.command

copy it exactly bestie, every single line, don't get creative πŸ™ˆ


πŸ”₯ FUNCTIONS πŸ”₯

  • orient.N (requires a floating-point thread) β€” updates the command based on enable, position, mode and angle.

πŸ‘‘ PINS πŸ‘‘

  • orient.N.enable bit in β€” enable angular output for orientation mode ✨
  • orient.N.mode s32 in β€” 0: rotate - shortest move; 1: always rotate clockwise; 2: always rotate counterclockwise.
  • orient.N.position float in β€” spindle position input, unit 1 rev.
  • orient.N.angle float in β€” orient target position in degrees, 0 <= angle < 360.
  • orient.N.command float out β€” target spindle position, input to PID command.
  • orient.N.poserr float out β€” in degrees - aid for PID tuning (she's the little helper bestie, use her for tuning πŸŽ€).
  • orient.N.is-oriented bit out β€” this pin goes high when poserr < tolerance. use to drive spindle.N.is-oriented.
  • orient.N.tolerance float in (default: 0.5) β€” the tolerance in degrees for considering the align completed. like, how close is close enough, you know? πŸ’…
ngl poserr is lowkey the most useful pin in this whole page for tuning. she's in degrees. she's telling you the truth. fr fr.

πŸ’œ AUTHOR πŸ’œ

Michael Haberler

🌈 LICENSE 🌈

GPL


and that's the whole page, bestie, you ate it πŸ’…βœ¨ this was LinuxCNC Documentation, dated 2026-03-17, and it's the ORIENT(9) page β€” go orient those spindles, you've got this πŸ«ΆπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from