Bläddra i källkod

Merge branch 'MK3' into time_remaining_fix

# Conflicts:
#	Firmware/Marlin_main.cpp
Marek Bel 6 år sedan
förälder
incheckning
001680bbdc
5 ändrade filer med 56 tillägg och 7 borttagningar
  1. 11 1
      Firmware/Marlin_main.cpp
  2. 1 0
      Firmware/messages.c
  3. 1 0
      Firmware/messages.h
  4. 34 4
      Firmware/mmu.cpp
  5. 9 2
      Firmware/ultralcd.cpp

+ 11 - 1
Firmware/Marlin_main.cpp

@@ -1665,7 +1665,7 @@ void setup()
 	  }
 	  else if (calibration_status() == CALIBRATION_STATUS_Z_CALIBRATION) {
 		  // Show the message.
-		  lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW));
+		  lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW));
 	  }
   }
 
@@ -8857,8 +8857,12 @@ void print_mesh_bed_leveling_table()
 
 uint16_t print_time_remaining() {
 	uint16_t print_t = PRINT_TIME_REMAINING_INIT;
+#ifdef TMC2130 
 	if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_remaining_normal;
 	else print_t = print_time_remaining_silent;
+#else
+	print_t = print_time_remaining_normal;
+#endif //TMC2130
 	if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply;
 	return print_t;
 }
@@ -8867,12 +8871,18 @@ uint8_t calc_percent_done()
 {
 	//in case that we have information from M73 gcode return percentage counted by slicer, else return percentage counted as byte_printed/filesize
 	uint8_t percent_done = 0;
+#ifdef TMC2130
 	if (SilentModeMenu == SILENT_MODE_OFF && print_percent_done_normal <= 100) {
 		percent_done = print_percent_done_normal;
 	}
 	else if (print_percent_done_silent <= 100) {
 		percent_done = print_percent_done_silent;
 	}
+#else
+	if (print_percent_done_normal <= 100) {
+		percent_done = print_percent_done_normal;
+	}
+#endif //TMC2130
 	else {
 		percent_done = card.percentDone();
 	}

+ 1 - 0
Firmware/messages.c

@@ -43,6 +43,7 @@ const char MSG_FIND_BED_OFFSET_AND_SKEW_LINE1[] PROGMEM_I1 = ISTR("Searching bed
 const char MSG_FIND_BED_OFFSET_AND_SKEW_LINE2[] PROGMEM_I1 = ISTR(" of 4"); ////c=14 r=0
 const char MSG_FINISHING_MOVEMENTS[] PROGMEM_I1 = ISTR("Finishing movements"); ////c=20 r=1
 const char MSG_FOLLOW_CALIBRATION_FLOW[] PROGMEM_I1 = ISTR("Printer has not been calibrated yet. Please follow the manual, chapter First steps, section Calibration flow."); ////c=20 r=8
+const char MSG_FOLLOW_Z_CALIBRATION_FLOW[] PROGMEM_I1 = ISTR("There is still a need to make Z calibration. Please follow the manual, chapter First steps, section Calibration flow."); ////c=20 r=8
 const char MSG_FSENS_AUTOLOAD_NA[] PROGMEM_I1 = ISTR("F. autoload [N/A]"); ////c=17 r=1
 const char MSG_FSENSOR_OFF[] PROGMEM_I1 = ISTR("Fil. sensor [off]"); ////c=0 r=0
 const char MSG_FSENSOR_ON[] PROGMEM_I1 = ISTR("Fil. sensor  [on]"); ////c=0 r=0

+ 1 - 0
Firmware/messages.h

@@ -40,6 +40,7 @@ extern const char MSG_FIND_BED_OFFSET_AND_SKEW_LINE1[];
 extern const char MSG_FIND_BED_OFFSET_AND_SKEW_LINE2[];
 extern const char MSG_FINISHING_MOVEMENTS[];
 extern const char MSG_FOLLOW_CALIBRATION_FLOW[];
+extern const char MSG_FOLLOW_Z_CALIBRATION_FLOW[];
 extern const char MSG_FSENS_AUTOLOAD_NA[];
 extern const char MSG_FSENSOR_OFF[];
 extern const char MSG_FSENSOR_ON[];

+ 34 - 4
Firmware/mmu.cpp

@@ -11,6 +11,7 @@
 #include "cardreader.h"
 #include "ultralcd.h"
 #include "sound.h"
+#include <avr/pgmspace.h>
 
 #define CHECK_FINDA ((IS_SD_PRINTING || is_usb_printing) && (mcode_in_progress != 600) && !saved_printing && e_active())
 
@@ -642,6 +643,37 @@ void extr_adj(int extruder) //loading filament for SNMM
 #endif
 }
 
+struct E_step
+{
+    float extrude;   //!< extrude distance in mm
+    float feed_rate; //!< feed rate in mm/s
+};
+static const E_step ramming_sequence[] PROGMEM =
+{
+    {1.0,   1000.0/60},
+    {1.0,   1500.0/60},
+    {2.0,   2000.0/60},
+    {1.5,   3000.0/60},
+    {2.5,   4000.0/60},
+    {-15.0, 5000.0/60},
+    {-14.0, 1200.0/60},
+    {-6.0,  600.0/60},
+    {10.0,  700.0/60},
+    {-10.0, 400.0/60},
+    {-50.0, 2000.0/60},
+};
+
+//! @brief Unload sequence to optimize shape of the tip of the unloaded filament
+static void filament_ramming()
+{
+    for(uint8_t i = 0; i < (sizeof(ramming_sequence)/sizeof(E_step));++i)
+    {
+        current_position[E_AXIS] += pgm_read_float(&(ramming_sequence[i].extrude));
+        plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
+                current_position[E_AXIS], pgm_read_float(&(ramming_sequence[i].feed_rate)), active_extruder);
+        st_synchronize();
+    }
+}
 
 void extr_unload()
 { //unload just current filament for multimaterial printers
@@ -663,9 +695,7 @@ void extr_unload()
 		lcd_print(" ");
 		lcd_print(mmu_extruder + 1);
 
-		current_position[E_AXIS] -= 80;
-		plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2500 / 60, active_extruder);
-		st_synchronize();
+		filament_ramming();
 
 		mmu_command(MMU_CMD_U0);
 		// get response
@@ -986,4 +1016,4 @@ void mmu_eject_filament(uint8_t filament, bool recover)
 	{
 		puts_P(PSTR("Filament nr out of range!"));
 	}
-}
+}

+ 9 - 2
Firmware/ultralcd.cpp

@@ -597,8 +597,15 @@ void lcdui_print_time(void)
 	int chars = 0;
 	if ((PRINTER_ACTIVE) && ((print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) || (starttime != 0)))
 	{
-		char suff = (print_time_remaining_normal == PRINT_TIME_REMAINING_INIT)?' ':'R';
-		chars = lcd_printf_P(_N("%c%02u:%02u%c"), LCD_STR_CLOCK[0], print_t / 60, print_t % 60, suff);
+          char suff = ' ';
+          char suff_doubt = ' ';
+		if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT)
+          {
+               suff = 'R';
+               if (feedmultiply != 100)
+                    suff_doubt = '?';
+          }
+		chars = lcd_printf_P(_N("%c%02u:%02u%c%c"), LCD_STR_CLOCK[0], print_t / 60, print_t % 60, suff, suff_doubt);
 	}
 	else
 		chars = lcd_printf_P(_N("%c--:--  "), LCD_STR_CLOCK[0]);