From e27fdafcec987f872b3cb63dfde484ae912514c2 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 28 Feb 2019 19:42:09 +0100 Subject: [PATCH 01/26] menu switch - initial --- .gitignore | 1 + Firmware/Marlin_main.cpp | 2 +- Firmware/eeprom.h | 5 +++-- Firmware/mesh_bed_calibration.cpp | 17 +++++++++++++++++ Firmware/mesh_bed_calibration.h | 9 +++++++++ Firmware/ultralcd.cpp | 24 ++++++++++++++++++++++++ 6 files changed, 55 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7bae2ff63..bbd9b9ac2 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ Firmware/Doc /lang/textaddr.txt /build-env/ /Firmware/Firmware.vcxproj +/Firmware/Configuration_prusa_bckp.h diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index a89aac74a..c89ac3ef8 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -1472,7 +1472,7 @@ void setup() if (eeprom_read_byte((uint8_t*)EEPROM_SD_SORT) == 255) { eeprom_write_byte((uint8_t*)EEPROM_SD_SORT, 0); } - + mbl_mode_init(); check_babystep(); //checking if Z babystep is in allowed range #ifdef UVLO_SUPPORT diff --git a/Firmware/eeprom.h b/Firmware/eeprom.h index eb99e5bca..907f88781 100644 --- a/Firmware/eeprom.h +++ b/Firmware/eeprom.h @@ -154,8 +154,9 @@ #define EEPROM_MMU_LOAD_FAIL_TOT (EEPROM_MMU_FAIL - 2) //uint16_t #define EEPROM_MMU_LOAD_FAIL (EEPROM_MMU_LOAD_FAIL_TOT - 1) //uint8_t -#define EEPROM_UVLO_MESH_BED_LEVELING_FULL (EEPROM_MMU_LOAD_FAIL - 1000 - 12*12*2) //allow 12 calibration points for future expansion -//-1000 is to be compatible with future updates from prusa if it not merged, real value is 2503 so there is space +#define EEPROM_UVLO_MESH_BED_LEVELING_FULL (EEPROM_MMU_LOAD_FAIL - 12*12*2) //allow 12 calibration points for future expansion +#define EEPROM_MBL_TYPE (EEPROM_UVLO_MESH_BED_LEVELING_FULL-1) //uint8_t for mesh bed leveling precision + // !!!!! // !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!! // !!!!! diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 0f56d999b..1ab22c4f2 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -3048,3 +3048,20 @@ void count_xyz_details(float (&distanceMin)[2]) { } } +e_MBL_TYPE e_mbl_type = e_MBL_OPTIMAL; + +void mbl_mode_set() { + switch (e_mbl_type) { + case e_MBL_OPTIMAL: e_mbl_type = e_MBL_PREC; break; + case e_MBL_PREC: e_mbl_type = e_MBL_FAST; break; + case e_MBL_FAST: e_mbl_type = e_MBL_OPTIMAL; break; + default: e_mbl_type = e_MBL_OPTIMAL; break; + } + eeprom_update_byte((uint8_t*)EEPROM_MBL_TYPE,(uint8_t)e_mbl_type); +} + +void mbl_mode_init() { + uint8_t mbl_type = eeprom_read_byte((uint8_t*)EEPROM_MBL_TYPE); + if (mbl_type == 0xFF) e_mbl_type = e_MBL_OPTIMAL; + else e_mbl_type = mbl_type; +} \ No newline at end of file diff --git a/Firmware/mesh_bed_calibration.h b/Firmware/mesh_bed_calibration.h index 4990d104b..9c7f45455 100644 --- a/Firmware/mesh_bed_calibration.h +++ b/Firmware/mesh_bed_calibration.h @@ -201,4 +201,13 @@ extern void babystep_reset(); extern void count_xyz_details(float (&distanceMin)[2]); extern bool sample_z(); +typedef enum +{ + e_MBL_FAST, e_MBL_OPTIMAL, e_MBL_PREC +} e_MBL_TYPE; + +extern e_MBL_TYPE e_mbl_type; +extern void mbl_mode_set(); +extern void mbl_mode_init(); + #endif /* MESH_BED_CALIBRATION_H */ diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 5a04796f7..37fd4746a 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5265,6 +5265,28 @@ do\ while (0) #endif // SDCARD_SORT_ALPHA +#define SETTINGS_MBL_MODE \ +do\ +{\ + switch(e_mbl_type)\ + {\ + case e_MBL_FAST:\ + MENU_ITEM_FUNCTION_P(_i("MBL mode [Fast]"),mbl_mode_set);\ + break; \ + case e_MBL_OPTIMAL:\ + MENU_ITEM_FUNCTION_P(_i("MBL mode [Optimal]"), mbl_mode_set); \ + break; \ + case e_MBL_PREC:\ + MENU_ITEM_FUNCTION_P(_i("MBL mode [Precise]"), mbl_mode_set); \ + break; \ + default:\ + MENU_ITEM_FUNCTION_P(_i("MBL mode [Optimal]"), mbl_mode_set); \ + break; \ + }\ +}\ +while (0) + + #define SETTINGS_SOUND \ do\ {\ @@ -5311,6 +5333,8 @@ static void lcd_settings_menu() SETTINGS_SILENT_MODE; + SETTINGS_MBL_MODE; + #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_i("Lin. correction"), lcd_settings_linearity_correction_menu); #endif //LINEARITY_CORRECTION && TMC2130 From 17f095b9572990964ce096c318b0b5d5b9b34560 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Mon, 4 Mar 2019 20:32:56 +0100 Subject: [PATCH 02/26] shorter Z movements (makes calibration faster) --- Firmware/Marlin_main.cpp | 20 ++++++++++++++++---- Firmware/mesh_bed_calibration.cpp | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index c89ac3ef8..d65241214 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4487,7 +4487,8 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) } // Move Z up to MESH_HOME_Z_SEARCH. - current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; + if((ix == 0) && (iy == 0)) current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; + else current_position[Z_AXIS] += 2.f / nMeasPoints; //use relative movement from Z coordinate where PINDa triggered on previous point. This makes calibration faster. plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], Z_LIFT_FEEDRATE, active_extruder); st_synchronize(); @@ -4515,9 +4516,20 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) kill_message = _T(MSG_BED_LEVELING_FAILED_POINT_LOW); break; } - if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { - kill_message = _i("Bed leveling failed. Sensor disconnected or cable broken. Waiting for reset.");////MSG_BED_LEVELING_FAILED_PROBE_DISCONNECTED c=20 r=4 - break; + if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { //broken cable or initial Z coordinate too low. Go to MESH_HOME_Z_SEARCH and repeat last step (z-probe) again to distinguish between these two cases. + + current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; + plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], Z_LIFT_FEEDRATE, active_extruder); + st_synchronize(); + + if (!find_bed_induction_sensor_point_z((has_z && mesh_point > 0) ? z0 - Z_CALIBRATION_THRESHOLD : -10.f, nProbeRetry)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point + kill_message = _T(MSG_BED_LEVELING_FAILED_POINT_LOW); + break; + } + if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { + kill_message = _i("Bed leveling failed. Sensor disconnected or cable broken. Waiting for reset.");////MSG_BED_LEVELING_FAILED_PROBE_DISCONNECTED c=20 r=4 + break; + } } if (has_z && fabs(z0 - current_position[Z_AXIS]) > Z_CALIBRATION_THRESHOLD) { //if we have data from z calibration, max. allowed difference is 1mm for each point kill_message = _i("Bed leveling failed. Sensor triggered too high. Waiting for reset.");////MSG_BED_LEVELING_FAILED_POINT_HIGH c=20 r=4 diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 1ab22c4f2..c05c868f9 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -936,6 +936,7 @@ static inline void update_current_position_z() } // At the current position, find the Z stop. + inline bool find_bed_induction_sensor_point_z(float minimum_z, uint8_t n_iter, int #ifdef SUPPORT_VERBOSITY verbosity_level From d9e93e8a77bea4adf39e963d603d45a28fbe8781 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Tue, 5 Mar 2019 20:40:08 +0100 Subject: [PATCH 03/26] measurements points moved 10mm to the left; measure only chosen points (e.g. not points affected by magnets proximity) --- Firmware/Marlin_main.cpp | 8 +++++++- Firmware/mesh_bed_calibration.cpp | 24 ++++++++++++++++++++++++ Firmware/mesh_bed_calibration.h | 6 ++++-- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index d65241214..4b089fed6 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4467,6 +4467,12 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) // Get coords of a measuring point. uint8_t ix = mesh_point % nMeasPoints; // from 0 to MESH_NUM_X_POINTS - 1 uint8_t iy = mesh_point / nMeasPoints; + if (!mbl_point_measurement_valid(ix, iy, nMeasPoints)) { + printf_P(PSTR("Skipping point [%d;%d] \n"), ix, iy); + custom_message_state--; + mesh_point++; + continue; //skip + } if (iy & 1) ix = (nMeasPoints - 1) - ix; // Zig zag float z0 = 0.f; if (has_z && (mesh_point > 0)) { @@ -4686,7 +4692,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) } // SERIAL_ECHOLNPGM("Bed leveling correction finished"); if (nMeasPoints == 3) { - mbl.upsample_3x3(); //bilinear interpolation from 3x3 to 7x7 points while using the same array z_values[iy][ix] for storing (just coppying measured data to new destination and interpolating between them) + mbl.upsample_3x3(); //interpolation from 3x3 to 7x7 points using largrangian polynomials while using the same array z_values[iy][ix] for storing (just coppying measured data to new destination and interpolating between them) } // SERIAL_ECHOLNPGM("Upsample finished"); mbl.active = 1; //activate mesh bed leveling diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index c05c868f9..85ed05544 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -3065,4 +3065,28 @@ void mbl_mode_init() { uint8_t mbl_type = eeprom_read_byte((uint8_t*)EEPROM_MBL_TYPE); if (mbl_type == 0xFF) e_mbl_type = e_MBL_OPTIMAL; else e_mbl_type = mbl_type; +} + +bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points) { + //"human readable" heatbed plan + //magnet proximity influence Z coordinate measurements significantly (40 - 100 um) + //0 - measurement point is above magnet and Z coordinate can be influenced negatively + //1 - we should be in safe distance from magnets, measurement should be accurate + uint8_t valid_points_mask[7] = { + //[X_MAX,Y_MAX] + 0b1111101, + 0b1110111, + 0b1111111, + 0b0111011, + 0b1110111, + 0b1111111, + 0b1110111, + //[0,0] + }; + if (meas_points == 3) { + ix *= 3; + iy *= 3; + } + if((iy%2) == 0) return (valid_points_mask[6 - iy] & (1 << (6 - ix))); + else return (valid_points_mask[6 - iy] & (1 << ix)); } \ No newline at end of file diff --git a/Firmware/mesh_bed_calibration.h b/Firmware/mesh_bed_calibration.h index 9c7f45455..0d5772718 100644 --- a/Firmware/mesh_bed_calibration.h +++ b/Firmware/mesh_bed_calibration.h @@ -6,9 +6,9 @@ #ifdef HEATBED_V2 -#define BED_X0 (13.f - BED_ZERO_REF_X) +#define BED_X0 (3.f - BED_ZERO_REF_X) #define BED_Y0 (10.4f - BED_ZERO_REF_Y) -#define BED_Xn (216.f - BED_ZERO_REF_X) +#define BED_Xn (206.f - BED_ZERO_REF_X) #define BED_Yn (202.4f - BED_ZERO_REF_Y) #else @@ -210,4 +210,6 @@ extern e_MBL_TYPE e_mbl_type; extern void mbl_mode_set(); extern void mbl_mode_init(); +extern bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points); + #endif /* MESH_BED_CALIBRATION_H */ From 7c187541e14f90ca54eded535c1bd379a360645d Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Tue, 5 Mar 2019 22:36:30 +0100 Subject: [PATCH 04/26] function for valid points determination improved; simple Z-coordinate estimation; measure all points and use inaccurate Z-coordinate in case that we don't have enought information for counting Z-coordinate estimation --- Firmware/Marlin_main.cpp | 7 +++++-- Firmware/mesh_bed_calibration.cpp | 24 +++++++++++++++++++++++- Firmware/mesh_bed_calibration.h | 4 ++-- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 4b089fed6..ceefa39d5 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4467,12 +4467,12 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) // Get coords of a measuring point. uint8_t ix = mesh_point % nMeasPoints; // from 0 to MESH_NUM_X_POINTS - 1 uint8_t iy = mesh_point / nMeasPoints; - if (!mbl_point_measurement_valid(ix, iy, nMeasPoints)) { + /*if (!mbl_point_measurement_valid(ix, iy, nMeasPoints, true)) { printf_P(PSTR("Skipping point [%d;%d] \n"), ix, iy); custom_message_state--; mesh_point++; continue; //skip - } + }*/ if (iy & 1) ix = (nMeasPoints - 1) - ix; // Zig zag float z0 = 0.f; if (has_z && (mesh_point > 0)) { @@ -4694,6 +4694,9 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) if (nMeasPoints == 3) { mbl.upsample_3x3(); //interpolation from 3x3 to 7x7 points using largrangian polynomials while using the same array z_values[iy][ix] for storing (just coppying measured data to new destination and interpolating between them) } + if (nMeasPoints == 7) { + mbl_interpolation(nMeasPoints); + } // SERIAL_ECHOLNPGM("Upsample finished"); mbl.active = 1; //activate mesh bed leveling // SERIAL_ECHOLNPGM("Mesh bed leveling activated"); diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 85ed05544..c5fc58290 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -3067,11 +3067,13 @@ void mbl_mode_init() { else e_mbl_type = mbl_type; } -bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points) { +bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points, bool zigzag) { //"human readable" heatbed plan //magnet proximity influence Z coordinate measurements significantly (40 - 100 um) //0 - measurement point is above magnet and Z coordinate can be influenced negatively //1 - we should be in safe distance from magnets, measurement should be accurate + if ((ix >= meas_points) || (iy >= meas_points)) return false; + uint8_t valid_points_mask[7] = { //[X_MAX,Y_MAX] 0b1111101, @@ -3089,4 +3091,24 @@ bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points) { } if((iy%2) == 0) return (valid_points_mask[6 - iy] & (1 << (6 - ix))); else return (valid_points_mask[6 - iy] & (1 << ix)); +} + +void mbl_single_point_interpolation(uint8_t x, uint8_t y, uint8_t meas_points) { + uint8_t count = 0; + float z = 0; + if(mbl_point_measurement_valid(x, y+1, meas_points, false)) { z += mbl.z_values[x][y+1]; count++; } + if(mbl_point_measurement_valid(x, y-1, meas_points, false)) { z += mbl.z_values[x][y-1]; count++; } + if(mbl_point_measurement_valid(x+1, y, meas_points, false)) { z += mbl.z_values[x+1][y]; count++; } + if(mbl_point_measurement_valid(x-1, y, meas_points, false)) { z += mbl.z_values[x+1][y]; count++; } + if(count != 0) mbl.z_values[x][y] = z / count; //if we have at least one valid point in surrounding area use average value, otherwise use inaccurately measured Z-coordinate +} + +void mbl_interpolation(uint8_t meas_points) { + for (uint8_t x = 0; x < meas_points; x++) { + for (uint8_t y = 0; y < meas_points; y++) { + if (!mbl_point_measurement_valid(x, y, meas_points, false)) { + mbl_single_point_interpolation(x, y, meas_points); + } + } + } } \ No newline at end of file diff --git a/Firmware/mesh_bed_calibration.h b/Firmware/mesh_bed_calibration.h index 0d5772718..7fd8011c7 100644 --- a/Firmware/mesh_bed_calibration.h +++ b/Firmware/mesh_bed_calibration.h @@ -210,6 +210,6 @@ extern e_MBL_TYPE e_mbl_type; extern void mbl_mode_set(); extern void mbl_mode_init(); -extern bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points); - +extern bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points, bool zigzag); +extern void mbl_interpolation(uint8_t meas_points); #endif /* MESH_BED_CALIBRATION_H */ From 5766a5537e128cd1a9d60c72e87230b0605bdb46 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Tue, 5 Mar 2019 22:43:44 +0100 Subject: [PATCH 05/26] limit number of probes --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index ceefa39d5..0453b00ad 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4392,7 +4392,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) if (code_seen('R')) { nProbeRetry = code_value_uint8(); if (nProbeRetry > 10) { - nProbeRetry = 3; + nProbeRetry = 10; } } From 101453b674a179f7fd104ba08f4e58fa432bc275 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 6 Mar 2019 13:27:31 +0100 Subject: [PATCH 06/26] mbl submenu --- Firmware/ultralcd.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 37fd4746a..cf93397b2 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5271,16 +5271,16 @@ do\ switch(e_mbl_type)\ {\ case e_MBL_FAST:\ - MENU_ITEM_FUNCTION_P(_i("MBL mode [Fast]"),mbl_mode_set);\ + MENU_ITEM_FUNCTION_P(_i("Mode [Fast]"),mbl_mode_set);\ break; \ case e_MBL_OPTIMAL:\ - MENU_ITEM_FUNCTION_P(_i("MBL mode [Optimal]"), mbl_mode_set); \ + MENU_ITEM_FUNCTION_P(_i("Mode [Optimal]"), mbl_mode_set); \ break; \ case e_MBL_PREC:\ - MENU_ITEM_FUNCTION_P(_i("MBL mode [Precise]"), mbl_mode_set); \ + MENU_ITEM_FUNCTION_P(_i("Mode [Precise]"), mbl_mode_set); \ break; \ default:\ - MENU_ITEM_FUNCTION_P(_i("MBL mode [Optimal]"), mbl_mode_set); \ + MENU_ITEM_FUNCTION_P(_i("Mode [Optimal]"), mbl_mode_set); \ break; \ }\ }\ @@ -5333,7 +5333,7 @@ static void lcd_settings_menu() SETTINGS_SILENT_MODE; - SETTINGS_MBL_MODE; + MENU_ITEM_SUBMENU_P(_i("Mesh bed leveling"), lcd_mesh_bed_leveling_settings);////MSG_TEMPERATURE c=0 r=0 #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_i("Lin. correction"), lcd_settings_linearity_correction_menu); @@ -6524,6 +6524,12 @@ static void lcd_tune_menu() MENU_END(); } +static void mesh_bed_leveling_menu() +{ + + SETTINGS_MBL_MODE; +} + static void lcd_control_temperature_menu() { #ifdef PIDTEMP From f0cc313fede4c15233fa90a0be6c8d07dc521c26 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 6 Mar 2019 19:56:48 +0100 Subject: [PATCH 07/26] debug gcodes (fans, bed analysis) moved to Dcodes, HOST_KEEPALIVE_FEATURE simplified --- Firmware/Configuration.h | 2 + Firmware/Marlin.h | 14 +- Firmware/Marlin_main.cpp | 316 +++++++++++++++--- Firmware/pins_Rambo_1_3.h | 6 + Firmware/temperature.cpp | 2 - .../variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h | 3 + 6 files changed, 279 insertions(+), 64 deletions(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index c21325c77..a64e90a14 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -446,7 +446,9 @@ your extruder heater takes 2 minutes to hit the target on heating. // When enabled Marlin will send a busy status message to the host // every couple of seconds when it can't accept commands. // +#ifndef HEATBED_ANALYSIS #define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#endif //HEATBED_ANALYSIS #define HOST_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. //LCD and SD support diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 2d469a764..ef342b0cb 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -311,9 +311,9 @@ extern float retract_length_swap; extern float retract_recover_length_swap; #endif -#ifdef HOST_KEEPALIVE_FEATURE + extern uint8_t host_keepalive_interval; -#endif + extern unsigned long starttime; extern unsigned long stoptime; @@ -397,13 +397,12 @@ extern void check_babystep(); extern void long_pause(); extern void crashdet_stop_and_save_print(); -#ifdef DIS - +#ifdef HEATBED_ANALYSIS void d_setup(); float d_ReadData(); void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_points_num, float shift_x, float shift_y); - -#endif +void bed_check(float x_dimension, float y_dimension, int x_points_num, int y_points_num, float shift_x, float shift_y); +#endif //HEATBED_ANALYSIS float temp_comp_interpolation(float temperature); void temp_compensation_apply(); void temp_compensation_start(); @@ -443,7 +442,7 @@ extern void restore_print_from_ram_and_continue(float e_move); extern uint16_t print_time_remaining(); extern uint8_t calc_percent_done(); -#ifdef HOST_KEEPALIVE_FEATURE + // States for managing Marlin and host communication // Marlin sends messages if blocked or busy @@ -466,7 +465,6 @@ extern void host_keepalive(); //extern MarlinBusyState busy_state; extern int busy_state; -#endif //HOST_KEEPALIVE_FEATURE #ifdef TMC2130 diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index d14226f36..53e842887 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -302,16 +302,9 @@ int fanSpeed=0; bool cancel_heatup = false ; -#ifdef HOST_KEEPALIVE_FEATURE - - int busy_state = NOT_BUSY; - static long prev_busy_signal_ms = -1; - uint8_t host_keepalive_interval = HOST_KEEPALIVE_INTERVAL; -#else - #define host_keepalive(); - #define KEEPALIVE_STATE(n); -#endif - +int busy_state = NOT_BUSY; +static long prev_busy_signal_ms = -1; +uint8_t host_keepalive_interval = HOST_KEEPALIVE_INTERVAL; const char errormagic[] PROGMEM = "Error:"; const char echomagic[] PROGMEM = "echo:"; @@ -1696,12 +1689,14 @@ void serial_read_stream() { } } -#ifdef HOST_KEEPALIVE_FEATURE /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { +#ifndef HOST_KEEPALIVE_FEATURE + return; +#endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); if (host_keepalive_interval && busy_state != NOT_BUSY) { @@ -1726,7 +1721,7 @@ void host_keepalive() { } prev_busy_signal_ms = ms; } -#endif + // The loop() function is called in an endless loop by the Arduino framework from the default main() routine. // Before loop(), the setup() function is called by the main() routine. @@ -4295,44 +4290,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) } break; -#ifdef DIS - case 77: - { - //! G77 X200 Y150 XP100 YP15 XO10 Y015 - //! for 9 point mesh bed leveling G77 X203 Y196 XP3 YP3 XO0 YO0 - //! G77 X232 Y218 XP116 YP109 XO-11 YO0 - float dimension_x = 40; - float dimension_y = 40; - int points_x = 40; - int points_y = 40; - float offset_x = 74; - float offset_y = 33; - - if (code_seen('X')) dimension_x = code_value(); - if (code_seen('Y')) dimension_y = code_value(); - if (code_seen("XP")) { strchr_pointer+=1; points_x = code_value(); } - if (code_seen("YP")) { strchr_pointer+=1; points_y = code_value(); } - if (code_seen("XO")) { strchr_pointer+=1; offset_x = code_value(); } - if (code_seen("YO")) { strchr_pointer+=1; offset_y = code_value(); } - - bed_analysis(dimension_x,dimension_y,points_x,points_y,offset_x,offset_y); - - } break; - -#endif - - case 79: { - for (int i = 255; i > 0; i = i - 5) { - fanSpeed = i; - //delay_keep_alive(2000); - for (int j = 0; j < 100; j++) { - delay_keep_alive(100); - - } - printf_P(_N("%d: %d\n"), i, fan_speed[1]); - } - }break; /** * G80: Mesh-based Z probe, probes a grid and produces a @@ -5792,7 +5750,6 @@ Sigma_Exit: if (code_seen('N')) gcode_LastN = code_value_long(); break; -#ifdef HOST_KEEPALIVE_FEATURE case 113: // M113 - Get or set Host Keepalive interval if (code_seen('S')) { host_keepalive_interval = (uint8_t)code_value_short(); @@ -5804,7 +5761,6 @@ Sigma_Exit: SERIAL_PROTOCOLLN(""); } break; -#endif case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. @@ -7138,7 +7094,66 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) dcode_9(); break; case 10: //! D10 - XYZ calibration = OK dcode_10(); break; - +#endif //DEBUG_DCODES +#ifdef HEATBED_ANALYSIS + case 80: + { + float dimension_x = 40; + float dimension_y = 40; + int points_x = 40; + int points_y = 40; + float offset_x = 74; + float offset_y = 33; + + if (code_seen('E')) dimension_x = code_value(); + if (code_seen('F')) dimension_y = code_value(); + if (code_seen('G')) {points_x = code_value(); } + if (code_seen('H')) {points_y = code_value(); } + if (code_seen('I')) {offset_x = code_value(); } + if (code_seen('J')) {offset_y = code_value(); } + printf_P(PSTR("DIM X: %f\n"), dimension_x); + printf_P(PSTR("DIM Y: %f\n"), dimension_y); + printf_P(PSTR("POINTS X: %d\n"), points_x); + printf_P(PSTR("POINTS Y: %d\n"), points_y); + printf_P(PSTR("OFFSET X: %f\n"), offset_x); + printf_P(PSTR("OFFSET Y: %f\n"), offset_y); + bed_check(dimension_x,dimension_y,points_x,points_y,offset_x,offset_y); + }break; + + case 81: + { + float dimension_x = 40; + float dimension_y = 40; + int points_x = 40; + int points_y = 40; + float offset_x = 74; + float offset_y = 33; + + if (code_seen('E')) dimension_x = code_value(); + if (code_seen('F')) dimension_y = code_value(); + if (code_seen("G")) { strchr_pointer+=1; points_x = code_value(); } + if (code_seen("H")) { strchr_pointer+=1; points_y = code_value(); } + if (code_seen("I")) { strchr_pointer+=1; offset_x = code_value(); } + if (code_seen("J")) { strchr_pointer+=1; offset_y = code_value(); } + + bed_analysis(dimension_x,dimension_y,points_x,points_y,offset_x,offset_y); + + } break; + +#endif //HEATBED_ANALYSIS +#ifdef DEBUG_DCODES + case 106: //D106 print measured fan speed for different pwm values + { + for (int i = 255; i > 0; i = i - 5) { + fanSpeed = i; + //delay_keep_alive(2000); + for (int j = 0; j < 100; j++) { + delay_keep_alive(100); + + } + printf_P(_N("%d: %d\n"), i, fan_speed[1]); + } + }break; #ifdef TMC2130 case 2130: //! D2130 - TMC2130 @@ -7934,7 +7949,7 @@ void check_babystep() lcd_update_enable(true); } } -#ifdef DIS +#ifdef HEATBED_ANALYSIS void d_setup() { pinMode(D_DATACLOCK, INPUT_PULLUP); @@ -7984,6 +7999,199 @@ float d_ReadData() } +void bed_check(float x_dimension, float y_dimension, int x_points_num, int y_points_num, float shift_x, float shift_y) { + int t1 = 0; + int t_delay = 0; + int digit[13]; + int m; + char str[3]; + //String mergeOutput; + char mergeOutput[15]; + float output; + + int mesh_point = 0; //index number of calibration point + float bed_zero_ref_x = (-22.f + X_PROBE_OFFSET_FROM_EXTRUDER); //shift between zero point on bed and target and between probe and nozzle + float bed_zero_ref_y = (-0.6f + Y_PROBE_OFFSET_FROM_EXTRUDER); + + float mesh_home_z_search = 4; + float measure_z_heigth = 0.2f; + float row[x_points_num]; + int ix = 0; + int iy = 0; + + const char* filename_wldsd = "mesh.txt"; + char data_wldsd[x_points_num * 7 + 1]; //6 chars(" -A.BCD")for each measurement + null + char numb_wldsd[8]; // (" -A.BCD" + null) +#ifdef MICROMETER_LOGGING + d_setup(); +#endif //MICROMETER_LOGGING + + int XY_AXIS_FEEDRATE = homing_feedrate[X_AXIS] / 20; + int Z_LIFT_FEEDRATE = homing_feedrate[Z_AXIS] / 40; + + unsigned int custom_message_type_old = custom_message_type; + unsigned int custom_message_state_old = custom_message_state; + custom_message_type = CUSTOM_MSG_TYPE_MESHBL; + custom_message_state = (x_points_num * y_points_num) + 10; + lcd_update(1); + + //mbl.reset(); + babystep_undo(); + + card.openFile(filename_wldsd, false); + + /*destination[Z_AXIS] = mesh_home_z_search; + //plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], Z_LIFT_FEEDRATE, active_extruder); + + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], Z_LIFT_FEEDRATE, active_extruder); + for(int8_t i=0; i < NUM_AXIS; i++) { + current_position[i] = destination[i]; + } + st_synchronize(); + */ + destination[Z_AXIS] = measure_z_heigth; + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], Z_LIFT_FEEDRATE, active_extruder); + for(int8_t i=0; i < NUM_AXIS; i++) { + current_position[i] = destination[i]; + } + st_synchronize(); + /*int l_feedmultiply = */setup_for_endstop_move(false); + + SERIAL_PROTOCOLPGM("Num X,Y: "); + SERIAL_PROTOCOL(x_points_num); + SERIAL_PROTOCOLPGM(","); + SERIAL_PROTOCOL(y_points_num); + SERIAL_PROTOCOLPGM("\nZ search height: "); + SERIAL_PROTOCOL(mesh_home_z_search); + SERIAL_PROTOCOLPGM("\nDimension X,Y: "); + SERIAL_PROTOCOL(x_dimension); + SERIAL_PROTOCOLPGM(","); + SERIAL_PROTOCOL(y_dimension); + SERIAL_PROTOCOLLNPGM("\nMeasured points:"); + + while (mesh_point != x_points_num * y_points_num) { + ix = mesh_point % x_points_num; // from 0 to MESH_NUM_X_POINTS - 1 + iy = mesh_point / x_points_num; + if (iy & 1) ix = (x_points_num - 1) - ix; // Zig zag + float z0 = 0.f; + /*destination[Z_AXIS] = mesh_home_z_search; + //plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], Z_LIFT_FEEDRATE, active_extruder); + + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], Z_LIFT_FEEDRATE, active_extruder); + for(int8_t i=0; i < NUM_AXIS; i++) { + current_position[i] = destination[i]; + } + st_synchronize();*/ + + + //current_position[X_AXIS] = 13.f + ix * (x_dimension / (x_points_num - 1)) - bed_zero_ref_x + shift_x; + //current_position[Y_AXIS] = 6.4f + iy * (y_dimension / (y_points_num - 1)) - bed_zero_ref_y + shift_y; + + destination[X_AXIS] = ix * (x_dimension / (x_points_num - 1)) + shift_x; + destination[Y_AXIS] = iy * (y_dimension / (y_points_num - 1)) + shift_y; + + mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], XY_AXIS_FEEDRATE/6, active_extruder); + for(int8_t i=0; i < NUM_AXIS; i++) { + current_position[i] = destination[i]; + } + st_synchronize(); + + // printf_P(PSTR("X = %f; Y= %f \n"), current_position[X_AXIS], current_position[Y_AXIS]); + + delay_keep_alive(1000); +#ifdef MICROMETER_LOGGING + + //memset(numb_wldsd, 0, sizeof(numb_wldsd)); + //dtostrf(d_ReadData(), 8, 5, numb_wldsd); + //strcat(data_wldsd, numb_wldsd); + + + + //MYSERIAL.println(data_wldsd); + //delay(1000); + //delay(3000); + //t1 = millis(); + + //while (digitalRead(D_DATACLOCK) == LOW) {} + //while (digitalRead(D_DATACLOCK) == HIGH) {} + memset(digit, 0, sizeof(digit)); + //cli(); + digitalWrite(D_REQUIRE, LOW); + + for (int i = 0; i<13; i++) + { + //t1 = millis(); + for (int j = 0; j < 4; j++) + { + while (digitalRead(D_DATACLOCK) == LOW) {} + while (digitalRead(D_DATACLOCK) == HIGH) {} + //printf_P(PSTR("Done %d\n"), j); + bitWrite(digit[i], j, digitalRead(D_DATA)); + } + //t_delay = (millis() - t1); + //SERIAL_PROTOCOLPGM(" "); + //SERIAL_PROTOCOL_F(t_delay, 5); + //SERIAL_PROTOCOLPGM(" "); + + } + //sei(); + digitalWrite(D_REQUIRE, HIGH); + mergeOutput[0] = '\0'; + output = 0; + for (int r = 5; r <= 10; r++) //Merge digits + { + sprintf(str, "%d", digit[r]); + strcat(mergeOutput, str); + } + + output = atof(mergeOutput); + + if (digit[4] == 8) //Handle sign + { + output *= -1; + } + + for (int i = digit[11]; i > 0; i--) //Handle floating point + { + output *= 0.1; + } + + + //output = d_ReadData(); + + //row[ix] = current_position[Z_AXIS]; + + + + //row[ix] = d_ReadData(); + + row[ix] = output; + + if (iy % 2 == 1 ? ix == 0 : ix == x_points_num - 1) { + memset(data_wldsd, 0, sizeof(data_wldsd)); + for (int i = 0; i < x_points_num; i++) { + SERIAL_PROTOCOLPGM(" "); + SERIAL_PROTOCOL_F(row[i], 5); + memset(numb_wldsd, 0, sizeof(numb_wldsd)); + dtostrf(row[i], 7, 3, numb_wldsd); + strcat(data_wldsd, numb_wldsd); + } + card.write_command(data_wldsd); + SERIAL_PROTOCOLPGM("\n"); + + } + + custom_message_state--; + mesh_point++; + lcd_update(1); + + } + #endif //MICROMETER_LOGGING + card.closefile(); + //clean_up_after_endstop_move(l_feedmultiply); + +} + void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_points_num, float shift_x, float shift_y) { int t1 = 0; int t_delay = 0; @@ -8167,7 +8375,7 @@ void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_ card.closefile(); clean_up_after_endstop_move(l_feedmultiply); } -#endif +#endif //HEATBED_ANALYSIS void temp_compensation_start() { diff --git a/Firmware/pins_Rambo_1_3.h b/Firmware/pins_Rambo_1_3.h index c1adf5969..538fb4f35 100644 --- a/Firmware/pins_Rambo_1_3.h +++ b/Firmware/pins_Rambo_1_3.h @@ -14,6 +14,12 @@ #define SWI2C_SDA 20 //SDA on P3 #define SWI2C_SCL 21 //SCL on P3 +#ifdef MICROMETER_LOGGING +#define D_DATACLOCK 24 //Y_MAX (green) +#define D_DATA 30 //X_MAX (blue) +#define D_REQUIRE 23 //Z_MAX (white) +#endif //MICROMETER_LOGGING + #define X_STEP_PIN 37 diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index 4ce13bd60..d6019eebc 100644 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -888,9 +888,7 @@ void manage_heater() } #endif -#ifdef HOST_KEEPALIVE_FEATURE host_keepalive(); -#endif } #define PGM_RD_W(x) (short)pgm_read_word(&x) diff --git a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h index e316c4f02..99dd1e65a 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h @@ -504,4 +504,7 @@ #define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning +//#define HEATBED_ANALYSIS //for meash bed leveling and heatbed analysis D-codes D80 and D81 +//#define MICROMETER_LOGGING //related to D-codes D80 and D81, currently works on MK2.5 only (MK3 board pin definitions missing) + #endif //__CONFIGURATION_PRUSA_H From 6a864ffbab45d28fbf3f4680e2696a625a70786b Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Fri, 8 Mar 2019 15:43:37 +0100 Subject: [PATCH 08/26] G80 parameters configurable via settings menu --- Firmware/Marlin.h | 1 + Firmware/Marlin_main.cpp | 14 +++++++-- Firmware/eeprom.h | 3 ++ Firmware/mesh_bed_calibration.cpp | 22 ++++++++++++-- Firmware/mesh_bed_calibration.h | 11 +++---- Firmware/ultralcd.cpp | 48 +++++++++++++++++++++++++++---- 6 files changed, 85 insertions(+), 14 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 78929e9fc..d91f74fb7 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -21,6 +21,7 @@ #include "Configuration.h" #include "pins.h" #include "Timer.h" +extern int mbl_z_probe_nr; #ifndef AT90USB #define HardwareSerial_h // trick to disable the standard HWserial diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index d70e66ea6..084241c55 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -167,6 +167,7 @@ CardReader card; unsigned long PingTime = _millis(); unsigned long NcTime; +int mbl_z_probe_nr = 4; //numer of Z measurements for each point in mesh bed leveling calibration //used for PINDA temp calibration and pause print #define DEFAULT_RETRACTION 1 @@ -1465,7 +1466,8 @@ void setup() if (eeprom_read_byte((uint8_t*)EEPROM_SD_SORT) == 255) { eeprom_write_byte((uint8_t*)EEPROM_SD_SORT, 0); } - mbl_mode_init(); + //mbl_mode_init(); + mbl_settings_init(); check_babystep(); //checking if Z babystep is in allowed range #ifdef UVLO_SUPPORT @@ -4325,6 +4327,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) */ case 80: + #ifdef MK1BP break; #endif //MK1BP @@ -4363,6 +4366,9 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) nMeasPoints = 3; } } + else { + nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); + } uint8_t nProbeRetry = 3; if (code_seen('R')) { @@ -4371,6 +4377,10 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) nProbeRetry = 10; } } + else { + nProbeRetry = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR) - 1; + } + bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); bool temp_comp_start = true; #ifdef PINDA_THERMISTOR @@ -4670,7 +4680,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) if (nMeasPoints == 3) { mbl.upsample_3x3(); //interpolation from 3x3 to 7x7 points using largrangian polynomials while using the same array z_values[iy][ix] for storing (just coppying measured data to new destination and interpolating between them) } - if (nMeasPoints == 7) { + if (nMeasPoints == 7 && magnet_elimination) { mbl_interpolation(nMeasPoints); } // SERIAL_ECHOLNPGM("Upsample finished"); diff --git a/Firmware/eeprom.h b/Firmware/eeprom.h index 3dc0a0929..8a15248e9 100644 --- a/Firmware/eeprom.h +++ b/Firmware/eeprom.h @@ -156,6 +156,9 @@ #define EEPROM_MMU_CUTTER_ENABLED (EEPROM_MMU_LOAD_FAIL - 1) #define EEPROM_UVLO_MESH_BED_LEVELING_FULL (EEPROM_MMU_CUTTER_ENABLED - 12*12*2) //allow 12 calibration points for future expansion #define EEPROM_MBL_TYPE (EEPROM_UVLO_MESH_BED_LEVELING_FULL-1) //uint8_t for mesh bed leveling precision +#define EEPROM_MBL_MAGNET_ELIMINATION (EEPROM_MBL_TYPE -1) +#define EEPROM_MBL_POINTS_NR (EEPROM_MBL_MAGNET_ELIMINATION -1) //uint8_t number of points in one exis for mesh bed leveling +#define EEPROM_MBL_PROBE_NR (EEPROM_MBL_POINTS_NR-1) // !!!!! // !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!! // !!!!! diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index c5fc58290..9b3c78f1d 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -985,7 +985,7 @@ inline bool find_bed_induction_sensor_point_z(float minimum_z, uint8_t n_iter, i // SERIAL_ECHOLNPGM(""); float dz = i?abs(current_position[Z_AXIS] - (z / i)):0; z += current_position[Z_AXIS]; -// printf_P(PSTR(" Z[%d] = %d, dz=%d\n"), i, (int)(current_position[Z_AXIS] * 1000), (int)(dz * 1000)); + printf_P(PSTR("Z[%d] = %d, dz=%d\n"), i, (int)(current_position[Z_AXIS] * 1000), (int)(dz * 1000)); if (dz > 0.05) goto error;//deviation > 50um } current_position[Z_AXIS] = z; @@ -3048,7 +3048,7 @@ void count_xyz_details(float (&distanceMin)[2]) { distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); } } - +/* e_MBL_TYPE e_mbl_type = e_MBL_OPTIMAL; void mbl_mode_set() { @@ -3066,6 +3066,24 @@ void mbl_mode_init() { if (mbl_type == 0xFF) e_mbl_type = e_MBL_OPTIMAL; else e_mbl_type = mbl_type; } +*/ + +void mbl_settings_init() { +//3x3 mesh; 3 Z-probes on each point, magnet elimination on +//magnet elimination: use aaproximate Z-coordinate instead of measured values for points which are near magnets + if (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) == 0xFF) { + eeprom_update_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION, 1); + } + if (eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR) == 0xFF) { + eeprom_update_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); + } + mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); + if (mbl_z_probe_nr == 0xFF) { + mbl_z_probe_nr = 4; + eeprom_update_byte((uint8_t*)EEPROM_MBL_POINTS_NR, mbl_z_probe_nr); + } + +} bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points, bool zigzag) { //"human readable" heatbed plan diff --git a/Firmware/mesh_bed_calibration.h b/Firmware/mesh_bed_calibration.h index 7fd8011c7..954db9c30 100644 --- a/Firmware/mesh_bed_calibration.h +++ b/Firmware/mesh_bed_calibration.h @@ -200,15 +200,16 @@ extern void babystep_reset(); extern void count_xyz_details(float (&distanceMin)[2]); extern bool sample_z(); - +/* typedef enum { e_MBL_FAST, e_MBL_OPTIMAL, e_MBL_PREC } e_MBL_TYPE; - -extern e_MBL_TYPE e_mbl_type; -extern void mbl_mode_set(); -extern void mbl_mode_init(); +*/ +//extern e_MBL_TYPE e_mbl_type; +//extern void mbl_mode_set(); +//extern void mbl_mode_init(); +extern void mbl_settings_init(); extern bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points, bool zigzag); extern void mbl_interpolation(uint8_t meas_points); diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 4e3d76b47..77492ac08 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -47,6 +47,7 @@ char longFilenameOLD[LONG_FILENAME_LENGTH]; static void lcd_sd_updir(); +static void lcd_mesh_bed_leveling_settings(); int8_t ReInitLCD = 0; @@ -5325,6 +5326,7 @@ do\ while (0) #endif // SDCARD_SORT_ALPHA +/* #define SETTINGS_MBL_MODE \ do\ {\ @@ -5345,7 +5347,7 @@ do\ }\ }\ while (0) - +*/ #define SETTINGS_SOUND \ do\ @@ -5395,7 +5397,7 @@ static void lcd_settings_menu() SETTINGS_SILENT_MODE; - MENU_ITEM_SUBMENU_P(_i("Mesh bed leveling"), lcd_mesh_bed_leveling_settings);////MSG_TEMPERATURE c=0 r=0 + MENU_ITEM_SUBMENU_P(_i("Mesh bed leveling"), lcd_mesh_bed_leveling_settings);////MSG_MBL_SETTINGS c=18 r=1 #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_i("Lin. correction"), lcd_settings_linearity_correction_menu); @@ -6632,10 +6634,46 @@ static void lcd_tune_menu() MENU_END(); } -static void mesh_bed_leveling_menu() -{ +static void mbl_magnets_elimination_set() { + bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); + magnet_elimination = !magnet_elimination; + eeprom_update_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION, (uint8_t)magnet_elimination); +} - SETTINGS_MBL_MODE; +static void mbl_mesh_set() { + uint8_t mesh_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); + if(mesh_nr == 3) mesh_nr = 7; + else mesh_nr = 3; + eeprom_update_byte((uint8_t*)EEPROM_MBL_POINTS_NR, mesh_nr); +} + +static void lcd_mesh_bed_leveling_settings() +{ + + bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); + uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); + + MENU_BEGIN(); + // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P + if (((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving) + { + eeprom_update_byte((uint8_t*)EEPROM_MBL_PROBE_NR, (uint8_t)mbl_z_probe_nr); + } + MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); + if(points_nr == 3) MENU_ITEM_FUNCTION_P(_i("Mesh [3x3]"), mbl_mesh_set); + else MENU_ITEM_FUNCTION_P(_i("Mesh [7x7]"), mbl_mesh_set); + MENU_ITEM_EDIT_int3_P(_i("Probe nr."), &mbl_z_probe_nr, 1, 5); + if (points_nr == 7) { + if (magnet_elimination) MENU_ITEM_FUNCTION_P(_i("Magnets eli [On]"), mbl_magnets_elimination_set); + else MENU_ITEM_FUNCTION_P(_i("Magnets eli [Off]"), mbl_magnets_elimination_set); + } + else menu_item_text_P(_i("MAgnets eli [N/A]")); + MENU_END(); + /*if(menu_leaving) + { + eeprom_update_byte((uint8_t*)EEPROM_MBL_POINTS_NR, mbl_z_probe_nr); + }*/ + //SETTINGS_MBL_MODE; } static void lcd_control_temperature_menu() From f293d61d3d26bb529c856b0283c5887f89900aa6 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Fri, 8 Mar 2019 18:52:14 +0100 Subject: [PATCH 09/26] faster Z probe: move Z 150um relatively to last measurement. If PINDA is triggered at the beginning of measurement, move Z 500um higher and repeat measurement --- Firmware/mesh_bed_calibration.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 9b3c78f1d..7b53e2859 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -967,15 +967,29 @@ inline bool find_bed_induction_sensor_point_z(float minimum_z, uint8_t n_iter, i #endif //TMC2130 for (uint8_t i = 0; i < n_iter; ++ i) { - // Move up the retract distance. - current_position[Z_AXIS] += .5f; - go_to_current(homing_feedrate[Z_AXIS]/60); - // Move back down slowly to find bed. + + current_position[Z_AXIS] += 0.15; + float z_bckp = current_position[Z_AXIS]; + go_to_current(homing_feedrate[Z_AXIS]/60); + // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; go_to_current(homing_feedrate[Z_AXIS]/(4*60)); // we have to let the planner know where we are right now as it is not where we said to go. update_current_position_z(); - if (! endstop_z_hit_on_purpose()) + //printf_P(PSTR("Zs: %f, Z: %f, delta Z: %f"), z_bckp, current_position[Z_AXIS], (z_bckp - current_position[Z_AXIS])); + if (abs(current_position[Z_AXIS] - z_bckp) < 0.025) { + printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); + current_position[Z_AXIS] += 0.5; + go_to_current(homing_feedrate[Z_AXIS]/60); + current_position[Z_AXIS] = minimum_z; + go_to_current(homing_feedrate[Z_AXIS]/(4*60)); + // we have to let the planner know where we are right now as it is not where we said to go. + update_current_position_z(); + } + + + + if (! endstop_z_hit_on_purpose()) goto error; #ifdef TMC2130 if (READ(Z_TMC2130_DIAG) != 0) goto error; //crash Z detected @@ -2748,7 +2762,7 @@ void go_home_with_z_lift() current_position[Y_AXIS] = Y_MIN_POS+0.2; // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); - go_to_current(homing_feedrate[X_AXIS]/60); + go_to_current(homing_feedrate[X_AXIS]/20); // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; go_to_current(homing_feedrate[Z_AXIS]/60); From 952e0e1e772135f389d1ae19cbf6c903fb14c40d Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Fri, 8 Mar 2019 19:49:10 +0100 Subject: [PATCH 10/26] change min. nProbeRetry to 1 --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 084241c55..fe88c8cae 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4378,7 +4378,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) } } else { - nProbeRetry = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR) - 1; + nProbeRetry = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); } bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); From 315959c13aab15abc9fce571201f5d4453256417 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Fri, 8 Mar 2019 20:03:23 +0100 Subject: [PATCH 11/26] menu update --- Firmware/ultralcd.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 77492ac08..ce38a35d6 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6660,14 +6660,14 @@ static void lcd_mesh_bed_leveling_settings() eeprom_update_byte((uint8_t*)EEPROM_MBL_PROBE_NR, (uint8_t)mbl_z_probe_nr); } MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); - if(points_nr == 3) MENU_ITEM_FUNCTION_P(_i("Mesh [3x3]"), mbl_mesh_set); - else MENU_ITEM_FUNCTION_P(_i("Mesh [7x7]"), mbl_mesh_set); - MENU_ITEM_EDIT_int3_P(_i("Probe nr."), &mbl_z_probe_nr, 1, 5); + if(points_nr == 3) MENU_ITEM_FUNCTION_P(_i("Mesh [3x3]"), mbl_mesh_set); + else MENU_ITEM_FUNCTION_P(_i("Mesh [7x7]"), mbl_mesh_set); + MENU_ITEM_EDIT_int3_P(_i("Z-probe nr."), &mbl_z_probe_nr, 1, 5); if (points_nr == 7) { - if (magnet_elimination) MENU_ITEM_FUNCTION_P(_i("Magnets eli [On]"), mbl_magnets_elimination_set); - else MENU_ITEM_FUNCTION_P(_i("Magnets eli [Off]"), mbl_magnets_elimination_set); + if (magnet_elimination) MENU_ITEM_FUNCTION_P(_i("Magnets eli [On]"), mbl_magnets_elimination_set); + else MENU_ITEM_FUNCTION_P(_i("Magnets comp. [Off]"), mbl_magnets_elimination_set); } - else menu_item_text_P(_i("MAgnets eli [N/A]")); + else menu_item_text_P(_i("Magnets comp. [N/A]")); MENU_END(); /*if(menu_leaving) { From 091934462d09f52c61f7b68c04cb23fe1c090e9f Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Fri, 8 Mar 2019 20:06:30 +0100 Subject: [PATCH 12/26] menu correction --- Firmware/ultralcd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index ce38a35d6..5cdf6b8a5 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6660,14 +6660,14 @@ static void lcd_mesh_bed_leveling_settings() eeprom_update_byte((uint8_t*)EEPROM_MBL_PROBE_NR, (uint8_t)mbl_z_probe_nr); } MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); - if(points_nr == 3) MENU_ITEM_FUNCTION_P(_i("Mesh [3x3]"), mbl_mesh_set); - else MENU_ITEM_FUNCTION_P(_i("Mesh [7x7]"), mbl_mesh_set); + if(points_nr == 3) MENU_ITEM_FUNCTION_P(_i("Mesh [3x3]"), mbl_mesh_set); + else MENU_ITEM_FUNCTION_P(_i("Mesh [7x7]"), mbl_mesh_set); MENU_ITEM_EDIT_int3_P(_i("Z-probe nr."), &mbl_z_probe_nr, 1, 5); if (points_nr == 7) { - if (magnet_elimination) MENU_ITEM_FUNCTION_P(_i("Magnets eli [On]"), mbl_magnets_elimination_set); - else MENU_ITEM_FUNCTION_P(_i("Magnets comp. [Off]"), mbl_magnets_elimination_set); + if (magnet_elimination) MENU_ITEM_FUNCTION_P(_i("Magnets eli [On]"), mbl_magnets_elimination_set); + else MENU_ITEM_FUNCTION_P(_i("Magnets comp. [Off]"), mbl_magnets_elimination_set); } - else menu_item_text_P(_i("Magnets comp. [N/A]")); + else menu_item_text_P(_i("Magnets comp. [N/A]")); MENU_END(); /*if(menu_leaving) { From 141b78c048c76cff09866c68036d5ff7f9e10d27 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Sun, 10 Mar 2019 16:03:46 +0100 Subject: [PATCH 13/26] number of Z-probes defualt value changed from 4 to 3, mmu stealth mode switch in settings menu --- Firmware/Marlin_main.cpp | 7 ++++++- Firmware/eeprom.h | 1 + Firmware/mesh_bed_calibration.cpp | 2 +- Firmware/mmu.cpp | 6 ++---- Firmware/ultralcd.cpp | 14 ++++++++++++++ 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index fe88c8cae..22fb576b9 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -167,7 +167,7 @@ CardReader card; unsigned long PingTime = _millis(); unsigned long NcTime; -int mbl_z_probe_nr = 4; //numer of Z measurements for each point in mesh bed leveling calibration +int mbl_z_probe_nr = 3; //numer of Z measurements for each point in mesh bed leveling calibration //used for PINDA temp calibration and pause print #define DEFAULT_RETRACTION 1 @@ -1468,6 +1468,11 @@ void setup() } //mbl_mode_init(); mbl_settings_init(); + SilentModeMenu_MMU = eeprom_read_byte((uint8_t*)EEPROM_MMU_STEALTH); + if (SilentModeMenu_MMU == 255) { + SilentModeMenu_MMU = 1; + eeprom_write_byte((uint8_t*)EEPROM_MMU_STEALTH, SilentModeMenu_MMU); + } check_babystep(); //checking if Z babystep is in allowed range #ifdef UVLO_SUPPORT diff --git a/Firmware/eeprom.h b/Firmware/eeprom.h index 8a15248e9..56ee5f77d 100644 --- a/Firmware/eeprom.h +++ b/Firmware/eeprom.h @@ -159,6 +159,7 @@ #define EEPROM_MBL_MAGNET_ELIMINATION (EEPROM_MBL_TYPE -1) #define EEPROM_MBL_POINTS_NR (EEPROM_MBL_MAGNET_ELIMINATION -1) //uint8_t number of points in one exis for mesh bed leveling #define EEPROM_MBL_PROBE_NR (EEPROM_MBL_POINTS_NR-1) +#define EEPROM_MMU_STEALTH (EEPROM_MBL_PROBE_NR-1) // !!!!! // !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!! // !!!!! diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 7b53e2859..8de8fe81b 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -3093,7 +3093,7 @@ void mbl_settings_init() { } mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); if (mbl_z_probe_nr == 0xFF) { - mbl_z_probe_nr = 4; + mbl_z_probe_nr = 3; eeprom_update_byte((uint8_t*)EEPROM_MBL_POINTS_NR, mbl_z_probe_nr); } diff --git a/Firmware/mmu.cpp b/Firmware/mmu.cpp index 449efabd0..6d5cc5144 100644 --- a/Firmware/mmu.cpp +++ b/Firmware/mmu.cpp @@ -185,10 +185,8 @@ static bool activate_stealth_mode() { #if defined (MMU_FORCE_STEALTH_MODE) return true; -#elif defined (SILENT_MODE_STEALTH) - return (eeprom_read_byte((uint8_t*)EEPROM_SILENT) == SILENT_MODE_STEALTH); -#else - return false; +#elif + return (eeprom_read_byte((uint8_t*)EEPROM_MMU_STEALTH) == 1); #endif } diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 5cdf6b8a5..169ae1434 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -53,6 +53,7 @@ int8_t ReInitLCD = 0; int8_t SilentModeMenu = SILENT_MODE_OFF; +uint8_t SilentModeMenu_MMU = 1; //activate mmu unit stealth mode int8_t FSensorStateMenu = 1; @@ -4515,6 +4516,12 @@ static void lcd_sound_state_set(void) Sound_CycleState(); } +static void lcd_silent_mode_mmu_set() { + if (SilentModeMenu_MMU == 1) SilentModeMenu_MMU = 0; + else SilentModeMenu_MMU = 1; + eeprom_update_byte((uint8_t*)EEPROM_MMU_STEALTH, SilentModeMenu_MMU); +} + static void lcd_silent_mode_set() { switch (SilentModeMenu) { #ifdef TMC2130 @@ -5288,6 +5295,13 @@ do\ break; /* (probably) not needed*/\ }\ }\ +#ifndef MMU_FORCE_STEALTH_MODE + if(mmu_enabled)\ + {\ + if (SilentModeMenu_MMU == 0) MENU_ITEM_FUNCTION_P(_i("MMU Mode [Fast]"), lcd_silent_mode_mmu_set);\ + else MENU_ITEM_FUNCTION_P(_i("MMU Mode [Stealth]"), lcd_silent_mode_mmu_set);\ + }\ +#endif //MMU_FORCE_STEALTH_MODE }\ while (0) #endif //TMC2130 From 819a91ab1e88d96e7eaae630bc6c9a29a4471007 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Mon, 11 Mar 2019 12:33:22 +0100 Subject: [PATCH 14/26] switching stealth/normal mode for mmu in settings menu and tune menu --- Firmware/mmu.cpp | 27 ++++++++++++++++++++++++--- Firmware/ultralcd.cpp | 30 +++++++++++++++++++++--------- Firmware/ultralcd.h | 1 + 3 files changed, 46 insertions(+), 12 deletions(-) diff --git a/Firmware/mmu.cpp b/Firmware/mmu.cpp index 6d5cc5144..3e587ce90 100644 --- a/Firmware/mmu.cpp +++ b/Firmware/mmu.cpp @@ -45,6 +45,7 @@ namespace WaitCmd, //!< wait for command response Pause, GetDrvError, //!< get power failures count + SwitchMode //switch mmu between stealth and normal mode }; } @@ -183,9 +184,9 @@ bool check_for_ir_sensor() static bool activate_stealth_mode() { -#if defined (MMU_FORCE_STEALTH_MODE) +#ifdef MMU_FORCE_STEALTH_MODE return true; -#elif +#else return (eeprom_read_byte((uint8_t*)EEPROM_MMU_STEALTH) == 1); #endif } @@ -335,6 +336,12 @@ void mmu_loop(void) mmu_last_cmd = mmu_cmd; mmu_cmd = MmuCmd::None; } + else if ((eeprom_read_byte((uint8_t*)EEPROM_MMU_STEALTH) != SilentModeMenu_MMU) && mmu_ready) { + DEBUG_PRINTF_P(PSTR("MMU <= 'M%d'\n"), SilentModeMenu_MMU); + mmu_printf_P(PSTR("M%d\n"), SilentModeMenu_MMU); + mmu_ready = false; + mmu_state = S::SwitchMode; + } else if ((mmu_last_response + 300) < _millis()) //request every 300ms { #ifndef IR_SENSOR @@ -450,9 +457,23 @@ void mmu_loop(void) mmu_state = S::Idle; } else if ((mmu_last_request + MMU_CMD_TIMEOUT) < _millis()) - { //resend request after timeout (5 min) + { //timeout 45 s mmu_state = S::Idle; } + return; + case S::SwitchMode: + if (mmu_rx_ok() > 0) + { + DEBUG_PRINTF_P(PSTR("MMU => 'ok'\n")); + eeprom_update_byte((uint8_t*)EEPROM_MMU_STEALTH, SilentModeMenu_MMU); + mmu_ready = true; + mmu_state = S::Idle; + } + else if ((mmu_last_request + MMU_CMD_TIMEOUT) < _millis()) + { //timeout 45 s + mmu_state = S::Idle; + } + return; } } diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 169ae1434..2627a8aaa 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -4516,11 +4516,13 @@ static void lcd_sound_state_set(void) Sound_CycleState(); } +#ifndef MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_mmu_set() { if (SilentModeMenu_MMU == 1) SilentModeMenu_MMU = 0; else SilentModeMenu_MMU = 1; - eeprom_update_byte((uint8_t*)EEPROM_MMU_STEALTH, SilentModeMenu_MMU); + //saving to eeprom is done in mmu_loop() after mmu actually switches state and confirms with "ok" } +#endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { @@ -5295,17 +5297,26 @@ do\ break; /* (probably) not needed*/\ }\ }\ -#ifndef MMU_FORCE_STEALTH_MODE - if(mmu_enabled)\ - {\ - if (SilentModeMenu_MMU == 0) MENU_ITEM_FUNCTION_P(_i("MMU Mode [Fast]"), lcd_silent_mode_mmu_set);\ - else MENU_ITEM_FUNCTION_P(_i("MMU Mode [Stealth]"), lcd_silent_mode_mmu_set);\ - }\ -#endif //MMU_FORCE_STEALTH_MODE + }\ while (0) #endif //TMC2130 +#ifndef MMU_FORCE_STEALTH_MODE +#define SETTINGS_MMU_MODE \ +do\ +{\ + if (mmu_enabled)\ + {\ + if (SilentModeMenu_MMU == 0) MENU_ITEM_FUNCTION_P(_i("MMU Mode [Fast]"), lcd_silent_mode_mmu_set); \ + else MENU_ITEM_FUNCTION_P(_i("MMU Mode[Stealth]"), lcd_silent_mode_mmu_set); \ + }\ +}\ +while (0) +#else //MMU_FORCE_STEALTH_MODE +#define SETTINGS_MMU_MODE +#endif //MMU_FORCE_STEALTH_MODE + #ifdef SDCARD_SORT_ALPHA #define SETTINGS_SD \ do\ @@ -5410,6 +5421,7 @@ static void lcd_settings_menu() MENU_ITEM_FUNCTION_P(_i("Fans check [off]"), lcd_set_fan_check);////MSG_FANS_CHECK_OFF c=17 r=1 SETTINGS_SILENT_MODE; + SETTINGS_MMU_MODE; MENU_ITEM_SUBMENU_P(_i("Mesh bed leveling"), lcd_mesh_bed_leveling_settings);////MSG_MBL_SETTINGS c=18 r=1 @@ -6626,7 +6638,7 @@ static void lcd_tune_menu() } } #endif //TMC2130 - + SETTINGS_MMU_MODE; switch(eSoundMode) { case e_SOUND_MODE_LOUD: diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index 0b286181b..8ed424427 100644 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -117,6 +117,7 @@ extern int farm_status; #endif extern int8_t SilentModeMenu; +extern uint8_t SilentModeMenu_MMU; extern bool cancel_heatup; extern bool isPrintPaused; From 698f81abe00e2462e2020f177c8f156607bdcbf4 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Mon, 11 Mar 2019 15:55:48 +0100 Subject: [PATCH 15/26] fix compile error --- Firmware/ultralcd.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 2627a8aaa..c1372f0e5 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5297,7 +5297,6 @@ do\ break; /* (probably) not needed*/\ }\ }\ - }\ while (0) #endif //TMC2130 From 9a83925a97eeb26c9260aace19e2a5ab41a9b0ba Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Mon, 11 Mar 2019 23:13:55 +0100 Subject: [PATCH 16/26] fixed bug in counting approximate Z coordinate --- Firmware/Marlin_main.cpp | 32 +++++++++++++++++++++++++++++++ Firmware/mesh_bed_calibration.cpp | 21 +++++++++++++------- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 22fb576b9..6aadd69c1 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4685,9 +4685,41 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) if (nMeasPoints == 3) { mbl.upsample_3x3(); //interpolation from 3x3 to 7x7 points using largrangian polynomials while using the same array z_values[iy][ix] for storing (just coppying measured data to new destination and interpolating between them) } +/* + SERIAL_PROTOCOLPGM("Num X,Y: "); + SERIAL_PROTOCOL(MESH_NUM_X_POINTS); + SERIAL_PROTOCOLPGM(","); + SERIAL_PROTOCOL(MESH_NUM_Y_POINTS); + SERIAL_PROTOCOLPGM("\nZ search height: "); + SERIAL_PROTOCOL(MESH_HOME_Z_SEARCH); + SERIAL_PROTOCOLLNPGM("\nMeasured points:"); + for (int y = MESH_NUM_Y_POINTS-1; y >= 0; y--) { + for (int x = 0; x < MESH_NUM_X_POINTS; x++) { + SERIAL_PROTOCOLPGM(" "); + SERIAL_PROTOCOL_F(mbl.z_values[y][x], 5); + } + SERIAL_PROTOCOLPGM("\n"); + } +*/ if (nMeasPoints == 7 && magnet_elimination) { mbl_interpolation(nMeasPoints); } +/* + SERIAL_PROTOCOLPGM("Num X,Y: "); + SERIAL_PROTOCOL(MESH_NUM_X_POINTS); + SERIAL_PROTOCOLPGM(","); + SERIAL_PROTOCOL(MESH_NUM_Y_POINTS); + SERIAL_PROTOCOLPGM("\nZ search height: "); + SERIAL_PROTOCOL(MESH_HOME_Z_SEARCH); + SERIAL_PROTOCOLLNPGM("\nMeasured points:"); + for (int y = MESH_NUM_Y_POINTS-1; y >= 0; y--) { + for (int x = 0; x < MESH_NUM_X_POINTS; x++) { + SERIAL_PROTOCOLPGM(" "); + SERIAL_PROTOCOL_F(mbl.z_values[y][x], 5); + } + SERIAL_PROTOCOLPGM("\n"); + } +*/ // SERIAL_ECHOLNPGM("Upsample finished"); mbl.active = 1; //activate mesh bed leveling // SERIAL_ECHOLNPGM("Mesh bed leveling activated"); diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 8de8fe81b..f9c21c006 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -3121,18 +3121,25 @@ bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points, bo ix *= 3; iy *= 3; } - if((iy%2) == 0) return (valid_points_mask[6 - iy] & (1 << (6 - ix))); - else return (valid_points_mask[6 - iy] & (1 << ix)); + if (zigzag) { + if ((iy % 2) == 0) return (valid_points_mask[6 - iy] & (1 << (6 - ix))); + else return (valid_points_mask[6 - iy] & (1 << ix)); + } + else { + return (valid_points_mask[6 - iy] & (1 << (6 - ix))); + } } void mbl_single_point_interpolation(uint8_t x, uint8_t y, uint8_t meas_points) { + printf_P(PSTR("x = %d; y = %d \n"), x, y); uint8_t count = 0; float z = 0; - if(mbl_point_measurement_valid(x, y+1, meas_points, false)) { z += mbl.z_values[x][y+1]; count++; } - if(mbl_point_measurement_valid(x, y-1, meas_points, false)) { z += mbl.z_values[x][y-1]; count++; } - if(mbl_point_measurement_valid(x+1, y, meas_points, false)) { z += mbl.z_values[x+1][y]; count++; } - if(mbl_point_measurement_valid(x-1, y, meas_points, false)) { z += mbl.z_values[x+1][y]; count++; } - if(count != 0) mbl.z_values[x][y] = z / count; //if we have at least one valid point in surrounding area use average value, otherwise use inaccurately measured Z-coordinate + if (mbl_point_measurement_valid(x, y + 1, meas_points, false)) { z += mbl.z_values[y + 1][x]; /*printf_P(PSTR("x; y+1: Z = %f \n")*/, mbl.z_values[y + 1][x]); count++; } + if (mbl_point_measurement_valid(x, y - 1, meas_points, false)) { z += mbl.z_values[y - 1][x]; /*printf_P(PSTR("x; y-1: Z = %f \n")*/, mbl.z_values[y - 1][x]); count++; } + if (mbl_point_measurement_valid(x + 1, y, meas_points, false)) { z += mbl.z_values[y][x + 1]; /*printf_P(PSTR("x+1; y: Z = %f \n")*/, mbl.z_values[y][x + 1]); count++; } + if (mbl_point_measurement_valid(x - 1, y, meas_points, false)) { z += mbl.z_values[y][x - 1]; /*printf_P(PSTR("x-1; y: Z = %f \n")*/, mbl.z_values[y][x - 1]); count++; } + if(count != 0) mbl.z_values[y][x] = z / count; //if we have at least one valid point in surrounding area use average value, otherwise use inaccurately measured Z-coordinate + //printf_P(PSTR("result: Z = %f \n\n"), mbl.z_values[y][x]); } void mbl_interpolation(uint8_t meas_points) { From 0aa21c362ef25db5ed8abeb992d60c4c207b37be Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Mon, 11 Mar 2019 23:37:30 +0100 Subject: [PATCH 17/26] compile error fix --- Firmware/mesh_bed_calibration.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index f9c21c006..0a6755506 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -3134,10 +3134,10 @@ void mbl_single_point_interpolation(uint8_t x, uint8_t y, uint8_t meas_points) { printf_P(PSTR("x = %d; y = %d \n"), x, y); uint8_t count = 0; float z = 0; - if (mbl_point_measurement_valid(x, y + 1, meas_points, false)) { z += mbl.z_values[y + 1][x]; /*printf_P(PSTR("x; y+1: Z = %f \n")*/, mbl.z_values[y + 1][x]); count++; } - if (mbl_point_measurement_valid(x, y - 1, meas_points, false)) { z += mbl.z_values[y - 1][x]; /*printf_P(PSTR("x; y-1: Z = %f \n")*/, mbl.z_values[y - 1][x]); count++; } - if (mbl_point_measurement_valid(x + 1, y, meas_points, false)) { z += mbl.z_values[y][x + 1]; /*printf_P(PSTR("x+1; y: Z = %f \n")*/, mbl.z_values[y][x + 1]); count++; } - if (mbl_point_measurement_valid(x - 1, y, meas_points, false)) { z += mbl.z_values[y][x - 1]; /*printf_P(PSTR("x-1; y: Z = %f \n")*/, mbl.z_values[y][x - 1]); count++; } + if (mbl_point_measurement_valid(x, y + 1, meas_points, false)) { z += mbl.z_values[y + 1][x]; /*printf_P(PSTR("x; y+1: Z = %f \n"), mbl.z_values[y + 1][x]);*/ count++; } + if (mbl_point_measurement_valid(x, y - 1, meas_points, false)) { z += mbl.z_values[y - 1][x]; /*printf_P(PSTR("x; y-1: Z = %f \n"), mbl.z_values[y - 1][x]);*/ count++; } + if (mbl_point_measurement_valid(x + 1, y, meas_points, false)) { z += mbl.z_values[y][x + 1]; /*printf_P(PSTR("x+1; y: Z = %f \n"), mbl.z_values[y][x + 1]);*/ count++; } + if (mbl_point_measurement_valid(x - 1, y, meas_points, false)) { z += mbl.z_values[y][x - 1]; /*printf_P(PSTR("x-1; y: Z = %f \n"), mbl.z_values[y][x - 1]);*/ count++; } if(count != 0) mbl.z_values[y][x] = z / count; //if we have at least one valid point in surrounding area use average value, otherwise use inaccurately measured Z-coordinate //printf_P(PSTR("result: Z = %f \n\n"), mbl.z_values[y][x]); } From c3a95ab79baa4dfebd346fb7f99308b0affc39f5 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Tue, 12 Mar 2019 11:57:35 +0100 Subject: [PATCH 18/26] variants update --- Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h index 3b9f76987..a036a11a6 100644 --- a/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h @@ -438,7 +438,7 @@ THERMISTORS SETTINGS #define M600_TIMEOUT 600 //seconds -#define MMU_REQUIRED_FW_BUILDNR 132 +#define MMU_REQUIRED_FW_BUILDNR 310 #ifndef SNMM //#define SUPPORT_VERBOSITY diff --git a/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h index 2d00929f3..d2ada705a 100644 --- a/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h @@ -438,7 +438,7 @@ THERMISTORS SETTINGS #define M600_TIMEOUT 600 //seconds -#define MMU_REQUIRED_FW_BUILDNR 132 +#define MMU_REQUIRED_FW_BUILDNR 310 #ifndef SNMM //#define SUPPORT_VERBOSITY diff --git a/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h index 40a3a229b..424d2a7e1 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h @@ -497,7 +497,7 @@ //#define SUPPORT_VERBOSITY -#define MMU_REQUIRED_FW_BUILDNR 132 +#define MMU_REQUIRED_FW_BUILDNR 310 #define MMU_FORCE_STEALTH_MODE #define MMU_DEBUG //print communication between MMU2 and printer on serial diff --git a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h index 99dd1e65a..0912748af 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h @@ -498,7 +498,7 @@ //#define SUPPORT_VERBOSITY -#define MMU_REQUIRED_FW_BUILDNR 132 +#define MMU_REQUIRED_FW_BUILDNR 310 #define MMU_FORCE_STEALTH_MODE #define MMU_DEBUG //print communication between MMU2 and printer on serial diff --git a/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h index d3badf6aa..c02868c9f 100644 --- a/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h @@ -497,7 +497,7 @@ //#define SUPPORT_VERBOSITY -#define MMU_REQUIRED_FW_BUILDNR 132 +#define MMU_REQUIRED_FW_BUILDNR 310 #define MMU_FORCE_STEALTH_MODE #define MMU_DEBUG //print communication between MMU2 and printer on serial diff --git a/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h index 2563f848a..008f1b178 100644 --- a/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h @@ -498,7 +498,7 @@ //#define SUPPORT_VERBOSITY -#define MMU_REQUIRED_FW_BUILDNR 132 +#define MMU_REQUIRED_FW_BUILDNR 310 #define MMU_FORCE_STEALTH_MODE #define MMU_DEBUG //print communication between MMU2 and printer on serial diff --git a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h index c400b016f..baebd0ecb 100644 --- a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h @@ -623,7 +623,7 @@ //#define SUPPORT_VERBOSITY -#define MMU_REQUIRED_FW_BUILDNR 83 +#define MMU_REQUIRED_FW_BUILDNR 310 #define MMU_HWRESET #define MMU_DEBUG //print communication between MMU2 and printer on serial #define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning diff --git a/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h index 37512071c..a99d38f71 100644 --- a/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h @@ -623,7 +623,7 @@ //#define SUPPORT_VERBOSITY -#define MMU_REQUIRED_FW_BUILDNR 83 +#define MMU_REQUIRED_FW_BUILDNR 310 #define MMU_HWRESET #define MMU_DEBUG //print communication between MMU2 and printer on serial #define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning From 6c70d598100a6801e70e1020e0efa64671c164a1 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 13 Mar 2019 15:05:10 +0100 Subject: [PATCH 19/26] mbl settings initialization fix --- Firmware/eeprom.h | 2 +- Firmware/mesh_bed_calibration.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Firmware/eeprom.h b/Firmware/eeprom.h index 56ee5f77d..c96e1d8db 100644 --- a/Firmware/eeprom.h +++ b/Firmware/eeprom.h @@ -158,7 +158,7 @@ #define EEPROM_MBL_TYPE (EEPROM_UVLO_MESH_BED_LEVELING_FULL-1) //uint8_t for mesh bed leveling precision #define EEPROM_MBL_MAGNET_ELIMINATION (EEPROM_MBL_TYPE -1) #define EEPROM_MBL_POINTS_NR (EEPROM_MBL_MAGNET_ELIMINATION -1) //uint8_t number of points in one exis for mesh bed leveling -#define EEPROM_MBL_PROBE_NR (EEPROM_MBL_POINTS_NR-1) +#define EEPROM_MBL_PROBE_NR (EEPROM_MBL_POINTS_NR-1) //number of measurements for each point #define EEPROM_MMU_STEALTH (EEPROM_MBL_PROBE_NR-1) // !!!!! // !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!! diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 0a6755506..e50fb435e 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -3088,15 +3088,14 @@ void mbl_settings_init() { if (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) == 0xFF) { eeprom_update_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION, 1); } - if (eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR) == 0xFF) { - eeprom_update_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); + if (eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR) == 0xFF) { + eeprom_update_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); } - mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); + mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); if (mbl_z_probe_nr == 0xFF) { mbl_z_probe_nr = 3; - eeprom_update_byte((uint8_t*)EEPROM_MBL_POINTS_NR, mbl_z_probe_nr); + eeprom_update_byte((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } - } bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points, bool zigzag) { From 32138ea09af8f3a1700d55d0c9e54eed49ce542d Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 13 Mar 2019 15:08:09 +0100 Subject: [PATCH 20/26] menu item alignment --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index cae2f2748..655b15907 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5309,7 +5309,7 @@ do\ {\ if (mmu_enabled)\ {\ - if (SilentModeMenu_MMU == 0) MENU_ITEM_FUNCTION_P(_i("MMU Mode [Fast]"), lcd_silent_mode_mmu_set); \ + if (SilentModeMenu_MMU == 0) MENU_ITEM_FUNCTION_P(_i("MMU Mode [Fast]"), lcd_silent_mode_mmu_set); \ else MENU_ITEM_FUNCTION_P(_i("MMU Mode[Stealth]"), lcd_silent_mode_mmu_set); \ }\ }\ From 72f51989fa7b3df34da645548a3c2227c58a0757 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 13 Mar 2019 19:41:09 +0100 Subject: [PATCH 21/26] compare measured Z-value during mesh bed leveling with Z-calibration value even for 7x7 mesh --- Firmware/Marlin_main.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 2b22383b5..140c680b3 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4447,7 +4447,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) int XY_AXIS_FEEDRATE = homing_feedrate[X_AXIS] / 20; int Z_LIFT_FEEDRATE = homing_feedrate[Z_AXIS] / 40; - bool has_z = (nMeasPoints == 3) && is_bed_z_jitter_data_valid(); //checks if we have data from Z calibration (offsets of the Z heiths of the 8 calibration points from the first point) + bool has_z = is_bed_z_jitter_data_valid(); //checks if we have data from Z calibration (offsets of the Z heiths of the 8 calibration points from the first point) #ifdef SUPPORT_VERBOSITY if (verbosity_level >= 1) { has_z ? SERIAL_PROTOCOLPGM("Z jitter data from Z cal. valid.\n") : SERIAL_PROTOCOLPGM("Z jitter data from Z cal. not valid.\n"); @@ -4466,11 +4466,14 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) continue; //skip }*/ if (iy & 1) ix = (nMeasPoints - 1) - ix; // Zig zag + if (nMeasPoints == 7) //if we have 7x7 mesh, compare with Z-calibration for points which are in 3x3 mesh + { + has_z = ((ix % 3 == 0) && (iy % 3 == 0)) && is_bed_z_jitter_data_valid(); + } float z0 = 0.f; if (has_z && (mesh_point > 0)) { uint16_t z_offset_u = eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + 2 * (ix + iy * 3 - 1))); z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; - //#if 0 #ifdef SUPPORT_VERBOSITY if (verbosity_level >= 1) { SERIAL_ECHOLNPGM(""); @@ -4481,7 +4484,6 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY - //#endif } // Move Z up to MESH_HOME_Z_SEARCH. @@ -4511,7 +4513,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) // Go down until endstop is hit const float Z_CALIBRATION_THRESHOLD = 1.f; if (!find_bed_induction_sensor_point_z((has_z && mesh_point > 0) ? z0 - Z_CALIBRATION_THRESHOLD : -10.f, nProbeRetry)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point - kill_message = _T(MSG_BED_LEVELING_FAILED_POINT_LOW); + printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { //broken cable or initial Z coordinate too low. Go to MESH_HOME_Z_SEARCH and repeat last step (z-probe) again to distinguish between these two cases. @@ -4521,16 +4523,16 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) st_synchronize(); if (!find_bed_induction_sensor_point_z((has_z && mesh_point > 0) ? z0 - Z_CALIBRATION_THRESHOLD : -10.f, nProbeRetry)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point - kill_message = _T(MSG_BED_LEVELING_FAILED_POINT_LOW); + printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { - kill_message = _i("Bed leveling failed. Sensor disconnected or cable broken. Waiting for reset.");////MSG_BED_LEVELING_FAILED_PROBE_DISCONNECTED c=20 r=4 + printf_P(PSTR("Bed leveling failed. Sensor disconnected or cable broken. Waiting for reset.\n")); break; } } if (has_z && fabs(z0 - current_position[Z_AXIS]) > Z_CALIBRATION_THRESHOLD) { //if we have data from z calibration, max. allowed difference is 1mm for each point - kill_message = _i("Bed leveling failed. Sensor triggered too high. Waiting for reset.");////MSG_BED_LEVELING_FAILED_POINT_HIGH c=20 r=4 + printf_P(PSTR("Bed leveling failed. Sensor triggered too high. Waiting for reset.\n")); break; } #ifdef SUPPORT_VERBOSITY From 9e0e4198c5b2f9f30df4cba839d020793699dcdc Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 14 Mar 2019 01:52:44 +0100 Subject: [PATCH 22/26] Mesh by 3d-gussner, fixed difference between mbl points coordinates and coordinates used in planner for corrections, mbl settings menu update --- Firmware/Marlin_main.cpp | 2 +- Firmware/mesh_bed_calibration.cpp | 14 +++++++------- Firmware/mesh_bed_calibration.h | 8 ++++---- Firmware/ultralcd.cpp | 10 +++++----- Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h | 6 +++--- Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h | 6 +++--- .../variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h | 6 +++--- .../variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h | 6 +++--- Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h | 6 +++--- Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h | 6 +++--- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 140c680b3..437af16fe 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4496,7 +4496,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) current_position[X_AXIS] = BED_X(ix, nMeasPoints); current_position[Y_AXIS] = BED_Y(iy, nMeasPoints); - + //printf_P(PSTR("[%f;%f]\n"), current_position[X_AXIS], current_position[Y_AXIS]); world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); #ifdef SUPPORT_VERBOSITY diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index e50fb435e..acbe34081 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -978,7 +978,7 @@ inline bool find_bed_induction_sensor_point_z(float minimum_z, uint8_t n_iter, i update_current_position_z(); //printf_P(PSTR("Zs: %f, Z: %f, delta Z: %f"), z_bckp, current_position[Z_AXIS], (z_bckp - current_position[Z_AXIS])); if (abs(current_position[Z_AXIS] - z_bckp) < 0.025) { - printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); + //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); current_position[Z_AXIS] += 0.5; go_to_current(homing_feedrate[Z_AXIS]/60); current_position[Z_AXIS] = minimum_z; @@ -999,7 +999,7 @@ inline bool find_bed_induction_sensor_point_z(float minimum_z, uint8_t n_iter, i // SERIAL_ECHOLNPGM(""); float dz = i?abs(current_position[Z_AXIS] - (z / i)):0; z += current_position[Z_AXIS]; - printf_P(PSTR("Z[%d] = %d, dz=%d\n"), i, (int)(current_position[Z_AXIS] * 1000), (int)(dz * 1000)); + //printf_P(PSTR("Z[%d] = %d, dz=%d\n"), i, (int)(current_position[Z_AXIS] * 1000), (int)(dz * 1000)); if (dz > 0.05) goto error;//deviation > 50um } current_position[Z_AXIS] = z; @@ -3107,13 +3107,13 @@ bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points, bo uint8_t valid_points_mask[7] = { //[X_MAX,Y_MAX] - 0b1111101, - 0b1110111, 0b1111111, - 0b0111011, - 0b1110111, 0b1111111, 0b1110111, + 0b1111011, + 0b1110111, + 0b1111111, + 0b1111111, //[0,0] }; if (meas_points == 3) { @@ -3130,7 +3130,7 @@ bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points, bo } void mbl_single_point_interpolation(uint8_t x, uint8_t y, uint8_t meas_points) { - printf_P(PSTR("x = %d; y = %d \n"), x, y); + //printf_P(PSTR("x = %d; y = %d \n"), x, y); uint8_t count = 0; float z = 0; if (mbl_point_measurement_valid(x, y + 1, meas_points, false)) { z += mbl.z_values[y + 1][x]; /*printf_P(PSTR("x; y+1: Z = %f \n"), mbl.z_values[y + 1][x]);*/ count++; } diff --git a/Firmware/mesh_bed_calibration.h b/Firmware/mesh_bed_calibration.h index 954db9c30..8adc1c119 100644 --- a/Firmware/mesh_bed_calibration.h +++ b/Firmware/mesh_bed_calibration.h @@ -6,10 +6,10 @@ #ifdef HEATBED_V2 -#define BED_X0 (3.f - BED_ZERO_REF_X) -#define BED_Y0 (10.4f - BED_ZERO_REF_Y) -#define BED_Xn (206.f - BED_ZERO_REF_X) -#define BED_Yn (202.4f - BED_ZERO_REF_Y) +#define BED_X0 (2.f - BED_ZERO_REF_X) //1 +#define BED_Y0 (9.4f - BED_ZERO_REF_Y) //1 +#define BED_Xn (206.f - BED_ZERO_REF_X) //205 +#define BED_Yn (213.4f - BED_ZERO_REF_Y) //205 #else diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 655b15907..d907e2c7d 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6687,14 +6687,14 @@ static void lcd_mesh_bed_leveling_settings() eeprom_update_byte((uint8_t*)EEPROM_MBL_PROBE_NR, (uint8_t)mbl_z_probe_nr); } MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); - if(points_nr == 3) MENU_ITEM_FUNCTION_P(_i("Mesh [3x3]"), mbl_mesh_set); - else MENU_ITEM_FUNCTION_P(_i("Mesh [7x7]"), mbl_mesh_set); + if(points_nr == 3) MENU_ITEM_FUNCTION_P(_i("Mesh [3x3]"), mbl_mesh_set); + else MENU_ITEM_FUNCTION_P(_i("Mesh [7x7]"), mbl_mesh_set); MENU_ITEM_EDIT_int3_P(_i("Z-probe nr."), &mbl_z_probe_nr, 1, 5); if (points_nr == 7) { - if (magnet_elimination) MENU_ITEM_FUNCTION_P(_i("Magnets eli [On]"), mbl_magnets_elimination_set); - else MENU_ITEM_FUNCTION_P(_i("Magnets comp. [Off]"), mbl_magnets_elimination_set); + if (magnet_elimination) MENU_ITEM_FUNCTION_P(_i("Magnets comp. [On]"), mbl_magnets_elimination_set); + else MENU_ITEM_FUNCTION_P(_i("Magnets comp.[Off]"), mbl_magnets_elimination_set); } - else menu_item_text_P(_i("Magnets comp. [N/A]")); + else menu_item_text_P(_i("Magnets comp.[N/A]")); MENU_END(); /*if(menu_leaving) { diff --git a/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h index 424d2a7e1..a6ca8c61e 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h @@ -290,10 +290,10 @@ #define MBL_Z_STEP 0.01 // Mesh definitions -#define MESH_MIN_X 35 -#define MESH_MAX_X 238 +#define MESH_MIN_X 24 +#define MESH_MAX_X 228 #define MESH_MIN_Y 6 -#define MESH_MAX_Y 202 +#define MESH_MAX_Y 210 // Mesh upsample definition #define MESH_NUM_X_POINTS 7 diff --git a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h index 0912748af..4cd2e9777 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h @@ -291,10 +291,10 @@ #define MBL_Z_STEP 0.01 // Mesh definitions -#define MESH_MIN_X 35 -#define MESH_MAX_X 238 +#define MESH_MIN_X 24 +#define MESH_MAX_X 228 #define MESH_MIN_Y 6 -#define MESH_MAX_Y 202 +#define MESH_MAX_Y 210 // Mesh upsample definition #define MESH_NUM_X_POINTS 7 diff --git a/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h index c02868c9f..603274eb8 100644 --- a/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h @@ -290,10 +290,10 @@ #define MBL_Z_STEP 0.01 // Mesh definitions -#define MESH_MIN_X 35 -#define MESH_MAX_X 238 +#define MESH_MIN_X 24 +#define MESH_MAX_X 228 #define MESH_MIN_Y 6 -#define MESH_MAX_Y 202 +#define MESH_MAX_Y 210 // Mesh upsample definition #define MESH_NUM_X_POINTS 7 diff --git a/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h index 008f1b178..a45d23c21 100644 --- a/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h @@ -291,10 +291,10 @@ #define MBL_Z_STEP 0.01 // Mesh definitions -#define MESH_MIN_X 35 -#define MESH_MAX_X 238 +#define MESH_MIN_X 24 +#define MESH_MAX_X 228 #define MESH_MIN_Y 6 -#define MESH_MAX_Y 202 +#define MESH_MAX_Y 210 // Mesh upsample definition #define MESH_NUM_X_POINTS 7 diff --git a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h index baebd0ecb..d3e168550 100644 --- a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h @@ -400,10 +400,10 @@ #define MBL_Z_STEP 0.01 // Mesh definitions -#define MESH_MIN_X 35 -#define MESH_MAX_X 238 +#define MESH_MIN_X 24 +#define MESH_MAX_X 228 #define MESH_MIN_Y 6 -#define MESH_MAX_Y 202 +#define MESH_MAX_Y 210 // Mesh upsample definition #define MESH_NUM_X_POINTS 7 diff --git a/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h index a99d38f71..fed7863bf 100644 --- a/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h @@ -400,10 +400,10 @@ #define MBL_Z_STEP 0.01 // Mesh definitions -#define MESH_MIN_X 35 -#define MESH_MAX_X 238 +#define MESH_MIN_X 24 +#define MESH_MAX_X 228 #define MESH_MIN_Y 6 -#define MESH_MAX_Y 202 +#define MESH_MAX_Y 210 // Mesh upsample definition #define MESH_NUM_X_POINTS 7 From ef198856a470e471d81d90958291098e84045cea Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 14 Mar 2019 14:10:52 +0100 Subject: [PATCH 23/26] increase relative movement in Z to work better with higher hysteresis PINDAs --- Firmware/mesh_bed_calibration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index acbe34081..0aca64a5f 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -968,7 +968,7 @@ inline bool find_bed_induction_sensor_point_z(float minimum_z, uint8_t n_iter, i for (uint8_t i = 0; i < n_iter; ++ i) { - current_position[Z_AXIS] += 0.15; + current_position[Z_AXIS] += 0.2; float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); // Move back down slowly to find bed. From 6e26f61726330051cf122f8b5ac03145fa0507c8 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 14 Mar 2019 14:48:01 +0100 Subject: [PATCH 24/26] fixed 7x7 mesh bed leveling vs. Z calibration check --- Firmware/Marlin_main.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 437af16fe..7be151f9f 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4472,16 +4472,17 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) } float z0 = 0.f; if (has_z && (mesh_point > 0)) { - uint16_t z_offset_u = eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + 2 * (ix + iy * 3 - 1))); + uint16_t z_offset_u = 0; + if (nMeasPoints == 7) { + z_offset_u = eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + 2 * ((ix/3) + iy - 1))); + } + else { + z_offset_u = eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + 2 * (ix + iy * 3 - 1))); + } z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; #ifdef SUPPORT_VERBOSITY if (verbosity_level >= 1) { - SERIAL_ECHOLNPGM(""); - SERIAL_ECHOPGM("Bed leveling, point: "); - MYSERIAL.print(mesh_point); - SERIAL_ECHOPGM(", calibration z: "); - MYSERIAL.print(z0, 5); - SERIAL_ECHOLNPGM(""); + printf_P(PSTR("Bed leveling, point: %d, calibration Z stored in eeprom: %d, calibration z: %f \n"), mesh_point, z_offset_u, z0); } #endif // SUPPORT_VERBOSITY } From 80ef2686aec783b378db5771caf6b3377e0b3573 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 14 Mar 2019 18:17:40 +0100 Subject: [PATCH 25/26] mmu mode switching fix --- Firmware/mmu.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Firmware/mmu.cpp b/Firmware/mmu.cpp index 087753a6b..f82ea05af 100644 --- a/Firmware/mmu.cpp +++ b/Firmware/mmu.cpp @@ -339,7 +339,6 @@ void mmu_loop(void) else if ((eeprom_read_byte((uint8_t*)EEPROM_MMU_STEALTH) != SilentModeMenu_MMU) && mmu_ready) { DEBUG_PRINTF_P(PSTR("MMU <= 'M%d'\n"), SilentModeMenu_MMU); mmu_printf_P(PSTR("M%d\n"), SilentModeMenu_MMU); - mmu_ready = false; mmu_state = S::SwitchMode; } else if ((mmu_last_response + 300) < _millis()) //request every 300ms @@ -466,7 +465,6 @@ void mmu_loop(void) { DEBUG_PRINTF_P(PSTR("MMU => 'ok'\n")); eeprom_update_byte((uint8_t*)EEPROM_MMU_STEALTH, SilentModeMenu_MMU); - mmu_ready = true; mmu_state = S::Idle; } else if ((mmu_last_request + MMU_CMD_TIMEOUT) < _millis()) From 0ca52216f3d0c8e94b831addb1f4118bef23dec5 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Fri, 15 Mar 2019 13:14:32 +0100 Subject: [PATCH 26/26] Revert "variants update" This reverts commit c3a95ab79baa4dfebd346fb7f99308b0affc39f5. --- Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h index a036a11a6..3b9f76987 100644 --- a/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h @@ -438,7 +438,7 @@ THERMISTORS SETTINGS #define M600_TIMEOUT 600 //seconds -#define MMU_REQUIRED_FW_BUILDNR 310 +#define MMU_REQUIRED_FW_BUILDNR 132 #ifndef SNMM //#define SUPPORT_VERBOSITY diff --git a/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h index d2ada705a..2d00929f3 100644 --- a/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h @@ -438,7 +438,7 @@ THERMISTORS SETTINGS #define M600_TIMEOUT 600 //seconds -#define MMU_REQUIRED_FW_BUILDNR 310 +#define MMU_REQUIRED_FW_BUILDNR 132 #ifndef SNMM //#define SUPPORT_VERBOSITY diff --git a/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h index a6ca8c61e..63d03dfe6 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h @@ -497,7 +497,7 @@ //#define SUPPORT_VERBOSITY -#define MMU_REQUIRED_FW_BUILDNR 310 +#define MMU_REQUIRED_FW_BUILDNR 132 #define MMU_FORCE_STEALTH_MODE #define MMU_DEBUG //print communication between MMU2 and printer on serial diff --git a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h index 4cd2e9777..262ec865e 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h @@ -498,7 +498,7 @@ //#define SUPPORT_VERBOSITY -#define MMU_REQUIRED_FW_BUILDNR 310 +#define MMU_REQUIRED_FW_BUILDNR 132 #define MMU_FORCE_STEALTH_MODE #define MMU_DEBUG //print communication between MMU2 and printer on serial diff --git a/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h index 603274eb8..bf91b7322 100644 --- a/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h @@ -497,7 +497,7 @@ //#define SUPPORT_VERBOSITY -#define MMU_REQUIRED_FW_BUILDNR 310 +#define MMU_REQUIRED_FW_BUILDNR 132 #define MMU_FORCE_STEALTH_MODE #define MMU_DEBUG //print communication between MMU2 and printer on serial diff --git a/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h index a45d23c21..ff7e1f588 100644 --- a/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h @@ -498,7 +498,7 @@ //#define SUPPORT_VERBOSITY -#define MMU_REQUIRED_FW_BUILDNR 310 +#define MMU_REQUIRED_FW_BUILDNR 132 #define MMU_FORCE_STEALTH_MODE #define MMU_DEBUG //print communication between MMU2 and printer on serial diff --git a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h index d3e168550..4a430d7dc 100644 --- a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h @@ -623,7 +623,7 @@ //#define SUPPORT_VERBOSITY -#define MMU_REQUIRED_FW_BUILDNR 310 +#define MMU_REQUIRED_FW_BUILDNR 83 #define MMU_HWRESET #define MMU_DEBUG //print communication between MMU2 and printer on serial #define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning diff --git a/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h index fed7863bf..9ddb71e58 100644 --- a/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h @@ -623,7 +623,7 @@ //#define SUPPORT_VERBOSITY -#define MMU_REQUIRED_FW_BUILDNR 310 +#define MMU_REQUIRED_FW_BUILDNR 83 #define MMU_HWRESET #define MMU_DEBUG //print communication between MMU2 and printer on serial #define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning