From d13991ae18514bc5181cd853684f8650fd026c1e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 5 Apr 2017 22:29:44 -0500 Subject: [PATCH 1/5] Use same config name for all mesh dimensions --- Marlin/Configuration.h | 12 +- Marlin/G26_Mesh_Validation_Tool.cpp | 20 ++-- Marlin/Marlin.h | 2 +- Marlin/Marlin_main.cpp | 104 +++++++++--------- Marlin/SanityCheck.h | 28 +++-- Marlin/UBL.h | 28 ++--- Marlin/UBL_Bed_Leveling.cpp | 32 +++--- Marlin/UBL_G29.cpp | 62 +++++------ Marlin/UBL_line_to_destination.cpp | 2 +- Marlin/configuration_store.cpp | 36 +++--- .../Cartesio/Configuration.h | 12 +- .../Felix/Configuration.h | 12 +- .../Felix/DUAL/Configuration.h | 12 +- .../Hephestos/Configuration.h | 12 +- .../Hephestos_2/Configuration.h | 12 +- .../K8200/Configuration.h | 12 +- .../K8400/Configuration.h | 12 +- .../K8400/Dual-head/Configuration.h | 12 +- .../RepRapWorld/Megatronics/Configuration.h | 12 +- .../RigidBot/Configuration.h | 12 +- .../SCARA/Configuration.h | 12 +- .../TAZ4/Configuration.h | 12 +- .../TinyBoy2/Configuration.h | 12 +- .../WITBOX/Configuration.h | 12 +- .../adafruit/ST7565/Configuration.h | 12 +- .../delta/flsun_kossel_mini/Configuration.h | 12 +- .../delta/generic/Configuration.h | 12 +- .../delta/kossel_mini/Configuration.h | 12 +- .../delta/kossel_pro/Configuration.h | 14 +-- .../delta/kossel_xl/Configuration.h | 12 +- .../makibox/Configuration.h | 12 +- .../tvrrug/Round2/Configuration.h | 12 +- Marlin/mesh_bed_leveling.cpp | 10 +- Marlin/mesh_bed_leveling.h | 24 ++-- Marlin/ultralcd.cpp | 6 +- 35 files changed, 318 insertions(+), 314 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c303741c4..8fc9f7478 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -813,8 +813,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -860,8 +860,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -877,8 +877,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/G26_Mesh_Validation_Tool.cpp b/Marlin/G26_Mesh_Validation_Tool.cpp index d00369d57..fc64eb3cb 100644 --- a/Marlin/G26_Mesh_Validation_Tool.cpp +++ b/Marlin/G26_Mesh_Validation_Tool.cpp @@ -293,22 +293,22 @@ end_angle = 90.0; if (yi == 0) // it is an edge, check for the two left corners start_angle = 0.0; - else if (yi == UBL_MESH_NUM_Y_POINTS - 1) + else if (yi == GRID_MAX_POINTS_Y - 1) end_angle = 0.0; } - else if (xi == UBL_MESH_NUM_X_POINTS - 1) { // Check for top edge + else if (xi == GRID_MAX_POINTS_X - 1) { // Check for top edge start_angle = 90.0; end_angle = 270.0; if (yi == 0) // it is an edge, check for the two right corners end_angle = 180.0; - else if (yi == UBL_MESH_NUM_Y_POINTS - 1) + else if (yi == GRID_MAX_POINTS_Y - 1) start_angle = 180.0; } else if (yi == 0) { start_angle = 0.0; // only do the top side of the cirlce end_angle = 180.0; } - else if (yi == UBL_MESH_NUM_Y_POINTS - 1) { + else if (yi == GRID_MAX_POINTS_Y - 1) { start_angle = 180.0; // only do the bottom side of the cirlce end_angle = 360.0; } @@ -397,8 +397,8 @@ return_val.x_index = return_val.y_index = -1; - for (uint8_t i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { - for (uint8_t j = 0; j < UBL_MESH_NUM_Y_POINTS; j++) { + for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { + for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { if (!is_bit_set(circle_flags, i, j)) { const float mx = ubl.mesh_index_to_xpos[i], // We found a circle that needs to be printed my = ubl.mesh_index_to_ypos[j]; @@ -432,10 +432,10 @@ void look_for_lines_to_connect() { float sx, sy, ex, ey; - for (uint8_t i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { - for (uint8_t j = 0; j < UBL_MESH_NUM_Y_POINTS; j++) { + for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { + for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - if (i < UBL_MESH_NUM_X_POINTS) { // We can't connect to anything to the right than UBL_MESH_NUM_X_POINTS. + if (i < GRID_MAX_POINTS_X) { // We can't connect to anything to the right than GRID_MAX_POINTS_X. // This is already a half circle because we are at the edge of the bed. if (is_bit_set(circle_flags, i, j) && is_bit_set(circle_flags, i + 1, j)) { // check if we can do a line to the left @@ -467,7 +467,7 @@ } } - if (j < UBL_MESH_NUM_Y_POINTS) { // We can't connect to anything further back than UBL_MESH_NUM_Y_POINTS. + if (j < GRID_MAX_POINTS_Y) { // We can't connect to anything further back than GRID_MAX_POINTS_Y. // This is already a half circle because we are at the edge of the bed. if (is_bit_set(circle_flags, i, j) && is_bit_set(circle_flags, i, j + 1)) { // check if we can do a line straight down diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index b0537162e..476e92839 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -283,7 +283,7 @@ float code_value_temp_diff(); #if ENABLED(AUTO_BED_LEVELING_BILINEAR) extern int bilinear_grid_spacing[2], bilinear_start[2]; - extern float bed_level_grid[ABL_GRID_MAX_POINTS_X][ABL_GRID_MAX_POINTS_Y]; + extern float bed_level_grid[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; float bilinear_z_offset(float logical[XYZ]); void set_bed_leveling_enabled(bool enable=true); #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 817c4f934..6f73300b4 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -589,7 +589,7 @@ static uint8_t target_extruder; #if ENABLED(AUTO_BED_LEVELING_BILINEAR) int bilinear_grid_spacing[2], bilinear_start[2]; - float bed_level_grid[ABL_GRID_MAX_POINTS_X][ABL_GRID_MAX_POINTS_Y]; + float bed_level_grid[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; #endif #if IS_SCARA @@ -2341,8 +2341,8 @@ static void clean_up_after_endstop_or_probe_move() { #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) bilinear_start[X_AXIS] = bilinear_start[Y_AXIS] = bilinear_grid_spacing[X_AXIS] = bilinear_grid_spacing[Y_AXIS] = 0; - for (uint8_t x = 0; x < ABL_GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < ABL_GRID_MAX_POINTS_Y; y++) + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) + for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) bed_level_grid[x][y] = NAN; #elif ENABLED(AUTO_BED_LEVELING_UBL) ubl.reset(); @@ -2473,9 +2473,9 @@ static void clean_up_after_endstop_or_probe_move() { //#define EXTRAPOLATE_FROM_EDGE #if ENABLED(EXTRAPOLATE_FROM_EDGE) - #if ABL_GRID_MAX_POINTS_X < ABL_GRID_MAX_POINTS_Y + #if GRID_MAX_POINTS_X < GRID_MAX_POINTS_Y #define HALF_IN_X - #elif ABL_GRID_MAX_POINTS_Y < ABL_GRID_MAX_POINTS_X + #elif GRID_MAX_POINTS_Y < GRID_MAX_POINTS_X #define HALF_IN_Y #endif #endif @@ -2486,18 +2486,18 @@ static void clean_up_after_endstop_or_probe_move() { */ static void extrapolate_unprobed_bed_level() { #ifdef HALF_IN_X - const uint8_t ctrx2 = 0, xlen = ABL_GRID_MAX_POINTS_X - 1; + const uint8_t ctrx2 = 0, xlen = GRID_MAX_POINTS_X - 1; #else - const uint8_t ctrx1 = (ABL_GRID_MAX_POINTS_X - 1) / 2, // left-of-center - ctrx2 = ABL_GRID_MAX_POINTS_X / 2, // right-of-center + const uint8_t ctrx1 = (GRID_MAX_POINTS_X - 1) / 2, // left-of-center + ctrx2 = GRID_MAX_POINTS_X / 2, // right-of-center xlen = ctrx1; #endif #ifdef HALF_IN_Y - const uint8_t ctry2 = 0, ylen = ABL_GRID_MAX_POINTS_Y - 1; + const uint8_t ctry2 = 0, ylen = GRID_MAX_POINTS_Y - 1; #else - const uint8_t ctry1 = (ABL_GRID_MAX_POINTS_Y - 1) / 2, // top-of-center - ctry2 = ABL_GRID_MAX_POINTS_Y / 2, // bottom-of-center + const uint8_t ctry1 = (GRID_MAX_POINTS_Y - 1) / 2, // top-of-center + ctry2 = GRID_MAX_POINTS_Y / 2, // bottom-of-center ylen = ctry1; #endif @@ -2524,17 +2524,17 @@ static void clean_up_after_endstop_or_probe_move() { static void print_bilinear_leveling_grid() { SERIAL_ECHOLNPGM("Bilinear Leveling Grid:"); - print_2d_array(ABL_GRID_MAX_POINTS_X, ABL_GRID_MAX_POINTS_Y, 3, + print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 3, [](const uint8_t ix, const uint8_t iy) { return bed_level_grid[ix][iy]; } ); } #if ENABLED(ABL_BILINEAR_SUBDIVISION) - #define ABL_GRID_POINTS_VIRT_X (ABL_GRID_MAX_POINTS_X - 1) * (BILINEAR_SUBDIVISIONS) + 1 - #define ABL_GRID_POINTS_VIRT_Y (ABL_GRID_MAX_POINTS_Y - 1) * (BILINEAR_SUBDIVISIONS) + 1 - #define ABL_TEMP_POINTS_X (ABL_GRID_MAX_POINTS_X + 2) - #define ABL_TEMP_POINTS_Y (ABL_GRID_MAX_POINTS_Y + 2) + #define ABL_GRID_POINTS_VIRT_X (GRID_MAX_POINTS_X - 1) * (BILINEAR_SUBDIVISIONS) + 1 + #define ABL_GRID_POINTS_VIRT_Y (GRID_MAX_POINTS_Y - 1) * (BILINEAR_SUBDIVISIONS) + 1 + #define ABL_TEMP_POINTS_X (GRID_MAX_POINTS_X + 2) + #define ABL_TEMP_POINTS_Y (GRID_MAX_POINTS_Y + 2) float bed_level_grid_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y]; int bilinear_grid_spacing_virt[2] = { 0 }; @@ -2550,8 +2550,8 @@ static void clean_up_after_endstop_or_probe_move() { uint8_t ep = 0, ip = 1; if (!x || x == ABL_TEMP_POINTS_X - 1) { if (x) { - ep = ABL_GRID_MAX_POINTS_X - 1; - ip = ABL_GRID_MAX_POINTS_X - 2; + ep = GRID_MAX_POINTS_X - 1; + ip = GRID_MAX_POINTS_X - 2; } if (WITHIN(y, 1, ABL_TEMP_POINTS_Y - 2)) return LINEAR_EXTRAPOLATION( @@ -2566,8 +2566,8 @@ static void clean_up_after_endstop_or_probe_move() { } if (!y || y == ABL_TEMP_POINTS_Y - 1) { if (y) { - ep = ABL_GRID_MAX_POINTS_Y - 1; - ip = ABL_GRID_MAX_POINTS_Y - 2; + ep = GRID_MAX_POINTS_Y - 1; + ip = GRID_MAX_POINTS_Y - 2; } if (WITHIN(x, 1, ABL_TEMP_POINTS_X - 2)) return LINEAR_EXTRAPOLATION( @@ -2604,11 +2604,11 @@ static void clean_up_after_endstop_or_probe_move() { } void bed_level_virt_interpolate() { - for (uint8_t y = 0; y < ABL_GRID_MAX_POINTS_Y; y++) - for (uint8_t x = 0; x < ABL_GRID_MAX_POINTS_X; x++) + for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) for (uint8_t ty = 0; ty < BILINEAR_SUBDIVISIONS; ty++) for (uint8_t tx = 0; tx < BILINEAR_SUBDIVISIONS; tx++) { - if ((ty && y == ABL_GRID_MAX_POINTS_Y - 1) || (tx && x == ABL_GRID_MAX_POINTS_X - 1)) + if ((ty && y == GRID_MAX_POINTS_Y - 1) || (tx && x == GRID_MAX_POINTS_X - 1)) continue; bed_level_grid_virt[x * (BILINEAR_SUBDIVISIONS) + tx][y * (BILINEAR_SUBDIVISIONS) + ty] = bed_level_virt_2cmr( @@ -3752,10 +3752,10 @@ inline void gcode_G28() { void say_not_entered() { SERIAL_PROTOCOLLNPGM(" not entered."); } void mbl_mesh_report() { - SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); + SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(GRID_MAX_POINTS_X) "," STRINGIFY(GRID_MAX_POINTS_Y)); SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5); SERIAL_PROTOCOLLNPGM("\nMeasured points:"); - print_2d_array(MESH_NUM_X_POINTS, MESH_NUM_Y_POINTS, 5, + print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5, [](const uint8_t ix, const uint8_t iy) { return mbl.z_values[ix][iy]; } ); } @@ -3832,7 +3832,7 @@ inline void gcode_G28() { #endif } // If there's another point to sample, move there with optional lift. - if (mbl_probe_index < (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) { + if (mbl_probe_index < (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)) { mbl.zigzag(mbl_probe_index, px, py); _manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]); @@ -3864,8 +3864,8 @@ inline void gcode_G28() { case MeshSet: if (code_seen('X')) { px = code_value_int() - 1; - if (!WITHIN(px, 0, MESH_NUM_X_POINTS - 1)) { - SERIAL_PROTOCOLLNPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ")."); + if (!WITHIN(px, 0, GRID_MAX_POINTS_X - 1)) { + SERIAL_PROTOCOLLNPGM("X out of range (1-" STRINGIFY(GRID_MAX_POINTS_X) ")."); return; } } @@ -3876,8 +3876,8 @@ inline void gcode_G28() { if (code_seen('Y')) { py = code_value_int() - 1; - if (!WITHIN(py, 0, MESH_NUM_Y_POINTS - 1)) { - SERIAL_PROTOCOLLNPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ")."); + if (!WITHIN(py, 0, GRID_MAX_POINTS_Y - 1)) { + SERIAL_PROTOCOLLNPGM("Y out of range (1-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); return; } } @@ -4034,16 +4034,16 @@ inline void gcode_G28() { ABL_VAR int left_probe_bed_position, right_probe_bed_position, front_probe_bed_position, back_probe_bed_position; ABL_VAR float xGridSpacing, yGridSpacing; - #define ABL_GRID_MAX (ABL_GRID_MAX_POINTS_X) * (ABL_GRID_MAX_POINTS_Y) + #define ABL_GRID_MAX (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y) #if ABL_PLANAR - ABL_VAR uint8_t abl_grid_points_x = ABL_GRID_MAX_POINTS_X, - abl_grid_points_y = ABL_GRID_MAX_POINTS_Y; + ABL_VAR uint8_t abl_grid_points_x = GRID_MAX_POINTS_X, + abl_grid_points_y = GRID_MAX_POINTS_Y; ABL_VAR int abl2; ABL_VAR bool do_topography_map; #else // 3-point - uint8_t constexpr abl_grid_points_x = ABL_GRID_MAX_POINTS_X, - abl_grid_points_y = ABL_GRID_MAX_POINTS_Y; + uint8_t constexpr abl_grid_points_x = GRID_MAX_POINTS_X, + abl_grid_points_y = GRID_MAX_POINTS_Y; int constexpr abl2 = ABL_GRID_MAX; #endif @@ -4054,7 +4054,7 @@ inline void gcode_G28() { #elif ENABLED(AUTO_BED_LEVELING_LINEAR) - ABL_VAR int indexIntoAB[ABL_GRID_MAX_POINTS_X][ABL_GRID_MAX_POINTS_Y]; + ABL_VAR int indexIntoAB[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; ABL_VAR float eqnAMatrix[ABL_GRID_MAX * 3], // "A" matrix of the linear system of equations eqnBVector[ABL_GRID_MAX], // "B" vector of Z points @@ -4105,10 +4105,10 @@ inline void gcode_G28() { // Get nearest i / j from x / y i = (x - LOGICAL_X_POSITION(bilinear_start[X_AXIS]) + 0.5 * xGridSpacing) / xGridSpacing; j = (y - LOGICAL_Y_POSITION(bilinear_start[Y_AXIS]) + 0.5 * yGridSpacing) / yGridSpacing; - i = constrain(i, 0, ABL_GRID_MAX_POINTS_X - 1); - j = constrain(j, 0, ABL_GRID_MAX_POINTS_Y - 1); + i = constrain(i, 0, GRID_MAX_POINTS_X - 1); + j = constrain(j, 0, GRID_MAX_POINTS_Y - 1); } - if (WITHIN(i, 0, ABL_GRID_MAX_POINTS_X - 1) && WITHIN(j, 0, ABL_GRID_MAX_POINTS_Y)) { + if (WITHIN(i, 0, GRID_MAX_POINTS_X - 1) && WITHIN(j, 0, GRID_MAX_POINTS_Y)) { set_bed_leveling_enabled(false); bed_level_grid[i][j] = z; #if ENABLED(ABL_BILINEAR_SUBDIVISION) @@ -4145,8 +4145,8 @@ inline void gcode_G28() { // X and Y specify points in each direction, overriding the default // These values may be saved with the completed mesh - abl_grid_points_x = code_seen('X') ? code_value_int() : ABL_GRID_MAX_POINTS_X; - abl_grid_points_y = code_seen('Y') ? code_value_int() : ABL_GRID_MAX_POINTS_Y; + abl_grid_points_x = code_seen('X') ? code_value_int() : GRID_MAX_POINTS_X; + abl_grid_points_y = code_seen('Y') ? code_value_int() : GRID_MAX_POINTS_Y; if (code_seen('P')) abl_grid_points_x = abl_grid_points_y = code_value_int(); if (abl_grid_points_x < 2 || abl_grid_points_y < 2) { @@ -7627,7 +7627,7 @@ void quickstop_stepper() { } } else if (hasI && hasJ && hasZ) { - if (WITHIN(px, 0, MESH_NUM_X_POINTS - 1) && WITHIN(py, 0, MESH_NUM_Y_POINTS - 1)) + if (WITHIN(px, 0, GRID_MAX_POINTS_X - 1) && WITHIN(py, 0, GRID_MAX_POINTS_Y - 1)) mbl.set_z(px, py, z); else { SERIAL_ERROR_START; @@ -7656,7 +7656,7 @@ void quickstop_stepper() { if ((hasZ = code_seen('Z'))) z = code_value_axis_units(Z_AXIS); if (hasI && hasJ && hasZ) { - if (WITHIN(px, 0, ABL_GRID_MAX_POINTS_X - 1) && WITHIN(py, 0, ABL_GRID_MAX_POINTS_X - 1)) { + if (WITHIN(px, 0, GRID_MAX_POINTS_X - 1) && WITHIN(py, 0, GRID_MAX_POINTS_X - 1)) { bed_level_grid[px][py] = z; #if ENABLED(ABL_BILINEAR_SUBDIVISION) bed_level_virt_interpolate(); @@ -7687,7 +7687,7 @@ void quickstop_stepper() { if ((hasZ = code_seen('Z'))) z = code_value_axis_units(Z_AXIS); if (hasI && hasJ && hasZ) { - if (WITHIN(px, 0, UBL_MESH_NUM_Y_POINTS - 1) && WITHIN(py, 0, UBL_MESH_NUM_Y_POINTS - 1)) { + if (WITHIN(px, 0, GRID_MAX_POINTS_Y - 1) && WITHIN(py, 0, GRID_MAX_POINTS_Y - 1)) { ubl.z_values[px][py] = z; } else { @@ -7801,8 +7801,8 @@ inline void gcode_M503() { // Correct bilinear grid for new probe offset const float diff = value - zprobe_zoffset; if (diff) { - for (uint8_t x = 0; x < ABL_GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < ABL_GRID_MAX_POINTS_Y; y++) + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) + for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) bed_level_grid[x][y] += diff; } #if ENABLED(ABL_BILINEAR_SUBDIVISION) @@ -9661,8 +9661,8 @@ void ok_to_send() { #define ABL_BG_GRID(X,Y) bed_level_grid_virt[X][Y] #else #define ABL_BG_SPACING(A) bilinear_grid_spacing[A] - #define ABL_BG_POINTS_X ABL_GRID_MAX_POINTS_X - #define ABL_BG_POINTS_Y ABL_GRID_MAX_POINTS_Y + #define ABL_BG_POINTS_X GRID_MAX_POINTS_X + #define ABL_BG_POINTS_Y GRID_MAX_POINTS_Y #define ABL_BG_GRID(X,Y) bed_level_grid[X][Y] #endif @@ -9989,10 +9989,10 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { cy1 = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)), cx2 = mbl.cell_index_x(RAW_X_POSITION(destination[X_AXIS])), cy2 = mbl.cell_index_y(RAW_Y_POSITION(destination[Y_AXIS])); - NOMORE(cx1, MESH_NUM_X_POINTS - 2); - NOMORE(cy1, MESH_NUM_Y_POINTS - 2); - NOMORE(cx2, MESH_NUM_X_POINTS - 2); - NOMORE(cy2, MESH_NUM_Y_POINTS - 2); + NOMORE(cx1, GRID_MAX_POINTS_X - 2); + NOMORE(cy1, GRID_MAX_POINTS_Y - 2); + NOMORE(cx2, GRID_MAX_POINTS_X - 2); + NOMORE(cy2, GRID_MAX_POINTS_Y - 2); if (cx1 == cx2 && cy1 == cy2) { // Start and end on same mesh square diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 002d423a5..301f32735 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -147,9 +147,15 @@ #elif defined(AUTO_BED_LEVELING_FEATURE) #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT." #elif defined(ABL_GRID_POINTS) - #error "ABL_GRID_POINTS is now ABL_GRID_MAX_POINTS_X and ABL_GRID_MAX_POINTS_Y. Please update your configuration." + #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y. Please update your configuration." #elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y) - #error "ABL_GRID_POINTS_[XY] is now ABL_GRID_MAX_POINTS_[XY]. Please update your configuration." + #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration." +#elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y) + #error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration." +#elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS) + #error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration." +#elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS) + #error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration." #elif defined(UBL_MESH_EDIT_ENABLED) #error "UBL_MESH_EDIT_ENABLED is now UBL_G26_MESH_EDITING. Please update your configuration." #elif defined(BEEPER) @@ -242,10 +248,10 @@ #error "DELTA is incompatible with ENABLE_LEVELING_FADE_HEIGHT. Please disable it." #endif #if ABL_GRID - #if (ABL_GRID_MAX_POINTS_X & 1) == 0 || (ABL_GRID_MAX_POINTS_Y & 1) == 0 - #error "DELTA requires ABL_GRID_MAX_POINTS_X and ABL_GRID_MAX_POINTS_Y to be odd numbers." - #elif ABL_GRID_MAX_POINTS_X < 3 - #error "DELTA requires ABL_GRID_MAX_POINTS_X and ABL_GRID_MAX_POINTS_Y to be 3 or higher." + #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0 + #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers." + #elif GRID_MAX_POINTS_X < 3 + #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher." #endif #endif #endif @@ -411,8 +417,8 @@ static_assert(1 >= 0 #if ENABLED(MESH_BED_LEVELING) #if ENABLED(DELTA) #error "MESH_BED_LEVELING does not yet support DELTA printers." - #elif MESH_NUM_X_POINTS > 9 || MESH_NUM_Y_POINTS > 9 - #error "MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS must be less than 10." + #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9 + #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL." #endif #endif @@ -424,8 +430,6 @@ static_assert(1 >= 0 #error "AUTO_BED_LEVELING_UBL does not yet support DELTA printers." #elif DISABLED(NEWPANEL) #error "AUTO_BED_LEVELING_UBL requires an LCD controller." - #elif UBL_MESH_NUM_X_POINTS > 15 || UBL_MESH_NUM_Y_POINTS > 15 - #error "UBL_MESH_NUM_X_POINTS and UBL_MESH_NUM_Y_POINTS must be less than 16." #endif #endif @@ -602,8 +606,8 @@ static_assert(1 >= 0 #elif ENABLED(AUTO_BED_LEVELING_UBL) #if DISABLED(EEPROM_SETTINGS) #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration." - #elif !WITHIN(UBL_MESH_NUM_X_POINTS, 3, 15) || !WITHIN(UBL_MESH_NUM_Y_POINTS, 3, 15) - #error "UBL_MESH_NUM_[XY]_POINTS must be a whole number between 3 and 15." + #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15) + #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15." #elif !WITHIN(UBL_PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X) #error "The given UBL_PROBE_PT_1_X can't be reached by the Z probe." #elif !WITHIN(UBL_PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X) diff --git a/Marlin/UBL.h b/Marlin/UBL.h index c62e05a31..22b3bc5e0 100644 --- a/Marlin/UBL.h +++ b/Marlin/UBL.h @@ -78,15 +78,15 @@ enum MBLStatus { MBL_STATUS_NONE = 0, MBL_STATUS_HAS_MESH_BIT = 0, MBL_STATUS_ACTIVE_BIT = 1 }; - #define MESH_X_DIST (float(UBL_MESH_MAX_X - (UBL_MESH_MIN_X)) / float(UBL_MESH_NUM_X_POINTS - 1)) - #define MESH_Y_DIST (float(UBL_MESH_MAX_Y - (UBL_MESH_MIN_Y)) / float(UBL_MESH_NUM_Y_POINTS - 1)) + #define MESH_X_DIST (float(UBL_MESH_MAX_X - (UBL_MESH_MIN_X)) / float(GRID_MAX_POINTS_X - 1)) + #define MESH_Y_DIST (float(UBL_MESH_MAX_Y - (UBL_MESH_MIN_Y)) / float(GRID_MAX_POINTS_Y - 1)) typedef struct { bool active = false; float z_offset = 0.0; int8_t eeprom_storage_slot = -1, - n_x = UBL_MESH_NUM_X_POINTS, - n_y = UBL_MESH_NUM_Y_POINTS; + n_x = GRID_MAX_POINTS_X, + n_y = GRID_MAX_POINTS_Y; float mesh_x_min = UBL_MESH_MIN_X, mesh_y_min = UBL_MESH_MIN_Y, @@ -122,9 +122,9 @@ static ubl_state state, pre_initialized; - static float z_values[UBL_MESH_NUM_X_POINTS][UBL_MESH_NUM_Y_POINTS], - mesh_index_to_xpos[UBL_MESH_NUM_X_POINTS + 1], // +1 safety margin for now, until determinism prevails - mesh_index_to_ypos[UBL_MESH_NUM_Y_POINTS + 1]; + static float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], + mesh_index_to_xpos[GRID_MAX_POINTS_X + 1], // +1 safety margin for now, until determinism prevails + mesh_index_to_ypos[GRID_MAX_POINTS_Y + 1]; static bool g26_debug_flag, has_control_of_lcd_panel; @@ -151,14 +151,14 @@ static int8_t get_cell_index_x(const float &x) { const int8_t cx = (x - (UBL_MESH_MIN_X)) * (1.0 / (MESH_X_DIST)); - return constrain(cx, 0, (UBL_MESH_NUM_X_POINTS) - 1); // -1 is appropriate if we want all movement to the X_MAX + return constrain(cx, 0, (GRID_MAX_POINTS_X) - 1); // -1 is appropriate if we want all movement to the X_MAX } // position. But with this defined this way, it is possible // to extrapolate off of this point even further out. Probably // that is OK because something else should be keeping that from // happening and should not be worried about at this level. static int8_t get_cell_index_y(const float &y) { const int8_t cy = (y - (UBL_MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST)); - return constrain(cy, 0, (UBL_MESH_NUM_Y_POINTS) - 1); // -1 is appropriate if we want all movement to the Y_MAX + return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 1); // -1 is appropriate if we want all movement to the Y_MAX } // position. But with this defined this way, it is possible // to extrapolate off of this point even further out. Probably // that is OK because something else should be keeping that from @@ -166,12 +166,12 @@ static int8_t find_closest_x_index(const float &x) { const int8_t px = (x - (UBL_MESH_MIN_X) + (MESH_X_DIST) * 0.5) * (1.0 / (MESH_X_DIST)); - return WITHIN(px, 0, UBL_MESH_NUM_X_POINTS - 1) ? px : -1; + return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; } static int8_t find_closest_y_index(const float &y) { const int8_t py = (y - (UBL_MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * (1.0 / (MESH_Y_DIST)); - return WITHIN(py, 0, UBL_MESH_NUM_Y_POINTS - 1) ? py : -1; + return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; } /** @@ -198,7 +198,7 @@ * the rare occasion when a point lies exactly on a Mesh line (denoted by index yi). */ static inline float z_correction_for_x_on_horizontal_mesh_line(const float &lx0, const int x1_i, const int yi) { - if (!WITHIN(x1_i, 0, UBL_MESH_NUM_X_POINTS - 1) || !WITHIN(yi, 0, UBL_MESH_NUM_Y_POINTS - 1)) { + if (!WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(yi, 0, GRID_MAX_POINTS_Y - 1)) { SERIAL_ECHOPAIR("? in z_correction_for_x_on_horizontal_mesh_line(lx0=", lx0); SERIAL_ECHOPAIR(",x1_i=", x1_i); SERIAL_ECHOPAIR(",yi=", yi); @@ -217,7 +217,7 @@ // See comments above for z_correction_for_x_on_horizontal_mesh_line // static inline float z_correction_for_y_on_vertical_mesh_line(const float &ly0, const int xi, const int y1_i) { - if (!WITHIN(xi, 0, UBL_MESH_NUM_X_POINTS - 1) || !WITHIN(y1_i, 0, UBL_MESH_NUM_Y_POINTS - 1)) { + if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) { SERIAL_ECHOPAIR("? in get_z_correction_along_vertical_mesh_line_at_specific_x(ly0=", ly0); SERIAL_ECHOPAIR(", x1_i=", xi); SERIAL_ECHOPAIR(", yi=", y1_i); @@ -242,7 +242,7 @@ const int8_t cx = get_cell_index_x(RAW_X_POSITION(lx0)), cy = get_cell_index_y(RAW_Y_POSITION(ly0)); - if (!WITHIN(cx, 0, UBL_MESH_NUM_X_POINTS - 1) || !WITHIN(cy, 0, UBL_MESH_NUM_Y_POINTS - 1)) { + if (!WITHIN(cx, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(cy, 0, GRID_MAX_POINTS_Y - 1)) { SERIAL_ECHOPAIR("? in get_z_correction(lx0=", lx0); SERIAL_ECHOPAIR(", ly0=", ly0); diff --git a/Marlin/UBL_Bed_Leveling.cpp b/Marlin/UBL_Bed_Leveling.cpp index 6bf29dc7c..330d2c2e5 100644 --- a/Marlin/UBL_Bed_Leveling.cpp +++ b/Marlin/UBL_Bed_Leveling.cpp @@ -48,7 +48,7 @@ } static void serial_echo_10x_spaces() { - for (uint8_t i = UBL_MESH_NUM_X_POINTS - 1; --i;) { + for (uint8_t i = GRID_MAX_POINTS_X - 1; --i;) { SERIAL_ECHOPGM(" "); #if TX_BUFFER_SIZE > 0 MYSERIAL.flushTX(); @@ -59,10 +59,10 @@ ubl_state unified_bed_leveling::state, unified_bed_leveling::pre_initialized; - float unified_bed_leveling::z_values[UBL_MESH_NUM_X_POINTS][UBL_MESH_NUM_Y_POINTS], + float unified_bed_leveling::z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], unified_bed_leveling::last_specified_z, - unified_bed_leveling::mesh_index_to_xpos[UBL_MESH_NUM_X_POINTS + 1], // +1 safety margin for now, until determinism prevails - unified_bed_leveling::mesh_index_to_ypos[UBL_MESH_NUM_Y_POINTS + 1]; + unified_bed_leveling::mesh_index_to_xpos[GRID_MAX_POINTS_X + 1], // +1 safety margin for now, until determinism prevails + unified_bed_leveling::mesh_index_to_ypos[GRID_MAX_POINTS_Y + 1]; bool unified_bed_leveling::g26_debug_flag = false, unified_bed_leveling::has_control_of_lcd_panel = false; @@ -165,8 +165,8 @@ void unified_bed_leveling::invalidate() { state.active = false; state.z_offset = 0; - for (int x = 0; x < UBL_MESH_NUM_X_POINTS; x++) - for (int y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) + for (int x = 0; x < GRID_MAX_POINTS_X; x++) + for (int y = 0; y < GRID_MAX_POINTS_Y; y++) z_values[x][y] = NAN; } @@ -176,13 +176,13 @@ if (map0) { SERIAL_PROTOCOLLNPGM("\nBed Topography Report:\n"); - serial_echo_xy(0, UBL_MESH_NUM_Y_POINTS - 1); + serial_echo_xy(0, GRID_MAX_POINTS_Y - 1); SERIAL_ECHOPGM(" "); } if (map0) { serial_echo_10x_spaces(); - serial_echo_xy(UBL_MESH_NUM_X_POINTS - 1, UBL_MESH_NUM_Y_POINTS - 1); + serial_echo_xy(GRID_MAX_POINTS_X - 1, GRID_MAX_POINTS_Y - 1); SERIAL_EOL; serial_echo_xy(UBL_MESH_MIN_X, UBL_MESH_MIN_Y); serial_echo_10x_spaces(); @@ -193,8 +193,8 @@ const float current_xi = ubl.get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0), current_yi = ubl.get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0); - for (int8_t j = UBL_MESH_NUM_Y_POINTS - 1; j >= 0; j--) { - for (uint8_t i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { + for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) { + for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { const bool is_current = i == current_xi && j == current_yi; // is the nozzle here? then mark the number @@ -210,7 +210,7 @@ SERIAL_PROTOCOL_F(f, 3); idle(); } - if (!map0 && i < UBL_MESH_NUM_X_POINTS - 1) SERIAL_CHAR(','); + if (!map0 && i < GRID_MAX_POINTS_X - 1) SERIAL_CHAR(','); #if TX_BUFFER_SIZE > 0 MYSERIAL.flushTX(); @@ -237,7 +237,7 @@ serial_echo_xy(0, 0); SERIAL_ECHOPGM(" "); serial_echo_10x_spaces(); - serial_echo_xy(UBL_MESH_NUM_X_POINTS - 1, 0); + serial_echo_xy(GRID_MAX_POINTS_X - 1, 0); SERIAL_EOL; } } @@ -245,12 +245,12 @@ bool unified_bed_leveling::sanity_check() { uint8_t error_flag = 0; - if (state.n_x != UBL_MESH_NUM_X_POINTS) { - SERIAL_PROTOCOLLNPGM("?UBL_MESH_NUM_X_POINTS set wrong\n"); + if (state.n_x != GRID_MAX_POINTS_X) { + SERIAL_PROTOCOLLNPGM("?GRID_MAX_POINTS_X set wrong\n"); error_flag++; } - if (state.n_y != UBL_MESH_NUM_Y_POINTS) { - SERIAL_PROTOCOLLNPGM("?UBL_MESH_NUM_Y_POINTS set wrong\n"); + if (state.n_y != GRID_MAX_POINTS_Y) { + SERIAL_PROTOCOLLNPGM("?GRID_MAX_POINTS_Y set wrong\n"); error_flag++; } if (state.mesh_x_min != UBL_MESH_MIN_X) { diff --git a/Marlin/UBL_G29.cpp b/Marlin/UBL_G29.cpp index b674027c5..5cb982e3d 100644 --- a/Marlin/UBL_G29.cpp +++ b/Marlin/UBL_G29.cpp @@ -354,24 +354,24 @@ SERIAL_PROTOCOLLNPGM("Loading test_pattern values.\n"); switch (test_pattern) { case 0: - for (uint8_t x = 0; x < UBL_MESH_NUM_X_POINTS; x++) { // Create a bowl shape - similar to - for (uint8_t y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) { // a poorly calibrated Delta. - const float p1 = 0.5 * (UBL_MESH_NUM_X_POINTS) - x, - p2 = 0.5 * (UBL_MESH_NUM_Y_POINTS) - y; + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a bowl shape - similar to + for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { // a poorly calibrated Delta. + const float p1 = 0.5 * (GRID_MAX_POINTS_X) - x, + p2 = 0.5 * (GRID_MAX_POINTS_Y) - y; ubl.z_values[x][y] += 2.0 * HYPOT(p1, p2); } } break; case 1: - for (uint8_t x = 0; x < UBL_MESH_NUM_X_POINTS; x++) { // Create a diagonal line several Mesh cells thick that is raised + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a diagonal line several Mesh cells thick that is raised ubl.z_values[x][x] += 9.999; - ubl.z_values[x][x + (x < UBL_MESH_NUM_Y_POINTS - 1) ? 1 : -1] += 9.999; // We want the altered line several mesh points thick + ubl.z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1] += 9.999; // We want the altered line several mesh points thick } break; case 2: // Allow the user to specify the height because 10mm is a little extreme in some cases. - for (uint8_t x = (UBL_MESH_NUM_X_POINTS) / 3; x < 2 * (UBL_MESH_NUM_X_POINTS) / 3; x++) // Create a rectangular raised area in - for (uint8_t y = (UBL_MESH_NUM_Y_POINTS) / 3; y < 2 * (UBL_MESH_NUM_Y_POINTS) / 3; y++) // the center of the bed + for (uint8_t x = (GRID_MAX_POINTS_X) / 3; x < 2 * (GRID_MAX_POINTS_X) / 3; x++) // Create a rectangular raised area in + for (uint8_t y = (GRID_MAX_POINTS_Y) / 3; y < 2 * (GRID_MAX_POINTS_Y) / 3; y++) // the center of the bed ubl.z_values[x][y] += code_seen('C') ? ubl_constant : 9.99; break; } @@ -592,8 +592,8 @@ if (storage_slot == -1) { // Special case, we are going to 'Export' the mesh to the SERIAL_ECHOLNPGM("G29 I 999"); // host in a form it can be reconstructed on a different machine - for (uint8_t x = 0; x < UBL_MESH_NUM_X_POINTS; x++) - for (uint8_t y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) + for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) if (!isnan(ubl.z_values[x][y])) { SERIAL_ECHOPAIR("M421 I ", x); SERIAL_ECHOPAIR(" J ", y); @@ -694,8 +694,8 @@ sum = sum_of_diff_squared = 0.0; n = 0; - for (x = 0; x < UBL_MESH_NUM_X_POINTS; x++) - for (y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) + for (x = 0; x < GRID_MAX_POINTS_X; x++) + for (y = 0; y < GRID_MAX_POINTS_Y; y++) if (!isnan(ubl.z_values[x][y])) { sum += ubl.z_values[x][y]; n++; @@ -706,8 +706,8 @@ // // Now do the sumation of the squares of difference from mean // - for (x = 0; x < UBL_MESH_NUM_X_POINTS; x++) - for (y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) + for (x = 0; x < GRID_MAX_POINTS_X; x++) + for (y = 0; y < GRID_MAX_POINTS_Y; y++) if (!isnan(ubl.z_values[x][y])) { difference = (ubl.z_values[x][y] - mean); sum_of_diff_squared += difference * difference; @@ -724,15 +724,15 @@ SERIAL_EOL; if (c_flag) - for (x = 0; x < UBL_MESH_NUM_X_POINTS; x++) - for (y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) + for (x = 0; x < GRID_MAX_POINTS_X; x++) + for (y = 0; y < GRID_MAX_POINTS_Y; y++) if (!isnan(ubl.z_values[x][y])) ubl.z_values[x][y] -= mean + ubl_constant; } void shift_mesh_height() { - for (uint8_t x = 0; x < UBL_MESH_NUM_X_POINTS; x++) - for (uint8_t y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) + for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) if (!isnan(ubl.z_values[x][y])) ubl.z_values[x][y] += ubl_constant; } @@ -848,8 +848,8 @@ SERIAL_ECHO_F(c, 6); SERIAL_EOL; - for (i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { - for (j = 0; j < UBL_MESH_NUM_Y_POINTS; j++) { + for (i = 0; i < GRID_MAX_POINTS_X; i++) { + for (j = 0; j < GRID_MAX_POINTS_Y; j++) { c = -((normal.x * (UBL_MESH_MIN_X + i * (MESH_X_DIST)) + normal.y * (UBL_MESH_MIN_Y + j * (MESH_Y_DIST))) - d); ubl.z_values[i][j] += c; } @@ -1148,7 +1148,7 @@ safe_delay(50); SERIAL_PROTOCOLPGM("X-Axis Mesh Points at: "); - for (uint8_t i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { + for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(ubl.mesh_index_to_xpos[i]), 1); SERIAL_PROTOCOLPGM(" "); safe_delay(50); @@ -1156,7 +1156,7 @@ SERIAL_EOL; SERIAL_PROTOCOLPGM("Y-Axis Mesh Points at: "); - for (uint8_t i = 0; i < UBL_MESH_NUM_Y_POINTS; i++) { + for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; i++) { SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ubl.mesh_index_to_ypos[i]), 1); SERIAL_PROTOCOLPGM(" "); safe_delay(50); @@ -1195,8 +1195,8 @@ SERIAL_PROTOCOLPAIR("sizeof(ubl.state) : ", (int)sizeof(ubl.state)); - SERIAL_PROTOCOLPAIR("\nUBL_MESH_NUM_X_POINTS ", UBL_MESH_NUM_X_POINTS); - SERIAL_PROTOCOLPAIR("\nUBL_MESH_NUM_Y_POINTS ", UBL_MESH_NUM_Y_POINTS); + SERIAL_PROTOCOLPAIR("\nGRID_MAX_POINTS_X ", GRID_MAX_POINTS_X); + SERIAL_PROTOCOLPAIR("\nGRID_MAX_POINTS_Y ", GRID_MAX_POINTS_Y); safe_delay(50); SERIAL_PROTOCOLPAIR("\nUBL_MESH_MIN_X ", UBL_MESH_MIN_X); SERIAL_PROTOCOLPAIR("\nUBL_MESH_MIN_Y ", UBL_MESH_MIN_Y); @@ -1245,7 +1245,7 @@ * use cases for the users. So we can wait and see what to do with it. */ void g29_compare_current_mesh_to_stored_mesh() { - float tmp_z_values[UBL_MESH_NUM_X_POINTS][UBL_MESH_NUM_Y_POINTS]; + float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; if (!code_has_value()) { SERIAL_PROTOCOLLNPGM("?Mesh # required.\n"); @@ -1267,8 +1267,8 @@ SERIAL_PROTOCOLLNPAIR(" loaded from EEPROM address 0x", hex_word(j)); // Soon, we can remove the extra clutter of printing // the address in the EEPROM where the Mesh is stored. - for (uint8_t x = 0; x < UBL_MESH_NUM_X_POINTS; x++) - for (uint8_t y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) + for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) ubl.z_values[x][y] -= tmp_z_values[x][y]; } @@ -1285,8 +1285,8 @@ const float px = lx - (probe_as_reference ? X_PROBE_OFFSET_FROM_EXTRUDER : 0), py = ly - (probe_as_reference ? Y_PROBE_OFFSET_FROM_EXTRUDER : 0); - for (uint8_t i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { - for (uint8_t j = 0; j < UBL_MESH_NUM_Y_POINTS; j++) { + for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { + for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { if ( (type == INVALID && isnan(ubl.z_values[i][j])) // Check to see if this location holds the right thing || (type == REAL && !isnan(ubl.z_values[i][j])) @@ -1314,8 +1314,8 @@ distance = HYPOT(px - mx, py - my) + HYPOT(current_x - mx, current_y - my) * 0.1; if (far_flag) { // If doing the far_flag action, we want to be as far as possible - for (uint8_t k = 0; k < UBL_MESH_NUM_X_POINTS; k++) { // from the starting point and from any other probed points. We - for (uint8_t l = 0; l < UBL_MESH_NUM_Y_POINTS; l++) { // want the next point spread out and filling in any blank spaces + for (uint8_t k = 0; k < GRID_MAX_POINTS_X; k++) { // from the starting point and from any other probed points. We + for (uint8_t l = 0; l < GRID_MAX_POINTS_Y; l++) { // want the next point spread out and filling in any blank spaces if (!isnan(ubl.z_values[k][l])) { // in the mesh. So we add in some of the distance to every probed distance += sq(i - k) * (MESH_X_DIST) * .05 // point we can find. + sq(j - l) * (MESH_Y_DIST) * .05; diff --git a/Marlin/UBL_line_to_destination.cpp b/Marlin/UBL_line_to_destination.cpp index e110a4288..b3a5f73af 100644 --- a/Marlin/UBL_line_to_destination.cpp +++ b/Marlin/UBL_line_to_destination.cpp @@ -135,7 +135,7 @@ * But we detect it and isolate it. For now, we just pass along the request. */ - if (!WITHIN(cell_dest_xi, 0, UBL_MESH_NUM_X_POINTS - 1) || !WITHIN(cell_dest_yi, 0, UBL_MESH_NUM_Y_POINTS - 1)) { + if (!WITHIN(cell_dest_xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(cell_dest_yi, 0, GRID_MAX_POINTS_Y - 1)) { // Note: There is no Z Correction in this case. We are off the grid and don't know what // a reasonable correction would be. diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index dab1acd88..42228b8b3 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -67,8 +67,8 @@ * Mesh bed leveling: * 219 M420 S from mbl.status (bool) * 220 mbl.z_offset (float) - * 224 MESH_NUM_X_POINTS (uint8 as set in firmware) - * 225 MESH_NUM_Y_POINTS (uint8 as set in firmware) + * 224 GRID_MAX_POINTS_X (uint8 as set in firmware) + * 225 GRID_MAX_POINTS_Y (uint8 as set in firmware) * 226 G29 S3 XYZ z_values[][] (float x9, by default, up to float x 81) +288 * * AUTO BED LEVELING @@ -78,8 +78,8 @@ * 266 planner.bed_level_matrix (matrix_3x3 = float x9) * * AUTO_BED_LEVELING_BILINEAR (or placeholder): 47 bytes - * 302 ABL_GRID_MAX_POINTS_X (uint8_t) - * 303 ABL_GRID_MAX_POINTS_Y (uint8_t) + * 302 GRID_MAX_POINTS_X (uint8_t) + * 303 GRID_MAX_POINTS_Y (uint8_t) * 304 bilinear_grid_spacing (int x2) from G29: (B-F)/X, (R-L)/Y * 308 G29 L F bilinear_start (int x2) * 312 bed_level_grid[][] (float x9, up to float x256) +988 @@ -294,9 +294,9 @@ void Config_Postprocess() { #if ENABLED(MESH_BED_LEVELING) // Compile time test that sizeof(mbl.z_values) is as expected - typedef char c_assert[(sizeof(mbl.z_values) == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS) * sizeof(dummy)) ? 1 : -1]; + typedef char c_assert[(sizeof(mbl.z_values) == (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y) * sizeof(dummy)) ? 1 : -1]; const bool leveling_is_on = TEST(mbl.status, MBL_STATUS_HAS_MESH_BIT); - const uint8_t mesh_num_x = MESH_NUM_X_POINTS, mesh_num_y = MESH_NUM_Y_POINTS; + const uint8_t mesh_num_x = GRID_MAX_POINTS_X, mesh_num_y = GRID_MAX_POINTS_Y; EEPROM_WRITE(leveling_is_on); EEPROM_WRITE(mbl.z_offset); EEPROM_WRITE(mesh_num_x); @@ -336,8 +336,8 @@ void Config_Postprocess() { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) // Compile time test that sizeof(bed_level_grid) is as expected - typedef char c_assert[(sizeof(bed_level_grid) == (ABL_GRID_MAX_POINTS_X) * (ABL_GRID_MAX_POINTS_Y) * sizeof(dummy)) ? 1 : -1]; - const uint8_t grid_max_x = ABL_GRID_MAX_POINTS_X, grid_max_y = ABL_GRID_MAX_POINTS_Y; + typedef char c_assert[(sizeof(bed_level_grid) == (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y) * sizeof(dummy)) ? 1 : -1]; + const uint8_t grid_max_x = GRID_MAX_POINTS_X, grid_max_y = GRID_MAX_POINTS_Y; EEPROM_WRITE(grid_max_x); // 1 byte EEPROM_WRITE(grid_max_y); // 1 byte EEPROM_WRITE(bilinear_grid_spacing); // 2 ints @@ -631,7 +631,7 @@ void Config_Postprocess() { #if ENABLED(MESH_BED_LEVELING) mbl.status = leveling_is_on ? _BV(MBL_STATUS_HAS_MESH_BIT) : 0; mbl.z_offset = dummy; - if (mesh_num_x == MESH_NUM_X_POINTS && mesh_num_y == MESH_NUM_Y_POINTS) { + if (mesh_num_x == GRID_MAX_POINTS_X && mesh_num_y == GRID_MAX_POINTS_Y) { // EEPROM data fits the current mesh EEPROM_READ(mbl.z_values); } @@ -668,7 +668,7 @@ void Config_Postprocess() { EEPROM_READ(grid_max_x); // 1 byte EEPROM_READ(grid_max_y); // 1 byte #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - if (grid_max_x == ABL_GRID_MAX_POINTS_X && grid_max_y == ABL_GRID_MAX_POINTS_Y) { + if (grid_max_x == GRID_MAX_POINTS_X && grid_max_y == GRID_MAX_POINTS_Y) { set_bed_leveling_enabled(false); EEPROM_READ(bilinear_grid_spacing); // 2 ints EEPROM_READ(bilinear_start); // 2 ints @@ -1203,8 +1203,8 @@ void Config_ResetDefault() { CONFIG_ECHO_START; } SERIAL_ECHOLNPAIR(" M420 S", mbl.has_mesh() ? 1 : 0); - for (uint8_t py = 1; py <= MESH_NUM_Y_POINTS; py++) { - for (uint8_t px = 1; px <= MESH_NUM_X_POINTS; px++) { + for (uint8_t py = 1; py <= GRID_MAX_POINTS_Y; py++) { + for (uint8_t px = 1; px <= GRID_MAX_POINTS_X; px++) { CONFIG_ECHO_START; SERIAL_ECHOPAIR(" G29 S3 X", (int)px); SERIAL_ECHOPAIR(" Y", (int)py); @@ -1235,14 +1235,14 @@ void Config_ResetDefault() { SERIAL_ECHOPAIR("EEPROM can hold ", (int)((UBL_LAST_EEPROM_INDEX - ubl.eeprom_start) / sizeof(ubl.z_values))); SERIAL_ECHOLNPGM(" meshes.\n"); - SERIAL_ECHOLNPGM("UBL_MESH_NUM_X_POINTS " STRINGIFY(UBL_MESH_NUM_X_POINTS)); - SERIAL_ECHOLNPGM("UBL_MESH_NUM_Y_POINTS " STRINGIFY(UBL_MESH_NUM_Y_POINTS)); + SERIAL_ECHOLNPGM("GRID_MAX_POINTS_X " STRINGIFY(GRID_MAX_POINTS_X)); + SERIAL_ECHOLNPGM("GRID_MAX_POINTS_Y " STRINGIFY(GRID_MAX_POINTS_Y)); - SERIAL_ECHOLNPGM("UBL_MESH_MIN_X " STRINGIFY(UBL_MESH_MIN_X)); - SERIAL_ECHOLNPGM("UBL_MESH_MIN_Y " STRINGIFY(UBL_MESH_MIN_Y)); + SERIAL_ECHOLNPGM("UBL_MESH_MIN_X " STRINGIFY(UBL_MESH_MIN_X)); + SERIAL_ECHOLNPGM("UBL_MESH_MIN_Y " STRINGIFY(UBL_MESH_MIN_Y)); - SERIAL_ECHOLNPGM("UBL_MESH_MAX_X " STRINGIFY(UBL_MESH_MAX_X)); - SERIAL_ECHOLNPGM("UBL_MESH_MAX_Y " STRINGIFY(UBL_MESH_MAX_Y)); + SERIAL_ECHOLNPGM("UBL_MESH_MAX_X " STRINGIFY(UBL_MESH_MAX_X)); + SERIAL_ECHOLNPGM("UBL_MESH_MAX_Y " STRINGIFY(UBL_MESH_MAX_Y)); SERIAL_ECHOLNPGM("MESH_X_DIST " STRINGIFY(MESH_X_DIST)); SERIAL_ECHOLNPGM("MESH_Y_DIST " STRINGIFY(MESH_Y_DIST)); diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index e7497693b..46119be60 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -813,8 +813,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -860,8 +860,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -877,8 +877,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index c25b18494..0d2b6553b 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -796,8 +796,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -843,8 +843,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -860,8 +860,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 69ff05641..f3c6d9be4 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -796,8 +796,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -843,8 +843,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -860,8 +860,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 3eb1b4dee..5b6d17b83 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -805,8 +805,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -852,8 +852,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -869,8 +869,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 5c9a5acb2..efaa962fd 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -807,8 +807,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER @@ -854,8 +854,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -871,8 +871,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 2265ce131..75f637788 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -842,8 +842,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -889,8 +889,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -906,8 +906,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index d7a965bcd..61bde92d1 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -813,8 +813,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -860,8 +860,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -877,8 +877,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index fbc6b5c3a..e798a9c82 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -813,8 +813,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -860,8 +860,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -877,8 +877,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 2238891c9..75f1eb700 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -813,8 +813,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -860,8 +860,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -877,8 +877,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 256d6cd57..8494788eb 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -812,8 +812,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -859,8 +859,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -876,8 +876,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index e6204aa11..08cd979c3 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -828,8 +828,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -875,8 +875,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -892,8 +892,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index c58b09b9a..26c7ca69e 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -834,8 +834,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -881,8 +881,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -898,8 +898,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/TinyBoy2/Configuration.h b/Marlin/example_configurations/TinyBoy2/Configuration.h index a37da0036..c8d108fa7 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration.h @@ -864,8 +864,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -911,8 +911,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -928,8 +928,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 77c5f366f..fdd62abe0 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -805,8 +805,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -852,8 +852,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -869,8 +869,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index c9d9c7eaf..23d58e3e8 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -813,8 +813,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -860,8 +860,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -877,8 +877,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h index 2fbab8ba2..53ee50da6 100644 --- a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h @@ -919,8 +919,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 9 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 9 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 15) @@ -966,8 +966,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -983,8 +983,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 358e781b6..1290d44b8 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -904,8 +904,8 @@ // Set the number of grid points per dimension. // Works best with 5 or more points in each dimension. - #define ABL_GRID_MAX_POINTS_X 9 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 9 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) @@ -951,8 +951,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -968,8 +968,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 879b31430..67db5b00c 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -907,8 +907,8 @@ // Set the number of grid points per dimension. // Works best with 5 or more points in each dimension. - #define ABL_GRID_MAX_POINTS_X 9 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 9 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) @@ -955,8 +955,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -972,8 +972,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 6fc7c721a..f5e040e60 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -906,11 +906,11 @@ // Set the number of grid points per dimension. // Works best with 5 or more points in each dimension. - #define ABL_GRID_MAX_POINTS_X 7 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 7 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS-25) + #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 25) #define LEFT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) #define RIGHT_PROBE_BED_POSITION DELTA_PROBEABLE_RADIUS #define FRONT_PROBE_BED_POSITION -(DELTA_PROBEABLE_RADIUS) @@ -954,8 +954,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -971,8 +971,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 3fd0445d7..fb3cbe3ed 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -917,8 +917,8 @@ // Set the number of grid points per dimension. // Works best with 5 or more points in each dimension. - #define ABL_GRID_MAX_POINTS_X 5 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 5 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) @@ -964,8 +964,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -981,8 +981,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index dca380ed4..86cead434 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -816,8 +816,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -863,8 +863,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -880,8 +880,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index e5ba30695..50f0c20e0 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -809,8 +809,8 @@ #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define ABL_GRID_MAX_POINTS_X 3 - #define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 15 @@ -856,8 +856,8 @@ //=========================================================================== #define UBL_MESH_INSET 1 // Mesh inset margin on print area - #define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. - #define UBL_MESH_NUM_Y_POINTS 10 + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_2_X 39 @@ -873,8 +873,8 @@ //=========================================================================== #define MESH_INSET 10 // Mesh inset margin on print area - #define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. - #define MESH_NUM_Y_POINTS 3 + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS diff --git a/Marlin/mesh_bed_leveling.cpp b/Marlin/mesh_bed_leveling.cpp index 8809b0754..ef7e4ff38 100644 --- a/Marlin/mesh_bed_leveling.cpp +++ b/Marlin/mesh_bed_leveling.cpp @@ -29,14 +29,14 @@ uint8_t mesh_bed_leveling::status; float mesh_bed_leveling::z_offset, - mesh_bed_leveling::z_values[MESH_NUM_Y_POINTS][MESH_NUM_X_POINTS], - mesh_bed_leveling::index_to_xpos[MESH_NUM_X_POINTS], - mesh_bed_leveling::index_to_ypos[MESH_NUM_Y_POINTS]; + mesh_bed_leveling::z_values[GRID_MAX_POINTS_Y][GRID_MAX_POINTS_X], + mesh_bed_leveling::index_to_xpos[GRID_MAX_POINTS_X], + mesh_bed_leveling::index_to_ypos[GRID_MAX_POINTS_Y]; mesh_bed_leveling::mesh_bed_leveling() { - for (uint8_t i = 0; i < MESH_NUM_X_POINTS; ++i) + for (uint8_t i = 0; i < GRID_MAX_POINTS_X; ++i) index_to_xpos[i] = MESH_MIN_X + i * (MESH_X_DIST); - for (uint8_t i = 0; i < MESH_NUM_Y_POINTS; ++i) + for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; ++i) index_to_ypos[i] = MESH_MIN_Y + i * (MESH_Y_DIST); reset(); } diff --git a/Marlin/mesh_bed_leveling.h b/Marlin/mesh_bed_leveling.h index 3b7de0827..9d3bd9e9f 100644 --- a/Marlin/mesh_bed_leveling.h +++ b/Marlin/mesh_bed_leveling.h @@ -40,16 +40,16 @@ MBL_STATUS_REACTIVATE_BIT = 2 }; - #define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X)) / (MESH_NUM_X_POINTS - 1)) - #define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y)) / (MESH_NUM_Y_POINTS - 1)) + #define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X)) / (GRID_MAX_POINTS_X - 1)) + #define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y)) / (GRID_MAX_POINTS_Y - 1)) class mesh_bed_leveling { public: static uint8_t status; // Has Mesh and Is Active bits static float z_offset, - z_values[MESH_NUM_Y_POINTS][MESH_NUM_X_POINTS], - index_to_xpos[MESH_NUM_X_POINTS], - index_to_ypos[MESH_NUM_Y_POINTS]; + z_values[GRID_MAX_POINTS_Y][GRID_MAX_POINTS_X], + index_to_xpos[GRID_MAX_POINTS_X], + index_to_ypos[GRID_MAX_POINTS_Y]; mesh_bed_leveling(); @@ -65,9 +65,9 @@ static void set_reactivate(const bool onOff) { onOff ? SBI(status, MBL_STATUS_REACTIVATE_BIT) : CBI(status, MBL_STATUS_REACTIVATE_BIT); } static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) { - px = index % (MESH_NUM_X_POINTS); - py = index / (MESH_NUM_X_POINTS); - if (py & 1) px = (MESH_NUM_X_POINTS - 1) - px; // Zig zag + px = index % (GRID_MAX_POINTS_X); + py = index / (GRID_MAX_POINTS_X); + if (py & 1) px = (GRID_MAX_POINTS_X - 1) - px; // Zig zag } static void set_zigzag_z(const int8_t index, const float &z) { @@ -78,22 +78,22 @@ static int8_t cell_index_x(const float &x) { int8_t cx = (x - (MESH_MIN_X)) * (1.0 / (MESH_X_DIST)); - return constrain(cx, 0, (MESH_NUM_X_POINTS) - 2); + return constrain(cx, 0, (GRID_MAX_POINTS_X) - 2); } static int8_t cell_index_y(const float &y) { int8_t cy = (y - (MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST)); - return constrain(cy, 0, (MESH_NUM_Y_POINTS) - 2); + return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 2); } static int8_t probe_index_x(const float &x) { int8_t px = (x - (MESH_MIN_X) + 0.5 * (MESH_X_DIST)) * (1.0 / (MESH_X_DIST)); - return WITHIN(px, 0, MESH_NUM_X_POINTS - 1) ? px : -1; + return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; } static int8_t probe_index_y(const float &y) { int8_t py = (y - (MESH_MIN_Y) + 0.5 * (MESH_Y_DIST)) * (1.0 / (MESH_Y_DIST)); - return WITHIN(py, 0, MESH_NUM_Y_POINTS - 1) ? py : -1; + return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; } static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index eedbf5dc4..e74f09c8d 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1335,13 +1335,13 @@ void kill_screen(const char* lcd_msg) { // LCD probed points are from defaults constexpr uint8_t total_probe_points = #if ABL_GRID - (ABL_GRID_MAX_POINTS_X) * (ABL_GRID_MAX_POINTS_Y) + (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y) #elif ENABLED(AUTO_BED_LEVELING_3POINT) int(3) #elif ENABLED(AUTO_BED_LEVELING_UBL) - (UBL_MESH_NUM_X_POINTS) * (UBL_MESH_NUM_Y_POINTS) + (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y) #elif ENABLED(MESH_BED_LEVELING) - (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS) + (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y) #endif ; From 1b3a26f2f5d38510dfac886e8b7ff5688a4c80ba Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 5 Apr 2017 19:25:36 -0500 Subject: [PATCH 2/5] Rename all UBL files with a ubl_ prefix --- Marlin/G26_Mesh_Validation_Tool.cpp | 3 +-- Marlin/Marlin_main.cpp | 2 +- Marlin/configuration_store.cpp | 2 +- Marlin/{UBL_Bed_Leveling.cpp => ubl.cpp} | 2 +- Marlin/{UBL.h => ubl.h} | 0 Marlin/{UBL_G29.cpp => ubl_G29.cpp} | 2 +- Marlin/{UBL_line_to_destination.cpp => ubl_motion.cpp} | 2 +- Marlin/ultralcd.cpp | 2 +- 8 files changed, 7 insertions(+), 8 deletions(-) rename Marlin/{UBL_Bed_Leveling.cpp => ubl.cpp} (99%) rename Marlin/{UBL.h => ubl.h} (100%) rename Marlin/{UBL_G29.cpp => ubl_G29.cpp} (99%) rename Marlin/{UBL_line_to_destination.cpp => ubl_motion.cpp} (99%) diff --git a/Marlin/G26_Mesh_Validation_Tool.cpp b/Marlin/G26_Mesh_Validation_Tool.cpp index fc64eb3cb..12042a5de 100644 --- a/Marlin/G26_Mesh_Validation_Tool.cpp +++ b/Marlin/G26_Mesh_Validation_Tool.cpp @@ -28,12 +28,11 @@ #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(UBL_G26_MESH_EDITING) + #include "ubl.h" #include "Marlin.h" - #include "Configuration.h" #include "planner.h" #include "stepper.h" #include "temperature.h" - #include "UBL.h" #include "ultralcd.h" #define EXTRUSION_MULTIPLIER 1.0 diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6f73300b4..1c610e0b5 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -297,7 +297,7 @@ #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "UBL.h" + #include "ubl.h" unified_bed_leveling ubl; #define UBL_MESH_VALID !( ( ubl.z_values[0][0] == ubl.z_values[0][1] && ubl.z_values[0][1] == ubl.z_values[0][2] \ && ubl.z_values[1][0] == ubl.z_values[1][1] && ubl.z_values[1][1] == ubl.z_values[1][2] \ diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 42228b8b3..eddf51b53 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -165,7 +165,7 @@ #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "UBL.h" + #include "ubl.h" #endif #if ENABLED(ABL_BILINEAR_SUBDIVISION) diff --git a/Marlin/UBL_Bed_Leveling.cpp b/Marlin/ubl.cpp similarity index 99% rename from Marlin/UBL_Bed_Leveling.cpp rename to Marlin/ubl.cpp index 330d2c2e5..48db524c6 100644 --- a/Marlin/UBL_Bed_Leveling.cpp +++ b/Marlin/ubl.cpp @@ -25,7 +25,7 @@ #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "UBL.h" + #include "ubl.h" #include "hex_print_routines.h" /** diff --git a/Marlin/UBL.h b/Marlin/ubl.h similarity index 100% rename from Marlin/UBL.h rename to Marlin/ubl.h diff --git a/Marlin/UBL_G29.cpp b/Marlin/ubl_G29.cpp similarity index 99% rename from Marlin/UBL_G29.cpp rename to Marlin/ubl_G29.cpp index 5cb982e3d..9273b6e6e 100644 --- a/Marlin/UBL_G29.cpp +++ b/Marlin/ubl_G29.cpp @@ -26,7 +26,7 @@ //#include "vector_3.h" //#include "qr_solve.h" - #include "UBL.h" + #include "ubl.h" #include "Marlin.h" #include "hex_print_routines.h" #include "configuration_store.h" diff --git a/Marlin/UBL_line_to_destination.cpp b/Marlin/ubl_motion.cpp similarity index 99% rename from Marlin/UBL_line_to_destination.cpp rename to Marlin/ubl_motion.cpp index b3a5f73af..4bd34dd31 100644 --- a/Marlin/UBL_line_to_destination.cpp +++ b/Marlin/ubl_motion.cpp @@ -24,7 +24,7 @@ #if ENABLED(AUTO_BED_LEVELING_UBL) #include "Marlin.h" - #include "UBL.h" + #include "ubl.h" #include "planner.h" #include #include diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index e74f09c8d..9e59705d5 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -122,7 +122,7 @@ uint16_t max_display_update_time = 0; int32_t lastEncoderMovementMillis; #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "UBL.h" + #include "ubl.h" #endif #if HAS_POWER_SWITCH From e116723b8bbca0f4e20d75edc4b422be270d4948 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 6 Apr 2017 05:36:16 -0500 Subject: [PATCH 3/5] Adjust indentation in ubl.h --- Marlin/ubl.h | 566 ++++++++++++++++++++++++++------------------------- 1 file changed, 284 insertions(+), 282 deletions(-) diff --git a/Marlin/ubl.h b/Marlin/ubl.h index 22b3bc5e0..245173630 100644 --- a/Marlin/ubl.h +++ b/Marlin/ubl.h @@ -20,320 +20,322 @@ * */ -#include "Marlin.h" -#include "math.h" -#include "vector_3.h" - #ifndef UNIFIED_BED_LEVELING_H #define UNIFIED_BED_LEVELING_H - #if ENABLED(AUTO_BED_LEVELING_UBL) - - #define UBL_VERSION "1.00" - #define UBL_OK false - #define UBL_ERR true - - typedef struct { - int8_t x_index, y_index; - float distance; // When populated, the distance from the search location - } mesh_index_pair; - - enum MeshPointType { INVALID, REAL, SET_IN_BITMAP }; - - void dump(char * const str, const float &f); - bool ubl_lcd_clicked(); - void probe_entire_mesh(const float&, const float&, const bool, const bool, const bool); - void debug_current_and_destination(char *title); - void ubl_line_to_destination(const float&, uint8_t); - 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&); - float measure_business_card_thickness(const float&); - mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const float&, const float&, const bool, unsigned int[16], bool); - void find_mean_mesh_height(); - void shift_mesh_height(); - bool g29_parameter_parsing(); - void g29_what_command(); - void g29_eeprom_dump(); - void g29_compare_current_mesh_to_stored_mesh(); - void fine_tune_mesh(const float&, const float&, const bool); - void bit_clear(uint16_t bits[16], uint8_t x, uint8_t y); - void bit_set(uint16_t bits[16], uint8_t x, uint8_t y); - bool is_bit_set(uint16_t bits[16], uint8_t x, uint8_t y); - char *ftostr43sign(const float&, char); - - void gcode_G26(); - void gcode_G28(); - void gcode_G29(); - extern char conv[9]; - - void save_ubl_active_state_and_disable(); - void restore_ubl_active_state_and_leave(); - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - #if ENABLED(ULTRA_LCD) - extern char lcd_status_message[]; - void lcd_quick_feedback(); +#include "MarlinConfig.h" + +#if ENABLED(AUTO_BED_LEVELING_UBL) + + #include "Marlin.h" + #include "math.h" + #include "vector_3.h" + + #define UBL_VERSION "1.00" + #define UBL_OK false + #define UBL_ERR true + + typedef struct { + int8_t x_index, y_index; + float distance; // When populated, the distance from the search location + } mesh_index_pair; + + enum MeshPointType { INVALID, REAL, SET_IN_BITMAP }; + + void dump(char * const str, const float &f); + bool ubl_lcd_clicked(); + void probe_entire_mesh(const float&, const float&, const bool, const bool, const bool); + void debug_current_and_destination(char *title); + void ubl_line_to_destination(const float&, uint8_t); + 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&); + float measure_business_card_thickness(const float&); + mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const float&, const float&, const bool, unsigned int[16], bool); + void find_mean_mesh_height(); + void shift_mesh_height(); + bool g29_parameter_parsing(); + void g29_what_command(); + void g29_eeprom_dump(); + void g29_compare_current_mesh_to_stored_mesh(); + void fine_tune_mesh(const float&, const float&, const bool); + void bit_clear(uint16_t bits[16], uint8_t x, uint8_t y); + void bit_set(uint16_t bits[16], uint8_t x, uint8_t y); + bool is_bit_set(uint16_t bits[16], uint8_t x, uint8_t y); + char *ftostr43sign(const float&, char); + + void gcode_G26(); + void gcode_G28(); + void gcode_G29(); + extern char conv[9]; + + void save_ubl_active_state_and_disable(); + void restore_ubl_active_state_and_leave(); + + /////////////////////////////////////////////////////////////////////////////////////////////////////// + + #if ENABLED(ULTRA_LCD) + extern char lcd_status_message[]; + void lcd_quick_feedback(); + #endif + + enum MBLStatus { MBL_STATUS_NONE = 0, MBL_STATUS_HAS_MESH_BIT = 0, MBL_STATUS_ACTIVE_BIT = 1 }; + + #define MESH_X_DIST (float(UBL_MESH_MAX_X - (UBL_MESH_MIN_X)) / float(GRID_MAX_POINTS_X - 1)) + #define MESH_Y_DIST (float(UBL_MESH_MAX_Y - (UBL_MESH_MIN_Y)) / float(GRID_MAX_POINTS_Y - 1)) + + typedef struct { + bool active = false; + float z_offset = 0.0; + int8_t eeprom_storage_slot = -1, + n_x = GRID_MAX_POINTS_X, + n_y = GRID_MAX_POINTS_Y; + + float mesh_x_min = UBL_MESH_MIN_X, + mesh_y_min = UBL_MESH_MIN_Y, + mesh_x_max = UBL_MESH_MAX_X, + mesh_y_max = UBL_MESH_MAX_Y, + mesh_x_dist = MESH_X_DIST, + mesh_y_dist = MESH_Y_DIST; + + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + float g29_correction_fade_height = 10.0, + g29_fade_height_multiplier = 1.0 / 10.0; // It's cheaper to do a floating point multiply than divide, + // so keep this value and its reciprocal. #endif - enum MBLStatus { MBL_STATUS_NONE = 0, MBL_STATUS_HAS_MESH_BIT = 0, MBL_STATUS_ACTIVE_BIT = 1 }; - - #define MESH_X_DIST (float(UBL_MESH_MAX_X - (UBL_MESH_MIN_X)) / float(GRID_MAX_POINTS_X - 1)) - #define MESH_Y_DIST (float(UBL_MESH_MAX_Y - (UBL_MESH_MIN_Y)) / float(GRID_MAX_POINTS_Y - 1)) - - typedef struct { - bool active = false; - float z_offset = 0.0; - int8_t eeprom_storage_slot = -1, - n_x = GRID_MAX_POINTS_X, - n_y = GRID_MAX_POINTS_Y; - - float mesh_x_min = UBL_MESH_MIN_X, - mesh_y_min = UBL_MESH_MIN_Y, - mesh_x_max = UBL_MESH_MAX_X, - mesh_y_max = UBL_MESH_MAX_Y, - mesh_x_dist = MESH_X_DIST, - mesh_y_dist = MESH_Y_DIST; - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - float g29_correction_fade_height = 10.0, - g29_fade_height_multiplier = 1.0 / 10.0; // It's cheaper to do a floating point multiply than divide, - // so keep this value and its reciprocal. - #endif - - // If you change this struct, adjust TOTAL_STRUCT_SIZE - - #define TOTAL_STRUCT_SIZE 40 // Total size of the above fields - - // padding provides space to add state variables without - // changing the location of data structures in the EEPROM. - // This is for compatibility with future versions to keep - // users from having to regenerate their mesh data. - unsigned char padding[64 - TOTAL_STRUCT_SIZE]; - - } ubl_state; - - class unified_bed_leveling { - private: - - static float last_specified_z; - - public: - - static ubl_state state, pre_initialized; - - static float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], - mesh_index_to_xpos[GRID_MAX_POINTS_X + 1], // +1 safety margin for now, until determinism prevails - mesh_index_to_ypos[GRID_MAX_POINTS_Y + 1]; - - static bool g26_debug_flag, - has_control_of_lcd_panel; - - static int8_t eeprom_start; - - static volatile int encoder_diff; // Volatile because it's changed at interrupt time. - - unified_bed_leveling(); - - static void display_map(const int); - - static void reset(); - static void invalidate(); - - static void store_state(); - static void load_state(); - static void store_mesh(const int16_t); - static void load_mesh(const int16_t); - - static bool sanity_check(); - - static FORCE_INLINE void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } - - static int8_t get_cell_index_x(const float &x) { - const int8_t cx = (x - (UBL_MESH_MIN_X)) * (1.0 / (MESH_X_DIST)); - return constrain(cx, 0, (GRID_MAX_POINTS_X) - 1); // -1 is appropriate if we want all movement to the X_MAX - } // position. But with this defined this way, it is possible - // to extrapolate off of this point even further out. Probably - // that is OK because something else should be keeping that from - // happening and should not be worried about at this level. - static int8_t get_cell_index_y(const float &y) { - const int8_t cy = (y - (UBL_MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST)); - return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 1); // -1 is appropriate if we want all movement to the Y_MAX - } // position. But with this defined this way, it is possible - // to extrapolate off of this point even further out. Probably - // that is OK because something else should be keeping that from - // happening and should not be worried about at this level. - - static int8_t find_closest_x_index(const float &x) { - const int8_t px = (x - (UBL_MESH_MIN_X) + (MESH_X_DIST) * 0.5) * (1.0 / (MESH_X_DIST)); - return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; + // If you change this struct, adjust TOTAL_STRUCT_SIZE + + #define TOTAL_STRUCT_SIZE 40 // Total size of the above fields + + // padding provides space to add state variables without + // changing the location of data structures in the EEPROM. + // This is for compatibility with future versions to keep + // users from having to regenerate their mesh data. + unsigned char padding[64 - TOTAL_STRUCT_SIZE]; + + } ubl_state; + + class unified_bed_leveling { + private: + + static float last_specified_z; + + public: + + static ubl_state state, pre_initialized; + + static float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y], + mesh_index_to_xpos[GRID_MAX_POINTS_X + 1], // +1 safety margin for now, until determinism prevails + mesh_index_to_ypos[GRID_MAX_POINTS_Y + 1]; + + static bool g26_debug_flag, + has_control_of_lcd_panel; + + static int8_t eeprom_start; + + static volatile int encoder_diff; // Volatile because it's changed at interrupt time. + + unified_bed_leveling(); + + static void display_map(const int); + + static void reset(); + static void invalidate(); + + static void store_state(); + static void load_state(); + static void store_mesh(const int16_t); + static void load_mesh(const int16_t); + + static bool sanity_check(); + + static FORCE_INLINE void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } + + static int8_t get_cell_index_x(const float &x) { + const int8_t cx = (x - (UBL_MESH_MIN_X)) * (1.0 / (MESH_X_DIST)); + return constrain(cx, 0, (GRID_MAX_POINTS_X) - 1); // -1 is appropriate if we want all movement to the X_MAX + } // position. But with this defined this way, it is possible + // to extrapolate off of this point even further out. Probably + // that is OK because something else should be keeping that from + // happening and should not be worried about at this level. + static int8_t get_cell_index_y(const float &y) { + const int8_t cy = (y - (UBL_MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST)); + return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 1); // -1 is appropriate if we want all movement to the Y_MAX + } // position. But with this defined this way, it is possible + // to extrapolate off of this point even further out. Probably + // that is OK because something else should be keeping that from + // happening and should not be worried about at this level. + + static int8_t find_closest_x_index(const float &x) { + const int8_t px = (x - (UBL_MESH_MIN_X) + (MESH_X_DIST) * 0.5) * (1.0 / (MESH_X_DIST)); + return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; + } + + static int8_t find_closest_y_index(const float &y) { + const int8_t py = (y - (UBL_MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * (1.0 / (MESH_Y_DIST)); + return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; + } + + /** + * z2 --| + * z0 | | + * | | + (z2-z1) + * z1 | | | + * ---+-------------+--------+-- --| + * a1 a0 a2 + * |<---delta_a---------->| + * + * calc_z0 is the basis for all the Mesh Based correction. It is used to + * find the expected Z Height at a position between two known Z-Height locations. + * + * It is fairly expensive with its 4 floating point additions and 2 floating point + * multiplications. + */ + static FORCE_INLINE float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { + return z1 + (z2 - z1) * (a0 - a1) / (a2 - a1); + } + + /** + * z_correction_for_x_on_horizontal_mesh_line is an optimization for + * the rare occasion when a point lies exactly on a Mesh line (denoted by index yi). + */ + static inline float z_correction_for_x_on_horizontal_mesh_line(const float &lx0, const int x1_i, const int yi) { + if (!WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(yi, 0, GRID_MAX_POINTS_Y - 1)) { + SERIAL_ECHOPAIR("? in z_correction_for_x_on_horizontal_mesh_line(lx0=", lx0); + SERIAL_ECHOPAIR(",x1_i=", x1_i); + SERIAL_ECHOPAIR(",yi=", yi); + SERIAL_CHAR(')'); + SERIAL_EOL; + return NAN; } - static int8_t find_closest_y_index(const float &y) { - const int8_t py = (y - (UBL_MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * (1.0 / (MESH_Y_DIST)); - return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; + const float xratio = (RAW_X_POSITION(lx0) - mesh_index_to_xpos[x1_i]) * (1.0 / (MESH_X_DIST)), + z1 = z_values[x1_i][yi]; + + return z1 + xratio * (z_values[x1_i + 1][yi] - z1); + } + + // + // See comments above for z_correction_for_x_on_horizontal_mesh_line + // + static inline float z_correction_for_y_on_vertical_mesh_line(const float &ly0, const int xi, const int y1_i) { + if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) { + SERIAL_ECHOPAIR("? in get_z_correction_along_vertical_mesh_line_at_specific_x(ly0=", ly0); + SERIAL_ECHOPAIR(", x1_i=", xi); + SERIAL_ECHOPAIR(", yi=", y1_i); + SERIAL_CHAR(')'); + SERIAL_EOL; + return NAN; } - /** - * z2 --| - * z0 | | - * | | + (z2-z1) - * z1 | | | - * ---+-------------+--------+-- --| - * a1 a0 a2 - * |<---delta_a---------->| - * - * calc_z0 is the basis for all the Mesh Based correction. It is used to - * find the expected Z Height at a position between two known Z-Height locations. - * - * It is fairly expensive with its 4 floating point additions and 2 floating point - * multiplications. - */ - static FORCE_INLINE float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { - return z1 + (z2 - z1) * (a0 - a1) / (a2 - a1); - } + const float yratio = (RAW_Y_POSITION(ly0) - mesh_index_to_ypos[y1_i]) * (1.0 / (MESH_Y_DIST)), + z1 = z_values[xi][y1_i]; - /** - * z_correction_for_x_on_horizontal_mesh_line is an optimization for - * the rare occasion when a point lies exactly on a Mesh line (denoted by index yi). - */ - static inline float z_correction_for_x_on_horizontal_mesh_line(const float &lx0, const int x1_i, const int yi) { - if (!WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(yi, 0, GRID_MAX_POINTS_Y - 1)) { - SERIAL_ECHOPAIR("? in z_correction_for_x_on_horizontal_mesh_line(lx0=", lx0); - SERIAL_ECHOPAIR(",x1_i=", x1_i); - SERIAL_ECHOPAIR(",yi=", yi); - SERIAL_CHAR(')'); - SERIAL_EOL; - return NAN; - } + return z1 + yratio * (z_values[xi][y1_i + 1] - z1); + } - const float xratio = (RAW_X_POSITION(lx0) - mesh_index_to_xpos[x1_i]) * (1.0 / (MESH_X_DIST)), - z1 = z_values[x1_i][yi]; + /** + * This is the generic Z-Correction. It works anywhere within a Mesh Cell. It first + * does a linear interpolation along both of the bounding X-Mesh-Lines to find the + * Z-Height at both ends. Then it does a linear interpolation of these heights based + * on the Y position within the cell. + */ + static float get_z_correction(const float &lx0, const float &ly0) { + const int8_t cx = get_cell_index_x(RAW_X_POSITION(lx0)), + cy = get_cell_index_y(RAW_Y_POSITION(ly0)); - return z1 + xratio * (z_values[x1_i + 1][yi] - z1); - } + if (!WITHIN(cx, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(cy, 0, GRID_MAX_POINTS_Y - 1)) { - // - // See comments above for z_correction_for_x_on_horizontal_mesh_line - // - static inline float z_correction_for_y_on_vertical_mesh_line(const float &ly0, const int xi, const int y1_i) { - if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) { - SERIAL_ECHOPAIR("? in get_z_correction_along_vertical_mesh_line_at_specific_x(ly0=", ly0); - SERIAL_ECHOPAIR(", x1_i=", xi); - SERIAL_ECHOPAIR(", yi=", y1_i); - SERIAL_CHAR(')'); - SERIAL_EOL; - return NAN; - } + SERIAL_ECHOPAIR("? in get_z_correction(lx0=", lx0); + SERIAL_ECHOPAIR(", ly0=", ly0); + SERIAL_CHAR(')'); + SERIAL_EOL; - const float yratio = (RAW_Y_POSITION(ly0) - mesh_index_to_ypos[y1_i]) * (1.0 / (MESH_Y_DIST)), - z1 = z_values[xi][y1_i]; - - return z1 + yratio * (z_values[xi][y1_i + 1] - z1); + #if ENABLED(ULTRA_LCD) + strcpy(lcd_status_message, "get_z_correction() indexes out of range."); + lcd_quick_feedback(); + #endif + return 0.0; // this used to return state.z_offset } - /** - * This is the generic Z-Correction. It works anywhere within a Mesh Cell. It first - * does a linear interpolation along both of the bounding X-Mesh-Lines to find the - * Z-Height at both ends. Then it does a linear interpolation of these heights based - * on the Y position within the cell. - */ - static float get_z_correction(const float &lx0, const float &ly0) { - const int8_t cx = get_cell_index_x(RAW_X_POSITION(lx0)), - cy = get_cell_index_y(RAW_Y_POSITION(ly0)); - - if (!WITHIN(cx, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(cy, 0, GRID_MAX_POINTS_Y - 1)) { - - SERIAL_ECHOPAIR("? in get_z_correction(lx0=", lx0); - SERIAL_ECHOPAIR(", ly0=", ly0); - SERIAL_CHAR(')'); - SERIAL_EOL; + const float z1 = calc_z0(RAW_X_POSITION(lx0), + mesh_index_to_xpos[cx], z_values[cx][cy], + mesh_index_to_xpos[cx + 1], z_values[cx + 1][cy]), + z2 = calc_z0(RAW_X_POSITION(lx0), + mesh_index_to_xpos[cx], z_values[cx][cy + 1], + mesh_index_to_xpos[cx + 1], z_values[cx + 1][cy + 1]); + float z0 = calc_z0(RAW_Y_POSITION(ly0), + mesh_index_to_ypos[cy], z1, + mesh_index_to_ypos[cy + 1], z2); + + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(MESH_ADJUST)) { + SERIAL_ECHOPAIR(" raw get_z_correction(", lx0); + SERIAL_CHAR(',') + SERIAL_ECHO(ly0); + SERIAL_ECHOPGM(") = "); + SERIAL_ECHO_F(z0, 6); + } + #endif - #if ENABLED(ULTRA_LCD) - strcpy(lcd_status_message, "get_z_correction() indexes out of range."); - lcd_quick_feedback(); - #endif - return 0.0; // this used to return state.z_offset + #if ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(MESH_ADJUST)) { + SERIAL_ECHOPGM(" >>>---> "); + SERIAL_ECHO_F(z0, 6); + SERIAL_EOL; } + #endif - const float z1 = calc_z0(RAW_X_POSITION(lx0), - mesh_index_to_xpos[cx], z_values[cx][cy], - mesh_index_to_xpos[cx + 1], z_values[cx + 1][cy]), - z2 = calc_z0(RAW_X_POSITION(lx0), - mesh_index_to_xpos[cx], z_values[cx][cy + 1], - mesh_index_to_xpos[cx + 1], z_values[cx + 1][cy + 1]); - float z0 = calc_z0(RAW_Y_POSITION(ly0), - mesh_index_to_ypos[cy], z1, - mesh_index_to_ypos[cy + 1], z2); + if (isnan(z0)) { // if part of the Mesh is undefined, it will show up as NAN + z0 = 0.0; // in ubl.z_values[][] and propagate through the + // calculations. If our correction is NAN, we throw it out + // because part of the Mesh is undefined and we don't have the + // information we need to complete the height correction. #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPAIR(" raw get_z_correction(", lx0); - SERIAL_CHAR(',') + SERIAL_ECHOPAIR("??? Yikes! NAN in get_z_correction(", lx0); + SERIAL_CHAR(','); SERIAL_ECHO(ly0); - SERIAL_ECHOPGM(") = "); - SERIAL_ECHO_F(z0, 6); - } - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPGM(" >>>---> "); - SERIAL_ECHO_F(z0, 6); + SERIAL_CHAR(')'); SERIAL_EOL; } #endif - - if (isnan(z0)) { // if part of the Mesh is undefined, it will show up as NAN - z0 = 0.0; // in ubl.z_values[][] and propagate through the - // calculations. If our correction is NAN, we throw it out - // because part of the Mesh is undefined and we don't have the - // information we need to complete the height correction. - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPAIR("??? Yikes! NAN in get_z_correction(", lx0); - SERIAL_CHAR(','); - SERIAL_ECHO(ly0); - SERIAL_CHAR(')'); - SERIAL_EOL; - } - #endif - } - return z0; // there used to be a +state.z_offset on this line } + return z0; // there used to be a +state.z_offset on this line + } + + /** + * This function sets the Z leveling fade factor based on the given Z height, + * only re-calculating when necessary. + * + * Returns 1.0 if g29_correction_fade_height is 0.0. + * Returns 0.0 if Z is past the specified 'Fade Height'. + */ + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - /** - * This function sets the Z leveling fade factor based on the given Z height, - * only re-calculating when necessary. - * - * Returns 1.0 if g29_correction_fade_height is 0.0. - * Returns 0.0 if Z is past the specified 'Fade Height'. - */ - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - - static FORCE_INLINE float fade_scaling_factor_for_z(const float &lz) { - if (state.g29_correction_fade_height == 0.0) return 1.0; - - static float fade_scaling_factor = 1.0; - const float rz = RAW_Z_POSITION(lz); - if (last_specified_z != rz) { - last_specified_z = rz; - fade_scaling_factor = - rz < state.g29_correction_fade_height - ? 1.0 - (rz * state.g29_fade_height_multiplier) - : 0.0; - } - return fade_scaling_factor; + static FORCE_INLINE float fade_scaling_factor_for_z(const float &lz) { + if (state.g29_correction_fade_height == 0.0) return 1.0; + + static float fade_scaling_factor = 1.0; + const float rz = RAW_Z_POSITION(lz); + if (last_specified_z != rz) { + last_specified_z = rz; + fade_scaling_factor = + rz < state.g29_correction_fade_height + ? 1.0 - (rz * state.g29_fade_height_multiplier) + : 0.0; } + return fade_scaling_factor; + } - #endif + #endif - }; // class unified_bed_leveling + }; // class unified_bed_leveling - extern unified_bed_leveling ubl; + extern unified_bed_leveling ubl; - #define UBL_LAST_EEPROM_INDEX (E2END - sizeof(unified_bed_leveling::state)) + #define UBL_LAST_EEPROM_INDEX (E2END - sizeof(unified_bed_leveling::state)) - #endif // AUTO_BED_LEVELING_UBL +#endif // AUTO_BED_LEVELING_UBL #endif // UNIFIED_BED_LEVELING_H From 55d296aaf050a8b7d8846f7e3724cbd09a3ce238 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Mar 2017 06:10:31 -0500 Subject: [PATCH 4/5] pinsDebug with more features, uses less RAM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I've just uploaded a major change to pinsDebug. The big change was creating an array in FLASH that contained every active pin definition. That reduced the RAM memory usage considerably but increased the FLASH usage. Creating the array requires going through the pin list twice. Rather than having two copies of it in the code I moved the list out to another file (pinsDebug_list.h) and then just did two #includes. From the user’s view they’ll see the following changes: 1. Now reports all the names assigned to a pin 2. The port is now reported in addition to the pin number. 3. When PWM0A & PWM1C share a pin, both PWMs are reported 4. More PWM/Timer info is reported One new item that may cause some concern is the usage of the LINE predefined preprocessor macro. It may not be available if the Arduino IDE goes to a different compiler. Includes support for 1284 & 1286 families. Memory usage changes when enabling PINS_DEBUGGING: ATmega2560 FLASH . without 52576 . with new 64592 . with old 62826 . new-out 12016 . old-out 10250 . new-old 1766 . RAM . without 2807 . with new 2875 . with old 3545 . new-out 68 . old-out 738 . new-old -670 ================================================================== minor changes - mostly formatting 1) added newline to end of teensyduino file 2) changed flag name from TEENSYDUINO to TEENSYDUINO_IDE. Got warnings about redefining TEENSYDUINO 3) removed some trailing spaces reduce PROGMEM size & update pin list Reduced PROGMEM usage by 1) converting often used macro to a function 2) moved as much as possible into the function This required creating two arrays of address pointers for the PWM registers. ================================================================== update with new M3, M4, M5 pin names ================================================================== report I/O status for unused/unknown pins --- Marlin/pinsDebug.h | 1134 +++++++++++++-------------------------- Marlin/pinsDebug_list.h | 775 ++++++++++++++++++++++++++ 2 files changed, 1135 insertions(+), 774 deletions(-) create mode 100644 Marlin/pinsDebug_list.h diff --git a/Marlin/pinsDebug.h b/Marlin/pinsDebug.h index 8fe48da2a..ec20e47cb 100644 --- a/Marlin/pinsDebug.h +++ b/Marlin/pinsDebug.h @@ -20,649 +20,99 @@ * */ -#include "macros.h" bool endstop_monitor_flag = false; -#if !defined(TIMER1B) // working with Teensyduino extension so need to re-define some things - #include "pinsDebug_Teensyduino.h" +#define NAME_FORMAT "%-28s" // one place to specify the format of all the sources of names + // "-" left justify, "28" minimum width of name, pad with blanks + +#define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7))) + +#define AVR_ATmega2560_FAMILY (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)) +#define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__) || defined(__AVR_AT90USB647__)) +#define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)) + +/** + * This routine minimizes RAM usage by creating a FLASH resident array to + * store the pin names, pin numbers and analog/digital flag. + * + * Creating the array in FLASH is a two pass process. The first pass puts the + * name strings into FLASH. The second pass actually creates the array. + * + * Both passes use the same pin list. The list contains two macro names. The + * actual macro definitions are changed depending on which pass is being done. + * + */ + +// first pass - put the name strings into FLASH + +#define _ADD_PIN_2(PIN_NAME, ENTRY_NAME) static const unsigned char ENTRY_NAME[] PROGMEM = {PIN_NAME}; +#define _ADD_PIN(PIN_NAME, COUNTER) _ADD_PIN_2(PIN_NAME, entry_NAME_##COUNTER) +#define REPORT_NAME_DIGITAL(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER) +#define REPORT_NAME_ANALOG(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER) + +#line 0 // set __LINE__ to a known value for the first pass + +#include "pinsDebug_list.h" + +#line 59 // set __LINE__ to the correct line number or else compiler error messages don't make sense + +// manually add pins that have names that are macros which don't play well with these macros +#if SERIAL_PORT == 0 && (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY) + static const unsigned char RXD_NAME[] PROGMEM = {"RXD"}; + static const unsigned char TXD_NAME[] PROGMEM = {"TXD"}; #endif -#define NAME_FORMAT "%-28s" // one place to specify the format of all the sources of names - // "-" left justify, "28" minimum width of name, pad with blanks +///////////////////////////////////////////////////////////////////////////// -#define _PIN_SAY(NAME) { sprintf(buffer, NAME_FORMAT, NAME); SERIAL_ECHO(buffer); return true; } -#define PIN_SAY(NAME) if (pin == NAME) _PIN_SAY(#NAME); +// second pass - create the array -#define _ANALOG_PIN_SAY(NAME) { sprintf(buffer, NAME_FORMAT, NAME); SERIAL_ECHO(buffer); pin_is_analog = true; return true; } -#define ANALOG_PIN_SAY(NAME) if (pin == analogInputToDigitalPin(NAME)) _ANALOG_PIN_SAY(#NAME); +#undef _ADD_PIN_2 +#undef _ADD_PIN +#undef REPORT_NAME_DIGITAL +#undef REPORT_NAME_ANALOG -#define IS_ANALOG(P) ( WITHIN(P, analogInputToDigitalPin(0), analogInputToDigitalPin(15)) || (P) <= analogInputToDigitalPin(5) ) +#define _ADD_PIN_2( ENTRY_NAME, NAME, IS_DIGITAL) {(const char*) ENTRY_NAME, (const char*)NAME, (const char*)IS_DIGITAL}, +#define _ADD_PIN( NAME, COUNTER, IS_DIGITAL) _ADD_PIN_2( entry_NAME_##COUNTER, NAME, IS_DIGITAL) +#define REPORT_NAME_DIGITAL(NAME, COUNTER) _ADD_PIN( NAME, COUNTER, (uint8_t)1) +#define REPORT_NAME_ANALOG(NAME, COUNTER) _ADD_PIN( analogInputToDigitalPin(NAME), COUNTER, 0) -int digitalRead_mod(int8_t pin) { // same as digitalRead except the PWM stop section has been removed - uint8_t port = digitalPinToPort(pin); - return (port != NOT_A_PIN) && (*portInputRegister(port) & digitalPinToBitMask(pin)) ? HIGH : LOW; -} + +const char* const pin_array[][3] PROGMEM = { /** - * Report pin name for a given fastio digital pin index + * [pin name] [pin number] [is digital or analog] 1 = digital, 0 = analog + * Each entry takes up 6 bytes in FLASH: + * 2 byte pointer to location of the name string + * 2 bytes containing the pin number + * analog pin numbers were convereted to digital when the array was created + * 2 bytes containing the digital/analog bool flag */ -static bool report_pin_name(int8_t pin, bool &pin_is_analog) { - char buffer[30]; // for the sprintf statements - pin_is_analog = false; // default to digital pin - - if (IS_ANALOG(pin)) { - sprintf(buffer, "(A%2d) ", int(pin - analogInputToDigitalPin(0))); - SERIAL_ECHO(buffer); - } - else SERIAL_ECHOPGM(" "); - - #if defined(RXD) && RXD >= 0 - if (pin == 0) { sprintf(buffer, NAME_FORMAT, "RXD"); SERIAL_ECHO(buffer); return true; } + // manually add pins ... + #if SERIAL_PORT == 0 + #if AVR_ATmega2560_FAMILY + {RXD_NAME, 0, 1}, + {TXD_NAME, 1, 1}, + #elif AVR_ATmega1284_FAMILY + {RXD_NAME, 8, 1}, + {TXD_NAME, 9, 1}, + #endif #endif - #if defined(TXD) && TXD >= 0 - if (pin == 1) { sprintf(buffer, NAME_FORMAT, "TXD"); SERIAL_ECHO(buffer); return true; } - #endif + #line 0 // set __LINE__ to the SAME known value for the second pass + #include "pinsDebug_list.h" - // Pin list updated from 7 OCT RCBugfix branch - max length of pin name is 24 - #if defined(__FD) && __FD >= 0 - PIN_SAY(__FD) - #endif - #if defined(__FS) && __FS >= 0 - PIN_SAY(__FS) - #endif - #if defined(__GD) && __GD >= 0 - PIN_SAY(__GD) - #endif - #if defined(__GS) && __GS >= 0 - PIN_SAY(__GS) - #endif +}; // done populating the array - #if PIN_EXISTS(AVR_MISO) - PIN_SAY(AVR_MISO_PIN); - #endif - #if PIN_EXISTS(AVR_MOSI) - PIN_SAY(AVR_MOSI_PIN); - #endif - #if PIN_EXISTS(AVR_SCK) - PIN_SAY(AVR_SCK_PIN); - #endif - #if PIN_EXISTS(AVR_SS) - PIN_SAY(AVR_SS_PIN); - #endif - #if PIN_EXISTS(BEEPER) - PIN_SAY(BEEPER_PIN); - #endif - #if defined(BTN_CENTER) && BTN_CENTER >= 0 - PIN_SAY(BTN_CENTER); - #endif - #if defined(BTN_DOWN) && BTN_DOWN >= 0 - PIN_SAY(BTN_DOWN); - #endif - #if defined(BTN_DWN) && BTN_DWN >= 0 - PIN_SAY(BTN_DWN); - #endif - #if defined(BTN_EN1) && BTN_EN1 >= 0 - PIN_SAY(BTN_EN1); - #endif - #if defined(BTN_EN2) && BTN_EN2 >= 0 - PIN_SAY(BTN_EN2); - #endif - #if defined(BTN_ENC) && BTN_ENC >= 0 - PIN_SAY(BTN_ENC); - #endif - #if defined(BTN_HOME) && BTN_HOME >= 0 - PIN_SAY(BTN_HOME); - #endif - #if defined(BTN_LEFT) && BTN_LEFT >= 0 - PIN_SAY(BTN_LEFT); - #endif - #if defined(BTN_LFT) && BTN_LFT >= 0 - PIN_SAY(BTN_LFT); - #endif - #if defined(BTN_RIGHT) && BTN_RIGHT >= 0 - PIN_SAY(BTN_RIGHT); - #endif - #if defined(BTN_RT) && BTN_RT >= 0 - PIN_SAY(BTN_RT); - #endif - #if defined(BTN_UP) && BTN_UP >= 0 - PIN_SAY(BTN_UP); - #endif - #if PIN_EXISTS(CONTROLLERFAN) - PIN_SAY(CONTROLLERFAN_PIN); - #endif - #if PIN_EXISTS(DAC_DISABLE) - PIN_SAY(DAC_DISABLE_PIN); - #endif - #if defined(DAC_STEPPER_GAIN) && DAC_STEPPER_GAIN >= 0 - PIN_SAY(DAC_STEPPER_GAIN); - #endif - #if defined(DAC_STEPPER_VREF) && DAC_STEPPER_VREF >= 0 - PIN_SAY(DAC_STEPPER_VREF); - #endif - #if PIN_EXISTS(DEBUG) - PIN_SAY(DEBUG_PIN); - #endif - #if PIN_EXISTS(DIGIPOTSS) - PIN_SAY(DIGIPOTSS_PIN); - #endif - #if defined(DOGLCD_A0) && DOGLCD_A0 >= 0 - PIN_SAY(DOGLCD_A0); - #endif - #if defined(DOGLCD_CS) && DOGLCD_CS >= 0 - PIN_SAY(DOGLCD_CS); - #endif - #if defined(DOGLCD_MOSI) && DOGLCD_MOSI >= 0 - PIN_SAY(DOGLCD_MOSI); - #endif - #if defined(DOGLCD_SCK) && DOGLCD_SCK >= 0 - PIN_SAY(DOGLCD_SCK); - #endif - #if PIN_EXISTS(E0_ATT) - PIN_SAY(E0_ATT_PIN); - #endif - #if PIN_EXISTS(E0_AUTO_FAN) - PIN_SAY(E0_AUTO_FAN_PIN); - #endif - #if PIN_EXISTS(E1_AUTO_FAN) - PIN_SAY(E1_AUTO_FAN_PIN); - #endif - #if PIN_EXISTS(E2_AUTO_FAN) - PIN_SAY(E2_AUTO_FAN_PIN); - #endif - #if PIN_EXISTS(E3_AUTO_FAN) - PIN_SAY(E3_AUTO_FAN_PIN); - #endif - #if PIN_EXISTS(E0_DIR) - PIN_SAY(E0_DIR_PIN); - #endif - #if PIN_EXISTS(E0_ENABLE) - PIN_SAY(E0_ENABLE_PIN); - #endif - #if PIN_EXISTS(E0_MS1) - PIN_SAY(E0_MS1_PIN); - #endif - #if PIN_EXISTS(E0_MS2) - PIN_SAY(E0_MS2_PIN); - #endif - #if PIN_EXISTS(E0_STEP) - PIN_SAY(E0_STEP_PIN); - #endif - #if PIN_EXISTS(E1_DIR) - PIN_SAY(E1_DIR_PIN); - #endif - #if PIN_EXISTS(E1_ENABLE) - PIN_SAY(E1_ENABLE_PIN); - #endif - #if PIN_EXISTS(E1_MS1) - PIN_SAY(E1_MS1_PIN); - #endif - #if PIN_EXISTS(E1_MS2) - PIN_SAY(E1_MS2_PIN); - #endif - #if PIN_EXISTS(E1_STEP) - PIN_SAY(E1_STEP_PIN); - #endif - #if PIN_EXISTS(E2_DIR) - PIN_SAY(E2_DIR_PIN); - #endif - #if PIN_EXISTS(E2_ENABLE) - PIN_SAY(E2_ENABLE_PIN); - #endif - #if PIN_EXISTS(E2_STEP) - PIN_SAY(E2_STEP_PIN); - #endif - #if PIN_EXISTS(E3_DIR) - PIN_SAY(E3_DIR_PIN); - #endif - #if PIN_EXISTS(E3_ENABLE) - PIN_SAY(E3_ENABLE_PIN); - #endif - #if PIN_EXISTS(E3_STEP) - PIN_SAY(E3_STEP_PIN); - #endif - #if PIN_EXISTS(E4_DIR) - PIN_SAY(E4_DIR_PIN); - #endif - #if PIN_EXISTS(E4_ENABLE) - PIN_SAY(E4_ENABLE_PIN); - #endif - #if PIN_EXISTS(E4_STEP) - PIN_SAY(E4_STEP_PIN); - #endif - #if defined(encrot1) && encrot1 >= 0 - PIN_SAY(encrot1); - #endif - #if defined(encrot2) && encrot2 >= 0 - PIN_SAY(encrot2); - #endif - #if defined(encrot3) && encrot3 >= 0 - PIN_SAY(encrot3); - #endif - #if defined(EXT_AUX_A0_IO) && EXT_AUX_A0_IO >= 0 - PIN_SAY(EXT_AUX_A0_IO); - #endif - #if defined(EXT_AUX_A1) && EXT_AUX_A1 >= 0 - PIN_SAY(EXT_AUX_A1); - #endif - #if defined(EXT_AUX_A1_IO) && EXT_AUX_A1_IO >= 0 - PIN_SAY(EXT_AUX_A1_IO); - #endif - #if defined(EXT_AUX_A2) && EXT_AUX_A2 >= 0 - PIN_SAY(EXT_AUX_A2); - #endif - #if defined(EXT_AUX_A2_IO) && EXT_AUX_A2_IO >= 0 - PIN_SAY(EXT_AUX_A2_IO); - #endif - #if defined(EXT_AUX_A3) && EXT_AUX_A3 >= 0 - PIN_SAY(EXT_AUX_A3); - #endif - #if defined(EXT_AUX_A3_IO) && EXT_AUX_A3_IO >= 0 - PIN_SAY(EXT_AUX_A3_IO); - #endif - #if defined(EXT_AUX_A4) && EXT_AUX_A4 >= 0 - PIN_SAY(EXT_AUX_A4); - #endif - #if defined(EXT_AUX_A4_IO) && EXT_AUX_A4_IO >= 0 - PIN_SAY(EXT_AUX_A4_IO); - #endif - #if defined(EXT_AUX_PWM_D24) && EXT_AUX_PWM_D24 >= 0 - PIN_SAY(EXT_AUX_PWM_D24); - #endif - #if defined(EXT_AUX_RX1_D2) && EXT_AUX_RX1_D2 >= 0 - PIN_SAY(EXT_AUX_RX1_D2); - #endif - #if defined(EXT_AUX_SDA_D1) && EXT_AUX_SDA_D1 >= 0 - PIN_SAY(EXT_AUX_SDA_D1); - #endif - #if defined(EXT_AUX_TX1_D3) && EXT_AUX_TX1_D3 >= 0 - PIN_SAY(EXT_AUX_TX1_D3); - #endif +#line 109 // set __LINE__ to the correct line number or else compiler error messages don't make sense - #if PIN_EXISTS(FAN) - PIN_SAY(FAN_PIN); - #endif - #if PIN_EXISTS(FAN1) - PIN_SAY(FAN1_PIN); - #endif - #if PIN_EXISTS(FAN2) - PIN_SAY(FAN2_PIN); - #endif - #if PIN_EXISTS(FIL_RUNOUT) - PIN_SAY(FIL_RUNOUT_PIN); - #endif - #if PIN_EXISTS(FILWIDTH) - ANALOG_PIN_SAY(FILWIDTH_PIN); - #endif - #if defined(GEN7_VERSION) && GEN7_VERSION >= 0 - PIN_SAY(GEN7_VERSION); - #endif - #if PIN_EXISTS(HEATER_0) - PIN_SAY(HEATER_0_PIN); - #endif - #if PIN_EXISTS(HEATER_1) - PIN_SAY(HEATER_1_PIN); - #endif - #if PIN_EXISTS(HEATER_2) - PIN_SAY(HEATER_2_PIN); - #endif - #if PIN_EXISTS(HEATER_3) - PIN_SAY(HEATER_3_PIN); - #endif - #if PIN_EXISTS(HEATER_4) - PIN_SAY(HEATER_4_PIN); - #endif - #if PIN_EXISTS(HEATER_5) - PIN_SAY(HEATER_5_PIN); - #endif - #if PIN_EXISTS(HEATER_6) - PIN_SAY(HEATER_6_PIN); - #endif - #if PIN_EXISTS(HEATER_7) - PIN_SAY(HEATER_7_PIN); - #endif - #if PIN_EXISTS(HEATER_BED) - PIN_SAY(HEATER_BED_PIN); - #endif - #if defined(I2C_SCL) && I2C_SCL >= 0 - PIN_SAY(I2C_SCL); - #endif - #if defined(I2C_SDA) && I2C_SDA >= 0 - PIN_SAY(I2C_SDA); - #endif - #if PIN_EXISTS(KILL) - PIN_SAY(KILL_PIN); - #endif - #if PIN_EXISTS(LCD_BACKLIGHT) - PIN_SAY(LCD_BACKLIGHT_PIN); - #endif - #if defined(LCD_CONTRAST) && LCD_CONTRAST >= 0 - PIN_SAY(LCD_CONTRAST); - #endif - #if defined(LCD_PINS_D4) && LCD_PINS_D4 >= 0 - PIN_SAY(LCD_PINS_D4); - #endif - #if defined(LCD_PINS_D5) && LCD_PINS_D5 >= 0 - PIN_SAY(LCD_PINS_D5); - #endif - #if defined(LCD_PINS_D6) && LCD_PINS_D6 >= 0 - PIN_SAY(LCD_PINS_D6); - #endif - #if defined(LCD_PINS_D7) && LCD_PINS_D7 >= 0 - PIN_SAY(LCD_PINS_D7); - #endif - #if defined(LCD_PINS_ENABLE) && LCD_PINS_ENABLE >= 0 - PIN_SAY(LCD_PINS_ENABLE); - #endif - #if defined(LCD_PINS_RS) && LCD_PINS_RS >= 0 - PIN_SAY(LCD_PINS_RS); - #endif - #if defined(LCD_SDSS) && LCD_SDSS >= 0 - PIN_SAY(LCD_SDSS); - #endif - #if PIN_EXISTS(LED) - PIN_SAY(LED_PIN); - #endif - #if PIN_EXISTS(CASE_LIGHT) - PIN_SAY(CASE_LIGHT_PIN); - #endif - #if PIN_EXISTS(MAIN_VOLTAGE_MEASURE) - PIN_SAY(MAIN_VOLTAGE_MEASURE_PIN); - #endif - #if defined(MAX6675_SS) && MAX6675_SS >= 0 - PIN_SAY(MAX6675_SS); - #endif - #if PIN_EXISTS(MISO) - PIN_SAY(MISO_PIN); - #endif - #if PIN_EXISTS(MOSFET_D) - PIN_SAY(MOSFET_D_PIN); - #endif - #if PIN_EXISTS(MOSI) - PIN_SAY(MOSI_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - PIN_SAY(MOTOR_CURRENT_PWM_E_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - PIN_SAY(MOTOR_CURRENT_PWM_XY_PIN); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - PIN_SAY(MOTOR_CURRENT_PWM_Z_PIN); - #endif - #if defined(NUM_TLCS) && NUM_TLCS >= 0 - PIN_SAY(NUM_TLCS); - #endif - #if PIN_EXISTS(PHOTOGRAPH) - PIN_SAY(PHOTOGRAPH_PIN); - #endif - #if PIN_EXISTS(PS_ON) - PIN_SAY(PS_ON_PIN); - #endif - #if PIN_EXISTS(RAMPS_D10) - PIN_SAY(RAMPS_D10_PIN); - #endif - #if PIN_EXISTS(RAMPS_D8) - PIN_SAY(RAMPS_D8_PIN); - #endif - #if PIN_EXISTS(RAMPS_D9) - PIN_SAY(RAMPS_D9_PIN); - #endif - #if PIN_EXISTS(RX_ENABLE) - PIN_SAY(RX_ENABLE_PIN); - #endif - #if PIN_EXISTS(SAFETY_TRIGGERED) - PIN_SAY(SAFETY_TRIGGERED_PIN); - #endif - #if PIN_EXISTS(SCK) - PIN_SAY(SCK_PIN); - #endif - #if defined(SCL) && SCL >= 0 - PIN_SAY(SCL); - #endif - #if PIN_EXISTS(SD_DETECT) - PIN_SAY(SD_DETECT_PIN); - #endif - #if defined(SDA) && SDA >= 0 - PIN_SAY(SDA); - #endif - #if defined(SDPOWER) && SDPOWER >= 0 - PIN_SAY(SDPOWER); - #endif - #if defined(SDSS) && SDSS >= 0 - PIN_SAY(SDSS); - #endif - #if PIN_EXISTS(SERVO0) - PIN_SAY(SERVO0_PIN); - #endif - #if PIN_EXISTS(SERVO1) - PIN_SAY(SERVO1_PIN); - #endif - #if PIN_EXISTS(SERVO2) - PIN_SAY(SERVO2_PIN); - #endif - #if PIN_EXISTS(SERVO3) - PIN_SAY(SERVO3_PIN); - #endif - #if defined(SHIFT_CLK) && SHIFT_CLK >= 0 - PIN_SAY(SHIFT_CLK); - #endif - #if defined(SHIFT_EN) && SHIFT_EN >= 0 - PIN_SAY(SHIFT_EN); - #endif - #if defined(SHIFT_LD) && SHIFT_LD >= 0 - PIN_SAY(SHIFT_LD); - #endif - #if defined(SHIFT_OUT) && SHIFT_OUT >= 0 - PIN_SAY(SHIFT_OUT); - #endif - #if PIN_EXISTS(SLED) - PIN_SAY(SLED_PIN); - #endif - #if PIN_EXISTS(SLEEP_WAKE) - PIN_SAY(SLEEP_WAKE_PIN); - #endif - #if PIN_EXISTS(SOL1) - PIN_SAY(SOL1_PIN); - #endif - #if PIN_EXISTS(SOL2) - PIN_SAY(SOL2_PIN); - #endif - #if PIN_EXISTS(SPINDLE_ENABLE) - PIN_SAY(SPINDLE_ENABLE_PIN); - #endif - #if PIN_EXISTS(SPINDLE_SPEED) - PIN_SAY(SPINDLE_SPEED_PIN); - #endif - #if PIN_EXISTS(SS) - PIN_SAY(SS_PIN); - #endif - #if PIN_EXISTS(STAT_LED_BLUE) - PIN_SAY(STAT_LED_BLUE_PIN); - #endif - #if PIN_EXISTS(STAT_LED_RED) - PIN_SAY(STAT_LED_RED_PIN); - #endif - #if PIN_EXISTS(STEPPER_RESET) - PIN_SAY(STEPPER_RESET_PIN); - #endif - #if PIN_EXISTS(SUICIDE) - PIN_SAY(SUICIDE_PIN); - #endif - #if defined(TC1) && TC1 >= 0 - ANALOG_PIN_SAY(TC1); - #endif - #if defined(TC2) && TC2 >= 0 - ANALOG_PIN_SAY(TC2); - #endif - #if PIN_EXISTS(TEMP_0) - ANALOG_PIN_SAY(TEMP_0_PIN); - #endif - #if PIN_EXISTS(TEMP_1) - ANALOG_PIN_SAY(TEMP_1_PIN); - #endif - #if PIN_EXISTS(TEMP_2) - ANALOG_PIN_SAY(TEMP_2_PIN); - #endif - #if PIN_EXISTS(TEMP_3) - ANALOG_PIN_SAY(TEMP_3_PIN); - #endif - #if PIN_EXISTS(TEMP_4) - ANALOG_PIN_SAY(TEMP_4_PIN); - #endif - #if PIN_EXISTS(TEMP_BED) - ANALOG_PIN_SAY(TEMP_BED_PIN); - #endif - #if PIN_EXISTS(TEMP_X) - ANALOG_PIN_SAY(TEMP_X_PIN); - #endif - #if defined(TLC_BLANK_BIT) && TLC_BLANK_BIT >= 0 - PIN_SAY(TLC_BLANK_BIT); - #endif - #if PIN_EXISTS(TLC_BLANK) - PIN_SAY(TLC_BLANK_PIN); - #endif - #if defined(TLC_CLOCK_BIT) && TLC_CLOCK_BIT >= 0 - PIN_SAY(TLC_CLOCK_BIT); - #endif - #if PIN_EXISTS(TLC_CLOCK) - PIN_SAY(TLC_CLOCK_PIN); - #endif - #if defined(TLC_DATA_BIT) && TLC_DATA_BIT >= 0 - PIN_SAY(TLC_DATA_BIT); - #endif - #if PIN_EXISTS(TLC_DATA) - PIN_SAY(TLC_DATA_PIN); - #endif - #if PIN_EXISTS(TLC_XLAT) - PIN_SAY(TLC_XLAT_PIN); - #endif - #if PIN_EXISTS(TX_ENABLE) - PIN_SAY(TX_ENABLE_PIN); - #endif - #if defined(UNUSED_PWM) && UNUSED_PWM >= 0 - PIN_SAY(UNUSED_PWM); - #endif - #if PIN_EXISTS(X_ATT) - PIN_SAY(X_ATT_PIN); - #endif - #if PIN_EXISTS(X_DIR) - PIN_SAY(X_DIR_PIN); - #endif - #if PIN_EXISTS(X_ENABLE) - PIN_SAY(X_ENABLE_PIN); - #endif - #if PIN_EXISTS(X_MAX) - PIN_SAY(X_MAX_PIN); - #endif - #if PIN_EXISTS(X_MIN) - PIN_SAY(X_MIN_PIN); - #endif - #if PIN_EXISTS(X_MS1) - PIN_SAY(X_MS1_PIN); - #endif - #if PIN_EXISTS(X_MS2) - PIN_SAY(X_MS2_PIN); - #endif - #if PIN_EXISTS(X_STEP) - PIN_SAY(X_STEP_PIN); - #endif - #if PIN_EXISTS(X_STOP) - PIN_SAY(X_STOP_PIN); - #endif - #if PIN_EXISTS(X2_DIR) - PIN_SAY(X2_DIR_PIN); - #endif - #if PIN_EXISTS(X2_ENABLE) - PIN_SAY(X2_ENABLE_PIN); - #endif - #if PIN_EXISTS(X2_STEP) - PIN_SAY(X2_STEP_PIN); - #endif - #if PIN_EXISTS(Y_ATT) - PIN_SAY(Y_ATT_PIN); - #endif - #if PIN_EXISTS(Y_DIR) - PIN_SAY(Y_DIR_PIN); - #endif - #if PIN_EXISTS(Y_ENABLE) - PIN_SAY(Y_ENABLE_PIN); - #endif - #if PIN_EXISTS(Y_MAX) - PIN_SAY(Y_MAX_PIN); - #endif - #if PIN_EXISTS(Y_MIN) - PIN_SAY(Y_MIN_PIN); - #endif - #if PIN_EXISTS(Y_MS1) - PIN_SAY(Y_MS1_PIN); - #endif - #if PIN_EXISTS(Y_MS2) - PIN_SAY(Y_MS2_PIN); - #endif - #if PIN_EXISTS(Y_STEP) - PIN_SAY(Y_STEP_PIN); - #endif - #if PIN_EXISTS(Y_STOP) - PIN_SAY(Y_STOP_PIN); - #endif - #if PIN_EXISTS(Y2_DIR) - PIN_SAY(Y2_DIR_PIN); - #endif - #if PIN_EXISTS(Y2_ENABLE) - PIN_SAY(Y2_ENABLE_PIN); - #endif - #if PIN_EXISTS(Y2_STEP) - PIN_SAY(Y2_STEP_PIN); - #endif - #if PIN_EXISTS(Z_ATT) - PIN_SAY(Z_ATT_PIN); - #endif - #if PIN_EXISTS(Z_DIR) - PIN_SAY(Z_DIR_PIN); - #endif - #if PIN_EXISTS(Z_ENABLE) - PIN_SAY(Z_ENABLE_PIN); - #endif - #if PIN_EXISTS(Z_MAX) - PIN_SAY(Z_MAX_PIN); - #endif - #if PIN_EXISTS(Z_MIN) - PIN_SAY(Z_MIN_PIN); - #endif - #if PIN_EXISTS(Z_MIN_PROBE) - PIN_SAY(Z_MIN_PROBE_PIN); - #endif - #if PIN_EXISTS(Z_MS1) - PIN_SAY(Z_MS1_PIN); - #endif - #if PIN_EXISTS(Z_MS2) - PIN_SAY(Z_MS2_PIN); - #endif - #if PIN_EXISTS(Z_STEP) - PIN_SAY(Z_STEP_PIN); - #endif - #if PIN_EXISTS(Z_STOP) - PIN_SAY(Z_STOP_PIN); - #endif - #if PIN_EXISTS(Z2_DIR) - PIN_SAY(Z2_DIR_PIN); - #endif - #if PIN_EXISTS(Z2_ENABLE) - PIN_SAY(Z2_ENABLE_PIN); - #endif - #if PIN_EXISTS(Z2_STEP) - PIN_SAY(Z2_STEP_PIN); - #endif +#define n_array (sizeof (pin_array) / sizeof (const char *))/3 - sprintf(buffer, NAME_FORMAT, " "); - SERIAL_ECHO(buffer); +#if !defined(TIMER1B) // working with Teensyduino extension so need to re-define some things + #include "pinsDebug_Teensyduino.h" +#endif - return false; -} // report_pin_name #define PWM_PRINT(V) do{ sprintf(buffer, "PWM: %4d", V); SERIAL_ECHO(buffer); }while(0) #define PWM_CASE(N,Z) \ @@ -682,16 +132,18 @@ static bool pwm_status(uint8_t pin) { switch(digitalPinToTimer(pin)) { #if defined(TCCR0A) && defined(COM0A1) - PWM_CASE(0,A); + #if defined (TIMER0A) + PWM_CASE(0,A); + #endif PWM_CASE(0,B); #endif #if defined(TCCR1A) && defined(COM1A1) PWM_CASE(1,A); PWM_CASE(1,B); - #if defined(COM1C1) && defined(TIMER1C) - PWM_CASE(1,C); - #endif + #if defined(COM1C1) && defined (TIMER1C) + PWM_CASE(1,C); + #endif #endif #if defined(TCCR2A) && defined(COM2A1) @@ -726,167 +178,230 @@ static bool pwm_status(uint8_t pin) { SERIAL_PROTOCOLPGM(" "); } // pwm_status -#define WGM_MAKE3(N) (((TCCR##N##B & _BV(WGM##N##2)) >> 1) | (TCCR##N##A & (_BV(WGM##N##0) | _BV(WGM##N##1)))) -#define WGM_MAKE4(N) (WGM_MAKE3(N) | (TCCR##N##B & _BV(WGM##N##3)) >> 1) -#define TIMER_PREFIX(T,L,N) do{ \ - WGM = WGM_MAKE##N(T); \ - SERIAL_PROTOCOLPGM(" TIMER"); \ - SERIAL_PROTOCOLPGM(STRINGIFY(T) STRINGIFY(L)); \ - SERIAL_PROTOCOLPAIR(" WGM: ", WGM); \ - SERIAL_PROTOCOLPAIR(" TIMSK" STRINGIFY(T) ": ", TIMSK##T); \ - }while(0) -#define WGM_TEST1 (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) -#define WGM_TEST2 (WGM == 0 || WGM == 4 || WGM == 12 || WGM == 13) + +const uint8_t* const PWM_other[][3] PROGMEM = { + {&TCCR0A, &TCCR0B, &TIMSK0}, + {&TCCR1A, &TCCR1B, &TIMSK1}, + #if defined(TCCR2A) && defined(COM2A1) + {&TCCR2A, &TCCR2B, &TIMSK2}, + #endif + #if defined(TCCR3A) && defined(COM3A1) + {&TCCR3A, &TCCR3B, &TIMSK3}, + #endif + #ifdef TCCR4A + {&TCCR4A, &TCCR4B, &TIMSK4}, + #endif + #if defined(TCCR5A) && defined(COM5A1) + {&TCCR5A, &TCCR5B, &TIMSK5}, + #endif +}; + + +const uint8_t* const PWM_OCR[][3] PROGMEM = { + + #if defined (TIMER0A) + {&OCR0A,&OCR0B,0}, + #else + {0,&OCR0B,0}, + #endif + + #if defined(COM1C1) && defined (TIMER1C) + { (const uint8_t*) &OCR1A, (const uint8_t*) &OCR1B, (const uint8_t*) &OCR1C}, + #else + { (const uint8_t*) &OCR1A, (const uint8_t*) &OCR1B,0}, + #endif + + #if defined(TCCR2A) && defined(COM2A1) + {&OCR2A,&OCR2B,0}, + #endif + + #if defined(TCCR3A) && defined(COM3A1) + #if defined(COM3C1) + { (const uint8_t*) &OCR3A, (const uint8_t*) &OCR3B, (const uint8_t*) &OCR3C}, + #else + { (const uint8_t*) &OCR3A, (const uint8_t*) &OCR3B,0}, + #endif + #endif + + #ifdef TCCR4A + { (const uint8_t*) &OCR4A, (const uint8_t*) &OCR4B, (const uint8_t*) &OCR4C}, + #endif + + #if defined(TCCR5A) && defined(COM5A1) + { (const uint8_t*) &OCR5A, (const uint8_t*) &OCR5B, (const uint8_t*) &OCR5C}, + #endif +}; + + +#define TCCR_A(T) pgm_read_word(&PWM_other[T][0]) +#define TCCR_B(T) pgm_read_word(&PWM_other[T][1]) +#define TIMSK(T) pgm_read_word(&PWM_other[T][2]) +#define CS_0 0 +#define CS_1 1 +#define CS_2 2 +#define WGM_0 0 +#define WGM_1 1 +#define WGM_2 3 +#define WGM_3 4 +#define TOIE 0 + + +#define OCR_VAL(T, L) pgm_read_word(&PWM_OCR[T][L]) + static void err_is_counter() { - SERIAL_PROTOCOLPGM(" Can't be used as a PWM because of counter mode"); + SERIAL_PROTOCOLPGM(" non-standard PWM mode"); } static void err_is_interrupt() { - SERIAL_PROTOCOLPGM(" Can't be used as a PWM because it's being used as an interrupt"); + SERIAL_PROTOCOLPGM(" compare interrupt enabled "); } static void err_prob_interrupt() { - SERIAL_PROTOCOLPGM(" Probably can't be used as a PWM because counter/timer is being used as an interrupt"); + SERIAL_PROTOCOLPGM(" overflow interrupt enabled"); } static void can_be_used() { SERIAL_PROTOCOLPGM(" can be used as PWM "); } -static void pwm_details(uint8_t pin) { +void com_print(uint8_t N, uint8_t Z) { + uint8_t *TCCRA = (uint8_t*) TCCR_A(N); + SERIAL_PROTOCOLPGM(" COM"); + SERIAL_PROTOCOLCHAR(N + '0'); + switch(Z) { + case 'A' : + SERIAL_PROTOCOLPAIR("A: ", ((*TCCRA & (_BV(7) | _BV(6))) >> 6)); + break; + case 'B' : + SERIAL_PROTOCOLPAIR("B: ", ((*TCCRA & (_BV(5) | _BV(4))) >> 4)); + break; + case 'C' : + SERIAL_PROTOCOLPAIR("C: ", ((*TCCRA & (_BV(3) | _BV(2))) >> 2)); + break; + } +} + +void timer_prefix(uint8_t T, char L, uint8_t N){ // T - timer L - pwm n - WGM bit layout + char buffer[20]; // for the sprintf statements + uint8_t *TCCRB = (uint8_t*) TCCR_B(T); + uint8_t *TCCRA = (uint8_t*) TCCR_A(T); + uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1)))); + if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1); + + SERIAL_PROTOCOLPGM(" TIMER"); + SERIAL_PROTOCOLCHAR(T + '0'); + SERIAL_PROTOCOLCHAR(L); + SERIAL_PROTOCOLPGM(" "); + + if (N == 3) { + uint8_t *OCRVAL8 = (uint8_t*) OCR_VAL(T, L - 'A'); + PWM_PRINT(*OCRVAL8); + } + else { + uint16_t *OCRVAL16 = (uint16_t*) OCR_VAL(T, L - 'A'); + PWM_PRINT(*OCRVAL16); + } + SERIAL_PROTOCOLPAIR(" WGM: ", WGM); + com_print(T,L); + SERIAL_PROTOCOLPAIR(" CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) )); + + SERIAL_PROTOCOLPGM(" TCCR"); + SERIAL_PROTOCOLCHAR(T + '0'); + SERIAL_PROTOCOLPAIR("A: ", *TCCRA); + + SERIAL_PROTOCOLPGM(" TCCR"); + SERIAL_PROTOCOLCHAR(T + '0'); + SERIAL_PROTOCOLPAIR("B: ", *TCCRB); + + uint8_t *TMSK = (uint8_t*) TIMSK(T); + SERIAL_PROTOCOLPGM(" TIMSK"); + SERIAL_PROTOCOLCHAR(T + '0'); + SERIAL_PROTOCOLPAIR(": ", *TMSK); + + uint8_t OCIE = L - 'A' + 1; + if (N == 3) {if (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) err_is_counter();} + else {if (WGM == 0 || WGM == 4 || WGM == 12 || WGM == 13) err_is_counter();} + if (TEST(*TMSK, OCIE)) err_is_interrupt(); + if (TEST(*TMSK, TOIE)) err_prob_interrupt(); +} + + + +static void pwm_details(uint8_t pin) { + char buffer[20]; // for the sprintf statements uint8_t WGM; switch(digitalPinToTimer(pin)) { + #if defined(TCCR0A) && defined(COM0A1) - case TIMER0A: - TIMER_PREFIX(0,A,3); - if (WGM_TEST1) err_is_counter(); - else if (TEST(TIMSK0, OCIE0A)) err_is_interrupt(); - else if (TEST(TIMSK0, TOIE0)) err_prob_interrupt(); - else can_be_used(); - break; + + #if defined (TIMER0A) + case TIMER0A: + timer_prefix(0,'A',3); + break; + #endif case TIMER0B: - TIMER_PREFIX(0,B,3); - if (WGM_TEST1) err_is_counter(); - else if (TEST(TIMSK0, OCIE0B)) err_is_interrupt(); - else if (TEST(TIMSK0, TOIE0)) err_prob_interrupt(); - else can_be_used(); + timer_prefix(0,'B',3); break; #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: - TIMER_PREFIX(1,A,4); - if (WGM_TEST2) err_is_counter(); - else if (TEST(TIMSK1, OCIE1A)) err_is_interrupt(); - else if (TIMSK1 & (_BV(TOIE1) | _BV(ICIE1))) err_prob_interrupt(); - else can_be_used(); + timer_prefix(1,'A',4); break; case TIMER1B: - TIMER_PREFIX(1,B,4); - if (WGM_TEST2) err_is_counter(); - else if (TEST(TIMSK1, OCIE1B)) err_is_interrupt(); - else if (TIMSK1 & (_BV(TOIE1) | _BV(ICIE1))) err_prob_interrupt(); - else can_be_used(); + timer_prefix(1,'B',4); break; - #if defined(COM1C1) && defined(TIMER1C) + #if defined(COM1C1) && defined (TIMER1C) case TIMER1C: - TIMER_PREFIX(1,C,4); - if (WGM_TEST2) err_is_counter(); - else if (TEST(TIMSK1, OCIE1C)) err_is_interrupt(); - else if (TIMSK1 & (_BV(TOIE1) | _BV(ICIE1))) err_prob_interrupt(); - else can_be_used(); + timer_prefix(1,'C',4); break; #endif #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: - TIMER_PREFIX(2,A,3); - if (WGM_TEST1) err_is_counter(); - else if (TIMSK2 & (_BV(TOIE2) | _BV(OCIE2A))) err_is_interrupt(); - else if (TEST(TIMSK2, TOIE2)) err_prob_interrupt(); - else can_be_used(); + timer_prefix(2,'A',3); break; case TIMER2B: - TIMER_PREFIX(2,B,3); - if (WGM_TEST1) err_is_counter(); - else if (TEST(TIMSK2, OCIE2B)) err_is_interrupt(); - else if (TEST(TIMSK2, TOIE2)) err_prob_interrupt(); - else can_be_used(); + timer_prefix(2,'B',3); break; #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: - TIMER_PREFIX(3,A,3); - if (WGM_TEST2) err_is_counter(); - else if (TEST(TIMSK3, OCIE3A)) err_is_interrupt(); - else if (TIMSK3 & (_BV(TOIE3) | _BV(ICIE3))) err_prob_interrupt(); - else can_be_used(); + timer_prefix(3,'A',4); break; case TIMER3B: - TIMER_PREFIX(3,B,3); - if (WGM_TEST2) err_is_counter(); - else if (TEST(TIMSK3, OCIE3B)) err_is_interrupt(); - else if (TIMSK3 & (_BV(TOIE3) | _BV(ICIE3))) err_prob_interrupt(); - else can_be_used(); - break; - #ifdef COM3C1 - case TIMER3C: - TIMER_PREFIX(3,C,3); - if (WGM_TEST2) err_is_counter(); - else if (TEST(TIMSK3, OCIE3C)) err_is_interrupt(); - else if (TIMSK3 & (_BV(TOIE3) | _BV(ICIE3))) err_prob_interrupt(); - else can_be_used(); + timer_prefix(3,'B',4); break; + #if defined(COM3C1) + case TIMER3C: + timer_prefix(3,'C',4); + break; #endif #endif #ifdef TCCR4A case TIMER4A: - TIMER_PREFIX(4,A,4); - if (WGM_TEST2) err_is_counter(); - else if (TEST(TIMSK4, OCIE4A)) err_is_interrupt(); - else if (TIMSK4 & (_BV(TOIE4) | _BV(ICIE4))) err_prob_interrupt(); - else can_be_used(); + timer_prefix(4,'A',4); break; case TIMER4B: - TIMER_PREFIX(4,B,4); - if (WGM_TEST2) err_is_counter(); - else if (TEST(TIMSK4, OCIE4B)) err_is_interrupt(); - else if (TIMSK4 & (_BV(TOIE4) | _BV(ICIE4))) err_prob_interrupt(); - else can_be_used(); + timer_prefix(4,'B',4); break; case TIMER4C: - TIMER_PREFIX(4,C,4); - if (WGM_TEST2) err_is_counter(); - else if (TEST(TIMSK4, OCIE4C)) err_is_interrupt(); - else if (TIMSK4 & (_BV(TOIE4) | _BV(ICIE4))) err_prob_interrupt(); - else can_be_used(); + timer_prefix(4,'C',4); break; #endif #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: - TIMER_PREFIX(5,A,4); - if (WGM_TEST2) err_is_counter(); - else if (TEST(TIMSK5, OCIE5A)) err_is_interrupt(); - else if (TIMSK5 & (_BV(TOIE5) | _BV(ICIE5))) err_prob_interrupt(); - else can_be_used(); + timer_prefix(5,'A',4); break; case TIMER5B: - TIMER_PREFIX(5,B,4); - if (WGM_TEST2) err_is_counter(); - else if (TEST(TIMSK5, OCIE5B)) err_is_interrupt(); - else if (TIMSK5 & (_BV(TOIE5) | _BV(ICIE5))) err_prob_interrupt(); - else can_be_used(); + timer_prefix(5,'B',4); break; case TIMER5C: - TIMER_PREFIX(5,C,4); - if (WGM_TEST2) err_is_counter(); - else if (TEST(TIMSK5, OCIE5C)) err_is_interrupt(); - else if (TIMSK5 & (_BV(TOIE5) | _BV(ICIE5))) err_prob_interrupt(); - else can_be_used(); + timer_prefix(5,'C',4); break; #endif @@ -894,65 +409,136 @@ static void pwm_details(uint8_t pin) { } SERIAL_PROTOCOLPGM(" "); -} // pwm_details -inline void report_pin_state(int8_t pin) { - SERIAL_ECHO((int)pin); - SERIAL_CHAR(' '); - bool dummy; - if (report_pin_name(pin, dummy)) { - if (pin_is_protected(pin)) - SERIAL_ECHOPGM(" (protected)"); - else { - SERIAL_ECHOPGM(" = "); - pinMode(pin, INPUT_PULLUP); - SERIAL_ECHO(digitalRead(pin)); - if (IS_ANALOG(pin)) { - SERIAL_CHAR(' '); SERIAL_CHAR('('); - SERIAL_ECHO(analogRead(pin - analogInputToDigitalPin(0))); - SERIAL_CHAR(')'); - } +// on pins that have two PWMs, print info on second PWM + #if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY + // looking for port B7 - PWMs 0A and 1C + if ( ('B' == digitalPinToPort(pin) + 64) && (0x80 == digitalPinToBitMask(pin))) { + #if !defined(TEENSYDUINO_IDE) + SERIAL_EOL; + SERIAL_PROTOCOLPGM (" . TIMER1C is also tied to this pin "); + timer_prefix(1,'C',4); + #else + SERIAL_EOL; + SERIAL_PROTOCOLPGM (" . TIMER0A is also tied to this pin "); + timer_prefix(0,'A',3); + #endif } - } - SERIAL_EOL; -} + #endif +} // pwm_details bool get_pinMode(int8_t pin) { return *portModeRegister(digitalPinToPort(pin)) & digitalPinToBitMask(pin); } -// pretty report with PWM info -inline void report_pin_state_extended(int8_t pin, bool ignore) { +#if !defined(digitalRead_mod) // use Teensyduino's version of digitalRead - it doesn't disable the PWMs + int digitalRead_mod(int8_t pin) { // same as digitalRead except the PWM stop section has been removed + uint8_t port = digitalPinToPort(pin); + return (port != NOT_A_PIN) && (*portInputRegister(port) & digitalPinToBitMask(pin)) ? HIGH : LOW; + } +#endif - char buffer[30]; // for the sprintf statements +void print_port(int8_t pin) { // print port number + #if defined(digitalPinToPort) + SERIAL_PROTOCOLPGM(" Port: "); + uint8_t x = digitalPinToPort(pin) + 64; + SERIAL_CHAR(x); + uint8_t temp = digitalPinToBitMask(pin); + for (x = '0'; (x < '9' && !(temp == 1)); x++){ + temp = temp >> 1; + } + SERIAL_CHAR(x); + #else + SERIAL_PROTOCOLPGM(" ") + #endif +} - // report pin number - sprintf(buffer, "PIN:% 3d ", pin); - SERIAL_ECHO(buffer); - // report pin name - bool analog_pin; - report_pin_name(pin, analog_pin); +// pretty report with PWM info +inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = true) { + uint8_t temp_char; + char *name_mem_pointer; + char buffer[30]; // for the sprintf statements + bool found = false; + bool multi_name_pin = false; + for (uint8_t x = 0; x < n_array; x++) { // scan entire array and report all instances of this pin + if (pgm_read_byte(&pin_array[x][1]) == pin) { + if (found == true) multi_name_pin = true; + found = true; + if (multi_name_pin == false) { // report digitial and analog pin number only on the first time through + sprintf(buffer, "PIN:% 3d ", pin); // digital pin number + SERIAL_ECHO(buffer); + print_port(pin); + if (IS_ANALOG(pin)) { + sprintf(buffer, " (A%2d) ", int(pin - analogInputToDigitalPin(0))); // analog pin number + SERIAL_ECHO(buffer); + } + else SERIAL_ECHOPGM(" "); // add padding if not an analog pin + } + else SERIAL_ECHOPGM(". "); // add padding if not the first instance found + name_mem_pointer = (char*) pgm_read_word(&pin_array[x][0]); + for (uint8_t y = 0; y < 28; y++) { // always print pin name + temp_char = pgm_read_byte(name_mem_pointer + y); + if (temp_char != 0) MYSERIAL.write(temp_char); + else { + for (uint8_t i = 0; i < 28 - y; i++) MYSERIAL.write(" "); + break; + } + } + if (pin_is_protected(pin) && !ignore) + SERIAL_ECHOPGM("protected "); + else { + if (!(pgm_read_byte(&pin_array[x][2]))) { + sprintf(buffer, "Analog in =% 5d", analogRead(pin - analogInputToDigitalPin(0))); + SERIAL_ECHO(buffer); + } + else { + if (!get_pinMode(pin)) { +// pinMode(pin, INPUT_PULLUP); // make sure input isn't floating - stopped doing this + // because this could interfere with inductive/capacitive + // sensors (high impedance voltage divider) and with PT100 amplifier + SERIAL_PROTOCOLPAIR("Input = ", digitalRead_mod(pin)); + } + else if (pwm_status(pin)) { + // do nothing + } + else SERIAL_PROTOCOLPAIR("Output = ", digitalRead_mod(pin)); + } + if (multi_name_pin == false && extended) pwm_details(pin); // report PWM capabilities only on the first pass & only if doing an extended report + } + SERIAL_EOL; + } // end of IF + } // end of for loop - // report pin state - if (pin_is_protected(pin) && !ignore) - SERIAL_ECHOPGM("protected "); - else { - if (analog_pin) { - sprintf(buffer, "Analog in =% 5d", analogRead(pin - analogInputToDigitalPin(0))); + if (found == false) { + sprintf(buffer, "PIN:% 3d ", pin); + SERIAL_ECHO(buffer); + print_port(pin); + if (IS_ANALOG(pin)) { + sprintf(buffer, " (A%2d) ", int(pin - analogInputToDigitalPin(0))); // analog pin number SERIAL_ECHO(buffer); } + else SERIAL_ECHOPGM(" "); // add padding if not an analog pin + SERIAL_ECHOPGM(""); + if (get_pinMode(pin)) { + SERIAL_PROTOCOLPAIR(" Output = ", digitalRead_mod(pin)); + } else { - if (!get_pinMode(pin)) { - pinMode(pin, INPUT_PULLUP); // make sure input isn't floating - SERIAL_PROTOCOLPAIR("Input = ", digitalRead_mod(pin)); - } - else if (pwm_status(pin)) { - // do nothing + if (IS_ANALOG(pin)) { + sprintf(buffer, " Analog in =% 5d", analogRead(pin - analogInputToDigitalPin(0))); + SERIAL_ECHO(buffer); } - else SERIAL_PROTOCOLPAIR("Output = ", digitalRead_mod(pin)); - } + else { + SERIAL_ECHOPGM(" "); // add padding if not an analog pin + } + SERIAL_PROTOCOLPAIR(" Input = ", digitalRead_mod(pin)); + } +// if (!pwm_status(pin)) SERIAL_ECHOPGM(" "); // add padding if it's not a PWM pin + if (extended) pwm_details(pin); // report PWM capabilities only if doing an extended report + SERIAL_EOL; } +} + +inline void report_pin_state(int8_t pin) { + + report_pin_state_extended(pin, false, false); - // report PWM capabilities - pwm_details(pin); - SERIAL_EOL; } diff --git a/Marlin/pinsDebug_list.h b/Marlin/pinsDebug_list.h new file mode 100644 index 000000000..9ce20fb13 --- /dev/null +++ b/Marlin/pinsDebug_list.h @@ -0,0 +1,775 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + + // Please update this list when adding new pins to Marlin. + // The order doesn't matter. + // Following this pattern is a must. + // If the new pin name is over 28 characters long then pinsDebug.h will need to be modified. + + // Pin list updated from 18 FEB 2017 RCBugfix branch - max length of pin name is 24 +#if defined(__FD) && __FD >= 0 + REPORT_NAME_DIGITAL(__FD, __LINE__ ) +#endif +#if defined(__FS) && __FS >= 0 + REPORT_NAME_DIGITAL(__FS, __LINE__ ) +#endif +#if defined(__GD) && __GD >= 0 + REPORT_NAME_DIGITAL(__GD, __LINE__ ) +#endif +#if defined(__GS) && __GS >= 0 + REPORT_NAME_DIGITAL(__GS, __LINE__ ) +#endif +#if PIN_EXISTS(AVR_MISO) + REPORT_NAME_DIGITAL(AVR_MISO_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(AVR_MOSI) + REPORT_NAME_DIGITAL(AVR_MOSI_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(AVR_SCK) + REPORT_NAME_DIGITAL(AVR_SCK_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(AVR_SS) + REPORT_NAME_DIGITAL(AVR_SS_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(BEEPER) + REPORT_NAME_DIGITAL(BEEPER_PIN, __LINE__ ) +#endif +#if defined(BTN_CENTER) && BTN_CENTER >= 0 + REPORT_NAME_DIGITAL(BTN_CENTER, __LINE__ ) +#endif +#if defined(BTN_DOWN) && BTN_DOWN >= 0 + REPORT_NAME_DIGITAL(BTN_DOWN, __LINE__ ) +#endif +#if defined(BTN_DWN) && BTN_DWN >= 0 + REPORT_NAME_DIGITAL(BTN_DWN, __LINE__ ) +#endif +#if defined(BTN_EN1) && BTN_EN1 >= 0 + REPORT_NAME_DIGITAL(BTN_EN1, __LINE__ ) +#endif +#if defined(BTN_EN2) && BTN_EN2 >= 0 + REPORT_NAME_DIGITAL(BTN_EN2, __LINE__ ) +#endif +#if defined(BTN_ENC) && BTN_ENC >= 0 + REPORT_NAME_DIGITAL(BTN_ENC, __LINE__ ) +#endif +#if defined(BTN_HOME) && BTN_HOME >= 0 + REPORT_NAME_DIGITAL(BTN_HOME, __LINE__ ) +#endif +#if defined(BTN_LEFT) && BTN_LEFT >= 0 + REPORT_NAME_DIGITAL(BTN_LEFT, __LINE__ ) +#endif +#if defined(BTN_LFT) && BTN_LFT >= 0 + REPORT_NAME_DIGITAL(BTN_LFT, __LINE__ ) +#endif +#if defined(BTN_RIGHT) && BTN_RIGHT >= 0 + REPORT_NAME_DIGITAL(BTN_RIGHT, __LINE__ ) +#endif +#if defined(BTN_RT) && BTN_RT >= 0 + REPORT_NAME_DIGITAL(BTN_RT, __LINE__ ) +#endif +#if defined(BTN_UP) && BTN_UP >= 0 + REPORT_NAME_DIGITAL(BTN_UP, __LINE__ ) +#endif +#if PIN_EXISTS(CASE_LIGHT) + REPORT_NAME_DIGITAL(CASE_LIGHT_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(CONTROLLERFAN) + REPORT_NAME_DIGITAL(CONTROLLERFAN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(CUTOFF_RESET) + REPORT_NAME_DIGITAL(CUTOFF_RESET_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(CUTOFF_TEST) + REPORT_NAME_DIGITAL(CUTOFF_TEST_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(DAC_DISABLE) + REPORT_NAME_DIGITAL(DAC_DISABLE_PIN, __LINE__ ) +#endif +#if defined(DAC_STEPPER_VREF) && DAC_STEPPER_VREF >= 0 + REPORT_NAME_DIGITAL(DAC_STEPPER_VREF, __LINE__ ) +#endif +#if PIN_EXISTS(DEBUG) + REPORT_NAME_DIGITAL(DEBUG_PIN, __LINE__ ) +#endif +#if defined(DIGIPOTS_I2C_SCL) && DIGIPOTS_I2C_SCL >= 0 + REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SCL, __LINE__ ) +#endif +#if defined(DIGIPOTS_I2C_SDA_E0) && DIGIPOTS_I2C_SDA_E0 >= 0 + REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_E0, __LINE__ ) +#endif +#if defined(DIGIPOTS_I2C_SDA_E1) && DIGIPOTS_I2C_SDA_E1 >= 0 + REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_E1, __LINE__ ) +#endif +#if defined(DIGIPOTS_I2C_SDA_X) && DIGIPOTS_I2C_SDA_X >= 0 + REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_X, __LINE__ ) +#endif +#if defined(DIGIPOTS_I2C_SDA_Y) && DIGIPOTS_I2C_SDA_Y >= 0 + REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_Y, __LINE__ ) +#endif +#if defined(DIGIPOTS_I2C_SDA_Z) && DIGIPOTS_I2C_SDA_Z >= 0 + REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_Z, __LINE__ ) +#endif +#if PIN_EXISTS(DIGIPOTSS) + REPORT_NAME_DIGITAL(DIGIPOTSS_PIN, __LINE__ ) +#endif +#if defined(DOGLCD_A0) && DOGLCD_A0 >= 0 + REPORT_NAME_DIGITAL(DOGLCD_A0, __LINE__ ) +#endif +#if defined(DOGLCD_CS) && DOGLCD_CS >= 0 + REPORT_NAME_DIGITAL(DOGLCD_CS, __LINE__ ) +#endif +#if defined(DOGLCD_MOSI) && DOGLCD_MOSI >= 0 + REPORT_NAME_DIGITAL(DOGLCD_MOSI, __LINE__ ) +#endif +#if defined(DOGLCD_SCK) && DOGLCD_SCK >= 0 + REPORT_NAME_DIGITAL(DOGLCD_SCK, __LINE__ ) +#endif +#if PIN_EXISTS(E0_ATT) + REPORT_NAME_DIGITAL(E0_ATT_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E0_AUTO_FAN) + REPORT_NAME_DIGITAL(E0_AUTO_FAN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E0_CS) + REPORT_NAME_DIGITAL(E0_CS_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E0_DIR) + REPORT_NAME_DIGITAL(E0_DIR_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E0_ENABLE) + REPORT_NAME_DIGITAL(E0_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E0_MS1) + REPORT_NAME_DIGITAL(E0_MS1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E0_MS2) + REPORT_NAME_DIGITAL(E0_MS2_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E0_STEP) + REPORT_NAME_DIGITAL(E0_STEP_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E1_AUTO_FAN) + REPORT_NAME_DIGITAL(E1_AUTO_FAN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E1_CS) + REPORT_NAME_DIGITAL(E1_CS_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E1_DIR) + REPORT_NAME_DIGITAL(E1_DIR_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E1_ENABLE) + REPORT_NAME_DIGITAL(E1_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E1_MS1) + REPORT_NAME_DIGITAL(E1_MS1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E1_MS2) + REPORT_NAME_DIGITAL(E1_MS2_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E1_STEP) + REPORT_NAME_DIGITAL(E1_STEP_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E2_AUTO_FAN) + REPORT_NAME_DIGITAL(E2_AUTO_FAN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E2_DIR) + REPORT_NAME_DIGITAL(E2_DIR_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E2_ENABLE) + REPORT_NAME_DIGITAL(E2_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E2_STEP) + REPORT_NAME_DIGITAL(E2_STEP_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E3_AUTO_FAN) + REPORT_NAME_DIGITAL(E3_AUTO_FAN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E3_DIR) + REPORT_NAME_DIGITAL(E3_DIR_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E3_ENABLE) + REPORT_NAME_DIGITAL(E3_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E3_STEP) + REPORT_NAME_DIGITAL(E3_STEP_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E4_DIR) + REPORT_NAME_DIGITAL(E4_DIR_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E4_ENABLE) + REPORT_NAME_DIGITAL(E4_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(E4_STEP) + REPORT_NAME_DIGITAL(E4_STEP_PIN, __LINE__ ) +#endif +#if defined(encrot0) && encrot0 >= 0 + REPORT_NAME_DIGITAL(encrot0, __LINE__ ) +#endif +#if defined(encrot1) && encrot1 >= 0 + REPORT_NAME_DIGITAL(encrot1, __LINE__ ) +#endif +#if defined(encrot2) && encrot2 >= 0 + REPORT_NAME_DIGITAL(encrot2, __LINE__ ) +#endif +#if defined(encrot3) && encrot3 >= 0 + REPORT_NAME_DIGITAL(encrot3, __LINE__ ) +#endif +#if defined(EXT_AUX_A0) && EXT_AUX_A0 >= 0 && EXT_AUX_A0 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(EXT_AUX_A0, __LINE__ ) +#endif +#if defined(EXT_AUX_A0) && EXT_AUX_A0 >= 0 && EXT_AUX_A0 >= NUM_ANALOG_INPUTS + REPORT_NAME_DIGITAL(EXT_AUX_A0, __LINE__ ) +#endif +#if defined(EXT_AUX_A0_IO) && EXT_AUX_A0_IO >= 0 + REPORT_NAME_DIGITAL(EXT_AUX_A0_IO, __LINE__ ) +#endif +#if defined(EXT_AUX_A1) && EXT_AUX_A1 >= 0 && EXT_AUX_A1 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(EXT_AUX_A1, __LINE__ ) +#endif +#if defined(EXT_AUX_A1) && EXT_AUX_A1 >= 0 && EXT_AUX_A1 >= NUM_ANALOG_INPUTS + REPORT_NAME_DIGITAL(EXT_AUX_A1, __LINE__ ) +#endif +#if defined(EXT_AUX_A1_IO) && EXT_AUX_A1_IO >= 0 + REPORT_NAME_DIGITAL(EXT_AUX_A1_IO, __LINE__ ) +#endif +#if defined(EXT_AUX_A2) && EXT_AUX_A2 >= 0 && EXT_AUX_A2 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(EXT_AUX_A2, __LINE__ ) +#endif +#if defined(EXT_AUX_A2) && EXT_AUX_A2 >= 0 && EXT_AUX_A2 >= NUM_ANALOG_INPUTS + REPORT_NAME_DIGITAL(EXT_AUX_A2, __LINE__ ) +#endif +#if defined(EXT_AUX_A2_IO) && EXT_AUX_A2_IO >= 0 + REPORT_NAME_DIGITAL(EXT_AUX_A2_IO, __LINE__ ) +#endif +#if defined(EXT_AUX_A3) && EXT_AUX_A3 >= 0 && EXT_AUX_A3 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(EXT_AUX_A3, __LINE__ ) +#endif +#if defined(EXT_AUX_A3) && EXT_AUX_A3 >= 0 && EXT_AUX_A3 >= NUM_ANALOG_INPUTS + REPORT_NAME_DIGITAL(EXT_AUX_A3, __LINE__ ) +#endif +#if defined(EXT_AUX_A3_IO) && EXT_AUX_A3_IO >= 0 + REPORT_NAME_DIGITAL(EXT_AUX_A3_IO, __LINE__ ) +#endif +#if defined(EXT_AUX_A4) && EXT_AUX_A4 >= 0 && EXT_AUX_A4 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(EXT_AUX_A4, __LINE__ ) +#endif +#if defined(EXT_AUX_A4) && EXT_AUX_A4 >= 0 && EXT_AUX_A4 >= NUM_ANALOG_INPUTS + REPORT_NAME_DIGITAL(EXT_AUX_A4, __LINE__ ) +#endif +#if defined(EXT_AUX_A4_IO) && EXT_AUX_A4_IO >= 0 + REPORT_NAME_DIGITAL(EXT_AUX_A4_IO, __LINE__ ) +#endif +#if defined(EXT_AUX_PWM_D24) && EXT_AUX_PWM_D24 >= 0 + REPORT_NAME_DIGITAL(EXT_AUX_PWM_D24, __LINE__ ) +#endif +#if defined(EXT_AUX_RX1_D2) && EXT_AUX_RX1_D2 >= 0 + REPORT_NAME_DIGITAL(EXT_AUX_RX1_D2, __LINE__ ) +#endif +#if defined(EXT_AUX_SCL_D0) && EXT_AUX_SCL_D0 >= 0 + REPORT_NAME_DIGITAL(EXT_AUX_SCL_D0, __LINE__ ) +#endif +#if defined(EXT_AUX_SDA_D1) && EXT_AUX_SDA_D1 >= 0 + REPORT_NAME_DIGITAL(EXT_AUX_SDA_D1, __LINE__ ) +#endif +#if defined(EXT_AUX_TX1_D3) && EXT_AUX_TX1_D3 >= 0 + REPORT_NAME_DIGITAL(EXT_AUX_TX1_D3, __LINE__ ) +#endif +#if defined(EXTRUDER_0_AUTO_FAN) && EXTRUDER_0_AUTO_FAN >= 0 + REPORT_NAME_DIGITAL(EXTRUDER_0_AUTO_FAN, __LINE__ ) +#endif +#if defined(EXTRUDER_1_AUTO_FAN) && EXTRUDER_1_AUTO_FAN >= 0 + REPORT_NAME_DIGITAL(EXTRUDER_1_AUTO_FAN, __LINE__ ) +#endif +#if PIN_EXISTS(FAN) + REPORT_NAME_DIGITAL(FAN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(FAN1) + REPORT_NAME_DIGITAL(FAN1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(FAN2) + REPORT_NAME_DIGITAL(FAN2_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(FIL_RUNOUT) + REPORT_NAME_DIGITAL(FIL_RUNOUT_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(FILWIDTH) && FILWIDTH_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(FILWIDTH_PIN, __LINE__ ) +#endif +#if defined(GEN7_VERSION) && GEN7_VERSION >= 0 + REPORT_NAME_DIGITAL(GEN7_VERSION, __LINE__ ) +#endif +#if PIN_EXISTS(HEATER_0) + REPORT_NAME_DIGITAL(HEATER_0_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(HEATER_1) + REPORT_NAME_DIGITAL(HEATER_1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(HEATER_2) + REPORT_NAME_DIGITAL(HEATER_2_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(HEATER_3) + REPORT_NAME_DIGITAL(HEATER_3_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(HEATER_4) + REPORT_NAME_DIGITAL(HEATER_4_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(HEATER_5) + REPORT_NAME_DIGITAL(HEATER_5_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(HEATER_6) + REPORT_NAME_DIGITAL(HEATER_6_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(HEATER_7) + REPORT_NAME_DIGITAL(HEATER_7_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(HEATER_BED) + REPORT_NAME_DIGITAL(HEATER_BED_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(HOME) + REPORT_NAME_DIGITAL(HOME_PIN, __LINE__ ) +#endif +#if defined(I2C_SCL) && I2C_SCL >= 0 + REPORT_NAME_DIGITAL(I2C_SCL, __LINE__ ) +#endif +#if defined(I2C_SDA) && I2C_SDA >= 0 + REPORT_NAME_DIGITAL(I2C_SDA, __LINE__ ) +#endif +#if PIN_EXISTS(KILL) + REPORT_NAME_DIGITAL(KILL_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(LCD_BACKLIGHT) + REPORT_NAME_DIGITAL(LCD_BACKLIGHT_PIN, __LINE__ ) +#endif +#if defined(LCD_CONTRAST) && LCD_CONTRAST >= 0 + REPORT_NAME_DIGITAL(LCD_CONTRAST, __LINE__ ) +#endif +#if PIN_EXISTS(LCD) + REPORT_NAME_DIGITAL(LCD_PINS_D4, __LINE__ ) +#endif +#if PIN_EXISTS(LCD) + REPORT_NAME_DIGITAL(LCD_PINS_D5, __LINE__ ) +#endif +#if PIN_EXISTS(LCD) + REPORT_NAME_DIGITAL(LCD_PINS_D6, __LINE__ ) +#endif +#if PIN_EXISTS(LCD) + REPORT_NAME_DIGITAL(LCD_PINS_D7, __LINE__ ) +#endif +#if PIN_EXISTS(LCD) + REPORT_NAME_DIGITAL(LCD_PINS_ENABLE, __LINE__ ) +#endif +#if PIN_EXISTS(LCD) + REPORT_NAME_DIGITAL(LCD_PINS_RS, __LINE__ ) +#endif +#if defined(LCD_SDSS) && LCD_SDSS >= 0 + REPORT_NAME_DIGITAL(LCD_SDSS, __LINE__ ) +#endif +#if PIN_EXISTS(LED) + REPORT_NAME_DIGITAL(LED_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(MAIN_VOLTAGE_MEASURE) && MAIN_VOLTAGE_MEASURE_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(MAIN_VOLTAGE_MEASURE_PIN, __LINE__ ) +#endif +#if defined(MAX6675_SS) && MAX6675_SS >= 0 + REPORT_NAME_DIGITAL(MAX6675_SS, __LINE__ ) +#endif +#if PIN_EXISTS(MISO) + REPORT_NAME_DIGITAL(MISO_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(MOSFET_A) + REPORT_NAME_DIGITAL(MOSFET_A_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(MOSFET_B) + REPORT_NAME_DIGITAL(MOSFET_B_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(MOSFET_C) + REPORT_NAME_DIGITAL(MOSFET_C_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(MOSFET_D) + REPORT_NAME_DIGITAL(MOSFET_D_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(MOSI) + REPORT_NAME_DIGITAL(MOSI_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(MOTOR_CURRENT_PWM_E) + REPORT_NAME_DIGITAL(MOTOR_CURRENT_PWM_E_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) + REPORT_NAME_DIGITAL(MOTOR_CURRENT_PWM_XY_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) + REPORT_NAME_DIGITAL(MOTOR_CURRENT_PWM_Z_PIN, __LINE__ ) +#endif +#if defined(NUM_TLCS) && NUM_TLCS >= 0 + REPORT_NAME_DIGITAL(NUM_TLCS, __LINE__ ) +#endif +#if PIN_EXISTS(ORIG_E0_AUTO_FAN) + REPORT_NAME_DIGITAL(ORIG_E0_AUTO_FAN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(ORIG_E1_AUTO_FAN) + REPORT_NAME_DIGITAL(ORIG_E1_AUTO_FAN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(ORIG_E2_AUTO_FAN) + REPORT_NAME_DIGITAL(ORIG_E2_AUTO_FAN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(ORIG_E3_AUTO_FAN) + REPORT_NAME_DIGITAL(ORIG_E3_AUTO_FAN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(PHOTOGRAPH) + REPORT_NAME_DIGITAL(PHOTOGRAPH_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(PS_ON) + REPORT_NAME_DIGITAL(PS_ON_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(PWM_1) + REPORT_NAME_DIGITAL(PWM_1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(PWM_2) + REPORT_NAME_DIGITAL(PWM_2_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(RAMPS_D10) + REPORT_NAME_DIGITAL(RAMPS_D10_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(RAMPS_D8) + REPORT_NAME_DIGITAL(RAMPS_D8_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(RAMPS_D9) + REPORT_NAME_DIGITAL(RAMPS_D9_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(RX_ENABLE) + REPORT_NAME_DIGITAL(RX_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SAFETY_TRIGGERED) + REPORT_NAME_DIGITAL(SAFETY_TRIGGERED_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SCK) + REPORT_NAME_DIGITAL(SCK_PIN, __LINE__ ) +#endif +#if defined(SCL) && SCL >= 0 + REPORT_NAME_DIGITAL(SCL, __LINE__ ) +#endif +#if PIN_EXISTS(SD_DETECT) + REPORT_NAME_DIGITAL(SD_DETECT_PIN, __LINE__ ) +#endif +#if defined(SDA) && SDA >= 0 + REPORT_NAME_DIGITAL(SDA, __LINE__ ) +#endif +#if defined(SDPOWER) && SDPOWER >= 0 + REPORT_NAME_DIGITAL(SDPOWER, __LINE__ ) +#endif +#if defined(SDSS) && SDSS >= 0 + REPORT_NAME_DIGITAL(SDSS, __LINE__ ) +#endif +#if PIN_EXISTS(SERVO0) + REPORT_NAME_DIGITAL(SERVO0_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SERVO1) + REPORT_NAME_DIGITAL(SERVO1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SERVO2) + REPORT_NAME_DIGITAL(SERVO2_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SERVO3) + REPORT_NAME_DIGITAL(SERVO3_PIN, __LINE__ ) +#endif +#if defined(SHIFT_CLK) && SHIFT_CLK >= 0 + REPORT_NAME_DIGITAL(SHIFT_CLK, __LINE__ ) +#endif +#if defined(SHIFT_EN) && SHIFT_EN >= 0 + REPORT_NAME_DIGITAL(SHIFT_EN, __LINE__ ) +#endif +#if defined(SHIFT_LD) && SHIFT_LD >= 0 + REPORT_NAME_DIGITAL(SHIFT_LD, __LINE__ ) +#endif +#if defined(SHIFT_OUT) && SHIFT_OUT >= 0 + REPORT_NAME_DIGITAL(SHIFT_OUT, __LINE__ ) +#endif +#if PIN_EXISTS(SLED) + REPORT_NAME_DIGITAL(SLED_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SLEEP_WAKE) + REPORT_NAME_DIGITAL(SLEEP_WAKE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SOL1) + REPORT_NAME_DIGITAL(SOL1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SOL2) + REPORT_NAME_DIGITAL(SOL2_PIN, __LINE__ ) +#endif +#if defined(SPARE_IO) && SPARE_IO >= 0 + REPORT_NAME_DIGITAL(SPARE_IO, __LINE__ ) +#endif +#if PIN_EXISTS(SPINDLE_DIR) + REPORT_NAME_DIGITAL(SPINDLE_DIR_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SPINDLE_LASER_ENABLE) + REPORT_NAME_DIGITAL(SPINDLE_LASER_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SPINDLE_SPEED_LASER_POWER) + REPORT_NAME_DIGITAL(SPINDLE_SPEED_LASER_POWER_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SR_CLK) + REPORT_NAME_DIGITAL(SR_CLK_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SR_DATA) + REPORT_NAME_DIGITAL(SR_DATA_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SR_STROBE) + REPORT_NAME_DIGITAL(SR_STROBE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SS) + REPORT_NAME_DIGITAL(SS_PIN, __LINE__ ) +#endif +#if defined(STAT_LED_BLUE) && STAT_LED_BLUE >= 0 + REPORT_NAME_DIGITAL(STAT_LED_BLUE, __LINE__ ) +#endif +#if PIN_EXISTS(STAT_LED_BLUE) + REPORT_NAME_DIGITAL(STAT_LED_BLUE_PIN, __LINE__ ) +#endif +#if defined(STAT_LED_RED) && STAT_LED_RED >= 0 + REPORT_NAME_DIGITAL(STAT_LED_RED, __LINE__ ) +#endif +#if PIN_EXISTS(STAT_LED_RED) + REPORT_NAME_DIGITAL(STAT_LED_RED_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(STEPPER_RESET) + REPORT_NAME_DIGITAL(STEPPER_RESET_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(SUICIDE) + REPORT_NAME_DIGITAL(SUICIDE_PIN, __LINE__ ) +#endif +#if defined(TC1) && TC1 >= 0 && TC1 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TC1, __LINE__ ) +#endif +#if defined(TC2) && TC2 >= 0 && TC2 < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TC2, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_0) && TEMP_0_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_0_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_1) && TEMP_1_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_2) && TEMP_2_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_2_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_3) && TEMP_3_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_3_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_4) && TEMP_4_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_4_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_BED) && TEMP_BED_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_BED_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_CHAMBER) && TEMP_CHAMBER_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_CHAMBER_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TEMP_X) && TEMP_X_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(TEMP_X_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(THERMO_DO) + REPORT_NAME_DIGITAL(THERMO_DO_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(THERMO_SCK) + REPORT_NAME_DIGITAL(THERMO_SCK_PIN, __LINE__ ) +#endif +#if defined(TLC_BLANK_BIT) && TLC_BLANK_BIT >= 0 + REPORT_NAME_DIGITAL(TLC_BLANK_BIT, __LINE__ ) +#endif +#if PIN_EXISTS(TLC_BLANK) + REPORT_NAME_DIGITAL(TLC_BLANK_PIN, __LINE__ ) +#endif +#if defined(TLC_CLOCK_BIT) && TLC_CLOCK_BIT >= 0 + REPORT_NAME_DIGITAL(TLC_CLOCK_BIT, __LINE__ ) +#endif +#if PIN_EXISTS(TLC_CLOCK) + REPORT_NAME_DIGITAL(TLC_CLOCK_PIN, __LINE__ ) +#endif +#if defined(TLC_DATA_BIT) && TLC_DATA_BIT >= 0 + REPORT_NAME_DIGITAL(TLC_DATA_BIT, __LINE__ ) +#endif +#if PIN_EXISTS(TLC_DATA) + REPORT_NAME_DIGITAL(TLC_DATA_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TLC_XLAT) + REPORT_NAME_DIGITAL(TLC_XLAT_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TOOL_0) + REPORT_NAME_DIGITAL(TOOL_0_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TOOL_0_PWM) + REPORT_NAME_DIGITAL(TOOL_0_PWM_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TOOL_1) + REPORT_NAME_DIGITAL(TOOL_1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TOOL_1_PWM) + REPORT_NAME_DIGITAL(TOOL_1_PWM_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TOOL_2) + REPORT_NAME_DIGITAL(TOOL_2_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TOOL_2_PWM) + REPORT_NAME_DIGITAL(TOOL_2_PWM_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TOOL_3) + REPORT_NAME_DIGITAL(TOOL_3_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TOOL_3_PWM) + REPORT_NAME_DIGITAL(TOOL_3_PWM_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TOOL_PWM) + REPORT_NAME_DIGITAL(TOOL_PWM_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(TX_ENABLE) + REPORT_NAME_DIGITAL(TX_ENABLE_PIN, __LINE__ ) +#endif +#if defined(UI1) && UI1 >= 0 + REPORT_NAME_DIGITAL(UI1, __LINE__ ) +#endif +#if defined(UI2) && UI2 >= 0 + REPORT_NAME_DIGITAL(UI2, __LINE__ ) +#endif +#if defined(UNUSED_PWM) && UNUSED_PWM >= 0 + REPORT_NAME_DIGITAL(UNUSED_PWM, __LINE__ ) +#endif +#if PIN_EXISTS(X_ATT) + REPORT_NAME_DIGITAL(X_ATT_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(X_CS) + REPORT_NAME_DIGITAL(X_CS_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(X_DIR) + REPORT_NAME_DIGITAL(X_DIR_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(X_ENABLE) + REPORT_NAME_DIGITAL(X_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(X_MAX) + REPORT_NAME_DIGITAL(X_MAX_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(X_MIN) + REPORT_NAME_DIGITAL(X_MIN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(X_MS1) + REPORT_NAME_DIGITAL(X_MS1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(X_MS2) + REPORT_NAME_DIGITAL(X_MS2_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(X_STEP) + REPORT_NAME_DIGITAL(X_STEP_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(X_STOP) + REPORT_NAME_DIGITAL(X_STOP_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(X2_DIR) + REPORT_NAME_DIGITAL(X2_DIR_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(X2_ENABLE) + REPORT_NAME_DIGITAL(X2_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(X2_STEP) + REPORT_NAME_DIGITAL(X2_STEP_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y_ATT) + REPORT_NAME_DIGITAL(Y_ATT_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y_CS) + REPORT_NAME_DIGITAL(Y_CS_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y_DIR) + REPORT_NAME_DIGITAL(Y_DIR_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y_ENABLE) + REPORT_NAME_DIGITAL(Y_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y_MAX) + REPORT_NAME_DIGITAL(Y_MAX_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y_MIN) + REPORT_NAME_DIGITAL(Y_MIN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y_MS1) + REPORT_NAME_DIGITAL(Y_MS1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y_MS2) + REPORT_NAME_DIGITAL(Y_MS2_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y_STEP) + REPORT_NAME_DIGITAL(Y_STEP_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y_STOP) + REPORT_NAME_DIGITAL(Y_STOP_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y2_DIR) + REPORT_NAME_DIGITAL(Y2_DIR_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y2_ENABLE) + REPORT_NAME_DIGITAL(Y2_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Y2_STEP) + REPORT_NAME_DIGITAL(Y2_STEP_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z_ATT) + REPORT_NAME_DIGITAL(Z_ATT_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z_CS) + REPORT_NAME_DIGITAL(Z_CS_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z_DIR) + REPORT_NAME_DIGITAL(Z_DIR_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z_ENABLE) + REPORT_NAME_DIGITAL(Z_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z_MAX) + REPORT_NAME_DIGITAL(Z_MAX_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z_MIN) + REPORT_NAME_DIGITAL(Z_MIN_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z_MIN_PROBE) + REPORT_NAME_DIGITAL(Z_MIN_PROBE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z_MS1) + REPORT_NAME_DIGITAL(Z_MS1_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z_MS2) + REPORT_NAME_DIGITAL(Z_MS2_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z_STEP) + REPORT_NAME_DIGITAL(Z_STEP_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z_STOP) + REPORT_NAME_DIGITAL(Z_STOP_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z2_DIR) + REPORT_NAME_DIGITAL(Z2_DIR_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z2_ENABLE) + REPORT_NAME_DIGITAL(Z2_ENABLE_PIN, __LINE__ ) +#endif +#if PIN_EXISTS(Z2_STEP) + REPORT_NAME_DIGITAL(Z2_STEP_PIN, __LINE__ ) +#endif From 3b8926bd094b7857ef393aa165da587441e33dd1 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Tue, 10 Jan 2017 19:23:22 -0600 Subject: [PATCH 5/5] improved wording, consolidation of info, BLTouch warning ============================================== clarified BLTouch calculation & changed comment delimitters/flags I found it hard to pickout the various sections in this area so I changed most comments from // style to /** ... */ Made the BLTouch calculation simpler and clarified the units of measure for the result. ============================================ add changes to example configurations ============================================ add TinyBoy2 to this PR & add BLTouch Delay --- Marlin/Configuration.h | 235 ++++++++++------- .../Cartesio/Configuration.h | 235 ++++++++++------- .../Felix/Configuration.h | 235 ++++++++++------- .../Felix/DUAL/Configuration.h | 235 ++++++++++------- .../Hephestos/Configuration.h | 235 ++++++++++------- .../Hephestos_2/Configuration.h | 235 ++++++++++------- .../K8200/Configuration.h | 234 ++++++++++------- .../K8400/Configuration.h | 235 ++++++++++------- .../K8400/Dual-head/Configuration.h | 235 ++++++++++------- .../RepRapWorld/Megatronics/Configuration.h | 235 ++++++++++------- .../RigidBot/Configuration.h | 235 ++++++++++------- .../SCARA/Configuration.h | 235 ++++++++++------- .../TAZ4/Configuration.h | 237 ++++++++++------- .../TinyBoy2/Configuration.h | 235 ++++++++++------- .../WITBOX/Configuration.h | 235 ++++++++++------- .../adafruit/ST7565/Configuration.h | 237 ++++++++++------- .../delta/flsun_kossel_mini/Configuration.h | 238 ++++++++++------- .../delta/generic/Configuration.h | 240 ++++++++++------- .../delta/kossel_mini/Configuration.h | 234 ++++++++++------- .../delta/kossel_pro/Configuration.h | 246 +++++++++++------- .../delta/kossel_xl/Configuration.h | 238 ++++++++++------- .../makibox/Configuration.h | 235 ++++++++++------- .../tvrrug/Round2/Configuration.h | 235 ++++++++++------- 23 files changed, 3254 insertions(+), 2175 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8fc9f7478..bc85cc2fb 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -530,122 +530,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -665,12 +713,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 46119be60..a11bb7d70 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -530,122 +530,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -665,12 +713,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 1 diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 0d2b6553b..f327479d1 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -513,122 +513,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -648,12 +696,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index f3c6d9be4..bf60c1be5 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -513,122 +513,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -648,12 +696,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 5b6d17b83..3c12c03c9 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -522,122 +522,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// #define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. //#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -657,12 +705,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index efaa962fd..e01cc0ee8 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -524,122 +524,170 @@ #define DEFAULT_EJERK 1.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ #define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER 34 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -659,12 +707,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 0 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 2 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -2 #define Z_PROBE_OFFSET_RANGE_MAX 0 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 75f637788..1b6ff0645 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -559,122 +559,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// -// Allen Key Probe is defined in the Delta example configurations. -// - -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -694,9 +742,7 @@ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 61bde92d1..ac16107a5 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -530,122 +530,170 @@ #define DEFAULT_EJERK 20.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -665,12 +713,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index e798a9c82..b40eb460e 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -530,122 +530,170 @@ #define DEFAULT_EJERK 20.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -665,12 +713,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 75f1eb700..20ca7ae84 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -530,122 +530,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -665,12 +713,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 8494788eb..5ccf19035 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -529,122 +529,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -664,12 +712,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 08cd979c3..f118d361f 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -545,122 +545,170 @@ #define DEFAULT_EJERK 3.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -680,12 +728,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 26c7ca69e..8793a41a1 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -551,122 +551,170 @@ #define DEFAULT_EJERK 10.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. -//#define FIX_MOUNTED_PROBE +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ +#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -686,12 +734,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/TinyBoy2/Configuration.h b/Marlin/example_configurations/TinyBoy2/Configuration.h index c8d108fa7..952d95f13 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration.h @@ -581,117 +581,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ +//#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ +#define X_PROBE_OFFSET_FROM_EXTRUDER 34 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -711,9 +764,7 @@ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index fdd62abe0..dd8c3d759 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -522,122 +522,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -657,12 +705,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 23d58e3e8..e55e394a1 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -530,122 +530,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. -//#define FIX_MOUNTED_PROBE +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ + //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -665,12 +713,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h index 53ee50da6..f71c9c4c3 100644 --- a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h @@ -588,81 +588,112 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ #define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER 0.25 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 2000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing + +/* Use double touch for probing */ #define PROBE_DOUBLE_TOUCH -// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe -// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. +/** + * Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe + * Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. + */ //#define Z_PROBE_ALLEN_KEY #if ENABLED(Z_PROBE_ALLEN_KEY) @@ -709,49 +740,67 @@ #endif // Z_PROBE_ALLEN_KEY -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -#define Z_MIN_PROBE_PIN Z_MIN_PIN +/** + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP // A3K leave disable! - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ #define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -771,12 +820,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 50 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 1290d44b8..2060eace9 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -575,81 +575,113 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 4000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing + +/* Use double touch for probing */ //#define PROBE_DOUBLE_TOUCH -// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe -// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. + +/** + * Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe + * Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. + */ //#define Z_PROBE_ALLEN_KEY #if ENABLED(Z_PROBE_ALLEN_KEY) @@ -693,49 +725,66 @@ #endif // Z_PROBE_ALLEN_KEY -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// - -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// #define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. //#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -755,12 +804,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 67db5b00c..4e82838ed 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -575,81 +575,105 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. -//#define FIX_MOUNTED_PROBE - -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// -// Allen Key Probe is defined in the Delta example configurations. -// - -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 4000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing + +/* Use double touch for probing */ //#define PROBE_DOUBLE_TOUCH -// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe -// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. +/** + * Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe + * Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. + */ #define Z_PROBE_ALLEN_KEY #if ENABLED(Z_PROBE_ALLEN_KEY) @@ -696,49 +720,66 @@ #endif // Z_PROBE_ALLEN_KEY -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// - -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -758,12 +799,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 50 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index f5e040e60..2d3b21502 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -569,83 +569,115 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER -23 // KosselPro actual: -22.919 #define Y_PROBE_OFFSET_FROM_EXTRUDER -6 // KosselPro actual: -6.304 -// Kossel Pro note: The correct value is likely -17.45 but I'd rather err on the side of -// not giving someone a head crash. Use something like G29 Z-0.2 to adjust as needed. +/** + * Kossel Pro note: The correct value is likely -17.45 but I'd rather err on the side of + * not giving someone a head crash. Use something like G29 Z-0.2 to adjust as needed. + */ #define Z_PROBE_OFFSET_FROM_EXTRUDER -17.25 // Increase this if the first layer is too thin (remember: it's a negative number so increase means closer to zero). - -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing + +/* Use double touch for probing */ //#define PROBE_DOUBLE_TOUCH -// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe -// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. +/** + * Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe + * Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. + */ #define Z_PROBE_ALLEN_KEY #if ENABLED(Z_PROBE_ALLEN_KEY) @@ -695,49 +727,66 @@ #endif // Z_PROBE_ALLEN_KEY -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// - -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -756,10 +805,9 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 100 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points + +/* For M851 give a range for adjusting the Z probe offset */ -// -// For M851 give a range for adjusting the Z probe offset -// #define Z_PROBE_OFFSET_RANGE_MIN -15 #define Z_PROBE_OFFSET_RANGE_MAX 5 diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index fb3cbe3ed..bb0a094ab 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -588,81 +588,112 @@ #define DEFAULT_EJERK 20.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ #define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle X offset: -left +right #define Y_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle Y offset: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER 0.3 // Z probe to nozzle Z offset: -below (always!) -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing + +/* Use double touch for probing */ //#define PROBE_DOUBLE_TOUCH -// Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe -// Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. +/** + * Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe + * Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. + */ //#define Z_PROBE_ALLEN_KEY #if ENABLED(Z_PROBE_ALLEN_KEY) @@ -706,49 +737,65 @@ #endif // Z_PROBE_ALLEN_KEY -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// - -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// #define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. //#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -768,12 +815,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 20 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 10 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 86cead434..71df0a5d1 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -533,122 +533,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -668,12 +716,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 0 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 50f0c20e0..d2aaaf147 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -526,122 +526,170 @@ #define DEFAULT_EJERK 5.0 -//=========================================================================== -//============================= Z Probe Options ============================= -//=========================================================================== -// @section probes - -// -// Probe Type -// Probes are sensors/switches that are activated / deactivated before/after use. -// -// Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. -// You must activate one of these to use Auto Bed Leveling below. -// -// Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. -// +/** + * =========================================================================== + * ============================= Z Probe Options ============================= + * =========================================================================== + * @section probes + * + * + * Probe Type + * Probes are sensors/switches that are activated / deactivated before/after use. + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * You must activate one of these to use Auto Bed Leveling below. + * + * Use M851 to set the Z probe vertical offset from the nozzle. Store with M500. + */ -// The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. -// Use G29 repeatedly, adjusting the Z height at each point with movement commands -// or (with LCD_BED_LEVELING) the LCD controller. +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ //#define PROBE_MANUALLY -// A Fix-Mounted Probe either doesn't deploy or needs manual deployment. -// For example an inductive probe, or a setup that uses the nozzle to probe. -// An inductive probe must be deactivated to go below -// its trigger-point if hardware endstops are active. +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * For example an inductive probe, or a setup that uses the nozzle to probe. + * An inductive probe must be deactivated to go below + * its trigger-point if hardware endstops are active. + */ //#define FIX_MOUNTED_PROBE -// The BLTouch probe emulates a servo probe. -// The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + * NUM_SERVOS also needs to be set. This is found later in this file. Set it to + * 1 + the number of other servos in your system. + */ +//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + + /** + * The BLTouch probe emulates a servo probe. + * If using a BLTouch then NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES + * are setup for you in the background and you shouldn't need to set/modify/enable them + * with the possible exception of Z_ENDSTOP_SERVO_NR. + */ //#define BLTOUCH //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed -// Z Servo Probe, such as an endstop switch on a rotating arm. -//#define Z_ENDSTOP_SERVO_NR 0 -//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles +/** + * BLTouch WARNING - ONLY APPLIES TO VERSIONS OF MARLIN BEFORE 15 FEB 2017 + * Unless using interrupt endstops, there is a MINIMUM feedrate for Marlin to reliably + * sense the BLTouch. If the feedrate is too slow then G28 & G29 can sometimes result + * in the print head being driven into the bed until manual intervention. + * The minimum feedrate calculation is: + * + * feedrate minimum = 24000 / DEFAULT_AXIS_STEPS_PER_UNIT + * where feedrate is in "mm/minute" or "inches/minute" depending on the units used + * in DEFAULT_AXIS_STEPS_PER_UNIT + * + * This applies to the HOMING_FEEDRATE_Z and Z_PROBE_SPEED_FAST. If PROBE_DOUBLE_TOUCH + * is enabled then it also applies to Z_PROBE_SPEED_SLOW. + */ -// Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. +/* Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. */ //#define Z_PROBE_SLED -//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - -// -// Allen Key Probe is defined in the Delta example configurations. -// +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. -// Z Probe to nozzle (X,Y) offset, relative to (0, 0). -// X and Y offsets must be integers. -// -// In the following example the X and Y offsets are both positive: -// #define X_PROBE_OFFSET_FROM_EXTRUDER 10 -// #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 -// -// +-- BACK ---+ -// | | -// L | (+) P | R <-- probe (20,20) -// E | | I -// F | (-) N (+) | G <-- nozzle (10,10) -// T | | H -// | (-) | T -// | | -// O-- FRONT --+ -// (0,0) +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] -// X and Y axis travel speed (mm/m) between probes +/* X and Y axis travel speed (mm/m) between probes */ #define XY_PROBE_SPEED 8000 -// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) + +/* Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) */ #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z -// Speed for the "accurate" probe of each point + +/* Speed for the "accurate" probe of each point */ #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) -// Use double touch for probing -//#define PROBE_DOUBLE_TOUCH -// *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** -// -// To continue using the Z-min-endstop for homing, be sure to disable Z_SAFE_HOMING. -// Example: To park the head outside the bed area when homing with G28. -// -// To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. -// -// For a servo-based Z probe, just set Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES above. -// -// - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. -// - Use 5V for powered (usu. inductive) sensors. -// - Otherwise connect: -// - normally-closed switches to GND and D32. -// - normally-open switches to 5V and D32. -// -// Normally-closed switches are advised and are the default. -// +/* Use double touch for probing */ +//#define PROBE_DOUBLE_TOUCH -// -// The Z_MIN_PROBE_PIN sets the Arduino pin to use. (See your board's pins file.) -// Since the RAMPS Aux4->D32 pin maps directly to the Arduino D32 pin, D32 is the -// default pin for all RAMPS-based boards. Most boards use the X_MAX_PIN by default. -// To use a different pin you can override it here. -// -// WARNING: -// Setting the wrong pin may have unexpected and potentially disastrous consequences. -// Use with caution and do your homework. -// -//#define Z_MIN_PROBE_PIN X_MAX_PIN +/** + * Allen Key Probe is defined in the Delta example configurations. + * + * + * *** PLEASE READ ALL INSTRUCTIONS BELOW FOR SAFETY! *** + * + * - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. + * - Use 5V for powered (usu. inductive) sensors. + * - Otherwise connect: + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * Normally-closed switches are advised and are the default. + * + * + * PIN OPTIONS\SETUP FOR Z PROBES + * + * + * WARNING: + * Setting the wrong pin may have unexpected and potentially disastrous consequences. + * Use with caution and do your homework. + * + * + * All Z PROBE pin options are configured by defining (or not defining) + * the following five items: + * Z_MIN_PROBE_ENDSTOP – defined below + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN – defined below + * Z_MIN_PIN - defined in the pins_YOUR_BOARD.h file + * Z_MIN_PROBE_PIN - defined in the pins_YOUR_BOARD.h file + * + * If you're using a probe then you need to tell Marlin which pin to use as + * the Z MIN ENDSTOP. Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN determines if the + * Z_MIN_PIN or if the Z_MIN_PROBE_PIN is used. + * + * The pin selected for the probe is ONLY checked during probing operations. + * If you want to use the Z_MIN_PIN as an endstop AND you want to have a Z PROBE + * then you’ll need to use the Z_MIN_PROBE_PIN option. + * + * Z_MIN_PROBE_ENDSTOP also needs to be enabled if you want to use Z_MIN_PROBE_PIN. + * + * The settings needed to use the Z_MIN_PROBE_PIN are: + * 1. select the type of probe you're using + * 2. define Z_MIN_PROBE_PIN in your pins_YOUR_BOARD.h file + * 3. disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. enable Z_MIN_PROBE_ENDSTOP + * NOTE – if Z_MIN_PIN is defined then it’ll be checked during all moves in the + * negative Z direction. + * + * The settings needed to use the Z_MIN_PIN are: + * 1. select the type of probe you're using + * 2. enable Z_MIN _PIN in your pins_YOUR_BOARD.h file + * 3. enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * 4. disable Z_MIN_PROBE_ENDSTOP + * NOTES – if Z_MIN_PROBE_PIN is defined in the pins_YOUR_BOARD.h file then it’ll be + * ignored by Marlin + */ -// -// Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine. -// With this option the Z_MIN_PROBE_PIN will only be used for probing, never for homing. -// //#define Z_MIN_PROBE_ENDSTOP - -// Enable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to use the Z_MIN_PIN for your Z_MIN_PROBE. -// The Z_MIN_PIN will then be used for both Z-homing and probing. #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -// To use a probe you must enable one of the two options above! -// Enable Z Probe Repeatability test to see how accurate your probe is +/* Enable Z Probe Repeatability test to see how accurate your probe is */ //#define Z_MIN_PROBE_REPEATABILITY_TEST /** @@ -661,12 +709,11 @@ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -// -// For M851 give a range for adjusting the Z probe offset -// +/* For M851 give a range for adjusting the Z probe offset */ #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 + // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #define X_ENABLE_ON 1