Siemens G645 and G646: Tolerance-Based Smoothing Modes Guide
Learn to program Siemens G645 and G646 continuous-path modes. Configure MD33120, MD20480, and resolve Alarm 12553 to optimize Sinumerik surface quality.
Introduction
A severe machine collision with fixtures or a turret jaw occurs when continuous-path modes are active during rapid traverse (G0) moves without proper management of exact stop parameters. In multi-channel environments, such as Sinumerik lathe setups, axis coordinate dynamics and exact stops must be perfectly coordinated. Bypassing exact stops strips away positioning guarantees, causing the machine tool to cut corners at high feedrates. This trajectory deviation risks crashing into workholding equipment, leaves deep dwell marks on the workpiece, and halts production. Utilizing closed-loop tolerance-based smoothing helps balance surface quality requirements with axis acceleration limits.
Siemens controls use G645 and G646 to execute tolerance-based smoothing and velocity reduction. Rather than relying on simple corner rounding, the controller dynamically calculates path deviations and bridges curvature transitions. This ensures the continuous-path mode remains fluid, preventing acceleration spikes and protecting machine tool dynamics during complex milling operations.
Technical Summary
| Property | Details |
|---|---|
| Command Code | G645, G646 |
| Modal Group | G Group 10 / Modal |
| Brands | Siemens |
| Critical Parameters | MD33120 $MA_PATH_TRANS_POS_TOL, MD20480 $MC_SMOOTHING_MODE |
| Main Constraint | G646 requires machine software license option (Article number: 6FC5800-0AS37-0YXO) and proper configuration of MD20493. |
Quick Read
- Activate Tangential Smoothing: Use G645 to smooth tangential block transitions and eliminate deceleration spikes at curvature jumps.
- Secure License for G646: Ensure the "Extended continuous-path mode" license option (Article number: 6FC5800-0AS37-0YXO) is active before programming G646 to avoid Alarm 12553.
- Prevent Counter Motion: Set the ten-thousands digit of machine data
MD20480 $MC_SMOOTHING_MODEto 2 to reduce involved circle radii by the tolerance band. - Stretch Deceleration Cycles: Configure parameter
MD20493 $MC_G64_NUM_IPOto define the number of interpolator cycles over which G646 velocity reduction is effective. - Manage Rapid Traverses: Exercise extreme caution using continuous-path modes during G0 moves to avoid corner-cutting and physical collisions.
- Set Tolerance Fallbacks: Program
MD33120as the primary tolerance, knowing that angular, non-tangential corners will automatically fall back to the positional compressor toleranceMD33100.
Basic Concepts
The practical programming effect of Siemens' G645 is a dramatic improvement in surface finish and machine health during complex free-form machining. Standard smoothing (G642) only inserts rounding blocks at physical corners where the velocity of an axis jumps. However, at purely tangential block transitions that suffer from a sudden jump in curvature—such as moving from a straight line into an arc—G642 does nothing. As the machine hits this curvature jump, it suffers a harsh acceleration spike. To respect active jerk limits, the control must drastically throttle the path velocity, extending cycle times and causing dwell marks on the part. G645 actively identifies these tangential curvature jumps and inserts highly precise smoothing movements to ensure acceleration remains completely fluid.
Simultaneously, G646 serves as an aggressive cycle-time optimization tool. Rather than limiting the velocity reduction of a non-tangential corner to a single interpolator cycle, G646 spreads the deceleration over multiple programmed IPO cycles. This LookAhead manipulation allows the machine to bypass sharp, non-tangential transitions much faster without violating drive limits.
Command Structure
The command syntax for Sinumerik tolerance-based smoothing uses G645 and G646 to define how the controller transitions between blocks. G645 applies smoothing dynamically to both tangential and non-tangential transitions while adhering to defined tolerance limits. This allows the tool path to transition smoothly from linear paths to circular interpolation without bringing the axes to a complete stop.
G646 extends this continuous-path mode by distributing velocity reductions across multiple interpolator cycles. This allows the tool to maintain a higher average speed through corners by stretching the deceleration period. Both codes are modal and belong to G Group 10, meaning they remain active in the channel until overridden by another group member like G60 exact stop.
G645
G646
| Parameter | Description | Type / Range |
|---|---|---|
MD33120 $MA_PATH_TRANS_POS_TOL | Maximum contour deviation permitted for smoothing with G645 at tangential transitions. | REAL |
MD20480 $MC_SMOOTHING_MODE | Configures rounding behavior. Programming 2xxxx in the ten-thousands digit reduces involved circles by the set tolerance. | DWORD |
MD20493 $MC_G64_NUM_IPO | Sets the number of interpolator (IPO) cycles over which G646 speed reduction is effective. | INT |
MD33100 $MA_COMPRESS_POS_TOL | Axis-specific fallback maximum path deviation tolerance for angular, non-tangential transitions. | REAL |
Brand Applications
Siemens
Siemens Sinumerik controls utilize G645 and G646 to achieve high-speed smoothing without manual geometry modifications. Setting machine data MD33120 controls the maximum deviation, while MD20480 prevents unintended axis counter motion.
The continuous-path modes are programmed directly as G645 or G646 within the NC code blocks, often combined with look-ahead or compressor commands.
| Element | Details |
|---|---|
| Parameters | MD33120 $MA_PATH_TRANS_POS_TOL (smoothing tolerance), MD20480 $MC_SMOOTHING_MODE (rounding behavior), MD20493 $MC_G64_NUM_IPO (IPO cycles for G646), MD33100 $MA_COMPRESS_POS_TOL (fallback tolerance). |
| Alarms | Alarm 12553 (license missing for G646), Alarm 12550 (function unrecognized/not defined). |
| Versions / Options | Extended continuous-path mode option (license Article number: 6FC5800-0AS37-0YXO) required for G646. Advanced Surface requires G645 as the default pre-configured mode in manufacturer cycle CUST_832.SPF. |
Setting continuous-path mode on rapid traverse moves without managing exact stop behavior risks corner cutting at high speeds. Operators must configure the necessary machine parameters to prevent physical collisions with fixtures, clamps, or turret components during high-feed transitions.
Brand Comparison
| Siemens Mode / Option | Function & Curvature Detection | Deceleration Management | Licensing & Implementation |
|---|---|---|---|
| G645 (Advanced Surface) | Provides native, controller-level curvature detection at tangential block transitions, inserting precise smoothing blocks to eliminate acceleration spikes. | Corner-bypassing velocity is constrained by axis dynamics and MD33120. Falls back to MD33100 at angular corners. | Standard/pre-configured inside cycle CUST_832.SPF; mandatory for 3- to 5-axis free-form surface machining. |
| G646 (Extended Continuous-Path) | Enables extended continuous-path control with velocity reduction based on overload factors. No native tangential smoothing. | Allows operators to stretch deceleration across multiple custom-defined IPO cycles via MD20493. | Requires a dedicated machine software option license (Article number: 6FC5800-0AS37-0YXO). |
| G642 (Standard Continuous-Path) | Smoothes only transitions that form a physical corner (axis velocity jump). Does not insert rounding blocks at tangential transitions with curvature jumps. | Velocity reduction occurs over a single interpolator cycle, which can cause severe deceleration and cycle-time penalties. | Standard basic function, no additional software license required. |
Technical Analysis
Analytically, the differences in Siemens continuous-path modes lie in how they manage axis acceleration and deceleration. With G642, the controller only rounds physical corners where an axis velocity jump occurs, ignoring tangential transitions that have curvature jumps. This results in harsh acceleration jumps and velocity throttling. Under G645 (Advanced Surface), the control actively detects these tangential curvature jumps and inserts precise rounding movements to maintain fluid acceleration. The smoothing path deviation is dictated by machine data MD33120. If G645 encounters an angular, non-tangential corner where tangential smoothing is mathematically impossible, the control automatically utilizes MD33100 as a secondary fallback tolerance, avoiding program interruptions.
In contrast, G646 is optimized for cycle-time reduction by altering the LookAhead deceleration behavior. While G645 and G642 restrict deceleration to a single interpolator cycle, G646 allows programmers to configure MD20493 to stretch this deceleration over multiple IPO cycles. This LookAhead extension allows the machine to traverse non-tangential, sharp transitions much faster without exceeding axis acceleration limits. However, G646 requires a software option license, and attempting to execute it on an unlicensed machine will halt execution.
Program Examples
N10 G94 ; Active linear feedrate mode
N20 SOFT ; Enable soft acceleration profile to activate jerk limits
N30 G645 ; Enable continuous-path mode with tangential smoothing
N40 G0 X0 Y0 Z10 ; Rapid approach to starting position
N50 COMPCAD G1 Z-2 F12000 ; Activate compressor function with G645 smoothing
N60 X50 Y0 ; Linear machining path
N70 G2 X100 Y50 CR=50 ; Circular interpolation, G645 rounds transition to avoid jerk
N80 G1 X150 Y50 ; Linear transition
N90 G646 Z5 F20000 ; Transition to G646 extended continuous-path mode
N100 G0 X0 Y0 Z50 ; Retract to home position
N110 G60 ; Reset to exact stop mode
Dry Run Walkthrough:
dry run: Program execution without a workpiece or cutting tool allows verification of the smoothing behavior and axis transition velocities. In block N10, linear feedrate mode G94 is activated. Block N20 enables the SOFT acceleration profile to activate the internal jerk limits. Block N30 commands G645, enabling the tolerance-based smoothing mode with LookAhead. Block N40 commands rapid positioning to Z10. In block N50, the COMPCAD compressor function is engaged with G645 at a high feedrate of 12,000 mm/min. As the tool moves through blocks N60, N70, and N80, the axes transition from linear moves into circular interpolation. G645 dynamically calculates the tangential transitions, keeping acceleration fluid and preventing axis velocity drops. At block N90, the program switches to G646 extended continuous-path mode for rapid Z-axis retraction. Finally, block N110 returns the controller to exact stop mode, ensuring the machine halts precisely at the home position.
Error Analysis
| Brand | Alarm / Error State | Trigger Condition | Root Cause & Operator Action |
|---|---|---|---|
| Siemens Sinumerik | Alarm 12553 | G646 is programmed in the active NC block but the "Extended continuous-path mode" license option is not purchased or enabled on the control. | The software license option is missing. The operator must either correct the code to G645/G642 or purchase/activate the required option (Article number: 6FC5800-0AS37-0YXO). |
| Siemens Sinumerik | Alarm 12550 | G646 is programmed but the command is unrecognized by the control's current interpreter state due to lack of option enablement. | The function is completely unrecognized. Ensure correct command syntax, verify that the option is active, or change the continuous-path mode to G645. |
| Siemens Sinumerik | Unintended Counter Motion | Programmed circle contours experience rounding deviation that shifts the path outward, causing path movements to conflict with workpiece walls. | MD20480 $MC_SMOOTHING_MODE ten-thousands digit is not configured. The operator must set this parameter to 2xxxx to mathematically reduce the circle radius by the tolerance clearance. |
| Siemens Sinumerik | Corner Cutting Collision | Continuous-path mode is active during a rapid traverse (G0) block, resulting in the tool holder colliding with fixtures or chuck jaws. | Exact stop behavior (MD20734) is not properly managed during rapid traverses, causing the controller to cut corners. Verify machine data and ensure exact stop is active before high-speed moves. |
Application Note
A severe machine collision with fixtures or a turret jaw occurs when continuous-path modes are active during rapid traverse (G0) moves without proper management of exact stop parameters. In multi-channel environments, such as lathe setups utilizing a double turret enabled via G68, dynamics and feed modes must be synchronized across channels to keep LookAhead functioning. Bypassing exact stops strips away positioning guarantees, causing the machine tool to cut corners at high feedrates. This trajectory deviation risks crashing into workholding equipment, leaves deep dwell marks on the workpiece, and halts production. Setting the ten-thousands digit of machine data MD20480 to 2xxxx ensures the smoothed contour runs safely on the inner side of the tolerance band. Programmers must configure MD33120 for primary tolerance and verify G646 licensing to prevent sudden halts and scrapped parts.
Related Command Network
- G64 (Continuous-Path Mode): Activates standard continuous-path machining, which G645 and G646 build upon by adding tolerance-based smoothing.
- G60 (Exact Stop): Disables continuous-path modes like G645, forcing the machine to come to a complete standstill at block boundaries.
- CYCLE72 (Contour Milling): Sinumerik contour milling cycle that frequently operates under G645 smoothing to achieve high-quality surface finishes on free-form paths.
- COMPCAD / COMPSURF (Compressor Functions): Advanced compressor algorithms frequently paired with G645 to maximize surface quality during CAD-generated contour execution.
- CTOL / OTOL (Contour and Orientation Tolerances): Commands used to dynamically program the active contour and orientation tolerances that G645 obeys.
Conclusion
Achieving optimal surface quality and cycle times on Sinumerik controls requires coordinating G645 and G646 with machine dynamics. Use G645 with compressor functions for high-speed free-form milling while configuring MD20480 to prevent contour deviations. When using G646, verify the option license and set MD20493 to stretch deceleration cycles safely.
Frequently Asked Questions
Why does G646 trigger Alarm 12553 on Siemens Sinumerik controls?
This alarm triggers because the "Extended continuous-path mode" software option is not active on your machine. To resolve this, check your controller license status for Article number: 6FC5800-0AS37-0YXO, or modify your NC program to use G645 or G642 smoothing which do not require this license.
How can I prevent "counter motion" when smoothing circles with G645?
Counter motion occurs when the smoothed path shifts to the outer side of the tolerance band. To fix this, change the ten-thousands digit of channel-specific machine data MD20480 $MC_SMOOTHING_MODE to 2 (e.g., 2xxxx) to automatically reduce the radius of involved circles by the tolerance value, keeping the tool on the inner side of the band.
What is the difference between MD33120 and MD33100 during G645 smoothing?
MD33120 $MA_PATH_TRANS_POS_TOL specifies the tolerance for tangential, curved transitions where axis velocity remains smooth. If G645 encounters an angular, non-tangential corner, it falls back to the compressor tolerance in MD33100 $MA_COMPRESS_POS_TOL. Ensure both parameters are set to match your part tolerances.
Still not resolved?
Ask our AI assistant about this topic in natural language. Grounded in verified sources, no hallucinations.

- CNC CARE Co-Founder (May 2025 - Present)
- Mitsubishi Electric NC Sales & Service Section Manager (2008 - 2025)
- Reis CNC Service Engineer (2003 - 2005)
- Ören Kalıp CNC Mold Line Team Leader (1999 - 2002)
With over 25 years of experience working in all areas of the CNC machine industry, I continue my activities as a co-founder of CNC CARE, where we offer brand-independent consulting, engineering, and original spare parts services.
Related Articles
Other articles on this topic
Arithmetic Functions in CNC Macros: SIN, COS, and SQRT Guide
Master arithmetic functions like SIN, COS, and SQRT in Fanuc, Siemens, and Mitsubishi CNC macros to calculate parametric toolpaths and prevent FPU errors.
Argument Assignment in CNC Macro Calls: G65 and G66 Guide
Master G65 and G66 macro argument assignment on Fanuc, Siemens, and Mitsubishi. Prevent hard tool collisions, format variables, and avoid alarm PS0129.
Logical Operators in CNC Macros: IF, WHILE, and GOTO Guide
Master Fanuc, Siemens, and Mitsubishi CNC macro logical operators. Prevent crashes by configuring parameters, nested loops, and look-ahead buffers safely.
Siemens R Parameter Programming: Guide to Arithmetic Variables
Master Siemens SINUMERIK R parameters. Configure MD28050, run synchronized actions with $R, and troubleshoot alarm 61696 to prevent axis crashes of tools.