Skip to main content

Preprocessing

G-Code: G40, G41, G42, G43, G50, G51, G52, G60, G61, G70, G71

Function: The commands activate preprocessing modules, such as SMC_SmoothPath, SMC_RoundPath, SMC_AvoidLoop, SMC_ToolCorr, SMC_ToolLengthCorr, and SMC_ToolRadiusCorr.

Tip

If the Show preprocessed path option is selected, then the edited path is visible in the graphical editor.

Syntax

G40
G41 D
G42 D
G50
G51 D
G52 D
G60
G61

G Code Word

Description

D

Tool radius or overlay radius for G51/G52.

Note

For versions before 4.18.0.0: The angle rounding/smoothing (G51/G52) and tool radius correction (G41/G42) can influence each other because both preprocesses interpret each D word in the G code. For example, if a tool radius correction with radius=1 is active when an angle rounding starts with D=5, then as a result the tool radius correction also uses a radius of 5.

For version 4.18.0.0 and higher: Angle rounding/smoothing (G51/G52) and tool radius correction (G41/G42) can be used simultaneously without affecting each other. The following behavior applies for this.

  • For tool radius correction (G41/G42): By default, the 'Tool' radius used by SMC_ToolRadiusCorr is 0. If a D word is specified after the G words G41/G42, then the 'Tool' radius is adjusted and taken into account by the function blocks. When no value is specified, the currently set 'Tool' radius is used.

  • For angle rounding/smoothing (G51/G52): By default, the 'Smooth' radius used by SMC_Round/SmoothPath is 0. If a D word is specified after any G word (except G36/G37/G40/G41/G42) or on its own (for example, N00 D5), then this affects the current 'Smooth' radius and is taken into account by the SMC_Round/SmoothPath function blocks.

Table 51. Commands for tool correction

G Code

Description

G40

End of tool radius correction

G41

Start of tool radius correction to the left of the workpiece

G42

Start of tool radius correction to the right of the workpiece

G43

Starts the tool length correction

The tool offset to be corrected is specified with the I, J, K parameters (for X, Y, Z). The tool length correction is deactivated by setting the parameters to zero. After activation or deactivation, ramping in or out is performed.

For more details, see: SMC_ToolLengthCorr

Note: The length of the tool must not change during an active tool radius correction because a jump in the path can result.

The tool length correction (G43) works in the online decoder only (not in the CNC editor).



Table 52. Commands for angle rounding and angle smoothing

G Code

Description

G50

End of angle rounding and smoothing

G51

Start of angle smoothing by means of SMC_SmoothPath

G52

Start of angle rounding by means of SMC_RoundPath

G70

End of smoothing of additional axes by means of SMC_SmoothAddAxes

G71

Start of smoothing of additional axes by means of SMC_SmoothAddAxes



Table 53. Commands for loop suppression

G Code

Description

G60

End of function for loop suppression

G61

Start of function for loop suppression by means of SMC_AvoidLoop



Example 39. Example: Angle smoothing
N0 G51 D10 F100
N10 G01 X$g_x$ Y0 F50 E30 E-30
N20 G01 X0 Y$g_y$
N30 G01 X0 Y0
N40 G50