From ae08788c99ea77ad5a08e22fc156430b537322ac Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 18 Apr 2018 23:30:01 +0200 Subject: [PATCH 01/21] Split lcd_service_mode_show_result screens to separate functions. Make them non blocking. Remove global array distance_from_min, pass it as function return value. Make Support submenus returning to Support menu. --- Firmware/Marlin.h | 1 - Firmware/Marlin_main.cpp | 2 - Firmware/mesh_bed_calibration.cpp | 11 +-- Firmware/mesh_bed_calibration.h | 3 +- Firmware/ultralcd.cpp | 112 +++++++++++++++--------------- Firmware/ultralcd.h | 2 - 6 files changed, 65 insertions(+), 66 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index c540b13b..5767b8b2 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -343,7 +343,6 @@ extern unsigned long t_fan_rising_edge; extern bool mesh_bed_leveling_flag; extern bool mesh_bed_run_from_menu; -extern float distance_from_min[2]; extern bool sortAlpha; extern char dir_names[3][9]; diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 1102e111..833cea94 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -324,8 +324,6 @@ unsigned int custom_message_type; unsigned int custom_message_state; char snmm_filaments_used = 0; -float distance_from_min[2]; - bool fan_state[2]; int fan_edge_counter[2]; int fan_speed[2]; diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 266733c8..907136b6 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -2960,8 +2960,8 @@ void babystep_reset() babystepLoadZ = 0; } -void count_xyz_details() { - float a1, a2; +DistanceMin count_xyz_details() { + DistanceMin distanceMin; float cntr[2] = { eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER + 0)), eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER + 4)) @@ -2974,12 +2974,15 @@ void count_xyz_details() { eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y + 0)), eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y + 4)) }; +#if 0 a2 = -1 * asin(vec_y[0] / MACHINE_AXIS_SCALE_Y); a1 = asin(vec_x[1] / MACHINE_AXIS_SCALE_X); - //angleDiff = fabs(a2 - a1); + angleDiff = fabs(a2 - a1); +#endif for (uint8_t mesh_point = 0; mesh_point < 2; ++mesh_point) { float y = vec_x[1] * pgm_read_float(bed_ref_points_4 + mesh_point * 2) + vec_y[1] * pgm_read_float(bed_ref_points_4 + mesh_point * 2 + 1) + cntr[1]; - distance_from_min[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); + distanceMin.d[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); } + return distanceMin; } diff --git a/Firmware/mesh_bed_calibration.h b/Firmware/mesh_bed_calibration.h index ced77cf6..34def34a 100644 --- a/Firmware/mesh_bed_calibration.h +++ b/Firmware/mesh_bed_calibration.h @@ -181,7 +181,8 @@ extern void babystep_undo(); // Reset the current babystep counter without moving the axes. extern void babystep_reset(); -extern void count_xyz_details(); +typedef struct{ float d[2];} DistanceMin; +extern DistanceMin count_xyz_details(); extern bool sample_z(); #endif /* MESH_BED_CALIBRATION_H */ diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index a9518158..ac5d3bcf 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -222,6 +222,8 @@ static void prusa_stat_temperatures(); static void prusa_stat_printinfo(); static void lcd_farm_no(); static void lcd_menu_extruder_info(); +static void lcd_menu_xyz_y_min(); +static void lcd_menu_xyz_skew(); #if defined(TMC2130) || defined(PAT9125) static void lcd_menu_fails_stats(); #endif //TMC2130 or PAT9125 @@ -1582,7 +1584,7 @@ static void lcd_menu_extruder_info() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } @@ -1686,7 +1688,7 @@ static void lcd_menu_debug() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } #endif /* DEBUG_BUILD */ @@ -1703,7 +1705,7 @@ static void lcd_menu_temperatures() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } @@ -1721,7 +1723,7 @@ static void lcd_menu_voltages() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } #endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN @@ -1733,7 +1735,7 @@ static void lcd_menu_belt_status() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } #endif //TMC2130 @@ -1831,7 +1833,7 @@ static void lcd_support_menu() } #ifndef MK1BP MENU_ITEM(back, PSTR("------------"), 0); - if (!IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LCD_COMMAND_V2_CAL)) MENU_ITEM(function, MSG_XYZ_DETAILS, lcd_service_mode_show_result); + if (!IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LCD_COMMAND_V2_CAL)) MENU_ITEM(submenu, MSG_XYZ_DETAILS, lcd_menu_xyz_y_min); MENU_ITEM(submenu, MSG_INFO_EXTRUDER, lcd_menu_extruder_info); #ifdef TMC2130 @@ -2285,62 +2287,60 @@ static void lcd_move_e() } } -void lcd_service_mode_show_result() { - float angleDiff; - lcd_set_custom_characters_degree(); - count_xyz_details(); - angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); - lcd_update_enable(false); - lcd_implementation_clear(); - lcd_printPGM(MSG_Y_DISTANCE_FROM_MIN); - lcd_print_at_PGM(0, 1, MSG_LEFT); - lcd_print_at_PGM(0, 2, MSG_RIGHT); +static void lcd_menu_xyz_y_min() +{ + lcd.setCursor(0,0); + lcd_printPGM(MSG_Y_DISTANCE_FROM_MIN); + lcd_print_at_PGM(0, 1, PSTR("--------------------")); + lcd_print_at_PGM(0, 2, MSG_LEFT); + lcd_print_at_PGM(0, 3, MSG_RIGHT); - for (int i = 0; i < 2; i++) { - if(distance_from_min[i] < 200) { - lcd_print_at_PGM(11, i + 1, PSTR("")); - lcd.print(distance_from_min[i]); - lcd_print_at_PGM((distance_from_min[i] < 0) ? 17 : 16, i + 1, PSTR("mm")); - } else lcd_print_at_PGM(11, i + 1, PSTR("N/A")); - } - delay_keep_alive(500); - KEEPALIVE_STATE(PAUSED_FOR_USER); - while (!lcd_clicked()) { - delay_keep_alive(100); - } - delay_keep_alive(500); - lcd_implementation_clear(); - + DistanceMin distanceMin = count_xyz_details(); - lcd_printPGM(MSG_MEASURED_SKEW); - if (angleDiff < 100) { - lcd.setCursor(15, 0); - lcd.print(angleDiff * 180 / M_PI); - lcd.print(LCD_STR_DEGREE); - }else lcd_print_at_PGM(16, 0, PSTR("N/A")); - lcd_print_at_PGM(0, 1, PSTR("--------------------")); - lcd_print_at_PGM(0, 2, MSG_SLIGHT_SKEW); - lcd_print_at_PGM(15, 2, PSTR("")); - lcd.print(bed_skew_angle_mild * 180 / M_PI); - lcd.print(LCD_STR_DEGREE); - lcd_print_at_PGM(0, 3, MSG_SEVERE_SKEW); - lcd_print_at_PGM(15, 3, PSTR("")); - lcd.print(bed_skew_angle_extreme * 180 / M_PI); - lcd.print(LCD_STR_DEGREE); - delay_keep_alive(500); - while (!lcd_clicked()) { - delay_keep_alive(100); - } - KEEPALIVE_STATE(NOT_BUSY); - delay_keep_alive(500); - lcd_set_custom_characters_arrows(); - lcd_return_to_status(); - lcd_update_enable(true); - lcd_update(2); + for (int i = 0; i < 2; i++) { + if(distanceMin.d[i] < 200) { + lcd_print_at_PGM(11, i + 2, PSTR("")); + lcd.print(distanceMin.d[i]); + lcd_print_at_PGM((distanceMin.d[i] < 0) ? 17 : 16, i + 2, PSTR("mm")); + } else lcd_print_at_PGM(11, i + 2, PSTR("N/A")); + } + if (lcd_clicked()) + { + lcd_quick_feedback(); + lcd_set_custom_characters_degree(); + lcd_goto_menu(lcd_menu_xyz_skew); + } } +static void lcd_menu_xyz_skew() +{ + float angleDiff; + angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); + lcd.setCursor(0,0); + lcd_printPGM(MSG_MEASURED_SKEW); + if (angleDiff < 100) { + lcd.setCursor(15, 0); + lcd.print(angleDiff * 180 / M_PI); + lcd.print(LCD_STR_DEGREE); + }else lcd_print_at_PGM(16, 0, PSTR("N/A")); + lcd_print_at_PGM(0, 1, PSTR("--------------------")); + lcd_print_at_PGM(0, 2, MSG_SLIGHT_SKEW); + lcd_print_at_PGM(15, 2, PSTR("")); + lcd.print(bed_skew_angle_mild * 180 / M_PI); + lcd.print(LCD_STR_DEGREE); + lcd_print_at_PGM(0, 3, MSG_SEVERE_SKEW); + lcd_print_at_PGM(15, 3, PSTR("")); + lcd.print(bed_skew_angle_extreme * 180 / M_PI); + lcd.print(LCD_STR_DEGREE); + if (lcd_clicked()) + { + lcd_set_custom_characters_arrows(); + lcd_quick_feedback(); + menu_action_back(); + } +} // Save a single axis babystep value. void EEPROM_save_B(int pos, int* value) diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index 740dd738..4107bc72 100644 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -296,8 +296,6 @@ void lcd_temp_calibration_set(); void display_loading(); -void lcd_service_mode_show_result(); - #if !SDSORT_USES_RAM void lcd_set_degree(); void lcd_set_progress(); From d6aa149cfa37de60b8d5a50d2cee15cb1fd9a6ee Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Thu, 19 Apr 2018 00:15:08 +0200 Subject: [PATCH 02/21] Conserve 58 bytes of flash by returning by reference. --- Firmware/mesh_bed_calibration.cpp | 6 ++---- Firmware/mesh_bed_calibration.h | 4 ++-- Firmware/ultralcd.cpp | 9 +++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 907136b6..b8296662 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -2960,8 +2960,7 @@ void babystep_reset() babystepLoadZ = 0; } -DistanceMin count_xyz_details() { - DistanceMin distanceMin; +void count_xyz_details(float (&distanceMin)[2]) { float cntr[2] = { eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER + 0)), eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER + 4)) @@ -2981,8 +2980,7 @@ DistanceMin count_xyz_details() { #endif for (uint8_t mesh_point = 0; mesh_point < 2; ++mesh_point) { float y = vec_x[1] * pgm_read_float(bed_ref_points_4 + mesh_point * 2) + vec_y[1] * pgm_read_float(bed_ref_points_4 + mesh_point * 2 + 1) + cntr[1]; - distanceMin.d[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); + distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); } - return distanceMin; } diff --git a/Firmware/mesh_bed_calibration.h b/Firmware/mesh_bed_calibration.h index 34def34a..d1fa6523 100644 --- a/Firmware/mesh_bed_calibration.h +++ b/Firmware/mesh_bed_calibration.h @@ -181,8 +181,8 @@ extern void babystep_undo(); // Reset the current babystep counter without moving the axes. extern void babystep_reset(); -typedef struct{ float d[2];} DistanceMin; -extern DistanceMin count_xyz_details(); + +extern void count_xyz_details(float (&distanceMin)[2]); extern bool sample_z(); #endif /* MESH_BED_CALIBRATION_H */ diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index ac5d3bcf..32f03f80 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -2295,13 +2295,14 @@ static void lcd_menu_xyz_y_min() lcd_print_at_PGM(0, 2, MSG_LEFT); lcd_print_at_PGM(0, 3, MSG_RIGHT); - DistanceMin distanceMin = count_xyz_details(); + float distanceMin[2]; + count_xyz_details(distanceMin); for (int i = 0; i < 2; i++) { - if(distanceMin.d[i] < 200) { + if(distanceMin[i] < 200) { lcd_print_at_PGM(11, i + 2, PSTR("")); - lcd.print(distanceMin.d[i]); - lcd_print_at_PGM((distanceMin.d[i] < 0) ? 17 : 16, i + 2, PSTR("mm")); + lcd.print(distanceMin[i]); + lcd_print_at_PGM((distanceMin[i] < 0) ? 17 : 16, i + 2, PSTR("mm")); } else lcd_print_at_PGM(11, i + 2, PSTR("N/A")); } if (lcd_clicked()) From c1dd269a9278674c50ec42e53060488a9751631b Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Thu, 19 Apr 2018 00:22:21 +0200 Subject: [PATCH 03/21] Fix missing degree symbol after returning to status screen. Those lcd_set_custom_characters* calls were redundant. --- Firmware/ultralcd.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 32f03f80..71134c30 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -2308,7 +2308,6 @@ static void lcd_menu_xyz_y_min() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_set_custom_characters_degree(); lcd_goto_menu(lcd_menu_xyz_skew); } } @@ -2337,7 +2336,6 @@ static void lcd_menu_xyz_skew() if (lcd_clicked()) { - lcd_set_custom_characters_arrows(); lcd_quick_feedback(); menu_action_back(); } From b6888470cfa80451e34755474b6a5b8edc02700d Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Thu, 19 Apr 2018 00:49:42 +0200 Subject: [PATCH 04/21] Save 42 bytes of flash by removing duplicate string "--------------------". --- Firmware/ultralcd.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 71134c30..08ba18ca 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -192,6 +192,8 @@ unsigned char firstrun = 1; #include "ultralcd_implementation_hitachi_HD44780.h" +static const char separator[] PROGMEM = "--------------------"; + /** forward declarations **/ static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg, uint8_t &nlines); @@ -2291,7 +2293,7 @@ static void lcd_menu_xyz_y_min() { lcd.setCursor(0,0); lcd_printPGM(MSG_Y_DISTANCE_FROM_MIN); - lcd_print_at_PGM(0, 1, PSTR("--------------------")); + lcd_print_at_PGM(0, 1, separator); lcd_print_at_PGM(0, 2, MSG_LEFT); lcd_print_at_PGM(0, 3, MSG_RIGHT); @@ -2324,7 +2326,7 @@ static void lcd_menu_xyz_skew() lcd.print(angleDiff * 180 / M_PI); lcd.print(LCD_STR_DEGREE); }else lcd_print_at_PGM(16, 0, PSTR("N/A")); - lcd_print_at_PGM(0, 1, PSTR("--------------------")); + lcd_print_at_PGM(0, 1, separator); lcd_print_at_PGM(0, 2, MSG_SLIGHT_SKEW); lcd_print_at_PGM(15, 2, PSTR("")); lcd.print(bed_skew_angle_mild * 180 / M_PI); @@ -7138,7 +7140,7 @@ static int lcd_selftest_screen(int _step, int _progress, int _progress_scale, bo if (_step == 13) lcd_printPGM(PSTR("Calibrating home")); lcd.setCursor(0, 1); - lcd.print("--------------------"); + lcd_printPGM(separator); if ((_step >= -1) && (_step <= 1)) { //SERIAL_ECHOLNPGM("Fan test"); From 1a80fc28e8779315a2653fb206eef07729396ea5 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Thu, 19 Apr 2018 14:17:46 +0200 Subject: [PATCH 05/21] Add zero point offset information support menu. Note: XYZ menu is shown only if not printing and printer must me homed to show non-zero value. --- Firmware/language_all.cpp | 5 +++++ Firmware/language_all.h | 2 ++ Firmware/language_en.h | 1 + Firmware/ultralcd.cpp | 22 ++++++++++++++++++++++ 4 files changed, 30 insertions(+) diff --git a/Firmware/language_all.cpp b/Firmware/language_all.cpp index 2be14ede..510d2e68 100644 --- a/Firmware/language_all.cpp +++ b/Firmware/language_all.cpp @@ -1161,6 +1161,11 @@ const char * const MSG_MAX_LANG_TABLE[1] PROGMEM = { MSG_MAX_EN }; +const char MSG_MEASURED_OFFSET_EN[] PROGMEM = "[0;0] point offset"; +const char * const MSG_MEASURED_OFFSET_LANG_TABLE[1] PROGMEM = { + MSG_MEASURED_OFFSET_EN +}; + const char MSG_MEASURED_SKEW_EN[] PROGMEM = "Measured skew:"; const char MSG_MEASURED_SKEW_CZ[] PROGMEM = "Merene zkoseni:"; const char * const MSG_MEASURED_SKEW_LANG_TABLE[LANG_NUM] PROGMEM = { diff --git a/Firmware/language_all.h b/Firmware/language_all.h index 992d602c..c7353d96 100644 --- a/Firmware/language_all.h +++ b/Firmware/language_all.h @@ -392,6 +392,8 @@ extern const char* const MSG_MARK_FIL_LANG_TABLE[LANG_NUM]; #define MSG_MARK_FIL LANG_TABLE_SELECT(MSG_MARK_FIL_LANG_TABLE) extern const char* const MSG_MAX_LANG_TABLE[1]; #define MSG_MAX LANG_TABLE_SELECT_EXPLICIT(MSG_MAX_LANG_TABLE, 0) +extern const char* const MSG_MEASURED_OFFSET_LANG_TABLE[1]; +#define MSG_MEASURED_OFFSET LANG_TABLE_SELECT_EXPLICIT(MSG_MEASURED_OFFSET_LANG_TABLE, 0) extern const char* const MSG_MEASURED_SKEW_LANG_TABLE[LANG_NUM]; #define MSG_MEASURED_SKEW LANG_TABLE_SELECT(MSG_MEASURED_SKEW_LANG_TABLE) extern const char* const MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1_LANG_TABLE[LANG_NUM]; diff --git a/Firmware/language_en.h b/Firmware/language_en.h index 695546a8..9b1e86e5 100644 --- a/Firmware/language_en.h +++ b/Firmware/language_en.h @@ -218,6 +218,7 @@ #define(length=17,lines=1) MSG_SHOW_END_STOPS "Show end stops" #define MSG_CALIBRATE_BED "Calibrate XYZ" #define MSG_CALIBRATE_BED_RESET "Reset XYZ calibr." +#define MSG_MEASURED_OFFSET "[0;0] point offset" #define(length=20,lines=8) MSG_MOVE_CARRIAGE_TO_THE_TOP "Calibrating XYZ. Rotate the knob to move the Z carriage up to the end stoppers. Click when done." #define(length=20,lines=8) MSG_MOVE_CARRIAGE_TO_THE_TOP_Z "Calibrating Z. Rotate the knob to move the Z carriage up to the end stoppers. Click when done." diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 08ba18ca..ec9252ab 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -226,6 +226,7 @@ static void lcd_farm_no(); static void lcd_menu_extruder_info(); static void lcd_menu_xyz_y_min(); static void lcd_menu_xyz_skew(); +static void lcd_menu_xyz_offset(); #if defined(TMC2130) || defined(PAT9125) static void lcd_menu_fails_stats(); #endif //TMC2130 or PAT9125 @@ -2336,6 +2337,27 @@ static void lcd_menu_xyz_skew() lcd.print(bed_skew_angle_extreme * 180 / M_PI); lcd.print(LCD_STR_DEGREE); + if (lcd_clicked()) + { + lcd_quick_feedback(); + lcd_goto_menu(lcd_menu_xyz_offset); + } +} + +static void lcd_menu_xyz_offset() +{ + lcd.setCursor(0,0); + lcd_printPGM(MSG_MEASURED_OFFSET); + lcd_print_at_PGM(0, 1, separator); + lcd_print_at_PGM(0, 2, PSTR("X")); + lcd_print_at_PGM(0, 3, PSTR("Y")); + + for (int i = 0; i < 2; i++) + { + lcd_print_at_PGM(11, i + 2, PSTR("")); + lcd.print(world2machine_shift[i]); + lcd_print_at_PGM((world2machine_shift[i] < 0) ? 17 : 16, i + 2, PSTR("mm")); + } if (lcd_clicked()) { lcd_quick_feedback(); From ab68221976c3a6ac95215ac407defe4d218e328e Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Mon, 23 Apr 2018 21:23:36 +0200 Subject: [PATCH 06/21] Always show XYZ cal. details menu. --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index ec9252ab..ef392677 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1836,7 +1836,7 @@ static void lcd_support_menu() } #ifndef MK1BP MENU_ITEM(back, PSTR("------------"), 0); - if (!IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LCD_COMMAND_V2_CAL)) MENU_ITEM(submenu, MSG_XYZ_DETAILS, lcd_menu_xyz_y_min); + MENU_ITEM(submenu, MSG_XYZ_DETAILS, lcd_menu_xyz_y_min); MENU_ITEM(submenu, MSG_INFO_EXTRUDER, lcd_menu_extruder_info); #ifdef TMC2130 From d86d1beeaac4b7446b248026b048b50a428a5d6a Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 2 May 2018 16:16:48 +0200 Subject: [PATCH 07/21] fan error synchronization with planner --- Firmware/temperature.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index 50d47db1..e0cacb99 100644 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -472,11 +472,11 @@ void checkFanSpeed() fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); static unsigned char fan_speed_errors[2] = { 0,0 }; #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 >-1)) - if (fan_speed[0] == 0 && (current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE)) fan_speed_errors[0]++; + if ((fan_speed[0] == 0) && (current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE)) fan_speed_errors[0]++; else fan_speed_errors[0] = 0; #endif #if (defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) - if ((fan_speed[1] == 0)&& (fanSpeed > MIN_PRINT_FAN_SPEED)) fan_speed_errors[1]++; + if ((fan_speed[1] == 0) && ((blocks_queued() ? block_buffer[block_buffer_tail].fan_speed : fanSpeed) > MIN_PRINT_FAN_SPEED)) fan_speed_errors[1]++; else fan_speed_errors[1] = 0; #endif From 72364648dd610c840d826d2d1278c2656a1ff4ed Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 2 May 2018 20:50:47 +0200 Subject: [PATCH 08/21] Hot fix: Can not move X and Y axis in stealth mode, when the printer is not homed. Disable endstops in move axis menu. --- Firmware/ultralcd.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 88a55930..d59adf8a 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -114,6 +114,11 @@ union MenuData //Timer timer; char dummy; } autoLoadFilamentMenu; + struct _Lcd_moveMenu + { + bool initialized; + bool endstopsEnabledPrevious; + } _lcd_moveMenu; }; // State of the currently active menu. @@ -2236,6 +2241,12 @@ void lcd_menu_statistics() static void _lcd_move(const char *name, int axis, int min, int max) { + if (!menuData._lcd_moveMenu.initialized) + { + menuData._lcd_moveMenu.endstopsEnabledPrevious = enable_endstops(false); + menuData._lcd_moveMenu.initialized = true; + } + if (encoderPosition != 0) { refresh_cmd_timeout(); if (! planner_queue_full()) { @@ -2249,8 +2260,8 @@ static void _lcd_move(const char *name, int axis, int min, int max) { } } if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis])); - if (LCD_CLICKED) menu_action_back(); { - } + if (menuExiting || LCD_CLICKED) (void)enable_endstops(menuData._lcd_moveMenu.endstopsEnabledPrevious); + if (LCD_CLICKED) menu_action_back(); } From d02333918fbdf344c2a0b2db0578df4754716585 Mon Sep 17 00:00:00 2001 From: MRprusa3d Date: Wed, 2 May 2018 22:13:47 +0200 Subject: [PATCH 09/21] MaR::180501 --- Firmware/Marlin_main.cpp | 25 +++++++++++++------------ Firmware/ultralcd.cpp | 38 ++++++++++++++++++++++---------------- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 136debf1..b4e281ff 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -764,7 +764,8 @@ void factory_reset(char level, bool quiet) calibration_status_store(CALIBRATION_STATUS_Z_CALIBRATION); eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard farm_no = 0; - farm_mode == false; +//*** MaR::180501_01 + farm_mode = false; eeprom_update_byte((uint8_t*)EEPROM_FARM_MODE, farm_mode); EEPROM_save_B(EEPROM_FARM_NUMBER, &farm_no); @@ -970,6 +971,7 @@ void setup() setup_killpin(); setup_powerhold(); +//*** MaR::180501_02b farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE); EEPROM_read_B(EEPROM_FARM_NUMBER, &farm_no); if ((farm_mode == 0xFF && farm_no == 0) || ((uint16_t)farm_no == 0xFFFF)) @@ -1067,7 +1069,7 @@ void setup() // tmc2130_mode = silentMode?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; tmc2130_mode = TMC2130_MODE_NORMAL; uint8_t crashdet = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); - if (crashdet) + if (crashdet && !farm_mode) { crashdet_enable(); MYSERIAL.println("CrashDetect ENABLED!"); @@ -1165,6 +1167,7 @@ void setup() #if defined(Z_AXIS_ALWAYS_ON) enable_z(); #endif +//*** MaR::180501_02 farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE); EEPROM_read_B(EEPROM_FARM_NUMBER, &farm_no); if ((farm_mode == 0xFF && farm_no == 0) || (farm_no == 0xFFFF)) farm_mode = false; //if farm_mode has not been stored to eeprom yet and farm number is set to zero or EEPROM is fresh, deactivate farm mode @@ -3534,10 +3537,8 @@ void process_commands() st_synchronize(); bool find_z_result = find_bed_induction_sensor_point_z(-1.f); - if (find_z_result == false) { - lcd_temp_cal_show_result(find_z_result); - break; - } + if(find_z_result == false) lcd_temp_cal_show_result(find_z_result); + zero_z = current_position[Z_AXIS]; //current_position[Z_AXIS] @@ -3587,10 +3588,8 @@ void process_commands() plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 3000 / 60, active_extruder); st_synchronize(); find_z_result = find_bed_induction_sensor_point_z(-1.f); - if (find_z_result == false) { - lcd_temp_cal_show_result(find_z_result); - break; - } + if (find_z_result == false) lcd_temp_cal_show_result(find_z_result); + z_shift = (int)((current_position[Z_AXIS] - zero_z)*axis_steps_per_unit[Z_AXIS]); SERIAL_ECHOLNPGM(""); @@ -4221,13 +4220,15 @@ void process_commands() } break; - case 98: //activate farm mode + case 98: // G98 (activate farm mode) farm_mode = 1; PingTime = millis(); eeprom_update_byte((unsigned char *)EEPROM_FARM_MODE, farm_mode); + SilentModeMenu = SILENT_MODE_OFF; + eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu); break; - case 99: //deactivate farm mode + case 99: // G99 (deactivate farm mode) farm_mode = 0; lcd_printer_connected(); eeprom_update_byte((unsigned char *)EEPROM_FARM_MODE, farm_mode); diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 88a55930..f7337cde 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -3644,7 +3644,7 @@ static void lcd_crash_mode_set() } #endif //TMC2130 - + static void lcd_set_lang(unsigned char lang) { lang_selected = lang; @@ -4133,15 +4133,18 @@ static void lcd_settings_menu() } #ifdef TMC2130 -//*** MaR::180416_01a - if (SilentModeMenu == SILENT_MODE_NORMAL) MENU_ITEM(function, MSG_STEALTH_MODE_OFF, lcd_silent_mode_set); - else MENU_ITEM(function, MSG_STEALTH_MODE_ON, lcd_silent_mode_set); - if (SilentModeMenu == SILENT_MODE_NORMAL) + if(!farm_mode) { - if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set); - else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set); +//*** MaR::180416_01a + if (SilentModeMenu == SILENT_MODE_NORMAL) MENU_ITEM(function, MSG_STEALTH_MODE_OFF, lcd_silent_mode_set); + else MENU_ITEM(function, MSG_STEALTH_MODE_ON, lcd_silent_mode_set); + if (SilentModeMenu == SILENT_MODE_NORMAL) + { + if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set); + else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set); + } + else MENU_ITEM(submenu, MSG_CRASHDETECT_NA, lcd_crash_mode_info); } - else MENU_ITEM(submenu, MSG_CRASHDETECT_NA, lcd_crash_mode_info); MENU_ITEM_EDIT(wfac, MSG_EXTRUDER_CORRECTION, &tmc2130_wave_fac[E_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX); #endif //TMC2130 @@ -5859,16 +5862,19 @@ static void lcd_tune_menu() #endif //DEBUG_DISABLE_FSENSORCHECK #ifdef TMC2130 + if(!farm_mode) + { //*** MaR::180416_01b - if (SilentModeMenu == SILENT_MODE_NORMAL) MENU_ITEM(function, MSG_STEALTH_MODE_OFF, lcd_silent_mode_set); - else MENU_ITEM(function, MSG_STEALTH_MODE_ON, lcd_silent_mode_set); + if (SilentModeMenu == SILENT_MODE_NORMAL) MENU_ITEM(function, MSG_STEALTH_MODE_OFF, lcd_silent_mode_set); + else MENU_ITEM(function, MSG_STEALTH_MODE_ON, lcd_silent_mode_set); - if (SilentModeMenu == SILENT_MODE_NORMAL) - { - if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set); - else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set); - } - else MENU_ITEM(submenu, MSG_CRASHDETECT_NA, lcd_crash_mode_info); + if (SilentModeMenu == SILENT_MODE_NORMAL) + { + if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set); + else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set); + } + else MENU_ITEM(submenu, MSG_CRASHDETECT_NA, lcd_crash_mode_info); + } #else //TMC2130 if (!farm_mode) { //dont show in menu if we are in farm mode switch (SilentModeMenu) { From 8a92d9b6a3089bc6c80d73206fdf9f038b348054 Mon Sep 17 00:00:00 2001 From: MRprusa3d Date: Wed, 2 May 2018 23:49:21 +0200 Subject: [PATCH 10/21] MaR::180501b --- Firmware/Marlin_main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index b4e281ff..c081088e 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3537,8 +3537,10 @@ void process_commands() st_synchronize(); bool find_z_result = find_bed_induction_sensor_point_z(-1.f); - if(find_z_result == false) lcd_temp_cal_show_result(find_z_result); - + if (find_z_result == false) { + lcd_temp_cal_show_result(find_z_result); + break; + } zero_z = current_position[Z_AXIS]; //current_position[Z_AXIS] @@ -3588,8 +3590,10 @@ void process_commands() plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 3000 / 60, active_extruder); st_synchronize(); find_z_result = find_bed_induction_sensor_point_z(-1.f); - if (find_z_result == false) lcd_temp_cal_show_result(find_z_result); - + if (find_z_result == false) { + lcd_temp_cal_show_result(find_z_result); + break; + } z_shift = (int)((current_position[Z_AXIS] - zero_z)*axis_steps_per_unit[Z_AXIS]); SERIAL_ECHOLNPGM(""); From 1d7b3ea2de479865defdc114687e5893a2686fd9 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Thu, 3 May 2018 22:03:38 +0200 Subject: [PATCH 11/21] Set calibration status to calibrated also by using live adjust Z. This fixes problem, that if the first layer calibration is never done, live adjusting Z during printing is not applied after printer reset. Also repeatedly using live adjust Z on uncalibrated printer leads to steadily decreasing meaningless stored live adjust Z value. --- Firmware/ultralcd.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 68db66fc..e8eacec2 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -989,7 +989,6 @@ void lcd_commands() enquecommand_P(PSTR("M190 S" STRINGIFY(PLA_PREHEAT_HPB_TEMP))); enquecommand_P(PSTR("M109 S" STRINGIFY(PLA_PREHEAT_HOTEND_TEMP))); enquecommand_P(MSG_M117_V2_CALIBRATION); - enquecommand_P(PSTR("G87")); //sets calibration status enquecommand_P(PSTR("G28")); enquecommand_P(PSTR("G92 E0.0")); lcd_commands_step = 8; @@ -2384,7 +2383,17 @@ static void lcd_move_z() { } - +/** + * @brief Adjust first layer offset from bed if axis is Z_AXIS + * + * If menu is left (button pushed or timed out), value is stored to EEPROM and + * if the axis is Z_AXIS, CALIBRATION_STATUS_CALIBRATED is also stored. + * Purpose of this function for other axis then Z is unknown. + * + * @param axis AxisEnum X_AXIS Y_AXIS Z_AXIS + * other value leads to storing Z_AXIS + * @param msg text to be displayed + */ static void _lcd_babystep(int axis, const char *msg) { if (menuData.babyStep.status == 0) { @@ -2431,8 +2440,10 @@ static void _lcd_babystep(int axis, const char *msg) if (LCD_CLICKED || menuExiting) { // Only update the EEPROM when leaving the menu. EEPROM_save_B( - (axis == 0) ? EEPROM_BABYSTEP_X : ((axis == 1) ? EEPROM_BABYSTEP_Y : EEPROM_BABYSTEP_Z), + (axis == X_AXIS) ? EEPROM_BABYSTEP_X : ((axis == Y_AXIS) ? EEPROM_BABYSTEP_Y : EEPROM_BABYSTEP_Z), &menuData.babyStep.babystepMem[axis]); + + if(Z_AXIS == axis) calibration_status_store(CALIBRATION_STATUS_CALIBRATED); } if (LCD_CLICKED) menu_action_back(); } From c359d118583f0b473a7ec77e673974ad3b032c51 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Fri, 4 May 2018 15:21:22 +0200 Subject: [PATCH 12/21] Do not disable bed heating, when the print is paused. Also remove duplicate handleSafetyTimer() call. --- Firmware/Marlin_main.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index c081088e..da4bfba1 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -7132,6 +7132,8 @@ void handle_status_leds(void) { * @brief Turn off heating after 30 minutes of inactivity * * Full screen blocking notification message is shown after heater turning off. + * Paused print is not considered inactivity, as nozzle is cooled anyway and bed cooling would + * damage print. */ static void handleSafetyTimer() { @@ -7139,8 +7141,8 @@ static void handleSafetyTimer() #error Implemented only for one extruder. #endif //(EXTRUDERS > 1) static Timer safetyTimer; - if (IS_SD_PRINTING || is_usb_printing || (custom_message_type == 4) || (lcd_commands_type == LCD_COMMAND_V2_CAL) || - (!degTargetBed() && !degTargetHotend(0))) + if (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4) + || (lcd_commands_type == LCD_COMMAND_V2_CAL) || (!degTargetBed() && !degTargetHotend(0))) { safetyTimer.stop(); } @@ -7199,11 +7201,6 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s fsensor_autoload_check_stop(); #endif //PAT9125 -#ifdef SAFETYTIMER - handleSafetyTimer(); -#endif //SAFETYTIMER - - #ifdef SAFETYTIMER handleSafetyTimer(); #endif //SAFETYTIMER From f00bde09a42143a2d7810b7833662051c87be15d Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 8 May 2018 21:54:11 +0200 Subject: [PATCH 13/21] Re-factor bed calibration point coordinates to match bed CAD data. Tested successfully on MK3 (auto home position not calibrated and calibrated printer and print area position of calibrated printer). MK25 not tested. --- Firmware/mesh_bed_calibration.cpp | 35 +++++++++++++++---- .../variants/1_75mm_MK3-EINSy10a-E3Dv6full.h | 12 +++++-- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 266733c8..c69b4da7 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -57,13 +57,36 @@ const float bed_skew_angle_extreme = (0.25f * M_PI / 180.f); #ifdef HEATBED_V2 -// Positions of the bed reference points in the machine coordinates, referenced to the P.I.N.D.A sensor. -// The points are the following: center front, center right, center rear, center left. +/** + * [0,0] bed print area point X coordinate in bed coordinates ver. 05d/24V + */ +#define BED_PRINT_ZERO_REF_X 2.f +/** + * [0,0] bed print area point Y coordinate in bed coordinates ver. 05d/24V + */ +#define BED_PRINT_ZERO_REF_Y 9.4f + +/** + * @brief Positions of the bed reference points in print area coordinates. ver. 05d/24V + * + * Numeral constants are in bed coordinates, subtracting macro defined values converts it to print area coordinates. + * + * The points are the following: + * MK2: center front, center right, center rear, center left. + * MK25 and MK3: front left, front right, rear right, rear left + */ const float bed_ref_points_4[] PROGMEM = { - 13.f - BED_ZERO_REF_X, 10.4f - BED_ZERO_REF_Y, - 221.f - BED_ZERO_REF_X, 10.4f - BED_ZERO_REF_Y, - 221.f - BED_ZERO_REF_X, 202.4f - BED_ZERO_REF_Y, - 13.f - BED_ZERO_REF_X, 202.4f - BED_ZERO_REF_Y + 37.f - BED_PRINT_ZERO_REF_X - X_PROBE_OFFSET_FROM_EXTRUDER - SHEET_PRINT_ZERO_REF_X, + 18.4f - BED_PRINT_ZERO_REF_Y - Y_PROBE_OFFSET_FROM_EXTRUDER - SHEET_PRINT_ZERO_REF_Y, + + 245.f - BED_PRINT_ZERO_REF_X - X_PROBE_OFFSET_FROM_EXTRUDER - SHEET_PRINT_ZERO_REF_X, + 18.4f - BED_PRINT_ZERO_REF_Y - Y_PROBE_OFFSET_FROM_EXTRUDER - SHEET_PRINT_ZERO_REF_Y, + + 245.f - BED_PRINT_ZERO_REF_X - X_PROBE_OFFSET_FROM_EXTRUDER - SHEET_PRINT_ZERO_REF_X, + 210.4f - BED_PRINT_ZERO_REF_Y - Y_PROBE_OFFSET_FROM_EXTRUDER - SHEET_PRINT_ZERO_REF_Y, + + 37.f - BED_PRINT_ZERO_REF_X - X_PROBE_OFFSET_FROM_EXTRUDER - SHEET_PRINT_ZERO_REF_X, + 210.4f - BED_PRINT_ZERO_REF_Y - Y_PROBE_OFFSET_FROM_EXTRUDER - SHEET_PRINT_ZERO_REF_Y }; const float bed_ref_points[] PROGMEM = { diff --git a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h index d25526a0..48b9a565 100644 --- a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h @@ -76,7 +76,15 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E #define HOMING_FEEDRATE {3000, 3000, 800, 0} // set the homing speeds (mm/min) // 3000 is also valid for stallGuard homing. Valid range: 2200 - 3000 -#define DEFAULT_Y_OFFSET 2.f // Offset of [0;0] point, when the printer is not calibrated +//#define DEFAULT_Y_OFFSET 4.f // Default distance of Y_MIN_POS point from endstop, when the printer is not calibrated. +/** + * [0,0] steel sheet print area point X coordinate in bed print area coordinates + */ +#define SHEET_PRINT_ZERO_REF_X 0.f +/** + * [0,0] steel sheet print area point Y coordinate in bed print area coordinates + */ +#define SHEET_PRINT_ZERO_REF_Y -2.f #define DEFAULT_MAX_FEEDRATE {200, 200, 12, 120} // (mm/sec) max feedrate (M203) #define DEFAULT_MAX_ACCELERATION {1000, 1000, 200, 5000} // (mm/sec^2) max acceleration (M201) @@ -408,7 +416,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define MESH_HOME_Z_SEARCH 5 //Z lift for homing, mesh bed leveling etc. #define X_PROBE_OFFSET_FROM_EXTRUDER 23 // Z probe to nozzle X offset: -left +right -#define Y_PROBE_OFFSET_FROM_EXTRUDER 3 // Z probe to nozzle Y offset: -front +behind +#define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Z probe to nozzle Y offset: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER -0.4 // Z probe to nozzle Z offset: -below (always!) #endif From b889d770a588a30e491a955e996c7ea4bc227fe0 Mon Sep 17 00:00:00 2001 From: MRprusa3d Date: Tue, 8 May 2018 23:10:07 +0200 Subject: [PATCH 14/21] build instructions update Czech version added --- README.md | 3 +++ README_cz.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 README_cz.md diff --git a/README.md b/README.md index 0e2dea39..104a19c2 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ `https://www.arduino.cc -> Software->Downloads` it is strongly recommended to use older version `"1.6.8"`, by which we can assure correct compilation results _note: in versions `1.7.x` and `1.8.x` there are known some C/C++ compilator disasters, which disallow correct source code compilation (you can obtain `"... internal compiler error: in extract_insn, at ..."` error message, for example); we are not able to affect this situation afraid_ +_note: in the case of persistent compilation problems, check the version of the currently used C/C++ compiler (GCC) - should be `4.8.1`; version can be verified by entering the command +`avr-gcc --version` +if you are not sure where the file is placed (depends on how `"Arduino Software IDE"` was installed), you can use the search feature within the file system_ _note: name collision for `"LiquidCrystal"` library known from previous versions is now obsolete (so there is no need to delete or rename original file/-s)_ 2. add (`UltiMachine`) `RAMBo` board into the list of Arduino target boards diff --git a/README_cz.md b/README_cz.md new file mode 100644 index 00000000..5c649963 --- /dev/null +++ b/README_cz.md @@ -0,0 +1,53 @@ +# 1. Příprava vývojového prostředí + + 1. nainstalujte vývojové prostředí `"Arduino Software IDE"` pro operační prostředí, které jste zvyklí používat +`https://www.arduino.cc -> Software->Downloads` +důrazně doporučujeme použít starší verzi `"1.6.8"`, u které jsme schopni garantovat bezproblémový překlad a správné výsledky +_pozn.: ve verzích `1.7.x` a `1.8.x` jsou k datu vydání tohoto dokumentu evidovány chyby v překladači jazyka C/C++, které znemožňují překlad zdrojového kódu (můžete např. obdržet chybové hlášení `"... internal compiler error: in extract_insn, at ..."`); tuto nepříjemnou situaci bohužel nedokážeme nijak ovlivnit_ +_pozn.: v případě přetrvávajících potíží s překladem zkontrolujte verzi aktuálně použitého překladače jazyka C/C++ (GCC) - měla by být `4.8.1`; verzi ověříte zadáním příkazu +`avr-gcc --version` +pokud si nejste jisti umístěním souboru (závisí na způsobu, jakým bylo `"Arduino Software IDE"` nainstalováno), použijte funkci vyhledání v rámci systému souborů_ +_pozn.: konflikt názvů knihoven / modulů `"LiquidCrystal"` známý v předchozích verzích již není aktuální (původní knihovnu tudíž není nutné mazat ani přejmenovat)_ + + 2. do nabídky podporovaných cílových desek Arduino přidejte desku (`UltiMachine`) `RAMBo` +`File->Preferences->Settings` +do pole `"Additional Boards Manager URLs"` +vložte adresu / text +`"https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json"` +ev. je možno 'ručně upravit' položku +`"boardsmanager.additional.urls=....."` +v souboru `"preferences.txt"` (parametr umožňuje zápis seznamu adres oddělených čárkami) +_pozn.: konkrétní umístění tohoto souboru na Vašem disku lze zjistit následujícím způsobem: +`File->Preferences->Settings` (`"More preferences can be edited in file ..."`)_ +následně proveďte +`Tools->Board->BoardsManager` +ze zobrazeného seznamu vyberte položku `"RAMBo"` (pravděpodobně bude označena jako `"RepRap Arduino-compatible Mother Board (RAMBo) by UltiMachine"` +_pozn.: tuto položku zvolte pro všechny varianty desek použitých v tiskárnách `'Prusa i3 MKx'`, tzn. pro `RAMBo-mini x.y` i `EINSy x.y`_ +'kliknutím' na položku se zobrazí tlačítko pro instalaci; ve výběrovém seznamu zvolte verzi `"1.0.1"` (poslední známá verze k datu vydání tohoto dokumentu) +_(po provedení instalace je položka označena poznámkou `"INSTALLED"` a lze ji následně použít při výběru cílové desky)_ + + +# 2. Překlad zdrojoveho kódu + +do zvoleného adresáře umístěte zdrojové kódy odpovídající modelu Vaší tiskárny získané z repozitáře +`https://github.com/prusa3d/Prusa-Firmware/` +v podadresáři `"Firmware/variants/"` vyberte konfigurační soubor (`.h`) odpovídající modelu Vaší tiskárny, vytvořte kopii s názvem `"Configuration_prusa.h"` (popř. proveďte prosté přejmenování) a překopírujte do adresáře `"Firmware/"` + +spusťte vývojové prostředí `"Arduino IDE"`; v adresáři, kam jste umístili zdrojové kódy, vyberte z podadresáře `"Firmware/"` soubor `"Firmware.ino"` +`File->Open` +proveďte požadované úpravy kódu; **veškeré změny ovšem provádíte na svou vlastní odpovědnost!** + +jako cílovou desku pro překlad vyberte `"RAMBo"` +`Tools->Board->RAMBo` +_pozn.: nelze použít žádnou z variant `"Arduino Mega …"`, přestože se jedná o shodný MCU_ + +spusťte překlad +`Sketch->Verify/Compile` + +výsledný kód nahrajte do připojené tiskárny +`Sketch->Upload` + +přeložený kód můžete také nechat uložit do souboru (v tzv. `HEX`-formátu) `"Firmware.ino.rambo.hex"`: +`Sketch->ExportCompiledBinary` +a do tiskárny ho následně nahrát pomocí programu `"FirmwareUpdater"` +_pozn.: soubor je vytvořen v adresáři `"Firmware/"`_ From 80efafd7b964cec863a3225d25f34893e2af4b66 Mon Sep 17 00:00:00 2001 From: MRprusa3d Date: Wed, 9 May 2018 00:27:32 +0200 Subject: [PATCH 15/21] menu returns corrections Statistics Calibration::ShowEndStops Support::ExtruderInfo Support::BeltStatus Support::Temperatures Support::Voltages --- Firmware/ultralcd.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index e8eacec2..4ab147f2 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1586,7 +1586,7 @@ static void lcd_menu_extruder_info() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } @@ -1707,7 +1707,7 @@ static void lcd_menu_temperatures() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } @@ -1725,7 +1725,7 @@ static void lcd_menu_voltages() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } #endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN @@ -1737,7 +1737,7 @@ static void lcd_menu_belt_status() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } #endif //TMC2130 @@ -2161,7 +2161,7 @@ void lcd_menu_statistics() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } else @@ -2234,7 +2234,7 @@ void lcd_menu_statistics() KEEPALIVE_STATE(NOT_BUSY); lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } @@ -3178,7 +3178,7 @@ static void lcd_show_end_stops() { static void menu_show_end_stops() { lcd_show_end_stops(); - if (LCD_CLICKED) lcd_goto_menu(lcd_calibration_menu); //doesn't break menuStack + if (LCD_CLICKED) menu_action_back(); } // Lets the user move the Z carriage up to the end stoppers. From 2a5a7ab9d2a6fa8248f1d1a5c5f37de5bffe4f18 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 9 May 2018 17:09:57 +0200 Subject: [PATCH 16/21] Add bed calibration points macro definitions to MK25 variants. Homing and full print area printing tested on MK25. --- Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h | 9 +++++++++ Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h index a535c27f..f1965358 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h @@ -75,6 +75,15 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E #define HOMING_FEEDRATE {3000, 3000, 800, 0} // set the homing speeds (mm/min) // 3000 is also valid for stallGuard homing. Valid range: 2200 - 3000 +/** + * [0,0] steel sheet print area point X coordinate in bed print area coordinates + */ +#define SHEET_PRINT_ZERO_REF_X 0.f +/** + * [0,0] steel sheet print area point Y coordinate in bed print area coordinates + */ +#define SHEET_PRINT_ZERO_REF_Y 0.f + #define DEFAULT_MAX_FEEDRATE {200, 200, 12, 120} // (mm/sec) max feedrate (M203) #define DEFAULT_MAX_ACCELERATION {1000, 1000, 200, 5000} // (mm/sec^2) max acceleration (M201) diff --git a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h index 2879f975..558cc889 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h @@ -75,6 +75,15 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E #define HOMING_FEEDRATE {3000, 3000, 800, 0} // set the homing speeds (mm/min) // 3000 is also valid for stallGuard homing. Valid range: 2200 - 3000 +/** + * [0,0] steel sheet print area point X coordinate in bed print area coordinates + */ +#define SHEET_PRINT_ZERO_REF_X 0.f +/** + * [0,0] steel sheet print area point Y coordinate in bed print area coordinates + */ +#define SHEET_PRINT_ZERO_REF_Y 0.f + #define DEFAULT_MAX_FEEDRATE {200, 200, 12, 120} // (mm/sec) max feedrate (M203) #define DEFAULT_MAX_ACCELERATION {1000, 1000, 200, 5000} // (mm/sec^2) max acceleration (M201) From 2bfc7475a8be227aa34e04ea20f0c37bbce30cce Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 9 May 2018 18:58:24 +0200 Subject: [PATCH 17/21] version changed --- Firmware/Configuration.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index 16f4197e..55615b04 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -7,8 +7,8 @@ #define STR(x) STR_HELPER(x) // Firmware version -#define FW_VERSION "3.2.0-RC2" -#define FW_COMMIT_NR 534 +#define FW_VERSION "3.2.0" +#define FW_COMMIT_NR 555 // FW_VERSION_UNKNOWN means this is an unofficial build. // The firmware should only be checked into github with this symbol. #define FW_DEV_VERSION FW_VERSION_UNKNOWN From 329ea199ec58a15acb828580928eabab2123eab2 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Thu, 10 May 2018 18:24:49 +0200 Subject: [PATCH 18/21] Show measured bed offset from expected position even if not homed. Remove redundant lcd_quick_feedback() calls. --- Firmware/mesh_bed_calibration.cpp | 153 ++++++++++++++++++------------ Firmware/mesh_bed_calibration.h | 8 +- Firmware/ultralcd.cpp | 31 +++--- 3 files changed, 113 insertions(+), 79 deletions(-) diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index b8296662..c8e839c4 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -732,19 +732,24 @@ void world2machine_reset() } /** - * @brief Set calibration matrix to default value + * @brief Get calibration matrix default value * * This is used if no valid calibration data can be read from EEPROM. + * @param [out] vec_x axis x vector + * @param [out] vec_y axis y vector + * @param [out] cntr offset vector */ -static void world2machine_default() +static void world2machine_default(float vec_x[2], float vec_y[2], float cntr[2]) { + vec_x[0] = 1.f; + vec_x[1] = 0.f; + vec_y[0] = 0.f; + vec_y[1] = 1.f; + cntr[0] = 0.f; #ifdef DEFAULT_Y_OFFSET - const float vx[] = { 1.f, 0.f }; - const float vy[] = { 0.f, 1.f }; - const float cntr[] = { 0.f, DEFAULT_Y_OFFSET }; - world2machine_update(vx, vy, cntr); + cntr[1] = DEFAULT_Y_OFFSET; #else - world2machine_reset(); + cntr[1] = 0.f; #endif } /** @@ -768,93 +773,121 @@ static inline bool vec_undef(const float v[2]) return vx[0] == 0x0FFFFFFFF || vx[1] == 0x0FFFFFFFF; } + /** - * @brief Read and apply calibration data from EEPROM + * @brief Read calibration data from EEPROM * * If no calibration data has been stored in EEPROM or invalid, * world2machine_default() is used. * * If stored calibration data is invalid, EEPROM storage is cleared. - * + * @param [out] vec_x axis x vector + * @param [out] vec_y axis y vector + * @param [out] cntr offset vector */ -void world2machine_initialize() +void world2machine_read_valid(float vec_x[2], float vec_y[2], float cntr[2]) { - //SERIAL_ECHOLNPGM("world2machine_initialize"); - float cntr[2] = { - eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+0)), - eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4)) - }; - float vec_x[2] = { - eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_X +0)), - eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_X +4)) - }; - float vec_y[2] = { - eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y +0)), - eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y +4)) - }; + vec_x[0] = eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_X +0)); + vec_x[1] = eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_X +4)); + vec_y[0] = eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y +0)); + vec_y[1] = eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y +4)); + cntr[0] = eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+0)); + cntr[1] = eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4)); bool reset = false; - if (vec_undef(cntr) || vec_undef(vec_x) || vec_undef(vec_y)) { -// SERIAL_ECHOLNPGM("Undefined bed correction matrix."); + if (vec_undef(cntr) || vec_undef(vec_x) || vec_undef(vec_y)) + { +#if 0 + SERIAL_ECHOLNPGM("Undefined bed correction matrix."); +#endif reset = true; } - else { + else + { // Length of the vec_x shall be close to unity. float l = sqrt(vec_x[0] * vec_x[0] + vec_x[1] * vec_x[1]); - if (l < 0.9 || l > 1.1) { -// SERIAL_ECHOLNPGM("X vector length:"); -// MYSERIAL.println(l); -// SERIAL_ECHOLNPGM("Invalid bed correction matrix. Length of the X vector out of range."); + if (l < 0.9 || l > 1.1) + { +#if 0 + SERIAL_ECHOLNPGM("X vector length:"); + MYSERIAL.println(l); + SERIAL_ECHOLNPGM("Invalid bed correction matrix. Length of the X vector out of range."); +#endif reset = true; } // Length of the vec_y shall be close to unity. l = sqrt(vec_y[0] * vec_y[0] + vec_y[1] * vec_y[1]); - if (l < 0.9 || l > 1.1) { -// SERIAL_ECHOLNPGM("Y vector length:"); -// MYSERIAL.println(l); -// SERIAL_ECHOLNPGM("Invalid bed correction matrix. Length of the Y vector out of range."); + if (l < 0.9 || l > 1.1) + { +#if 0 + SERIAL_ECHOLNPGM("Y vector length:"); + MYSERIAL.println(l); + SERIAL_ECHOLNPGM("Invalid bed correction matrix. Length of the Y vector out of range."); +#endif reset = true; } // Correction of the zero point shall be reasonably small. l = sqrt(cntr[0] * cntr[0] + cntr[1] * cntr[1]); - if (l > 15.f) { -// SERIAL_ECHOLNPGM("Zero point correction:"); -// MYSERIAL.println(l); -// SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); + if (l > 15.f) + { +#if 0 + SERIAL_ECHOLNPGM("Zero point correction:"); + MYSERIAL.println(l); + SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); +#endif reset = true; } // vec_x and vec_y shall be nearly perpendicular. l = vec_x[0] * vec_y[0] + vec_x[1] * vec_y[1]; - if (fabs(l) > 0.1f) { -// SERIAL_ECHOLNPGM("Invalid bed correction matrix. X/Y axes are far from being perpendicular."); + if (fabs(l) > 0.1f) + { +#if 0 + SERIAL_ECHOLNPGM("Invalid bed correction matrix. X/Y axes are far from being perpendicular."); +#endif reset = true; } } - if (reset) { -// SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); + if (reset) + { +#if 0 + SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); +#endif reset_bed_offset_and_skew(); - world2machine_default(); - } else { - world2machine_update(vec_x, vec_y, cntr); - /* - SERIAL_ECHOPGM("world2machine_initialize() loaded: "); - MYSERIAL.print(world2machine_rotation_and_skew[0][0], 5); - SERIAL_ECHOPGM(", "); - MYSERIAL.print(world2machine_rotation_and_skew[0][1], 5); - SERIAL_ECHOPGM(", "); - MYSERIAL.print(world2machine_rotation_and_skew[1][0], 5); - SERIAL_ECHOPGM(", "); - MYSERIAL.print(world2machine_rotation_and_skew[1][1], 5); - SERIAL_ECHOPGM(", offset "); - MYSERIAL.print(world2machine_shift[0], 5); - SERIAL_ECHOPGM(", "); - MYSERIAL.print(world2machine_shift[1], 5); - SERIAL_ECHOLNPGM(""); - */ + world2machine_default(vec_x, vec_y, cntr); } } +/** + * @brief Read and apply validated calibration data from EEPROM + */ +void world2machine_initialize() +{ +#if 0 + SERIAL_ECHOLNPGM("world2machine_initialize"); +#endif + float vec_x[2]; + float vec_y[2]; + float cntr[2]; + world2machine_read_valid(vec_x, vec_y, cntr); + world2machine_update(vec_x, vec_y, cntr); +#if 0 + SERIAL_ECHOPGM("world2machine_initialize() loaded: "); + MYSERIAL.print(world2machine_rotation_and_skew[0][0], 5); + SERIAL_ECHOPGM(", "); + MYSERIAL.print(world2machine_rotation_and_skew[0][1], 5); + SERIAL_ECHOPGM(", "); + MYSERIAL.print(world2machine_rotation_and_skew[1][0], 5); + SERIAL_ECHOPGM(", "); + MYSERIAL.print(world2machine_rotation_and_skew[1][1], 5); + SERIAL_ECHOPGM(", offset "); + MYSERIAL.print(world2machine_shift[0], 5); + SERIAL_ECHOPGM(", "); + MYSERIAL.print(world2machine_shift[1], 5); + SERIAL_ECHOLNPGM(""); +#endif +} + /** * @brief Update current position after switching to corrected coordinates * diff --git a/Firmware/mesh_bed_calibration.h b/Firmware/mesh_bed_calibration.h index d1fa6523..6d020f8c 100644 --- a/Firmware/mesh_bed_calibration.h +++ b/Firmware/mesh_bed_calibration.h @@ -26,16 +26,10 @@ extern float world2machine_rotation_and_skew_inv[2][2]; // Shift of the machine zero point, in the machine coordinates. extern float world2machine_shift[2]; -// Resets the transformation to identity. extern void world2machine_reset(); -// Resets the transformation to identity and update current_position[X,Y] from the servos. extern void world2machine_revert_to_uncorrected(); -// Loads the transformation from the EEPROM, if available. extern void world2machine_initialize(); - -// When switching from absolute to corrected coordinates, -// this will apply an inverse world2machine transformation -// to current_position[x,y]. +extern void world2machine_read_valid(float vec_x[2], float vec_y[2], float cntr[2]); extern void world2machine_update_current(); inline void world2machine(float &x, float &y) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index ef392677..96b0ff83 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1586,7 +1586,6 @@ static void lcd_menu_extruder_info() if (lcd_clicked()) { - lcd_quick_feedback(); menu_action_back(); } } @@ -1707,7 +1706,6 @@ static void lcd_menu_temperatures() if (lcd_clicked()) { - lcd_quick_feedback(); menu_action_back(); } } @@ -1725,7 +1723,6 @@ static void lcd_menu_voltages() fprintf_P(lcdout, PSTR( ESC_H(1,1)"PWR: %d.%01dV"), (int)volt_pwr, (int)(10*fabs(volt_pwr - (int)volt_pwr))) ; if (lcd_clicked()) { - lcd_quick_feedback(); menu_action_back(); } } @@ -1737,7 +1734,6 @@ static void lcd_menu_belt_status() fprintf_P(lcdout, PSTR(ESC_H(1,0) "Belt status" ESC_H(2,1) "X %d" ESC_H(2,2) "Y %d" ), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y))); if (lcd_clicked()) { - lcd_quick_feedback(); menu_action_back(); } } @@ -2289,7 +2285,12 @@ static void lcd_move_e() lcd_return_to_status(); } } - +/** + * @brief Show measured Y distance of front calibration points from Y_MIN_POS + * + * If those points are detected too close to edge of reachable area, their confidence is lowered. + * This functionality is applied more often for MK2 printers. + */ static void lcd_menu_xyz_y_min() { lcd.setCursor(0,0); @@ -2310,11 +2311,12 @@ static void lcd_menu_xyz_y_min() } if (lcd_clicked()) { - lcd_quick_feedback(); lcd_goto_menu(lcd_menu_xyz_skew); } } - +/** + * @brief Show measured axis skewness + */ static void lcd_menu_xyz_skew() { float angleDiff; @@ -2339,11 +2341,12 @@ static void lcd_menu_xyz_skew() if (lcd_clicked()) { - lcd_quick_feedback(); lcd_goto_menu(lcd_menu_xyz_offset); } } - +/** + * @brief Show measured bed offset from expected position + */ static void lcd_menu_xyz_offset() { lcd.setCursor(0,0); @@ -2352,15 +2355,19 @@ static void lcd_menu_xyz_offset() lcd_print_at_PGM(0, 2, PSTR("X")); lcd_print_at_PGM(0, 3, PSTR("Y")); + float vec_x[2]; + float vec_y[2]; + float cntr[2]; + world2machine_read_valid(vec_x, vec_y, cntr); + for (int i = 0; i < 2; i++) { lcd_print_at_PGM(11, i + 2, PSTR("")); - lcd.print(world2machine_shift[i]); - lcd_print_at_PGM((world2machine_shift[i] < 0) ? 17 : 16, i + 2, PSTR("mm")); + lcd.print(cntr[i]); + lcd_print_at_PGM((cntr[i] < 0) ? 17 : 16, i + 2, PSTR("mm")); } if (lcd_clicked()) { - lcd_quick_feedback(); menu_action_back(); } } From 3eb21b65ed45d852716b0144b0f30cf54aa5ba33 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Tue, 15 May 2018 23:19:23 +0200 Subject: [PATCH 19/21] wizard fix: don't reset calibration status when repeating first layer cal. --- Firmware/ultralcd.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 2f5e5fe7..f190149e 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -4061,8 +4061,6 @@ void lcd_wizard(int state) { case 10: //repeat first layer cal.? wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(MSG_WIZARD_REPEAT_V2_CAL, false); if (wizard_event) { - //reset status and live adjust z value in eeprom - calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST); lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_CLEAN_HEATBED); state = 9; } From 503d5551e6b0a06c65ffd4293382be0157b9d1a7 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 16 May 2018 18:40:36 +0200 Subject: [PATCH 20/21] Fix build of MK2. Global variable distance_from_min was removed, do not update it. Expression float y = vec_x[1] * pgm_read_float(bed_ref_points_4+mesh_point*2) + vec_y[1] * pgm_read_float(bed_ref_points_4+mesh_point*2+1) + cntr[1]; is identical with expression in count_xyz_details(). --- Firmware/mesh_bed_calibration.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 120895a9..bca7a917 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -2632,12 +2632,11 @@ BedSkewOffsetDetectionResultType improve_bed_offset_and_skew(int8_t method, int8 // In case of success, update the too_far_mask from the calculated points. for (uint8_t mesh_point = 0; mesh_point < 2; ++ mesh_point) { float y = vec_x[1] * pgm_read_float(bed_ref_points_4+mesh_point*2) + vec_y[1] * pgm_read_float(bed_ref_points_4+mesh_point*2+1) + cntr[1]; - distance_from_min[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); #ifdef SUPPORT_VERBOSITY if (verbosity_level >= 20) { SERIAL_ECHOLNPGM(""); SERIAL_ECHOPGM("Distance from min:"); - MYSERIAL.print(distance_from_min[mesh_point]); + MYSERIAL.print(y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); SERIAL_ECHOLNPGM(""); SERIAL_ECHOPGM("y:"); MYSERIAL.print(y); From 9b7eeaecaa3ae582eec99b74aca0c9bd0f739a60 Mon Sep 17 00:00:00 2001 From: Robert Pelnar Date: Fri, 18 May 2018 14:42:35 +0200 Subject: [PATCH 21/21] version changed --- Firmware/Configuration.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index 55615b04..bb8df381 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -7,8 +7,8 @@ #define STR(x) STR_HELPER(x) // Firmware version -#define FW_VERSION "3.2.0" -#define FW_COMMIT_NR 555 +#define FW_VERSION "3.2.1" +#define FW_COMMIT_NR 576 // FW_VERSION_UNKNOWN means this is an unofficial build. // The firmware should only be checked into github with this symbol. #define FW_DEV_VERSION FW_VERSION_UNKNOWN