Kaynağa Gözat

use just short movement for unloading filament

PavelSindler 6 yıl önce
ebeveyn
işleme
27c8612360
2 değiştirilmiş dosya ile 7 ekleme ve 8 silme
  1. 6 8
      Firmware/mmu.cpp
  2. 1 0
      Firmware/mmu.h

+ 6 - 8
Firmware/mmu.cpp

@@ -377,13 +377,6 @@ void mmu_load_step() {
 	plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMU_LOAD_FEEDRATE, active_extruder);
 	st_synchronize();
 }
-
-void mmu_unload_step() {
-	current_position[E_AXIS] = current_position[E_AXIS] - MMU_LOAD_FEEDRATE * 0.1;
-	plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMU_LOAD_FEEDRATE, active_extruder);
-	st_synchronize();
-}
-
 bool mmu_get_response(uint8_t move)
 {
 	printf_P(PSTR("mmu_get_response - begin move:%d\n"), move);
@@ -406,7 +399,11 @@ bool mmu_get_response(uint8_t move)
 				mmu_load_step();
 				break;
 			case MMU_UNLOAD_MOVE:
-				mmu_unload_step();
+				current_position[E_AXIS] = current_position[E_AXIS] - MMU_LOAD_FEEDRATE * MMU_LOAD_TIME;
+				plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], MMU_LOAD_FEEDRATE, active_extruder);
+				st_synchronize();
+				disable_e0(); //turn off E-stepper to prevent overheating and alow filament pull-out if necessary
+				move = MMU_NO_MOVE;
 				break;
 			case MMU_TCODE_MOVE: //first do unload and then continue with infinite loading 
 				current_position[E_AXIS] = current_position[E_AXIS] - MMU_LOAD_FEEDRATE * MMU_LOAD_TIME;
@@ -414,6 +411,7 @@ bool mmu_get_response(uint8_t move)
 				st_synchronize();
 				move = MMU_LOAD_MOVE;
 				break;
+			case MMU_NO_MOVE:
 			default: 
 				delay_keep_alive(100);
 				break;

+ 1 - 0
Firmware/mmu.h

@@ -17,6 +17,7 @@ extern int16_t mmu_buildnr;
 
 #define MMU_FILAMENT_UNKNOWN 255
 
+#define MMU_NO_MOVE 0
 #define MMU_UNLOAD_MOVE 1
 #define MMU_LOAD_MOVE 2
 #define MMU_TCODE_MOVE 3