From ebe72ea3af3b2ab52d797d8100c635f68722100e Mon Sep 17 00:00:00 2001 From: Max Gaukler Date: Sun, 10 Nov 2024 10:40:48 +0100 Subject: [PATCH] Grbl: Change to CRLF line ending for better compatibility Grbl accepts any kind of line ending. The FludNC fork of Grbl only accepts CRLF and LF. https://github.com/t-oster/VisiCut/issues/734#issuecomment-2417528152 --- .../liblasercut/drivers/Grbl.java | 6 +- ....thomas_oster.liblasercut.drivers.Grbl.out | 77 ++++++++++++++++++- 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/thomas_oster/liblasercut/drivers/Grbl.java b/src/main/java/de/thomas_oster/liblasercut/drivers/Grbl.java index 54ac7765..43ac8e72 100644 --- a/src/main/java/de/thomas_oster/liblasercut/drivers/Grbl.java +++ b/src/main/java/de/thomas_oster/liblasercut/drivers/Grbl.java @@ -36,7 +36,11 @@ public class Grbl extends GenericGcodeDriver public Grbl() { //set some grbl-specific defaults - setLineend("CR"); + // Line ending + // Grbl accepts CR, CRLF and LF. + // FluidNC accepts CRLF and LF. + // So we use CRLF for best compatibility. + setLineend("CRLF"); setIdentificationLine("Grbl"); // Grbl uses "ok" flow control setWaitForOKafterEachLine(true); diff --git a/test-output/de.thomas_oster.liblasercut.drivers.Grbl.out b/test-output/de.thomas_oster.liblasercut.drivers.Grbl.out index adf20a44..5b7d0c0f 100644 --- a/test-output/de.thomas_oster.liblasercut.drivers.Grbl.out +++ b/test-output/de.thomas_oster.liblasercut.drivers.Grbl.out @@ -1 +1,76 @@ -G21 G90 M3 G0X0.508000Y0.508000S0 G1X25.4Y50.8S1000F1200 G1X50.8Y0 G0X101.600000Y0.000000S0 G1X76.2Y5.08S1000F1200 G1X76.1492Y20.32 G1X76.1492Y22.86 G1X76.0984Y25.4 G1X76.1492Y30.48 G1X76.2Y45.72 G1X101.6Y50.8 G0X0.000000Y1.879600S0 G1X0.6604Y1.8796S0F1200 G1X0.762Y1.8796S1000 G1X0.8636Y1.8796 G1X0.9144Y1.8796 G1X1.0668Y1.8796 G1X1.1176Y1.8796 G1X6.096Y1.8796S0 G0X0.000000Y1.930400S0 G1X0.6604Y1.9304S0F1200 G1X0.8128Y1.9304S1000 G1X0.8636Y1.9304 G1X0.9652Y1.9304 G1X1.0668Y1.9304 G1X1.1176Y1.9304 G1X6.096Y1.9304S0 G0X0.000000Y1.981200S0 G1X0.6604Y1.9812S0F1200 G1X1.1176Y1.9812S1000 G1X6.096Y1.9812S0 G0X0.000000Y2.032000S0 G1X0.6604Y2.032S0F1200 G1X0.762Y2.032S1000 G1X1.1176Y2.032 G1X6.096Y2.032S0 G0X0.000000Y2.082800S0 G1X0.6604Y2.0828S0F1200 G1X1.1176Y2.0828S1000 G1X6.096Y2.0828S0 G0X0.000000Y2.133600S0 G1X0.6604Y2.1336S0F1200 G1X0.762Y2.1336S1000 G1X1.1176Y2.1336 G1X6.096Y2.1336S0 G0X0.000000Y3.911600S0 G1X2.2352Y3.9116S0F1200 G1X2.3368Y3.9116S1000 G1X2.3876Y3.9116S0 G1X2.54Y3.9116S1000 G1X7.5184Y3.9116S0 G0X0.000000Y3.962400S0 G1X2.286Y3.9624S0F1200 G1X2.3368Y3.9624S1000 G1X2.4384Y3.9624S0 G1X2.54Y3.9624S1000 G1X7.5184Y3.9624S0 G0X0.000000Y4.013200S0 G1X2.1336Y4.0132S0F1200 G1X2.1844Y4.0132S750 G1X2.2352Y4.0132S0 G1X2.5908Y4.0132S750 G1X7.5692Y4.0132S0 G0X0.000000Y4.064000S0 G1X2.2352Y4.064S0F1200 G1X2.5908Y4.064S500 G1X7.5692Y4.064S0 G0X0.000000Y4.165600S0 G1X2.1336Y4.1656S0F1200 G1X2.2352Y4.1656S1000 G1X7.2136Y4.1656S0 M5 G0X0Y0 \ No newline at end of file +G21 +G90 +M3 +G0X0.508000Y0.508000S0 +G1X25.4Y50.8S1000F1200 +G1X50.8Y0 +G0X101.600000Y0.000000S0 +G1X76.2Y5.08S1000F1200 +G1X76.1492Y20.32 +G1X76.1492Y22.86 +G1X76.0984Y25.4 +G1X76.1492Y30.48 +G1X76.2Y45.72 +G1X101.6Y50.8 +G0X0.000000Y1.879600S0 +G1X0.6604Y1.8796S0F1200 +G1X0.762Y1.8796S1000 +G1X0.8636Y1.8796 +G1X0.9144Y1.8796 +G1X1.0668Y1.8796 +G1X1.1176Y1.8796 +G1X6.096Y1.8796S0 +G0X0.000000Y1.930400S0 +G1X0.6604Y1.9304S0F1200 +G1X0.8128Y1.9304S1000 +G1X0.8636Y1.9304 +G1X0.9652Y1.9304 +G1X1.0668Y1.9304 +G1X1.1176Y1.9304 +G1X6.096Y1.9304S0 +G0X0.000000Y1.981200S0 +G1X0.6604Y1.9812S0F1200 +G1X1.1176Y1.9812S1000 +G1X6.096Y1.9812S0 +G0X0.000000Y2.032000S0 +G1X0.6604Y2.032S0F1200 +G1X0.762Y2.032S1000 +G1X1.1176Y2.032 +G1X6.096Y2.032S0 +G0X0.000000Y2.082800S0 +G1X0.6604Y2.0828S0F1200 +G1X1.1176Y2.0828S1000 +G1X6.096Y2.0828S0 +G0X0.000000Y2.133600S0 +G1X0.6604Y2.1336S0F1200 +G1X0.762Y2.1336S1000 +G1X1.1176Y2.1336 +G1X6.096Y2.1336S0 +G0X0.000000Y3.911600S0 +G1X2.2352Y3.9116S0F1200 +G1X2.3368Y3.9116S1000 +G1X2.3876Y3.9116S0 +G1X2.54Y3.9116S1000 +G1X7.5184Y3.9116S0 +G0X0.000000Y3.962400S0 +G1X2.286Y3.9624S0F1200 +G1X2.3368Y3.9624S1000 +G1X2.4384Y3.9624S0 +G1X2.54Y3.9624S1000 +G1X7.5184Y3.9624S0 +G0X0.000000Y4.013200S0 +G1X2.1336Y4.0132S0F1200 +G1X2.1844Y4.0132S750 +G1X2.2352Y4.0132S0 +G1X2.5908Y4.0132S750 +G1X7.5692Y4.0132S0 +G0X0.000000Y4.064000S0 +G1X2.2352Y4.064S0F1200 +G1X2.5908Y4.064S500 +G1X7.5692Y4.064S0 +G0X0.000000Y4.165600S0 +G1X2.1336Y4.1656S0F1200 +G1X2.2352Y4.1656S1000 +G1X7.2136Y4.1656S0 +M5 +G0X0Y0