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 Rotation sequence: |
#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 Rotation mode: |
#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“.
Programming Example
Example 1
(and ID 1)
Programming Example
Example 2
(a CS under ID 3)
(a CS under ID 2)
(a CS under ID 5)
(last programmed ID 5)
Programming 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):
(automatically defined ID 1)
(automatically defined ID 2)
Programming Example
Changing the rotation mode and rotation sequence