Browse Source

Fix G30 with limits, print correct probe XY

pull/1/head
Scott Lahteine 8 years ago
parent
commit
410657b050
  1. 19
      Marlin/Marlin_main.cpp

19
Marlin/Marlin_main.cpp

@ -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();

Loading…
Cancel
Save