|
@@ -3025,6 +3025,8 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
void gcode_M701()
|
|
|
{
|
|
|
printf_P(PSTR("gcode_M701 begin\n"));
|
|
@@ -3051,28 +3053,15 @@ void gcode_M701()
|
|
|
if (current_position[Z_AXIS] < 20) current_position[Z_AXIS] += 30;
|
|
|
current_position[E_AXIS] += 30;
|
|
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 400 / 60, active_extruder); //fast sequence
|
|
|
- st_synchronize();
|
|
|
- current_position[E_AXIS] += 25;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 100 / 60, active_extruder); //slow sequence
|
|
|
- st_synchronize();
|
|
|
+
|
|
|
+ load_filament_final_feed(); //slow sequence
|
|
|
|
|
|
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) tone(BEEPER, 500);
|
|
|
delay_keep_alive(50);
|
|
|
noTone(BEEPER);
|
|
|
|
|
|
if (!farm_mode && loading_flag) {
|
|
|
- bool clean = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_CLEAN), false, true);
|
|
|
-
|
|
|
- while (!clean) {
|
|
|
- lcd_update_enable(true);
|
|
|
- lcd_update(2);
|
|
|
- current_position[E_AXIS] += 25;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 100 / 60, active_extruder); //slow sequence
|
|
|
- st_synchronize();
|
|
|
- clean = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_CLEAN), false, true);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+ lcd_load_filament_color_check();
|
|
|
}
|
|
|
lcd_update_enable(true);
|
|
|
lcd_update(2);
|
|
@@ -6773,17 +6762,23 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
|
|
|
break;
|
|
|
case 702: //! M702 [U C] -
|
|
|
{
|
|
|
- if (mmu_enabled)
|
|
|
- {
|
|
|
- if (code_seen('U'))
|
|
|
- extr_unload_used(); //! if "U" unload all filaments which were used in current print
|
|
|
- else if (code_seen('C'))
|
|
|
- extr_unload(); //! if "C" unload just current filament
|
|
|
- else
|
|
|
- extr_unload_all(); //! otherwise unload all filaments
|
|
|
- }
|
|
|
+#ifdef SNMM
|
|
|
+ if (code_seen('U'))
|
|
|
+ extr_unload_used(); //! if "U" unload all filaments which were used in current print
|
|
|
+ else if (code_seen('C'))
|
|
|
+ extr_unload(); //! if "C" unload just current filament
|
|
|
else
|
|
|
- unload_filament();
|
|
|
+ extr_unload_all(); //! otherwise unload all filaments
|
|
|
+#else
|
|
|
+ if (code_seen('C')) {
|
|
|
+ if(mmu_enabled) extr_unload(); //! if "C" unload current filament; if mmu is not present no action is performed
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if(mmu_enabled) extr_unload(); //! unload current filament
|
|
|
+ else unload_filament();
|
|
|
+ }
|
|
|
+
|
|
|
+#endif //SNMM
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -6799,7 +6794,8 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
|
|
|
// printf_P(_N("END M-CODE=%u\n"), mcode_in_progress);
|
|
|
mcode_in_progress = 0;
|
|
|
}
|
|
|
- } // end if(code_seen('M')) (end of M codes)
|
|
|
+ }
|
|
|
+ // end if(code_seen('M')) (end of M codes)
|
|
|
//! T<extruder nr.> - select extruder in case of multi extruder printer
|
|
|
//! select filament in case of MMU_V2
|
|
|
//! if extruder is "?", open menu to let the user select extruder/filament
|
|
@@ -6813,9 +6809,27 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
|
|
|
st_synchronize();
|
|
|
for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++);
|
|
|
|
|
|
- if ((*(strchr_pointer + index) < '0' || *(strchr_pointer + index) > '4') && *(strchr_pointer + index) != '?') {
|
|
|
+ *(strchr_pointer + index) = tolower(*(strchr_pointer + index));
|
|
|
+
|
|
|
+ if ((*(strchr_pointer + index) < '0' || *(strchr_pointer + index) > '4') && *(strchr_pointer + index) != '?' && *(strchr_pointer + index) != 'x' && *(strchr_pointer + index) != 'c') {
|
|
|
SERIAL_ECHOLNPGM("Invalid T code.");
|
|
|
}
|
|
|
+ else if (*(strchr_pointer + index) == 'x'){ //load to bondtech gears; if mmu is not present do nothing
|
|
|
+ if (mmu_enabled)
|
|
|
+ {
|
|
|
+ tmp_extruder = choose_menu_P(_T(MSG_CHOOSE_FILAMENT), _T(MSG_FILAMENT));
|
|
|
+ mmu_command(MMU_CMD_T0 + tmp_extruder);
|
|
|
+ manage_response(true, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (*(strchr_pointer + index) == 'c') { //load to from bondtech gears to nozzle (nozzle should be preheated)
|
|
|
+ if (mmu_enabled)
|
|
|
+ {
|
|
|
+ mmu_command(MMU_CMD_C0);
|
|
|
+ mmu_extruder = tmp_extruder; //filament change is finished
|
|
|
+ mmu_load_to_nozzle();
|
|
|
+ }
|
|
|
+ }
|
|
|
else {
|
|
|
if (*(strchr_pointer + index) == '?')
|
|
|
{
|
|
@@ -7362,13 +7376,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
|
|
|
else
|
|
|
{
|
|
|
lcd_update_enable(false);
|
|
|
- lcd_clear();
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
- lcd_puts_P(_T(MSG_ERROR));
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_T(MSG_PREHEAT_NOZZLE));
|
|
|
- delay(2000);
|
|
|
- lcd_clear();
|
|
|
+ show_preheat_nozzle_warning();
|
|
|
lcd_update_enable(true);
|
|
|
}
|
|
|
}
|
|
@@ -8910,6 +8918,14 @@ static void print_time_remaining_init()
|
|
|
print_percent_done_silent = PRINT_PERCENT_DONE_INIT;
|
|
|
}
|
|
|
|
|
|
+void load_filament_final_feed()
|
|
|
+{
|
|
|
+ st_synchronize();
|
|
|
+ current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED;
|
|
|
+ plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 200/60, active_extruder);
|
|
|
+ st_synchronize();
|
|
|
+}
|
|
|
+
|
|
|
void M600_check_state()
|
|
|
{
|
|
|
//Wait for user to check the state
|
|
@@ -8930,8 +8946,9 @@ void M600_check_state()
|
|
|
|
|
|
// Filament loaded properly but color is not clear
|
|
|
case 3:
|
|
|
- current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED ;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2, active_extruder);
|
|
|
+ st_synchronize();
|
|
|
+ current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED;
|
|
|
+ plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 200/60, active_extruder);
|
|
|
lcd_loading_color();
|
|
|
break;
|
|
|
|
|
@@ -9050,8 +9067,7 @@ void M600_load_filament_movements()
|
|
|
current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED ;
|
|
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_EFEED, active_extruder);
|
|
|
#endif
|
|
|
- current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED ;
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_EXFEED, active_extruder);
|
|
|
+ load_filament_final_feed();
|
|
|
lcd_loading_filament();
|
|
|
}
|
|
|
|