Definition of a machining coordinate system (CS)

Definition and storage of a CS:

#CS DEF [ [<CS-ID>] ] [<v1>,<v2><v3><ϕ1>,<ϕ2>,<ϕ3>] (modal)

Definition and storage with simultaneous activation:

#CS ON [ [<CS-ID>] ] [<v1>,<v2><v3><ϕ1>,<ϕ2>,<ϕ3>] (modal)
#CS ON [ <CS-ID> ] Selection of a stored CS (modal)
#CS ON Selection of the CS last defined (modal)
#CS OFF Deselection of the CS last activated (modal)

Parameter CS-ID may not be programmed here since only deselection of the CS last activated is allowed.

<CS-ID> Coordinate system ID. The CS-ID is assigned the default value 1 on program start. If at #CS DEF respectively #CS ON the CS-ID is not programmed, the next free CS-ID is calculated automatically. CS programmed in this way are not available again after deselection with #CS OFF!

<vi> Components of the translatory shift vector. (These refer to the main axes in the sequence in the case of G17).

< ϕi> Angle of rotation.

A CS is characterized by the relative offset (V2 in Fig. 16.5) and the rotation with respect to the current work piece coordinate system (WKS). Current zero offset, clamp position offset, and coordinate preset (V1 in Fig. 16.5) determine the position of the BKS with respect to the machine coordinate system (MKS).

Definition of a machining coordinate system (CS) 1:
Fig. 16.5: Machining at an inclined plane

The rotations ϕ1, ϕ2 and ϕ3 are performed in mathematical positive direction (Fig. 16.6) in the following sequence:

1st rotation at angle ϕ3 around the 3rd axis (for example z)

2nd rotation at angle ϕ2 around the new 2nd axis (for example y´)

3rd rotation at angle ϕ1 around the new 1st axis (for example x´´)

(The stated sequence of the axes thereby always corresponds to the sequence of the main axes at G17 respectively), independent of currently selected G17/G18/G19.

Definition of a machining coordinate system (CS) 2:
Fig. 16.6: Definition of a machining coordinate system (CS) by one shift and three rotations

The position (with respect to the current WKS) of a CS that has been defined via #CS DEF <[CS-ID]> [...] or CS ON <[CS-ID]> [...] is stored and can be re-selected via #CS ON without a specification of parameters. If the overall shift in the MKS has been modified in the meantime, the CS will have a new position with respect to the MKS however.

Zero offset and coordinate preset may be programmed during machining in the CS. These values are only valid until the CS is de-selected; they will not be saved.

The axis designations are retained in the CS.

Programming example 1

N005 P1 = 2 
N010 #CS DEF [1][P1,15,5,20,30,45] (Definition and activation of a CS)
(under ID 1:)
(Relative shifts: X2, Y15, Z5)
(Rotations: 45°around Z, 30°around Y')
(20°around X'')
N020 #CS ON[1] (Activation of CS with ID 1)
:
:
N100 #CS OFF (De-activation of CS with ID 1)
:
:
N200 P1=10
N210 #CS ON [P1,15,5,2,3,60] (Definition and activation of a CS)
(under the automatically defined ID 2)
:
:
N300 #CS OFF (Deselection of the latest activated CS (ID2))
(After that the CS with ID2 is deleted!)
:
N400 M30

Programming example 2

N5 P1 = 2
N10 #CS DEF [3][P1,15,5,2,3,4.5] (Definition and storage of a CS (ID 3))
N20 #CS DEF [2][P1,15,5,2,3,4.5] (Definition and storage of a CS (ID 2))
N30 #CS DEF [5][0,1,2,0,30,30] (Definition and storage of a CS (ID 5))
N30 #CS ON (Activation of a CS with the lastly) (programmed ID 5)
.
N50 #CS OFF
N60 #CS ON [3] (Activation of the CS with ID 3)
.
N80 #CS OFF
N90 #CS DEF [3][1,1.2,1.3,0,0,33] (Redefinition of the CS with ID 3)
.
M30

Programming example 3

If several coordinate systems were selected one after the other for example with CS ON [...] (without CS_ID), they form a chained new total CS. This must be deselected step by step by corresponding #CS OFF.

The combined CS selection with and without CS id's is allowed, but it is not recommended for the reason of NC program clarity.

Example for a multiple programming of CS (without CS_ID):

N010 #CS ON [0,0,0,0,0,20] (Definition and activation of a CS under)
(the automatically defined ID 1)
(No shifts, only rotation 20°around Z)
:
:
N050 #CS ON [0,0,0,0,0,30] (Definition and activation of a CS under)
(the automatically defined ID 2)
(No shifts, only rotation 30° around Z)
->(The result is a CS with a total rotation of 50° around Z)
:
N100 #CS OFF (Deselection of CS with ID 2, after that the CS)
(with ID 2 is deleted!)
->(CS with ID 1 with a rotation of 20° around Z remains active)
:
:
N200 #CS OFF (Deselection of CS with ID 1, after that the CS)
(with ID 1 is deleted and all CS are deselected!)
:
:
N400 M30