LinuxCNC Documentation

SYNOPSIS

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

DESCRIPTION

This component is designed to support a spindle orientation PID loop by providing a command value, and fit with the motion spindle-orient support pins to support the M19 code.

The spindle is assumed to have stopped in an arbitrary position. The spindle encoder position is linked to the position pin. The current value of the position pin is sampled on a positive edge on the enable pin, and command is computed and set depending on mode.

The mode pin is interpreted as follows:

  • 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

On spindle.N.orient disconnect the spindle control and connect to the orient-pid loop:

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

FUNCTIONS

orient.N

Update command based on enable, position, mode and angle.

PINS

orient.N.enable bool in

enable angular output for orientation mode

orient.N.mode si32 in

0: rotate - shortest move; 1: always rotate clockwise; 2: always rotate counterclockwise

orient.N.position real in

spindle position input, unit 1 rev

orient.N.angle real in

orient target position in degrees, 0 ≤ angle < 360

orient.N.command real out

target spindle position, input to PID command

orient.N.poserr real out

in degrees - aid for PID tuning

orient.N.is-oriented bool out

This pin goes high when poserr < tolerance. Use to drive spindle.N.is-oriented

orient.N.tolerance real in (default: 0.5)

The tolerance in degrees for considering the align completed

AUTHOR

Michael Haberler

LICENSE

GPL