Defining a machining coordinate system (#CS DEF, #CS ON/OFF, #CS MODE ON/OFF)
Syntax of CS programming |
Defining and storing a CS: #CS DEF [ [<CS-ID>] ] [ <v1>,<v2>,<v3>,<φ1>,<φ2>,<φ3> ]
Define and store with simultaneous activation: #CS ON [ [<CS-ID>] ] [ <v1>,<v2>,<v3>,<φ1>,<φ2>,<φ3> ] |
#CS ON [<CS-ID>] | Select a stored CS |
#CS ON | Select the last CS defined |
#CS OFF | Deselect the last CS activated The CS-ID parameter may not be programmed here since it is only permitted to deselect the last CS activated. |
<CS-ID> | Coordinate system ID. The CS-ID is assigned the default value 1 at program start. If the CS-ID is not programmed with #CS DEF or #CS ON, the next free CS-ID is determined instead. However, a CS of this type is not longer available after it is deselected with #CS OFF! At the same time, a maximum of 5 CS definitions can be stored. |
<vi> | Components of the translatory offset vector in [mm, inch]. (They refer to the main axes in the sequence contained in G17). |
<φi> | Angle of rotation in [°]. |
| Note: Separate the translation and rotation components by commas. Gaps in the sequence can be marked by consecutive commas ", ,". However, to improve legibility, we recommend programming these components with 0. Example: [,,10,,,45] ↔ [0,0,10,0,0,45] Abbreviated programming of components is also permissible: Example: [0,0,10] translation only [0,0,10,0,30] rotation with 2 rotation angles |
#CS OFF ALL | Deselect all machining coordinate systems CS |
A CS (PCS processing coordinate system) is characterised by the relative offset (V2 in figure below) and the rotation relative to the current work piece coordinate system (WCS). Current zero offset, clamp position offset and reference point offset (V1 in figure below) determine the position of the CS relative to the machine coordinate system (MCS).
Default setting of rotation sequence and rotation mode:
If the rotations φ1, φ2 and φ3 are defined, they are executed in the default setting in the mathematical positive direction (figure below) in the sequence as listed below:
1. rotation at angle φ3 about the 3rd axis (e.g. z)
2nd rotation at angle φ2 about the new 2nd axis (e.g. y´)
3rd rotation at angle φ1 about the 1st axis (e.g. x´´)
This rotation sequence is also referred to as YAW - PITCH - ROLL. The rotations always refer here to the new axes of the currently rotated CS (rotation mode).
(The specified axis sequence of the axes always corresponds to the sequence of the main axes at G17, irrespective of G17/G18/G19).
Free definition of rotation sequence and rotation mode:
Every orientation in space can be reached by concatenating three basic rotations. There are 6 possible rotation sequences about two axes (known as classic Euler angles) and 6 rotation sequences about 3 axes (known as Tait-Bryan angles).
Rotations either refer to fixed axes in space (extrinsic rotation) or to the new axes of the currently rotated CS (YAW, intrinsic rotation). The figure below shows this difference compared to the figure above.
The rotation sequence can be configured with P-CHAN-00394. The configured rotation sequence can be changed in the NC program by the following command.
Syntax of |
#CS MODE ON [ROTATION_SEQUENCE=<rot_sequence>] |
<rot_sequence> | Rotation sequence as string according to: | |
| Euler angles | Tait-Bryan angles |
| XYX, XZX, YXY, YZY, ZXZ, ZYZ | XYZ, XZY, YXZ, YZX, ZXY, ZYX (default) |
Syntax of Deselecting and restoring the default setting: | ||
#CS MODE OFF [ROTATION_SEQUENCE] |
The rotation mode is also configure by P-CHAN-00393. The configured rotation sequence can be changed in the NC program by the following command.
Syntax of |
#CS MODE ON [ROTATION_MODE_FIXED] |
ROTATION_MODE_FIXED | Rotation about (fixed) axes in space of the coordinate system at rotation state |
Syntax of Deselecting and restoring the default setting: |
#CS MODE OFF [ROTATION_MODE_FIXED] |
Without #CS MODE OFF [...] all settings remain active until main program end (M30) or RESET. After next program start, the default settings are again valid.
A CS that has been defined via #CS DEF [<CS-ID>] [...] or CS ON [<CS-ID>] [...] is stored in relation to its position with respect to the current MCS and can be re-selected via #CS ON [<CS-ID>] without a specification of parameters. However, if the overall offset in the MCS is modified in the meantime, the CS has a new position relative to the MCS.
Zero offsets, reference point offsets and actual value offsets may be programmed in the CS during machining. However, these are valid only up to cancellation of the CS and are not stored. The axis designations are retained in the CS. For more information, see Section “Offsets in the coordinate system“.
Programing Example
Example 1
N005 P1 = 2
N010 #CS DEF [1][P1,15,5,20,30,45] (Define and save a CS)
(and ID 1)
(Relative offsets: X2, Y15, Z5)
(Rotation Z:45° Y':30° X'':20°)
N020 #CS ON[1] (Activate CS with ID 1)
:
N100 #CS OFF (Deselect CS with ID 1)
:
N200 P1=10
N210 #CS ON [P1,15,5,2,3,60] (Define and activate a CS)
(with the automatically defined ID 2)
:
N300 #CS OFF (Deselect the last CS activated (ID2))
(Then the CS is deleted with ID 2)
:
N400 M30
Programing Example
Example 2
N05 P1 = 2
N10 #CS DEF [3][P1,15,5,2,3,4.5] (Define and save)
(a CS under ID 3)
N20 #CS DEF [2][P1,15,5,2,3,4.5] (Define and save)
(a CS under ID 2)
N30 #CS DEF [5][0,1,2,0,30,30] (Define and save)
(a CS under ID 5)
N30 #CS ON (Activate the CS with)
(last programmed ID 5)
:
N50 #CS OFF
N60 #CS ON [3] (Activate CS with ID 3)
:
N80 #CS OFF
N90 #CS DEF [3][1,1.2,1.3,0,0,33] (Redefine the CS with ID 3)
:
M30
Programing Example
Example 3
If several coordinate systems are selected in succession, e.g. with CS ON [...] (without CS_ID), they form a new linked total CS. This must be deselected step by step by corresponding #CS OFF.
It is permitted to select the combined CS with and without CS IDs but it is not recommended for the sake of NC program clarity.
Example of multiple programming of CS (without CS_ID):
N010 #CS ON [0,0,0,0,0,20] (Define and activate a CS under)
(automatically defined ID 1)
(No offsets, only rotation 20° about Z)
:
N050 #CS ON [0,0,0,0,0,30] (Define and activate a CS under)
(automatically defined ID 2)
(No offsets, only rotation 30° about Z)
->(This results in a total CS with a rotation of 50° about Z)
:
N100 #CS OFF (Deselect CS with ID 2, then the CS)
(deleted with ID 2.)
->(CS remains active with ID 1 with a rotation of 20° about Z)
:
N200 #CS OFF (Deselect CS with ID 1, then the CS)
(deleted with ID 1 and all CS are deselected.)
:
N400 M30
Programing Example
Changing the rotation mode and rotation sequence
Switching over from rotations about fixed axes (extrinsic rotation)
:
#CS MODE ON [ROTAION_MODE_FIXED ;Rotation about fixed axes
#CS MODE ON [ROTATION_SEQUENCE=XYZ] ;Rotation about axes X->Y->Z
#CS ON [0,0,0,90,0,90] ;Rotation X:90° Y:0° Z:90°
:
#CS OFF
#CS MODE OFF [ROTATION_SEQUENCE] ;Return to rotation sequence ZYX
#CS MODE OFF [ROTAION_MODE_FIXED] ;Deselect rotation mode about fixed axes
:
Switching over to rotations about new axes (intrinsic rotation)
:
#CS MODE ON [ROTATION_SEQUENCE=XZX] ;Rotation about axes X->Z'->X''
#CS ON [0,0,0,90,0,90] ;Rotation X:90° Y:0° Z:90°
:
#CS OFF
#CS MODE OFF [ROTATION_SEQUENCE] ;Return to rotation sequence ZYX