ORIENT(9)
β¨ 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 onenable,position,modeandangle.
π PINS π
orient.N.enablebit inβ enable angular output for orientation mode β¨orient.N.modes32 inβ0: rotate - shortest move;1: always rotate clockwise;2: always rotate counterclockwise.orient.N.positionfloat inβ spindle position input, unit1 rev.orient.N.anglefloat inβ orient target position in degrees,0 <= angle < 360.orient.N.commandfloat outβ target spindle position, input to PID command.orient.N.poserrfloat outβ in degrees - aid for PID tuning (she's the little helper bestie, use her for tuning π).orient.N.is-orientedbit outβ this pin goes high whenposerr < tolerance. use to drivespindle.N.is-oriented.orient.N.tolerancefloat 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
- 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