From 110afff4151fee954d7aa8132fb64bf0d172617c Mon Sep 17 00:00:00 2001 From: Roxy-3D Date: Sun, 7 May 2017 19:02:24 -0500 Subject: [PATCH] More misc UBL fixes and update gMax examples (#6632) I think I forgot to Sync before I committed last time. Some UBL changes did not stick. Also, update the gMax configuaration.h file so other than unique numbers and settings, it exactly matches the default configuration.h file. --- .../gCreate_gMax1.5+/Configuration.h | 44 ++++++++++++++++--- Marlin/ubl.cpp | 6 +-- Marlin/ubl_motion.cpp | 3 +- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h b/Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h index 62ccbfefa2..c83f9ddfa7 100644 --- a/Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h +++ b/Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h @@ -532,21 +532,51 @@ #define DEFAULT_ZJERK 1.0 #define DEFAULT_EJERK 4.0 +//=========================================================================== +//============================= Z Probe Options ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/configuration/probes.html +// + /** - * =========================================================================== - * ============================= Z Probe Options ============================= - * =========================================================================== - * @section probes + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + + +/** + * Z_MIN_PROBE_ENDSTOP * + * Enable this option for a probe connected to any pin except Z-Min. + * (By default Marlin assumes the Z-Max endstop pin.) + * To use a custom Z Probe pin, set Z_MIN_PROBE_PIN below. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * WARNING: Setting the wrong pin may have unexpected and potentially + * disastrous consequences. Use with caution and do your homework. + * + */ +//#define Z_MIN_PROBE_ENDSTOP +//#define Z_MIN_PROBE_PIN Z_MAX_PIN + +/** * 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. */ /** diff --git a/Marlin/ubl.cpp b/Marlin/ubl.cpp index 5471b178e2..b1d31fe680 100644 --- a/Marlin/ubl.cpp +++ b/Marlin/ubl.cpp @@ -136,7 +136,7 @@ void unified_bed_leveling::display_map(const int map_type) { const bool map0 = map_type == 0; - const uint8_t spaces = 9; + const uint8_t spaces = 11; if (map0) { SERIAL_PROTOCOLLNPGM("\nBed Topography Report:\n"); @@ -145,7 +145,7 @@ serial_echo_xy(GRID_MAX_POINTS_X - 1, GRID_MAX_POINTS_Y - 1); SERIAL_EOL; serial_echo_xy(UBL_MESH_MIN_X, UBL_MESH_MAX_Y); - SERIAL_ECHO_SP(spaces * (GRID_MAX_POINTS_X - 2)); + SERIAL_ECHO_SP(spaces * (GRID_MAX_POINTS_X - 2)-3); serial_echo_xy(UBL_MESH_MAX_X, UBL_MESH_MAX_Y); SERIAL_EOL; } @@ -190,7 +190,7 @@ if (map0) { serial_echo_xy(UBL_MESH_MIN_X, UBL_MESH_MIN_Y); - SERIAL_ECHO_SP(spaces * (GRID_MAX_POINTS_X - 2) + 4); + SERIAL_ECHO_SP(spaces * (GRID_MAX_POINTS_X - 2) + 1); serial_echo_xy(UBL_MESH_MAX_X, UBL_MESH_MIN_Y); SERIAL_EOL; serial_echo_xy(0, 0); diff --git a/Marlin/ubl_motion.cpp b/Marlin/ubl_motion.cpp index b1f8946e50..a6065dab55 100644 --- a/Marlin/ubl_motion.cpp +++ b/Marlin/ubl_motion.cpp @@ -225,7 +225,8 @@ const float e_normalized_dist = e_position / on_axis_distance, z_normalized_dist = z_position / on_axis_distance; - int current_xi = cell_start_xi, current_yi = cell_start_yi; + int current_xi = cell_start_xi, + current_yi = cell_start_yi; const float m = dy / dx, c = start[Y_AXIS] - m * start[X_AXIS];