diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index 16f4197e..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-RC2" -#define FW_COMMIT_NR 534 +#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 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 136debf1..272cbcfe 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]; @@ -764,7 +762,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 +969,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 +1067,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 +1165,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 @@ -4221,13 +4222,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); @@ -7127,6 +7130,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() { @@ -7134,8 +7139,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(); } @@ -7194,11 +7199,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 diff --git a/Firmware/language_all.cpp b/Firmware/language_all.cpp index 967230f3..1681d26e 100644 --- a/Firmware/language_all.cpp +++ b/Firmware/language_all.cpp @@ -1168,6 +1168,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 5030ad34..45e53c59 100644 --- a/Firmware/language_all.h +++ b/Firmware/language_all.h @@ -394,6 +394,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 5228750b..8c036677 100644 --- a/Firmware/language_en.h +++ b/Firmware/language_en.h @@ -219,6 +219,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/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 6b6eea99..cadd28de 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 = { @@ -732,19 +755,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 +796,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 * @@ -2576,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); @@ -2960,8 +3015,7 @@ void babystep_reset() babystepLoadZ = 0; } -void count_xyz_details() { - float a1, a2; +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)) @@ -2974,12 +3028,14 @@ 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[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); } } diff --git a/Firmware/mesh_bed_calibration.h b/Firmware/mesh_bed_calibration.h index ced77cf6..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) @@ -181,7 +175,8 @@ extern void babystep_undo(); // Reset the current babystep counter without moving the axes. extern void babystep_reset(); -extern void count_xyz_details(); + +extern void count_xyz_details(float (&distanceMin)[2]); extern bool sample_z(); #endif /* MESH_BED_CALIBRATION_H */ 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 diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 88a55930..f190149e 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. @@ -192,6 +197,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); @@ -222,6 +229,9 @@ 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(); +static void lcd_menu_xyz_offset(); #if defined(TMC2130) || defined(PAT9125) static void lcd_menu_fails_stats(); #endif //TMC2130 or PAT9125 @@ -984,7 +994,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; @@ -1581,8 +1590,7 @@ static void lcd_menu_extruder_info() if (lcd_clicked()) { - lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } @@ -1686,7 +1694,7 @@ static void lcd_menu_debug() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } #endif /* DEBUG_BUILD */ @@ -1702,8 +1710,7 @@ static void lcd_menu_temperatures() if (lcd_clicked()) { - lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } @@ -1720,8 +1727,7 @@ 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(); - lcd_return_to_status(); + menu_action_back(); } } #endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN @@ -1732,8 +1738,7 @@ 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(); - lcd_return_to_status(); + menu_action_back(); } } #endif //TMC2130 @@ -1831,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(function, MSG_XYZ_DETAILS, lcd_service_mode_show_result); + MENU_ITEM(submenu, MSG_XYZ_DETAILS, lcd_menu_xyz_y_min); MENU_ITEM(submenu, MSG_INFO_EXTRUDER, lcd_menu_extruder_info); #ifdef TMC2130 @@ -2157,7 +2162,7 @@ void lcd_menu_statistics() if (lcd_clicked()) { lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } else @@ -2230,12 +2235,18 @@ void lcd_menu_statistics() KEEPALIVE_STATE(NOT_BUSY); lcd_quick_feedback(); - lcd_return_to_status(); + menu_action_back(); } } 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(); } @@ -2284,63 +2295,92 @@ 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); + lcd_printPGM(MSG_Y_DISTANCE_FROM_MIN); + lcd_print_at_PGM(0, 1, separator); + lcd_print_at_PGM(0, 2, MSG_LEFT); + lcd_print_at_PGM(0, 3, MSG_RIGHT); -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); + float distanceMin[2]; + count_xyz_details(distanceMin); - 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(); - - - 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[i] < 200) { + lcd_print_at_PGM(11, i + 2, PSTR("")); + 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()) + { + lcd_goto_menu(lcd_menu_xyz_skew); + } } +/** + * @brief Show measured axis skewness + */ +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, 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); + 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_goto_menu(lcd_menu_xyz_offset); + } +} +/** + * @brief Show measured bed offset from expected position + */ +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")); + 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(cntr[i]); + lcd_print_at_PGM((cntr[i] < 0) ? 17 : 16, i + 2, PSTR("mm")); + } + if (lcd_clicked()) + { + menu_action_back(); + } +} // Save a single axis babystep value. void EEPROM_save_B(int pos, int* value) @@ -2373,7 +2413,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) { @@ -2420,8 +2470,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(); } @@ -3156,7 +3208,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. @@ -3644,7 +3696,7 @@ static void lcd_crash_mode_set() } #endif //TMC2130 - + static void lcd_set_lang(unsigned char lang) { lang_selected = lang; @@ -4009,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; } @@ -4133,15 +4183,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 +5912,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) { @@ -7147,7 +7203,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"); 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(); 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) 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 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/"`_