Merge pull request #117 from PavelSindler/m600

M600: wait for user before unloading filament
This commit is contained in:
XPila 2017-11-28 22:45:57 +01:00 committed by GitHub
commit 1da1eaea01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 120 additions and 72 deletions

View file

@ -9,7 +9,7 @@
// Firmware version
#define FW_version "3.1.1-RC1"
#define FW_build 116
#define FW_build 117
//#define FW_build --BUILD-NUMBER--
#define FW_version_build FW_version " b" STR(FW_build)

View file

@ -293,7 +293,7 @@ unsigned long pause_time = 0;
unsigned long start_pause_print = millis();
unsigned long t_fan_rising_edge = millis();
unsigned long load_filament_time;
//unsigned long load_filament_time;
bool mesh_bed_leveling_flag = false;
bool mesh_bed_run_from_menu = false;
@ -5386,64 +5386,113 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
}
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], FILAMENTCHANGE_XYFEED, active_extruder);
st_synchronize();
custom_message = true;
lcd_setstatuspgm(MSG_UNLOADING_FILAMENT);
KEEPALIVE_STATE(PAUSED_FOR_USER);
// Unload filament
if(code_seen('L'))
{
target[E_AXIS]+= code_value();
}
else
{
#ifdef SNMM
uint8_t cnt = 0;
int counterBeep = 0;
lcd_display_message_fullscreen_P(MSG_PRESS_TO_UNLOAD);
while (!lcd_clicked()) {
#else
#ifdef FILAMENTCHANGE_FINALRETRACT
target[E_AXIS] += FILAMENTCHANGE_FINALRETRACT;
#endif
#endif // SNMM
}
cnt++;
manage_heater();
manage_inactivity(true);
/*#ifdef SNMM
target[E_AXIS] += 0.002;
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 500, active_extruder);
#endif // SNMM*/
if (cnt == 0)
{
#if BEEPER > 0
if (counterBeep == 500) {
counterBeep = 0;
}
SET_OUTPUT(BEEPER);
if (counterBeep == 0) {
WRITE(BEEPER, HIGH);
}
if (counterBeep == 20) {
WRITE(BEEPER, LOW);
}
counterBeep++;
#else
#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
lcd_buzz(1000 / 6, 100);
#else
lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
#endif
#endif
}
}
WRITE(BEEPER, LOW);
lcd_change_fil_state = 0;
while (lcd_change_fil_state == 0) {
lcd_display_message_fullscreen_P(MSG_UNLOADING_FILAMENT);
KEEPALIVE_STATE(IN_HANDLER);
custom_message = true;
lcd_setstatuspgm(MSG_UNLOADING_FILAMENT);
// Unload filament
if (code_seen('L'))
{
target[E_AXIS] += code_value();
}
else
{
#ifdef SNMM
target[E_AXIS] += 12;
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 3500, active_extruder);
target[E_AXIS] += 6;
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 5000, active_extruder);
target[E_AXIS] += (FIL_LOAD_LENGTH * -1);
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 5000, active_extruder);
st_synchronize();
target[E_AXIS] += (FIL_COOLING);
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 50, active_extruder);
target[E_AXIS] += (FIL_COOLING*-1);
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 50, active_extruder);
target[E_AXIS] += (bowden_length[snmm_extruder] *-1);
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 3000, active_extruder);
st_synchronize();
#else
// plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], FILAMENTCHANGE_RFEED, active_extruder);
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 3500/60, active_extruder);
#ifdef FILAMENTCHANGE_FINALRETRACT
target[E_AXIS] += FILAMENTCHANGE_FINALRETRACT;
#endif
#endif // SNMM
}
//finish moves
st_synchronize();
//disable extruder steppers so filament can be removed
disable_e0();
disable_e1();
disable_e2();
delay(100);
#ifdef SNMM
target[E_AXIS] += 12;
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 3500, active_extruder);
target[E_AXIS] += 6;
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 5000, active_extruder);
target[E_AXIS] += (FIL_LOAD_LENGTH * -1);
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 5000, active_extruder);
st_synchronize();
target[E_AXIS] += (FIL_COOLING);
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 50, active_extruder);
target[E_AXIS] += (FIL_COOLING*-1);
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 50, active_extruder);
target[E_AXIS] += (bowden_length[snmm_extruder] * -1);
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 3000, active_extruder);
st_synchronize();
#else
// plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], FILAMENTCHANGE_RFEED, active_extruder);
plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], 3500 / 60, active_extruder);
#endif // SNMM
//finish moves
st_synchronize();
//disable extruder steppers so filament can be removed
disable_e0();
disable_e1();
disable_e2();
delay(100);
KEEPALIVE_STATE(PAUSED_FOR_USER);
lcd_change_fil_state = !lcd_show_fullscreen_message_yes_no_and_wait_P(MSG_UNLOAD_SUCCESSFULL, false, false);
//lcd_return_to_status();
lcd_update_enable(true);
}
//Wait for user to insert filament
uint8_t cnt=0;
int counterBeep = 0;
lcd_wait_interact();
load_filament_time = millis();
//load_filament_time = millis();
KEEPALIVE_STATE(PAUSED_FOR_USER);
while(!lcd_clicked()){
cnt++;
manage_heater();
manage_inactivity(true);
@ -5453,31 +5502,8 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
#endif // SNMM*/
if(cnt==0)
{
#if BEEPER > 0
if (counterBeep== 500){
counterBeep = 0;
}
SET_OUTPUT(BEEPER);
if (counterBeep== 0){
WRITE(BEEPER,HIGH);
}
if (counterBeep== 20){
WRITE(BEEPER,LOW);
}
counterBeep++;
#else
#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
lcd_buzz(1000/6,100);
#else
lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS,LCD_FEEDBACK_FREQUENCY_HZ);
#endif
#endif
}
}
WRITE(BEEPER, LOW);
//WRITE(BEEPER, LOW);
KEEPALIVE_STATE(IN_HANDLER);
#ifdef SNMM

View file

@ -1281,6 +1281,13 @@ const char * const MSG_PRESS_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_PRESS_CZ
};
const char MSG_PRESS_TO_UNLOAD_EN[] PROGMEM = "Please press the knob to unload filament";
const char MSG_PRESS_TO_UNLOAD_CZ[] PROGMEM = "Pro vysunuti filamentu stisknete prosim tlacitko";
const char * const MSG_PRESS_TO_UNLOAD_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_PRESS_TO_UNLOAD_EN,
MSG_PRESS_TO_UNLOAD_CZ
};
const char MSG_PRINTER_DISCONNECTED_EN[] PROGMEM = "Printer disconnected";
const char * const MSG_PRINTER_DISCONNECTED_LANG_TABLE[1] PROGMEM = {
MSG_PRINTER_DISCONNECTED_EN
@ -1946,6 +1953,13 @@ const char * const MSG_UNLOAD_FILAMENT_4_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_UNLOAD_FILAMENT_4_CZ
};
const char MSG_UNLOAD_SUCCESSFULL_EN[] PROGMEM = "Repeat unloading filament?";
const char MSG_UNLOAD_SUCCESSFULL_CZ[] PROGMEM = "Opakovat vysunuti filamentu?";
const char * const MSG_UNLOAD_SUCCESSFULL_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_UNLOAD_SUCCESSFULL_EN,
MSG_UNLOAD_SUCCESSFULL_CZ
};
const char MSG_USB_PRINTING_EN[] PROGMEM = "USB printing ";
const char MSG_USB_PRINTING_CZ[] PROGMEM = "Tisk z USB ";
const char * const MSG_USB_PRINTING_LANG_TABLE[LANG_NUM] PROGMEM = {

View file

@ -436,6 +436,8 @@ extern const char* const MSG_PREPARE_FILAMENT_LANG_TABLE[LANG_NUM];
#define MSG_PREPARE_FILAMENT LANG_TABLE_SELECT(MSG_PREPARE_FILAMENT_LANG_TABLE)
extern const char* const MSG_PRESS_LANG_TABLE[LANG_NUM];
#define MSG_PRESS LANG_TABLE_SELECT(MSG_PRESS_LANG_TABLE)
extern const char* const MSG_PRESS_TO_UNLOAD_LANG_TABLE[LANG_NUM];
#define MSG_PRESS_TO_UNLOAD LANG_TABLE_SELECT(MSG_PRESS_TO_UNLOAD_LANG_TABLE)
extern const char* const MSG_PRINTER_DISCONNECTED_LANG_TABLE[1];
#define MSG_PRINTER_DISCONNECTED LANG_TABLE_SELECT_EXPLICIT(MSG_PRINTER_DISCONNECTED_LANG_TABLE, 0)
extern const char* const MSG_PRINT_ABORTED_LANG_TABLE[LANG_NUM];
@ -650,6 +652,8 @@ extern const char* const MSG_UNLOAD_FILAMENT_3_LANG_TABLE[LANG_NUM];
#define MSG_UNLOAD_FILAMENT_3 LANG_TABLE_SELECT(MSG_UNLOAD_FILAMENT_3_LANG_TABLE)
extern const char* const MSG_UNLOAD_FILAMENT_4_LANG_TABLE[LANG_NUM];
#define MSG_UNLOAD_FILAMENT_4 LANG_TABLE_SELECT(MSG_UNLOAD_FILAMENT_4_LANG_TABLE)
extern const char* const MSG_UNLOAD_SUCCESSFULL_LANG_TABLE[LANG_NUM];
#define MSG_UNLOAD_SUCCESSFULL LANG_TABLE_SELECT(MSG_UNLOAD_SUCCESSFULL_LANG_TABLE)
extern const char* const MSG_USB_PRINTING_LANG_TABLE[LANG_NUM];
#define MSG_USB_PRINTING LANG_TABLE_SELECT(MSG_USB_PRINTING_LANG_TABLE)
extern const char* const MSG_USED_LANG_TABLE[LANG_NUM];

View file

@ -349,4 +349,6 @@
#define MSG_STEEL_SHEET_CHECK "Je tiskovy plat na heatbed?"
#define MSG_REMOVE_STEEL_SHEET "Odstrante tiskovy plat z heatbed prosim."
#define MSG_PLACE_STEEL_SHEET "Umistete prosim tiskovy plat na heatbed"
#define MSG_RECOVER_PRINT "Detekovan vypadek proudu.Obnovit tisk?"
#define MSG_RECOVER_PRINT "Detekovan vypadek proudu.Obnovit tisk?"
#define MSG_PRESS_TO_UNLOAD "Pro vysunuti filamentu stisknete prosim tlacitko"
#define MSG_UNLOAD_SUCCESSFULL "Opakovat vysunuti filamentu?"

View file

@ -366,3 +366,5 @@
#define(length=11, lines=1) MSG_INFO_FILAMENT_YDIFF "Fil. Ydiff:"
#define(length=17, lines=1) MSG_FANS_CHECK_ON "Fans check [on]"
#define(length=17, lines=1) MSG_FANS_CHECK_OFF "Fans check [off]"
#define(length=20, lines=4) MSG_PRESS_TO_UNLOAD "Please press the knob to unload filament"
#define(length=20, lines=2) MSG_UNLOAD_SUCCESSFULL "Repeat unloading filament?"