# Spindle speed (S)

Syntax:
<spindle_name> .. | modal

<spindle_name>.. | Designation of the main spindle as per P-CHAN-00053 with spindle speed in [rpm]

In the configuration, the main spindle can be assigned a string in the channel parameter list (P-CHAN-00053). In order to avoid ambiguities, there must be an equals sign in front of the speed entry after all spindle names consisting of more than one character.

Values can be assigned to the S word directly or by means of parameters. Decimal numbers are also permitted (REAL format).

A distinction is made between the following types of use of the S word in conjunction with spindle M functions:

1. S word in conjunction with M03, M04, M19:
   If the S word or the string used for it is programmed in conjunction with M03/M04 or M19, the value following the S word is interpreted as the spindle speed and is output to the spindle.
2. S word in conjunction with M05:
   The value following the S word is adopted as the spindle speed in the working data in conjunction with M05, but it is not output to the spindle.

The S word alone does not generate a motion in the NC program. This requires that a spindle mode M03, M04, M19 is known. Accordingly, programming M03, M04 and M19 only causes motion when the S word is set (> 0, analogous to G01, G02 and G03 in which traversing only occurs when the feedrate and the axes to be traversed are specified).

## Notice

In the case of a negative S value, an error message is output.

A negative S value is only permitted in conjunction with G63 (tapping) since it triggers reversal of the direction of rotation on withdrawal out of the thread bore.

## Programing Example

Programming with spindle S

N10 S300 (Speed 300 rpm is stored)

N20 M04 (Spindle rotation ccw at 300 rpm)

N30 M03 S1000 (Spindle rotation cw at 1000 rpm)

N40 S500 (M03 active, spindle rotation cw at 500 rpm)

N50 M05 S100 (Spindle stop, speed 100 rpm is stored)

N60 M04 (Spindle rotation ccw at 100 rpm)

N70 M05 (Spindle stop)

N80 M30 (Program end)

Channel parameter list [1]:

The synchronisation mode must be defined spindle-specific for the S word. An error message is generated in the case of synchronisation mode "0” (NO_SYNCH) since an S word may not be ignored.

:

spindel[0].bezeichnung S1

spindel[0].log_achs_nr 6

spindel[0].s_synch 0x00000001

spindel[0].m3_synch 0x00000002

spindel[0].m4_synch 0x00000002

spindel[0].m5_synch 0x00000008

spindel[0].m19_synch 0x00000001

## Programing Example

Spindle speed (S word)

N10 M03 S100 (Spindle rotation at 100 rpm)

N20 M19 S.POS90 (At 100 rpm cw to position 90)

N30 M04 (Spindle rotation ccw at 100 rpm)

N40 M19 S200 S.POS 180 (At 200 rpm cw to position 180)

N50 M05 S150 (Spindle stop, speed 150 rpm)

(is stored)

N60 M19 S.POS=135 (Position at 150 rpm on)

(the shortest path to position 135.)

N70 M03 S300 (Spindle rotation cw at 300 rpm)

N80 M19 S200 S.POS270 (At 200 rpm cw to position 270)

N90 M03 S400 S.POS45 (Spindle rotation cw at 400 rpm,)

(position 45 is stored)

N100 M19 (At 400 rpm cw to position 45)

N110 M04 S800 (Spindle rotation ccw at 800 rpm)

N120 S1200 (Spindle rotation ccw at 1200 rpm)

N130 M5 (Spindle stop)

N140 M03 (Spindle rotation cw at 1200 rpm)

N150 M19 (At 1200 rpm cw to position 45)