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 calculated automatically. 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).

Machining on an inclined plane
Machining on an inclined plane

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:

1st 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).

Definition of a CS by 3 rotations referred to the new axes
Definition of a CS by 3 rotations referred to the new axes

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.

Definition of a CS by 3 rotations about fixed axes in space
Definition of a CS by 3 rotations about fixed axes in space

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.

Syntaxof 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 and reference point offsets may be programmed in the CS during machining. However, these values are only valid until the CS is deselected and are not saved. The axis designations are retained in the CS.

Programing Example

prg_example

Example 1

N005 P1 = 2

N010 #CS DEF [1][P1,15,5,20,30,45] (Define and store a CS)
                                   (under 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 (ID 2))

                (Then the CS is deleted with ID 2)

:

N400 M30

Programing Example

prg_example

Example 2

N05 P1 = 2

N10 #CS DEF [3][P1,15,5,2,3,4.5]     (Define and store)
                                     (a CS with ID 3)

N20 #CS DEF [2][P1,15,5,2,3,4.5]     (Define and store)
                                     (a CS with ID 2)

N30 #CS DEF [5][0,1,2,0,30,30]       (Define and store)
                                   (a CS with ID 5)

N30 #CS ON                           (Activate the CS with the)
                                     (last ID 5 programmed)

:

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

prg_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 a corresponding #CS OFF.

It is permitted to select combined CS’s with and without CS IDs but this is not recommended for the sake of 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 with)
                            (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 with)
                            (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 the CS with ID 2, then the CS is)

                (deleted with ID 2.)

->(CS remains active with ID 1 with a rotation of 20° about Z)

:

N200 #CS OFF    (Deselect the CS with ID 1, then the CS is)

                (deleted with ID 1 and all CS’s are deselected.)

:

N400 M30

Programing Example

prg_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=XYZ] ;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