# FIVE-AXIS MACHINING FUNCTION

26

26-4 Workpiece Setup Error Correction: G54.4P0, G54.4P1 to G54.4P7 (Option)
1.

Function outline
This function is provided to compensate for the error in setting a workpiece easily, without
having to rewrite the program section for describing the machining contour, by modifying the
workpiece coordinate system according to the error in question.
Coordinate system to be referred to

Automatic renovation of coordinate system
to compensate for setup error

Workpiece

Workpiece

Workpiece setup error
D740PB0104

2.

Programming format
G54.4 Pn;
n: Number of the data set for workpiece setup error correction (1 to 7)
Enter zero with P (G54.4 P0) to cancel the correction function.
- Be sure to enter the G54.4 command (for selection as well as for cancellation) independently.
If a block of G54.4 should contain any other commands, an alarm is caused (1815 CANNOT
USE G54.4).
- Omission of argument P will lead to an alarm (807 ILLEGAL FORMAT).
Alarm 809 ILLEGAL NUMBER INPUT occurs if argument P is of any other value than 0 to 7.

3.

Definition of workpiece setup coordinate system
The workpiece setup coordinate system is defined by using the following three types of
externally provided data on the setup error.
1.

Linear errors on the orthogonal axes X, Y, and Z (Δx, Δy, Δz)
Specify the origin of the workpiece setup coordinate system with its absolute values in the
current workpiece coordinate system.

2.

Angular errors in rotation around the orthogonal axes (Δa, Δb, Δc)
Specify those angles (Δa, Δb, and Δc) of rotations around the axes X, Y, and Z of the
current workpiece coordinate system, in that order, by which the same orientation as that of
the workpiece setup coordinate system can be obtained.
Positive values of angle refer to the rotation by which a right-handed screw moves in the
positive direction of the third orthogonal axis.

3.

Coordinate of the axis of table rotation during error measurement
Set the machine coordinate of the axis of table rotation during measurement of errors Δx,
Δy, Δz and Δa, Δb, Δc. No setting is required for machines without the controlled axis of
table rotation, while setting for two axes is necessary for five-axis control machines of table
rotating type.

26-59

7 Δx #5801 #5811 #5821 #5831 #5841 #5851 #5861 #5871 Δy #5802 #5812 #5822 #5832 #5842 #5852 #5862 #5872 Δz #5803 #5813 #5823 #5833 #5843 #5853 #5863 #5873 Δa — #5814 #5824 #5834 #5844 #5854 #5864 #5874 Δb — #5815 #5825 #5835 #5845 #5855 #5865 #5875 Δc — #5816 #5826 #5836 #5846 #5856 #5866 #5876 Rotat. A 0. but not for the angular errors (Δa. 4 No. 1 to No. Y. display to prepare the data for workpiece setup error correction. 1 No. Z) Workpiece setup coordinate system (X’. display Use the WORK POSITION ERROR COMP. C –45. Set the coordinate of the axis of table rotation during error measurement. Δb 0. moreover. 15. Y. 7 Δx 5. 7) of workpiece setup errors can be set or prepared for the designation by argument P in a G54. and Z. it is possible to read and write the values used for workpiece setup error correction. 2 #5808 #5818 #5828 #5838 #5848 #5858 #5868 #5878 Use #5800 to read the number (1 to 7) of the currently selected data set for workpiece setup error correction. It is possible. 5 No. No common data can be provided for this type of data items. 1 #5807 #5817 #5827 #5837 #5847 #5857 #5867 #5877 Rotat. axis coord. 3 No. Δy. C 90. WORK POSITION ERROR COMP. 6 No. Values for the linear errors (Δx. Y’. Z’) Δy X Δx 4. Δa 0. Δc 45. A. Set linear errors on the orthogonal axes X. 26-60 . Δb. Δz 0. Set angular errors in rotation around the orthogonal axes. D740PB0105 Setting workpiece setup errors Seven data sets (No. See the relevant section in PART 3 of the Operating Manual. 1 to No. Δy 3.4 block. Common data B. System variables Using variables tabulated below. No. A 0. Δx Δy 0.26 FIVE-AXIS MACHINING FUNCTION Y’ Workpiece with setup errors Y Workpiece in the correct mounting position X’ Δc Workpiece coordinate system (X. 2 No. Δz) and the table’s angular position during measurement can be set as common data. axis coord. Common No. Δc). Δz 10. to prepare a special set of data to be added commonly to each of the numbered data sets. The number of available data items for the table’s angular position and their names depend upon the specifications of the machine in question.

A block of G54. and the POSITION values on the display will be changed accordingly.4 Pn (n = 1 to 7) selects the mode of workpiece setup error correction.4 P0 cancels the mode of workpiece setup error correction. Note 2: Selection and cancellation of the mode of workpiece setup error correction (with G54. Axis motion commands in the G54. n as well as to the current positions on the rotational axes concerned.4 Pn mode are processed in general with respect to the workpiece setup coordinate system.4). Y’ Y Y X’ Δc Δy X Δx X Tool path in the workpiece setup coordinate system (X’ Y’ Z’) Tool path in the workpiece coordinate system (X. 26-61 . but no actual movements occur on the machine. with the positional indication (POSITION values) on the display with respect to the currently valid coordinate system being changed accordingly. Operation in the mode of workpiece setup error correction A block of G54. Operation description A. 26 An attempt to overwrite the system variable #5800 will only lead to an alarm (1821 UNWRITABLE SYSTEM VARIABLE). Note 1: Resetting the NC-unit includes cancellation of the mode of workpiece setup error correction (G54.4) causes the POSITION values on the display to be changed as mentioned above.4 Pn command was given.4). Z) D740PB0106 In the mode of workpiece setup error correction (G54. indeed. The workpiece setup coordinate system will be replaced by the original workpiece coordinate system with reference to which the G54. and causes a workpiece setup coordinate system to be established according to the data set of No. the NC unit controls the tool path by including the program-externally provided data of workpiece setup errors.FIVE-AXIS MACHINING FUNCTION Note: 5. Y.

F500 D740PB0107 26-62 . N2 G91 G1 Y15. and the first motion command after G54. for the first block of axis movement after the selection of the mode of workpiece setup error correction (with G54.4 Y’ Y Y 20 N2 N2 5 N1 N1 X’ X X For incremental data input G54.Y5.F500 N1 G91 G0 X5. N2 G90 G1 Y20.26 FIVE-AXIS MACHINING FUNCTION B. N2 G91 G1 Y15.Y5. Movements for a correctly mounted workpiece Movement command with incremental data after G54. N2 G90 G1 Y20.4P0 must be given with absolute data. This also applies to the cancellation.Y5. Use the method of absolute data input. therefore.4 A block of G54.4 does not cause any actual movements on the machine.4 P1 N1 G90 G0 X5.4).Y5.4 N1 G90 G0 X5.4 P1 N1 G91 G0 X5. Use of incremental data could not move the tool to the expected position. Precautions for the selection and cancellation with G54.F500 Y’ Y N2 N1 X’ X G54.F500 For absolute data input Movement command with absolute data after G54.

FIVE-AXIS MACHINING FUNCTION C. Workpiece setup error correction ON D740PB0108 26-63 . 26 Correction of the tool-axis direction In addition to the translating correction in the XYZ space. an angular correction can be achieved on five-axis control machines. in order to set the tool-axis direction (tool attitude) normal to the surface to be machined. according to the inclination on the rotational axis.

/red. square root.1/G67 Inclined-plane machining G68. G45/G46/G47/G48 Tool length offset OFF G49 Scaling ON/OFF G50/G51 Mirror image ON/OFF G50. trigonometric functions. Relationship to other functions A. Commands available in the mode of workpiece setup error correction Function Code Positioning G00 Linear interpolation G01 Dwell G04 High-speed machining mode G05 Exact-stop G09 Programmed data setting ON/OFF G10/G11 Plane selection G17/G18/G19 Return to zero point G28/G30 Nose radius/Tool radius compensation OFF G40 Tool radius compensation for five-axis machining (to the right/left) G41./double ext. 26-64 .1/G51.5 Tool position offset ext. Common variables. Operation commands (arithmetic operations. B function MSTB Local variables.4 G41.5/G42. S.1 Cutting mode G64 Macro call G65/G66/G66.1-G89/G280-G289 Programmed coordinate rotation OFF G69 Absolute data input G90 Incremental data input G91 Feed per minute G94 Feed per revolution G95 Constant surface speed control OFF G97 Return to Initial point level in hole-machining fixed cycles G98 Return to R-point level in hole-machining fixed cycles G99 Subprogram call/End of subprogram M98/M99 Feed function F M.4 MODE).2/G42. T. WHILE ∼ DO ∼) Macro instructions Note: Giving any other command than those enumerated above in the mode of workpiece setup error correction will lead to an alarm (1814 ILLEGAL CMD IN G54.2 Fixed cycle G71.5 Tool length offset (+/–) G43/G44 Tool tip point control type 1/2 G43.2 Remarks G41.4/G42. Control commands (IF ∼ GOTO ∼.1 High-accuracy control mode (Geometry compensation) G61. etc)./double red.26 FIVE-AXIS MACHINING FUNCTION 6.4/G43.1 Machine coordinate system selection G53 Tool-axis direction control G53.

2P0 High-accuracy control mode (Geometry compensation) G61.1 Tool length offset (+/–) G43/G44 Tool length offset OFF G49 Scaling OFF G50 Mirror image OFF G50.4).FIVE-AXIS MACHINING FUNCTION B.1 Cutting mode G64 Modal macro call OFF G67 Programmed coordinate rotation OFF G69 Fixed cycle OFF G80 Absolute data input G90 Incremental data input G91 Inverse time feed G93 Feed per minute G94 Feed per revolution G95 Constant surface speed control OFF G97 Return to Initial point level in hole-machining fixed cycles G98 Return to R-point level in hole-machining fixed cycles G99 Note: Remarks G00 Selecting the mode of workpiece setup error correction in a mode other than those enumerated above will lead to an alarm (1815 CANNOT USE G54. 26-65 .1 Dynamic offsetting ΙΙ OFF G54.1 Local coordinate system setting G52 Selection of workpiece coordinate system G54-G59/G54. 26 Modes in which workpiece setup error correction is selectable Function Code Positioning Linear interpolation G01 Polar coordinate interpolation OFF G13.1 Polar coordinate input OFF G15 Plane selection G17/G18/G19 Inch/Metric data input G20/G21 Pre-move stroke check OFF G23 Return to zero point G28/G30 Nose radius/Tool radius compensation OFF G40 Shaping function OFF G40.

4 should contain any other commands. an alarm is caused (1815 CANNOT USE G54. otherwise an alarm will be caused (184 ILLEGAL OPER IN G54. 2. as shown in the example below for the use of tool radius compensation. Resetting the NC-unit includes cancellation of the mode of workpiece setup error correction.4P2 (Workpiece setup error correction ON) : : G41D3 (Tool radius compensation ON) Mode of setup error correction : : Mode of radius compensation G40 (Tool radius compensation OFF) : : G54. tool tip point control. Tool path check can only be performed on the basis of the original workpiece coordinate system (without coordinate conversion taken into consideration).4P_ and G54.4 MODE).4P0). 11.4 MODE). In the mode of workpiece setup error correction. in the case of using the [RESTART] and the [RESTART 2 NONMODAL] menu function. Restarting operation from a block in the mode of workpiece setup error correction begins with a movement to the accordingly corrected position and to the position without correction. otherwise an alarm will be caused (1814 ILLEGAL CMD IN G54. system variables #5001 to #5116 for reading positional information refer to the workpiece setup coordinate system.4P0 (Workpiece setup error correction OFF) 5.26 FIVE-AXIS MACHINING FUNCTION C. respectively. Tool radius compensation. G54. Be sure to enter the G54. During interruption of workpiece setup error correction. 9. Do not use corner chamfering or rounding commands in the mode of workpiece setup error correction. and fixed cycle must be selected and cancelled within the mode of workpiece setup error correction (between G54. 4. Do not give any tool change command in the mode of workpiece setup error correction.4 MODE). Tracing in the mode of workpiece setup error correction is displayed with reference to the machine coordinate system. or to use the manual pulse handle will only lead to an alarm (184 ILLEGAL OPER IN G54.4 command (for selection as well as for cancellation) independently. mirroring by G-code.4 MODE). If a block of G54. 10. Manual interruption is always performed on the basis of the machine coordinate system (without any coordinate conversion). 6.4). an attempt to perform manual movements on a rotational axis. while system variables #5021 to #5036 always denote the current position with respect to the machine coordinate system. tool length offset. 8. scaling. Restrictions 1. otherwise an alarm will be caused (1814 ILLEGAL CMD IN G54. 26-66 . inclined-plane machining. After manual interruption of workpiece setup error correction (by or without using the TPS function) do not resume automatic operation without returning the machine components concerned to the original positions on the controlled axes. 7. 3.

) is not compatible with the mode of workpiece setup error correction.FIVE-AXIS MACHINING FUNCTION 26 12.4 MODE).4 MODE The command given (G-code. Do not attempt such an operation. Message Description Remedy 184 ILLEGAL OPER IN G54.4 The mode of workpiece setup error correction is not selectable under the current modal conditions. 1815 CANNOT USE G54. G54.4 is not usable for a machine without the optional function. otherwise an alarm will be caused (1814 ILLEGAL CMD IN G54. etc.4 MODE The operation attempted is not allowed in the mode of workpiece setup error correction. or cancel the error correction mode beforehand to give the command. Related alarms No. 13. 1813 G54. Modify the program so as to establish correct modal conditions for workpiece setup error correction. Divide the command so that the amount of angular movement of any block does not exceed 180°.4 OPTION NOT FOUND The system of machining is not equipped with the optional function for workpiece setup error correction. Delete the incompatible command. T-code. 1820 ILLEGAL COMMD IN G54.4 A block of motion command requires an angular movement through more than 180°. otherwise an alarm will be caused (1820 ILLEGAL COMMD IN G54.4). Do not specify a MAZATROL program as a subprogram to be called up in the mode of workpiece setup error correction. Do not enter a block of motion command which requires an angular movement through more than 180°. 26-67 . 7. 1814 ILLEGAL CMD IN G54.

26 FIVE-AXIS MACHINING FUNCTION .NOTE - 26-68 E .