.\"******************************************************************* .\" .\" This file was extracted from hal/components/spindle.comp using halcompile.g. .\" Modify the source file. .\" .\"******************************************************************* .TH SPINDLE "9" "2024-03-13" "LinuxCNC Documentation" "HAL Component" .SH NAME spindle \- Control a spindle with different acceleration and deceleration and optional gear change scaling .SH SYNOPSIS .HP .B loadrt spindle [count=\fIN\fB|names=\fIname1\fB[,\fIname2...\fB]] .SH DESCRIPTION This component will control a spindle with adjustable acceleration and deceleration. NOTE: This component is unfortunately named and creates pins with names very much like those created by the motion component. In nearly every case this is not the documentation page that you are looking for. See http://linuxcnc.org/docs/html/man/man9/motion.9.html instead. It is designed for use with non-servo spindle drives that have separate fwd/reverse inputs, such as DC drives and inverters. If a spindle encoder is available it is used to tailor the acceleration and deceleration to the spindle load. If not the spindle speed is simulated. The component allows for gearboxes with up to 16 gears. Each gear has individual control of speeds, acceleration, driver gain and direction. .SH FUNCTIONS .TP \fBspindle.\fIN\fB\fR (requires a floating-point thread) .SH PINS .TP .B spindle.\fIN\fB.select-gear\fR u32 in \fR Select a gear. Must be in the range 0 -> number of available gears -1. If you use this, do not use the select.x input pins. .TP .B spindle.\fIN\fB.commanded-speed\fR float in \fR Commanded spindle speed (in RPM) .TP .B spindle.\fIN\fB.actual-speed\fR float in \fR Actual spindle speed from a spindle encoder (in RPS). If you do not have a spindle encoder set the simulate_encoder parameter to 1. .TP .B spindle.\fIN\fB.simulate-encoder\fR bit in \fR If you do not have an encoder, set this to 1. .TP .B spindle.\fIN\fB.enable\fR bit in \fR If FALSE, the spindle is stopped at the gear's maximum deceleration. .TP .B spindle.\fIN\fB.spindle-lpf\fR float in \fR Smooth the spindle-rpm-abs output when at speed, 0 = disabled. Suitable values are probably between 1 and 20 depending on how stable your spindle is. .TP .B spindle.\fIN\fB.spindle-rpm\fR float out \fR Current spindle speed in RPM.+ve = forward, -ve = reverse. Uses the encoder input if available. If not, uses a simulated encoder speed. .TP .B spindle.\fIN\fB.spindle-rpm-abs\fR float out \fR Absolute spindle speed in RPM. Useful for spindle speed displays. .TP .B spindle.\fIN\fB.output\fR float out \fR Scaled output .TP .B spindle.\fIN\fB.current-gear\fR u32 out \fR Currently selected gear. .TP .B spindle.\fIN\fB.at-speed\fR bit out \fR TRUE when the spindle is at speed .TP .B spindle.\fIN\fB.forward\fR bit out \fR TRUE for forward rotation .TP .B spindle.\fIN\fB.reverse\fR bit out \fR TRUE for reverse rotation. Both forward and reverse are false when the spindle is stopped. .TP .B spindle.\fIN\fB.brake\fR bit out \fR TRUE when decelerating .TP .B spindle.\fIN\fB.zero-speed\fR bit out \fR TRUE when the spindle is stationary .TP .B spindle.\fIN\fB.limited\fR bit out \fR TRUE when the commanded spindle speed is >max or