Browse Source

Log whether homing with probe or endstop

pull/1/head
Scott Lahteine 8 years ago
parent
commit
991a34aff2
  1. 90
      Marlin/Marlin_main.cpp

90
Marlin/Marlin_main.cpp

@ -1395,8 +1395,7 @@ bool get_target_extruder_from_command(int code) {
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_CHAR('M'); SERIAL_CHAR('M');
SERIAL_ECHO(code); SERIAL_ECHO(code);
SERIAL_ECHOPAIR(" " MSG_INVALID_EXTRUDER " ", code_value_byte()); SERIAL_ECHOLNPAIR(" " MSG_INVALID_EXTRUDER " ", code_value_byte());
SERIAL_EOL;
return true; return true;
} }
target_extruder = code_value_byte(); target_extruder = code_value_byte();
@ -1504,8 +1503,7 @@ void update_software_endstops(AxisEnum axis) {
SERIAL_ECHOPAIR(" axis:\n home_offset = ", home_offset[axis]); SERIAL_ECHOPAIR(" axis:\n home_offset = ", home_offset[axis]);
SERIAL_ECHOPAIR("\n position_shift = ", position_shift[axis]); SERIAL_ECHOPAIR("\n position_shift = ", position_shift[axis]);
SERIAL_ECHOPAIR("\n soft_endstop_min = ", soft_endstop_min[axis]); SERIAL_ECHOPAIR("\n soft_endstop_min = ", soft_endstop_min[axis]);
SERIAL_ECHOPAIR("\n soft_endstop_max = ", soft_endstop_max[axis]); SERIAL_ECHOLNPAIR("\n soft_endstop_max = ", soft_endstop_max[axis]);
SERIAL_EOL;
} }
#endif #endif
@ -1586,23 +1584,42 @@ static void set_axis_is_at_home(AxisEnum axis) {
current_position[axis] = LOGICAL_POSITION(base_home_pos(axis), axis); current_position[axis] = LOGICAL_POSITION(base_home_pos(axis), axis);
update_software_endstops(axis); update_software_endstops(axis);
if (axis == Z_AXIS) {
#if HAS_BED_PROBE && Z_HOME_DIR < 0
#if DISABLED(Z_MIN_PROBE_ENDSTOP)
current_position[Z_AXIS] -= zprobe_zoffset;
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
SERIAL_ECHOLNPGM("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***");
SERIAL_ECHOLNPAIR("> zprobe_zoffset = ", zprobe_zoffset);
}
#endif
#elif ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING))
SERIAL_ECHOLNPGM("*** Z HOMED TO ENDSTOP (Z_MIN_PROBE_ENDSTOP) ***");
#endif
#endif
}
#if HAS_BED_PROBE && Z_HOME_DIR < 0 && DISABLED(Z_MIN_PROBE_ENDSTOP) #if HAS_BED_PROBE && Z_HOME_DIR < 0 && DISABLED(Z_MIN_PROBE_ENDSTOP)
if (axis == Z_AXIS) { if (axis == Z_AXIS) {
current_position[Z_AXIS] -= zprobe_zoffset; current_position[Z_AXIS] -= zprobe_zoffset;
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR("> zprobe_zoffset = ", zprobe_zoffset); SERIAL_ECHOLNPGM("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***");
SERIAL_EOL; SERIAL_ECHOLNPAIR("> zprobe_zoffset = ", zprobe_zoffset);
} }
#endif #endif
} }
#elif HAS_BED_PROBE && Z_HOME_DIR < 0 && ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING))
SERIAL_ECHOLNPGM("*** Z HOMED TO ENDSTOP (Z_MIN_PROBE_ENDSTOP) ***");
#endif #endif
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR("> home_offset[", axis_codes[axis]); SERIAL_ECHOPAIR("> home_offset[", axis_codes[axis]);
SERIAL_ECHOPAIR("] = ", home_offset[axis]); SERIAL_ECHOLNPAIR("] = ", home_offset[axis]);
SERIAL_EOL;
DEBUG_POS("", current_position); DEBUG_POS("", current_position);
} }
#endif #endif
@ -2054,8 +2071,7 @@ static void clean_up_after_endstop_or_probe_move() {
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING)) {
DEBUG_POS("set_probe_deployed", current_position); DEBUG_POS("set_probe_deployed", current_position);
SERIAL_ECHOPAIR("deploy: ", deploy); SERIAL_ECHOLNPAIR("deploy: ", deploy);
SERIAL_EOL;
} }
#endif #endif
@ -3029,10 +3045,8 @@ inline void gcode_G28() {
if (destination[Z_AXIS] > current_position[Z_AXIS]) { if (destination[Z_AXIS] > current_position[Z_AXIS]) {
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING))
SERIAL_ECHOPAIR("Raise Z (before homing) to ", destination[Z_AXIS]); SERIAL_ECHOLNPAIR("Raise Z (before homing) to ", destination[Z_AXIS]);
SERIAL_EOL;
}
#endif #endif
do_blocking_move_to_z(destination[Z_AXIS]); do_blocking_move_to_z(destination[Z_AXIS]);
@ -3842,8 +3856,7 @@ inline void gcode_G28() {
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR("> BEFORE apply_rotation_xyz > stepper_z = ", stepper_z); SERIAL_ECHOPAIR("> BEFORE apply_rotation_xyz > stepper_z = ", stepper_z);
SERIAL_ECHOPAIR(" ... z_tmp = ", z_tmp); SERIAL_ECHOLNPAIR(" ... z_tmp = ", z_tmp);
SERIAL_EOL;
} }
#endif #endif
@ -3851,10 +3864,8 @@ inline void gcode_G28() {
apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp); apply_rotation_xyz(planner.bed_level_matrix, x_tmp, y_tmp, z_tmp);
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING))
SERIAL_ECHOPAIR("> AFTER apply_rotation_xyz > z_tmp = ", z_tmp); SERIAL_ECHOLNPAIR("> AFTER apply_rotation_xyz > z_tmp = ", z_tmp);
SERIAL_EOL;
}
#endif #endif
// Adjust the current Z and send it to the planner. // Adjust the current Z and send it to the planner.
@ -4380,8 +4391,7 @@ inline void gcode_M42() {
Y_current /= 1.25; Y_current /= 1.25;
if (verbose_level > 3) { if (verbose_level > 3) {
SERIAL_ECHOPAIR("Pulling point towards center:", X_current); SERIAL_ECHOPAIR("Pulling point towards center:", X_current);
SERIAL_ECHOPAIR(", ", Y_current); SERIAL_ECHOLNPAIR(", ", Y_current);
SERIAL_EOL;
} }
} }
#endif #endif
@ -4389,8 +4399,7 @@ inline void gcode_M42() {
SERIAL_PROTOCOLPGM("Going to:"); SERIAL_PROTOCOLPGM("Going to:");
SERIAL_ECHOPAIR(" X", X_current); SERIAL_ECHOPAIR(" X", X_current);
SERIAL_ECHOPAIR(" Y", Y_current); SERIAL_ECHOPAIR(" Y", Y_current);
SERIAL_ECHOPAIR(" Z", current_position[Z_AXIS]); SERIAL_ECHOLNPAIR(" Z", current_position[Z_AXIS]);
SERIAL_EOL;
} }
do_blocking_move_to_xy(X_current, Y_current); do_blocking_move_to_xy(X_current, Y_current);
} // n_legs loop } // n_legs loop
@ -4948,8 +4957,7 @@ inline void gcode_M111() {
} }
else { else {
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_ECHOLNPAIR("M113 S", (unsigned long)host_keepalive_interval);
SERIAL_EOL;
} }
} }
@ -5399,23 +5407,19 @@ inline void gcode_M203() {
inline void gcode_M204() { inline void gcode_M204() {
if (code_seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments. if (code_seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments.
planner.travel_acceleration = planner.acceleration = code_value_linear_units(); planner.travel_acceleration = planner.acceleration = code_value_linear_units();
SERIAL_ECHOPAIR("Setting Print and Travel Acceleration: ", planner.acceleration); SERIAL_ECHOLNPAIR("Setting Print and Travel Acceleration: ", planner.acceleration);
SERIAL_EOL;
} }
if (code_seen('P')) { if (code_seen('P')) {
planner.acceleration = code_value_linear_units(); planner.acceleration = code_value_linear_units();
SERIAL_ECHOPAIR("Setting Print Acceleration: ", planner.acceleration); SERIAL_ECHOLNPAIR("Setting Print Acceleration: ", planner.acceleration);
SERIAL_EOL;
} }
if (code_seen('R')) { if (code_seen('R')) {
planner.retract_acceleration = code_value_linear_units(); planner.retract_acceleration = code_value_linear_units();
SERIAL_ECHOPAIR("Setting Retract Acceleration: ", planner.retract_acceleration); SERIAL_ECHOLNPAIR("Setting Retract Acceleration: ", planner.retract_acceleration);
SERIAL_EOL;
} }
if (code_seen('T')) { if (code_seen('T')) {
planner.travel_acceleration = code_value_linear_units(); planner.travel_acceleration = code_value_linear_units();
SERIAL_ECHOPAIR("Setting Travel Acceleration: ", planner.travel_acceleration); SERIAL_ECHOLNPAIR("Setting Travel Acceleration: ", planner.travel_acceleration);
SERIAL_EOL;
} }
} }
@ -5491,8 +5495,7 @@ inline void gcode_M206() {
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPGM("endstop_adj["); SERIAL_ECHOPGM("endstop_adj[");
SERIAL_ECHO(axis_codes[i]); SERIAL_ECHO(axis_codes[i]);
SERIAL_ECHOPAIR("] = ", endstop_adj[i]); SERIAL_ECHOLNPAIR("] = ", endstop_adj[i]);
SERIAL_EOL;
} }
#endif #endif
} }
@ -5511,8 +5514,7 @@ inline void gcode_M206() {
*/ */
inline void gcode_M666() { inline void gcode_M666() {
if (code_seen('Z')) z_endstop_adj = code_value_axis_units(Z_AXIS); if (code_seen('Z')) z_endstop_adj = code_value_axis_units(Z_AXIS);
SERIAL_ECHOPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj); SERIAL_ECHOLNPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj);
SERIAL_EOL;
} }
#endif // !DELTA && Z_DUAL_ENDSTOPS #endif // !DELTA && Z_DUAL_ENDSTOPS
@ -5587,8 +5589,7 @@ inline void gcode_M211() {
SERIAL_ECHOPGM(" " MSG_SOFT_MAX ": "); SERIAL_ECHOPGM(" " MSG_SOFT_MAX ": ");
SERIAL_ECHOPAIR( MSG_X, soft_endstop_max[X_AXIS]); SERIAL_ECHOPAIR( MSG_X, soft_endstop_max[X_AXIS]);
SERIAL_ECHOPAIR(" " MSG_Y, soft_endstop_max[Y_AXIS]); SERIAL_ECHOPAIR(" " MSG_Y, soft_endstop_max[Y_AXIS]);
SERIAL_ECHOPAIR(" " MSG_Z, soft_endstop_max[Z_AXIS]); SERIAL_ECHOLNPAIR(" " MSG_Z, soft_endstop_max[Z_AXIS]);
SERIAL_EOL;
} }
#if HOTENDS > 1 #if HOTENDS > 1
@ -6822,8 +6823,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no"); SERIAL_ECHOLNPAIR("Active extruder parked: ", active_extruder_parked ? "yes" : "no");
SERIAL_EOL;
DEBUG_POS("New extruder (parked)", current_position); DEBUG_POS("New extruder (parked)", current_position);
} }
#endif #endif
@ -6932,10 +6932,8 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
ypos = RAW_CURRENT_POSITION(Y_AXIS); ypos = RAW_CURRENT_POSITION(Y_AXIS);
current_position[Z_AXIS] += mbl.get_z(xpos + xydiff[X_AXIS], ypos + xydiff[Y_AXIS]) - mbl.get_z(xpos, ypos); current_position[Z_AXIS] += mbl.get_z(xpos + xydiff[X_AXIS], ypos + xydiff[Y_AXIS]) - mbl.get_z(xpos, ypos);
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING))
SERIAL_ECHOPAIR(" after: ", current_position[Z_AXIS]); SERIAL_ECHOLNPAIR(" after: ", current_position[Z_AXIS]);
SERIAL_EOL;
}
#endif #endif
} }

Loading…
Cancel
Save