Mod: Spindle function
DerkHBos opened this issue · comments
Add new spindle configurations to sinumerik program generator
For a normal NC program – 3d printing – you have to add the following lines at the beginning of your program:
SPCON ; Switch spindle from speed control to position control (position-controlled spindle ON)
G90 G1 C0 F10000 ; Moves the C-axis to the zero position with a speed of 10.000 degrees per minute.
If you want to use the C-axis for milling – like a CNC machine – you need the following code lines
SPCOF ; Switch spindle from position control to speed control (position-controlled spindle OFF)
M3 ; Direction of spindle rotation clockwise
M4 ; Direction of spindle rotation counterclockwise
M5 ; Stops the rotation of the spindle
S25; Sets the speed of the spindle in RPM (max. is 25 RPM).
Example code for milling/polishing:
G500 ; Machine coordinate system
G54 ; Work offset
SPCOF ; Switch spindle from position control to speed control (position-controlled spindle OFF)
M3 S20 ; Rotate spindle clockwise with 20 RPM
G1 G90 X2000 Y500 Z100 ; Move to position
G1 G90 X2500 Y1500 Z100 ; Move to position
M5 ; Stops rotation of the spindle
To use the spindle you also have to enable the spindle on the physical panel of the SINUMERIK. The button is located at the left of the feedrate button. Be aware that for positioning the spindle with a certain feedrate you have to define the feedrate F in degrees per minute. For using the spindle as a milling device you define the speed of rotation in RPM.