From 276e7c00a440dab56d3b81428b38a5e072d896bd Mon Sep 17 00:00:00 2001 From: Jim Morris Date: Sun, 13 May 2018 13:59:33 +0100 Subject: [PATCH] Allow G92 A0 to change A axis, ditto for B C --- src/modules/robot/Robot.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/robot/Robot.cpp b/src/modules/robot/Robot.cpp index 31243798..d218c1ff 100644 --- a/src/modules/robot/Robot.cpp +++ b/src/modules/robot/Robot.cpp @@ -592,6 +592,17 @@ void Robot::on_gcode_received(void *argument) actuators[selected_extruder]->change_last_milestone(get_e_scale_fnc ? e*get_e_scale_fnc() : e); } } + if(gcode->subcode == 0 && gcode->get_num_args() > 0) { + for (int i = A_AXIS; i < n_motors; i++) { + // ABC just need to set machine_position and compensated_machine_position if specified + char axis= 'A'+i-3; + if(!actuators[i]->is_extruder() && gcode->has_letter(axis)) { + float ap= gcode->get_value(axis); + machine_position[i]= compensated_machine_position[i]= ap; + actuators[i]->change_last_milestone(ap); // this updates the last_milestone in the actuator + } + } + } #endif return; -- 2.20.1