G49 is a G-code command that cancels the tool length offset (TLO) applied by G43 or G44. TLO is a method of compensating for the difference in length between different tools used in CNC machining. TLO allows the CNC machine to adjust the Z-axis position according to the length of the current tool, so that the programmed coordinates are always relative to the workpiece surface.
Usage Format
The general format of G49 is:
G49
G49 does not require any parameters. It simply cancels the TLO that was previously set by G43 or G44. G49 should be used before changing the tool or at the end of the program to avoid any errors or collisions.
Explanation
G49 is useful when the TLO is no longer needed or when switching to a different tool that has a different length. G49 restores the Z-axis position to the original value before the TLO was applied. This ensures that the CNC machine moves according to the programmed coordinates without any offset.
For example, suppose that the CNC machine has a tool length of 100 mm and a TLO of 10 mm applied by G43. This means that the Z-axis position is offset by 10 mm, so that the tip of the tool is 10 mm closer to the workpiece than the programmed coordinate. If G49 is executed, the TLO is canceled and the Z-axis position is restored to the original value. The tip of the tool is now 10 mm farther from the workpiece than the programmed coordinate.
Example
Here is an example of a CNC program that uses G49 to cancel the TLO:
N10 T1 M06 ; Select tool 1 and change tool
N20 G43 H1 ; Apply tool length offset with tool 1
N30 G00 X0 Y0 Z5 ; Rapid move to X0 Y0 Z5
N40 G01 Z-10 F100 ; Linear move to Z-10 with feed rate 100
N50 G49 ; Cancel tool length offset
N60 T2 M06 ; Select tool 2 and change tool
N70 G00 X10 Y10 Z5 ; Rapid move to X10 Y10 Z5
N80 G01 Z-15 F200 ; Linear move to Z-15 with feed rate 200
N90 M30 ; End of program
In this program, tool 1 has a TLO of 10 mm and tool 2 has a TLO of 15 mm. G49 is used to cancel the TLO of tool 1 before changing to tool 2. This ensures that the Z-axis position is correct for each tool and that the programmed coordinates are followed accurately.