Skip to content

rs274ngc: reject UVW plane switch and invalid L orientation in cutter comp - #4924

Open
smallwhiteawhite wants to merge 1 commit into
LinuxCNC:masterfrom
smallwhiteawhite:fix-ccomp-plane-and-orientation
Open

smallwhiteawhite wants to merge 1 commit into
LinuxCNC:masterfrom
smallwhiteawhite:fix-ccomp-plane-and-orientation

Conversation

@smallwhiteawhite

Copy link
Copy Markdown
Contributor

Ref #4918 (items 1 and 2 from discussion)

Summary

Add two missing validation checks for cutter radius compensation:

  1. UVW plane switch while cutter comp is active: Interp::convert_set_plane() checked G17, G18, and G19, but omitted G17.1, G18.1, and G19.1, allowing a switch to a UVW plane with cutter comp on and deferring failure to an internal BUG abort on the next motion block.
  2. Out-of-range tool orientation (L > 9) in G41.1/G42.1: Interp::convert_cutter_compensation_on() accepted any non-negative L value without checking L <= 9.

Changes

  • src/emc/rs274ngc/interp_convert.cc:
    • Reject G_17_1, G_18_1, and G_19_1 in Interp::convert_set_plane() when settings->cutter_comp_side != CUTTER_COMP::OFF using NCE_CANNOT_CHANGE_PLANES_WITH_CUTTER_RADIUS_COMP_ON.
    • Reject block->l_number > 9 in Interp::convert_cutter_compensation_on() using "Invalid tool orientation" (consistent with G10 L1 Q).
  • tests/interp/bad/: Add regression tests for G17.1/G18.1/G19.1 with cutter comp active and G41.1 D2 L10.

… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants