Class Spindle
Class for controlling the machine spindle. Responsible for setting speed, direction, spindle operation mode and executing commands.
Inherited Members
Namespace: DotNet.Interpreter.Helper
Assembly: DotNet.Interpreter.Helper.dll
Syntax
public class Spindle
Constructors
Spindle()
Declaration
public Spindle()
Properties
CSS
Flag indicating operation in constant surface speed (CSS) mode
Declaration
public bool CSS { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
true - constant surface speed (CSS) mode
false - constant revolutions per minute (RPM) mode
Command
Current spindle control command.
Declaration
public TNCSpindleCommand Command { get; set; }
Property Value
| Type | Description |
|---|---|
| TNCSpindleCommand |
ConstantCuttingSpeedValue
Speed in constant surface speed (CSS) mode
Declaration
public double ConstantCuttingSpeedValue { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Remarks
Measured in meters per minute or feet per minute, depending on machine settings
Direction
Spindle rotation direction.
Declaration
public bool Direction { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
true = CW (ClockWise) - clockwise
false = CCW (CounterClockWise) - counterclockwise
MaxRPM
Maximum speed in revolutions per minute in CSS mode
Declaration
public double MaxRPM { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Remarks
Limits the maximum spindle rotation speed in RPM when operating in constant surface speed mode
MaxSpeed
Maximum spindle rotation speed.
Declaration
public double MaxSpeed { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Number
Current spindle number.
Declaration
public int Number { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Range
Spindle rotation range number.
Declaration
public int Range { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
RevolutionsPerMinuteValue
Spindle rotation speed in revolutions per minute (RPM) mode.
Declaration
public double RevolutionsPerMinuteValue { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Speed
Current spindle rotation speed (RPM or CSS).
Declaration
public double Speed { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Methods
ExecuteCommand(TNCSpindleCommand)
Executes a spindle control command if the state has changed. Depending on the current command (scOn, scOff, scOrient), corresponding actions are called. After execution, the change flag is reset.
Declaration
public void ExecuteCommand(TNCSpindleCommand command)
Parameters
| Type | Name | Description |
|---|---|---|
| TNCSpindleCommand | command |
Initialize(INCT_CLData, INCT_SpindleState)
Initializes a new instance of the Spindle class for spindle control.
Declaration
public void Initialize(INCT_CLData clData, INCT_SpindleState spindleState)
Parameters
| Type | Name | Description |
|---|---|---|
| INCT_CLData | clData | Interface for interacting with toolpath data |
| INCT_SpindleState | spindleState | Current spindle state |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If |
OrientSpindle()
Performs an oriented spindle stop with the current angle.
Declaration
public void OrientSpindle()
OrientSpindle(double)
Performs an oriented spindle stop with the specified angle.
Declaration
public void OrientSpindle(double angle)
Parameters
| Type | Name | Description |
|---|---|---|
| double | angle | Spindle orientation angle in degrees. |
SetActiveSpindleNumber()
Sets the active spindle number.
Declaration
public void SetActiveSpindleNumber()
StartSpindle()
Starts the spindle rotation with current parameters.
Declaration
public void StartSpindle()
StartSpindle(bool)
Starts the spindle rotation with the specified direction.
Declaration
public void StartSpindle(bool direction)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | direction | Spindle rotation direction (true - clockwise, false - counterclockwise). |
StartSpindle(bool, double)
Starts the spindle rotation with the specified direction and speed in revolutions per minute (RPM).
Declaration
public void StartSpindle(bool direction, double rpm)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | direction | Spindle rotation direction (true - clockwise, false - counterclockwise). |
| double | rpm | Rotation speed in revolutions per minute. |
StopSpindle()
Stops the spindle rotation.
Declaration
public void StopSpindle()