Repository navigation
rs274ngc: reject UVW plane switch and invalid L orientation in cutter comp - #4924
Open
smallwhiteawhite wants to merge 1 commit into
Open
smallwhiteawhite wants to merge 1 commit into
smallwhiteawhite wants to merge 1 commit into
Conversation
… comp Add two missing cutter radius compensation validation checks: 1. In Interp::convert_set_plane(), reject switching to UVW planes (G17.1, G18.1, G19.1) while cutter radius compensation is active using NCE_CANNOT_CHANGE_PLANES_WITH_CUTTER_RADIUS_COMP_ON, instead of deferring failure to an internal BUG abort on the next motion. 2. In Interp::convert_cutter_compensation_on(), reject out-of-range tool orientations (L > 9) on G41.1/G42.1 using "Invalid tool orientation" (matching G10 L1 Q). Add regression tests under tests/interp/bad/ for G17.1, G18.1, G19.1 with cutter comp active and for G41.1 with L10. Ref LinuxCNC#4918
grandixximo
approved these changes
Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref #4918 (items 1 and 2 from discussion)
Summary
Add two missing validation checks for cutter radius compensation:
Interp::convert_set_plane()checkedG17,G18, andG19, but omittedG17.1,G18.1, andG19.1, allowing a switch to a UVW plane with cutter comp on and deferring failure to an internalBUGabort on the next motion block.L > 9) inG41.1/G42.1:Interp::convert_cutter_compensation_on()accepted any non-negativeLvalue without checkingL <= 9.Changes
src/emc/rs274ngc/interp_convert.cc:G_17_1,G_18_1, andG_19_1inInterp::convert_set_plane()whensettings->cutter_comp_side != CUTTER_COMP::OFFusingNCE_CANNOT_CHANGE_PLANES_WITH_CUTTER_RADIUS_COMP_ON.block->l_number > 9inInterp::convert_cutter_compensation_on()using"Invalid tool orientation"(consistent withG10 L1 Q).tests/interp/bad/: Add regression tests forG17.1/G18.1/G19.1with cutter comp active andG41.1 D2 L10.