Skip to content

Commit 1f3ec37

Browse files
authored
Merge pull request #2677 from petterreinholdtsen/2.9-g71-fix-707
Corrected G72 behaviour with no axis movement.
2 parents 844045e + 0982fdb commit 1f3ec37

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

src/emc/rs274ngc/interp_g7x.cc

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,24 @@ int Interp::convert_g7x(int mode,
11911191
try {
11921192
switch(cycle) {
11931193
case 70: path.do_g70(&motion,x,z,d,e,p); break;
1194-
case 71: path.do_g71(&motion,subcycle,x,z,u,w,d,i,r); break;
1195-
case 72: path.do_g72(&motion,subcycle,x,z,u,w,d,i,r); break;
1194+
case 71:
1195+
if(x!=imag(start)) {
1196+
std::complex<double> end{real(start),x};
1197+
path.emplace_back(std::make_unique<straight_segment>(
1198+
start, end
1199+
));
1200+
}
1201+
path.do_g71(&motion,subcycle,x,z,u,w,d,i,r);
1202+
break;
1203+
case 72:
1204+
if(z!=real(start)) {
1205+
std::complex<double> end{z,imag(start)};
1206+
path.emplace_back(std::make_unique<straight_segment>(
1207+
start, end
1208+
));
1209+
}
1210+
path.do_g72(&motion,subcycle,x,z,u,w,d,i,r);
1211+
break;
11961212
}
11971213
} catch(std::string &s) {
11981214
ERS("G7X error: %s", s.c_str());

tests/interp/g72-missing-iteration/expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
N..... STRAIGHT_TRAVERSE(50.1000, 0.0000, -38.9000, 0.0000, 0.0000, 0.0000)
9090
N..... STRAIGHT_TRAVERSE(50.0000, 0.0000, -39.0000, 0.0000, 0.0000, 0.0000)
9191
N..... STRAIGHT_TRAVERSE(50.0000, 0.0000, -40.0000, 0.0000, 0.0000, 0.0000)
92-
N..... STRAIGHT_FEED(100.0000, 0.0000, -39.9990, 0.0000, 0.0000, 0.0000)
92+
N..... STRAIGHT_FEED(100.0000, 0.0000, -40.0000, 0.0000, 0.0000, 0.0000)
9393
N..... STRAIGHT_FEED(100.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
9494
N..... STRAIGHT_TRAVERSE(0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
9595
N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)

tests/interp/g72-missing-iteration/xfail

Whitespace-only changes.

0 commit comments

Comments
 (0)