Fix G30 with limits, print correct probe XY

This commit is contained in:
Scott Lahteine 2016-11-15 14:10:28 -06:00
parent 665b7f3893
commit 410657b050

View file

@ -4241,8 +4241,12 @@ inline void gcode_G28() {
* S = Stows the probe if 1 (default=1)
*/
inline void gcode_G30() {
float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER;
float Y_probe_location = code_seen('Y') ? code_value_axis_units(Y_AXIS) : current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER;
float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER,
Y_probe_location = code_seen('Y') ? code_value_axis_units(Y_AXIS) : current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER;
float pos[XYZ] = { X_probe_location, Y_probe_location, LOGICAL_Z_POSITION(0) };
if (!position_is_reachable(pos, true)) return;
bool stow = code_seen('S') ? code_value_bool() : true;
// Disable leveling so the planner won't mess with us
@ -4252,17 +4256,14 @@ inline void gcode_G28() {
setup_for_endstop_or_probe_move();
float measured_z = probe_pt(X_probe_location,
Y_probe_location,
stow, 1);
float measured_z = probe_pt(X_probe_location, Y_probe_location, stow, 1);
SERIAL_PROTOCOLPGM("Bed X: ");
SERIAL_PROTOCOL(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER + 0.0001);
SERIAL_PROTOCOL(X_probe_location + 0.0001);
SERIAL_PROTOCOLPGM(" Y: ");
SERIAL_PROTOCOL(current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER + 0.0001);
SERIAL_PROTOCOL(Y_probe_location + 0.0001);
SERIAL_PROTOCOLPGM(" Z: ");
SERIAL_PROTOCOL(measured_z + 0.0001);
SERIAL_EOL;
SERIAL_PROTOCOLLN(measured_z + 0.0001);
clean_up_after_endstop_or_probe_move();