Getting setup for debugging

This commit is contained in:
Roxy-3D 2017-04-06 22:10:12 -05:00 committed by Roxy-3D
parent f8408036f2
commit 14cf527bb8
3 changed files with 35 additions and 35 deletions

View file

@ -47,9 +47,9 @@
safe_delay(10); safe_delay(10);
} }
static void serial_echo_11x_spaces() { static void serial_echo_12x_spaces() {
for (uint8_t i = GRID_MAX_POINTS_X - 1; --i;) { for (uint8_t i = GRID_MAX_POINTS_X - 1; --i;) {
SERIAL_ECHOPGM(" "); SERIAL_ECHOPGM(" ");
#if TX_BUFFER_SIZE > 0 #if TX_BUFFER_SIZE > 0
MYSERIAL.flushTX(); MYSERIAL.flushTX();
#endif #endif
@ -172,11 +172,11 @@
} }
if (map0) { if (map0) {
serial_echo_11x_spaces(); serial_echo_12x_spaces();
serial_echo_xy(GRID_MAX_POINTS_X - 1, GRID_MAX_POINTS_Y - 1); serial_echo_xy(GRID_MAX_POINTS_X - 1, GRID_MAX_POINTS_Y - 1);
SERIAL_EOL; SERIAL_EOL;
serial_echo_xy(UBL_MESH_MIN_X, UBL_MESH_MIN_Y); serial_echo_xy(UBL_MESH_MIN_X, UBL_MESH_MIN_Y);
serial_echo_11x_spaces(); serial_echo_12x_spaces();
serial_echo_xy(UBL_MESH_MAX_X, UBL_MESH_MAX_Y); serial_echo_xy(UBL_MESH_MAX_X, UBL_MESH_MAX_Y);
SERIAL_EOL; SERIAL_EOL;
} }
@ -222,12 +222,12 @@
if (map0) { if (map0) {
serial_echo_xy(UBL_MESH_MIN_X, UBL_MESH_MIN_Y); serial_echo_xy(UBL_MESH_MIN_X, UBL_MESH_MIN_Y);
SERIAL_ECHOPGM(" "); SERIAL_ECHOPGM(" ");
serial_echo_11x_spaces(); serial_echo_12x_spaces();
serial_echo_xy(UBL_MESH_MAX_X, UBL_MESH_MIN_Y); serial_echo_xy(UBL_MESH_MAX_X, UBL_MESH_MIN_Y);
SERIAL_EOL; SERIAL_EOL;
serial_echo_xy(0, 0); serial_echo_xy(0, 0);
SERIAL_ECHOPGM(" "); SERIAL_ECHOPGM(" ");
serial_echo_11x_spaces(); serial_echo_12x_spaces();
serial_echo_xy(GRID_MAX_POINTS_X - 1, 0); serial_echo_xy(GRID_MAX_POINTS_X - 1, 0);
SERIAL_EOL; SERIAL_EOL;
} }

View file

@ -45,7 +45,7 @@
void dump(char * const str, const float &f); void dump(char * const str, const float &f);
bool ubl_lcd_clicked(); bool ubl_lcd_clicked();
void probe_entire_mesh(const float&, const float&, const bool, const bool, const bool); void probe_entire_mesh(const float&, const float&, const bool, const bool, const bool);
void debug_current_and_destination(const char *title); void debug_current_and_destination(const char * const title);
void ubl_line_to_destination(const float&, uint8_t); void ubl_line_to_destination(const float&, uint8_t);
void manually_probe_remaining_mesh(const float&, const float&, const float&, const float&, const bool); void manually_probe_remaining_mesh(const float&, const float&, const float&, const float&, const bool);
vector_3 tilt_mesh_based_on_3pts(const float&, const float&, const float&); vector_3 tilt_mesh_based_on_3pts(const float&, const float&, const float&);
@ -271,7 +271,7 @@
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(MESH_ADJUST)) { if (DEBUGGING(MESH_ADJUST)) {
SERIAL_ECHOPAIR(" raw get_z_correction(", lx0); SERIAL_ECHOPAIR(" raw get_z_correction(", lx0);
SERIAL_CHAR(',') SERIAL_CHAR(',');
SERIAL_ECHO(ly0); SERIAL_ECHO(ly0);
SERIAL_ECHOPGM(") = "); SERIAL_ECHOPGM(") = ");
SERIAL_ECHO_F(z0, 6); SERIAL_ECHO_F(z0, 6);

View file

@ -1492,9 +1492,9 @@
} }
if ((x_max - x_min + 1) < (grid_size_G) || (y_max - y_min + 1) < (grid_size_G)) { if ((x_max - x_min + 1) < (grid_size_G) || (y_max - y_min + 1) < (grid_size_G)) {
SERIAL_PROTOCOLPAIR("ERROR - probeable UBL MESH smaller than grid - X points: ", x_max - x_min + 1); SERIAL_ECHOPAIR("ERROR - probeable UBL MESH smaller than grid - X points: ", x_max - x_min + 1);
SERIAL_PROTOCOLPAIR(" Y points: ", y_max - y_min + 1); SERIAL_ECHOPAIR(" Y points: ", y_max - y_min + 1);
SERIAL_PROTOCOLLNPAIR(" grid: ", grid_size_G); SERIAL_ECHOLNPAIR(" grid: ", grid_size_G);
return; return;
} }
@ -1540,7 +1540,7 @@
int8_t inStart, inStop, inInc; int8_t inStart, inStop, inInc;
SERIAL_PROTOCOLPAIR("\nPR_OUTER_VAR: ", PR_OUTER_VAR); SERIAL_ECHOPAIR("\nPR_OUTER_VAR: ", PR_OUTER_VAR);
if (zig) { // away from origin if (zig) { // away from origin
inStart = 0; inStart = 0;
@ -1557,40 +1557,40 @@ SERIAL_PROTOCOLPAIR("\nPR_OUTER_VAR: ", PR_OUTER_VAR);
// Inner loop is Y with PROBE_Y_FIRST enabled // Inner loop is Y with PROBE_Y_FIRST enabled
for (PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; PR_INNER_VAR += inInc) { for (PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; PR_INNER_VAR += inInc) {
SERIAL_PROTOCOLPAIR("\nPR_INNER_VAR: ", PR_INNER_VAR); SERIAL_ECHOPAIR("\nPR_INNER_VAR: ", PR_INNER_VAR);
SERIAL_PROTOCOLPAIR("\nCheckpoint: ", 1); SERIAL_ECHOPAIR("\nCheckpoint: ", 1);
// end of G29 AUTO_BED_LEVELING_BILINEAR method/code // end of G29 AUTO_BED_LEVELING_BILINEAR method/code
if (ubl_lcd_clicked()) { if (ubl_lcd_clicked()) {
SERIAL_PROTOCOLPAIR("\nCheckpoint: ", 2); SERIAL_ECHOPAIR("\nCheckpoint: ", 2);
SERIAL_PROTOCOLLNPGM("\nGrid only partially populated.\n"); SERIAL_ECHOLNPGM("\nGrid only partially populated.\n");
lcd_quick_feedback(); lcd_quick_feedback();
STOW_PROBE(); STOW_PROBE();
SERIAL_PROTOCOLPAIR("\nCheckpoint: ", 3); SERIAL_ECHOPAIR("\nCheckpoint: ", 3);
while (ubl_lcd_clicked()) idle(); while (ubl_lcd_clicked()) idle();
SERIAL_PROTOCOLPAIR("\nCheckpoint: ", 4); SERIAL_ECHOPAIR("\nCheckpoint: ", 4);
ubl.has_control_of_lcd_panel = false; ubl.has_control_of_lcd_panel = false;
restore_ubl_active_state_and_leave(); restore_ubl_active_state_and_leave();
safe_delay(50); // Debounce the Encoder wheel safe_delay(50); // Debounce the Encoder wheel
return; return;
} }
SERIAL_PROTOCOLPAIR("\nCheckpoint: ", 5); SERIAL_ECHOPAIR("\nCheckpoint: ", 5);
const float probeX = ubl.mesh_index_to_xpos[grid_G_index_to_xpos[xCount]], //where we want the probe to be const float probeX = ubl.mesh_index_to_xpos[grid_G_index_to_xpos[xCount]], //where we want the probe to be
probeY = ubl.mesh_index_to_ypos[grid_G_index_to_ypos[yCount]]; probeY = ubl.mesh_index_to_ypos[grid_G_index_to_ypos[yCount]];
SERIAL_PROTOCOLPAIR("\nCheckpoint: ", 6); SERIAL_ECHOPAIR("\nCheckpoint: ", 6);
const float measured_z = probe_pt(LOGICAL_X_POSITION(probeX), LOGICAL_Y_POSITION(probeY), code_seen('E'), (code_seen('V') && code_has_value()) ? code_value_int() : 0 ); // takes into account the offsets const float measured_z = probe_pt(LOGICAL_X_POSITION(probeX), LOGICAL_Y_POSITION(probeY), code_seen('E'), (code_seen('V') && code_has_value()) ? code_value_int() : 0 ); // takes into account the offsets
SERIAL_PROTOCOLPAIR("\nmeasured_z: ", measured_z ); SERIAL_ECHOPAIR("\nmeasured_z: ", measured_z );
z_values_G[xCount][yCount] = measured_z; z_values_G[xCount][yCount] = measured_z;
//SERIAL_PROTOCOLLNPGM("\nFine Tuning of Mesh Stopped."); //SERIAL_LNPGM("\nFine Tuning of Mesh Stopped.");
} }
} }
SERIAL_PROTOCOL("\nDone probing...\n"); SERIAL_ECHO("\nDone probing...\n");
STOW_PROBE(); STOW_PROBE();
restore_ubl_active_state_and_leave(); restore_ubl_active_state_and_leave();
@ -1615,22 +1615,22 @@ double zzz[] = { 0.05, 0.05, 0.15, 0.15 };
int three_size = sizeof(xxx) / sizeof(double); int three_size = sizeof(xxx) / sizeof(double);
results = lsf_linear_fit(xxx9, yyy9, zzz9, nine_size); results = lsf_linear_fit(xxx9, yyy9, zzz9, nine_size);
SERIAL_PROTOCOLPAIR("\nxxx9->A =", results->A); SERIAL_ECHOPAIR("\nxxx9->A =", results->A);
SERIAL_PROTOCOLPAIR("\nxxx9->B =", results->B); SERIAL_ECHOPAIR("\nxxx9->B =", results->B);
SERIAL_PROTOCOLPAIR("\nxxx9->D =", results->D); SERIAL_ECHOPAIR("\nxxx9->D =", results->D);
SERIAL_PROTOCOL("\n"); SERIAL_ECHO("\n");
results = lsf_linear_fit(xxx0, yyy0, zzz0, zero_size); results = lsf_linear_fit(xxx0, yyy0, zzz0, zero_size);
SERIAL_PROTOCOLPAIR("\nxxx0->A =", results->A); SERIAL_ECHOPAIR("\nxxx0->A =", results->A);
SERIAL_PROTOCOLPAIR("\nxxx0->B =", results->B); SERIAL_ECHOPAIR("\nxxx0->B =", results->B);
SERIAL_PROTOCOLPAIR("\nxxx0->D =", results->D); SERIAL_ECHOPAIR("\nxxx0->D =", results->D);
SERIAL_PROTOCOL("\n"); SERIAL_ECHO("\n");
results = lsf_linear_fit(xxx, yyy, zzz, three_size); results = lsf_linear_fit(xxx, yyy, zzz, three_size);
SERIAL_PROTOCOLPAIR("\nxxx->A =", results->A); SERIAL_ECHOPAIR("\nxxx->A =", results->A);
SERIAL_PROTOCOLPAIR("\nxxx->B =", results->B); SERIAL_ECHOPAIR("\nxxx->B =", results->B);
SERIAL_PROTOCOLPAIR("\nxxx->D =", results->D); SERIAL_ECHOPAIR("\nxxx->D =", results->D);
SERIAL_PROTOCOL("\n"); SERIAL_ECHO("\n");
return; return;
} // end of tilt_mesh_based_on_probed_grid() } // end of tilt_mesh_based_on_probed_grid()