load to nozzle improved, unified feedrate and E-distance for final feed used in load filament function, M600 etc.

This commit is contained in:
PavelSindler 2018-11-01 16:29:09 +01:00
parent e80af46503
commit 96ce324b7c
9 changed files with 114 additions and 114 deletions

View file

@ -478,3 +478,4 @@ void M600_load_filament();
void M600_load_filament_movements();
void M600_wait_for_user(float HotendTempBckp);
void M600_check_state();
void load_filament_final_feed();

View file

@ -3049,10 +3049,8 @@ 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);
@ -7358,13 +7356,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);
}
}
@ -8906,6 +8898,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], 100/60, active_extruder);
st_synchronize();
}
void M600_check_state()
{
//Wait for user to check the state
@ -8926,8 +8926,7 @@ 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);
load_filament_final_feed();
lcd_loading_color();
break;
@ -9046,8 +9045,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();
}

View file

@ -544,13 +544,8 @@ void mmu_M600_load_filament(bool automatic)
manage_response(false, true);
mmu_command(MMU_CMD_C0);
mmu_extruder = tmp_extruder; //filament change is finished
mmu_load_to_nozzle();
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], 2, active_extruder);
load_filament_final_feed();
}
@ -811,13 +806,7 @@ void extr_unload()
}
else
{
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_return_to_status();
}
@ -873,6 +862,31 @@ void extr_adj_4()
#endif
}
void mmu_load_to_nozzle_0()
{
lcd_mmu_load_to_nozzle(0);
}
void mmu_load_to_nozzle_1()
{
lcd_mmu_load_to_nozzle(1);
}
void mmu_load_to_nozzle_2()
{
lcd_mmu_load_to_nozzle(2);
}
void mmu_load_to_nozzle_3()
{
lcd_mmu_load_to_nozzle(3);
}
void mmu_load_to_nozzle_4()
{
lcd_mmu_load_to_nozzle(4);
}
void mmu_eject_fil_0()
{
mmu_eject_filament(0, true);
@ -954,13 +968,7 @@ void extr_unload_all()
}
else
{
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_return_to_status();
}
}
@ -978,13 +986,7 @@ void extr_unload_used()
snmm_filaments_used = 0;
}
else {
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_return_to_status();
}
}
@ -1031,6 +1033,35 @@ void mmu_show_warning()
kill(_i("Please update firmware in your MMU2. Waiting for reset."));
}
void lcd_mmu_load_to_nozzle(uint8_t filament_nr)
{
if (degHotend0() > EXTRUDE_MINTEMP)
{
tmp_extruder = filament_nr;
lcd_update_enable(false);
lcd_clear();
lcd_set_cursor(0, 1); lcd_puts_P(_T(MSG_LOADING_FILAMENT));
lcd_print(" ");
lcd_print(tmp_extruder + 1);
mmu_command(MMU_CMD_T0 + tmp_extruder);
manage_response(true, true);
mmu_command(MMU_CMD_C0);
mmu_extruder = tmp_extruder; //filament change is finished
mmu_load_to_nozzle();
load_filament_final_feed();
custom_message_type = CUSTOM_MSG_TYPE_F_LOAD;
lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT));
lcd_return_to_status();
lcd_update_enable(true);
lcd_load_filament_color_check();
custom_message_type = CUSTOM_MSG_TYPE_STATUS;
}
else
{
show_preheat_nozzle_warning();
}
}
void mmu_eject_filament(uint8_t filament, bool recover)
{
if (filament < 5)
@ -1060,13 +1091,7 @@ void mmu_eject_filament(uint8_t filament, bool recover)
}
else
{
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();
}
}
else

View file

@ -74,6 +74,11 @@ extern void extr_adj_1();
extern void extr_adj_2();
extern void extr_adj_3();
extern void extr_adj_4();
extern void mmu_load_to_nozzle_0();
extern void mmu_load_to_nozzle_1();
extern void mmu_load_to_nozzle_2();
extern void mmu_load_to_nozzle_3();
extern void mmu_load_to_nozzle_4();
extern void load_all();
extern void extr_change_0();
extern void extr_change_1();
@ -91,6 +96,7 @@ extern void extr_unload_4();
extern bool mmu_check_version();
extern void mmu_show_warning();
extern void lcd_mmu_load_to_nozzle(uint8_t filament_nr);
extern void mmu_eject_filament(uint8_t filament, bool recover);
extern void mmu_eject_fil_0();
extern void mmu_eject_fil_1();

View file

@ -113,7 +113,6 @@ static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg,
/* Different menus */
static void lcd_status_screen();
static void lcd_language_menu();
static void lcd_main_menu();
static void lcd_tune_menu();
//static void lcd_move_menu();
@ -2222,15 +2221,7 @@ void lcd_unLoadFilament()
enquecommand_P(PSTR("M702")); //unload filament
} else {
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();
}
menu_back();
@ -2426,15 +2417,24 @@ void lcd_alright() {
}
void show_preheat_nozzle_warning()
{
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();
}
void lcd_load_filament_color_check()
{
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();
load_filament_final_feed();
clean = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_CLEAN), false, true);
}
}
@ -2474,42 +2474,10 @@ static void lcd_LoadFilament()
}
else
{
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();
}
}
static void lcd_mmu_load_to_nozzle()
{
if (degHotend0() > EXTRUDE_MINTEMP)
{
tmp_extruder = choose_menu_P(_T(MSG_CHOOSE_FILAMENT), _T(MSG_FILAMENT));
mmu_command(MMU_CMD_T0 + tmp_extruder);
manage_response(true, true);
mmu_command(MMU_CMD_C0);
mmu_extruder = tmp_extruder; //filament change is finished
mmu_load_to_nozzle();
lcd_load_filament_color_check();
lcd_return_to_status();
}
else
{
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();
}
}
//! @brief Show filament used a print time
//!
@ -2659,12 +2627,7 @@ static void lcd_move_e()
}
else
{
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);
show_preheat_nozzle_warning();
lcd_return_to_status();
}
}
@ -4333,13 +4296,7 @@ void lcd_calibrate_pinda() {
}
else
{
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_return_to_status();
}
@ -5343,6 +5300,18 @@ static void fil_load_menu()
MENU_END();
}
static void mmu_load_to_nozzle_menu()
{
MENU_BEGIN();
MENU_ITEM_BACK_P(_T(MSG_MAIN));
MENU_ITEM_FUNCTION_P(_i("Load filament 1"), mmu_load_to_nozzle_0);
MENU_ITEM_FUNCTION_P(_i("Load filament 2"), mmu_load_to_nozzle_1);
MENU_ITEM_FUNCTION_P(_i("Load filament 3"), mmu_load_to_nozzle_2);
MENU_ITEM_FUNCTION_P(_i("Load filament 4"), mmu_load_to_nozzle_3);
MENU_ITEM_FUNCTION_P(_i("Load filament 5"), mmu_load_to_nozzle_4);
MENU_END();
}
static void mmu_fil_eject_menu()
{
MENU_BEGIN();
@ -5372,7 +5341,7 @@ static void fil_unload_menu()
MENU_END();
}
#endif //SNMM
static void change_extr_menu(){
MENU_BEGIN();
@ -5384,7 +5353,7 @@ static void change_extr_menu(){
MENU_END();
}
#endif //SNMM
//unload filament for single material printer (used in M702 gcode)
void unload_filament()
@ -5818,7 +5787,7 @@ static void lcd_main_menu()
if (mmu_enabled)
{
MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), fil_load_menu);
MENU_ITEM_FUNCTION_P(_i("Load to nozzle"), lcd_mmu_load_to_nozzle);
MENU_ITEM_SUBMENU_P(_i("Load to nozzle"), mmu_load_to_nozzle_menu);
MENU_ITEM_SUBMENU_P(_i("Eject filament"), mmu_fil_eject_menu);
MENU_ITEM_GCODE_P(_T(MSG_UNLOAD_FILAMENT), PSTR("M702 C"));
}

View file

@ -24,6 +24,7 @@ uint8_t get_message_level();
void lcd_adjust_z();
void lcd_pick_babystep();
void lcd_alright();
void show_preheat_nozzle_warning();
void EEPROM_save_B(int pos, int* value);
void EEPROM_read_B(int pos, int* value);
void lcd_wait_interact();

View file

@ -221,7 +221,7 @@
#define FILAMENTCHANGE_FINALRETRACT -80
#define FILAMENTCHANGE_FIRSTFEED 70
#define FILAMENTCHANGE_FINALFEED 50
#define FILAMENTCHANGE_FINALFEED 25
#define FILAMENTCHANGE_RECFEED 5
#define FILAMENTCHANGE_XYFEED 50

View file

@ -222,7 +222,7 @@
#define FILAMENTCHANGE_FINALRETRACT -80
#define FILAMENTCHANGE_FIRSTFEED 70
#define FILAMENTCHANGE_FINALFEED 50
#define FILAMENTCHANGE_FINALFEED 25
#define FILAMENTCHANGE_RECFEED 5
#define FILAMENTCHANGE_XYFEED 50

View file

@ -340,7 +340,7 @@
#define FILAMENTCHANGE_FINALRETRACT -80
#define FILAMENTCHANGE_FIRSTFEED 70
#define FILAMENTCHANGE_FINALFEED 50
#define FILAMENTCHANGE_FINALFEED 25
#define FILAMENTCHANGE_RECFEED 5
#define FILAMENTCHANGE_XYFEED 50