Machinekit

Machinekit

Machinekit Documentation

HAL Component — ORIENTV2

INSTANTIABLE COMPONENTS — General

All instantiable components can be loaded in two manners

Using loadrt with or without count= | names= parameters as per legacy components
Using newinst, which names the instance and allows further parameters and arguments
primarily pincount= which can set the number of pins created for that instance (where applicable)

NAME

orientv2 — Provide a PID command input for orientation mode based on current spindle position, target angle and orient mode

SYNOPSIS

orientv2

USAGE SYNOPSIS

loadrt orientv2
OR
newinst orientv2 <newinstname> [ pincount=N | iprefix=prefix ] [instanceparamX=X | argX=X ]

( args in [ ] denote possible args and parameters, may not be used in all components )

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 \fBposition\fR pin. The current value of the position pin is sampled on a positive edge on the \fBenable\fR pin, and \fBcommand\fR is computed and set as follows: floor(number of full spindle revolutions in the \fBposition\fR sampled on positive edge) plus \fBangle\fR/360 (the fractional revolution) +1/-1/0 depending on \fBmode\fR.

The \fBmode\fR 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.

SH HAL USAGE

On \fBmotion.spindle-orient\fR disconnect the spindle control and connect to the orient-pid loop:

loadrt orient names=orient .br loadrt pid names=orient-pid .br net orient-angle motion.spindle-orient-angle orient.angle .br net orient-mode motion.spindle-orient-mode orient.mode .br net orient-enable motion.spindle-orient orient.enable orient-pid.enable .br net spindle-pos …​encoder..position orient.position orient-pid.feedback .br net orient-command orient.command orient-pid.command .br

FUNCTIONS

orientv2.N.funct ( OR <newinstname>.funct (requires a floating-point thread) )

Update \fBcommand\fR based on \fBenable\fR, \fBposition\fR, \fBmode\fR and \fBangle\fR.

PINS

AUTHOR

Michael Haberler

LICENCE

GPL