From 543d4814b2f3e33426b133cb798aa339bc8feab3 Mon Sep 17 00:00:00 2001 From: Jim Morris Date: Tue, 1 Mar 2016 00:32:24 -0800 Subject: [PATCH] Save G92 setting on M500 in compliance with linuxcnc and grbl --- src/modules/robot/Robot.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/modules/robot/Robot.cpp b/src/modules/robot/Robot.cpp index a75c7bf1..d21ce91a 100644 --- a/src/modules/robot/Robot.cpp +++ b/src/modules/robot/Robot.cpp @@ -603,15 +603,12 @@ void Robot::on_gcode_received(void *argument) } ++n; } - } - - if(gcode->m == 503) { - // just print the G92 setting as it is not saved - // TODO linuxcnc does seem to save G92, so maybe we should here too + // linuxcnc does seem to save G92, so we do too + // also it needs to be used to set Z0 on rotary deltas as M206/306 can't be used if(g92_offset != wcs_t(0, 0, 0)) { float x, y, z; std::tie(x, y, z) = g92_offset; - gcode->stream->printf("G92 X%f Y%f Z%f ; NOT SAVED\n", x, y, z); + gcode->stream->printf("G92 X%f Y%f Z%f\n", x, y, z); } } break; -- 2.20.1