Merge remote-tracking branch 'prusa3d/MK3' into MM_lay1_cal

This commit is contained in:
Marek Bel 2019-09-12 14:28:52 +02:00
commit 6661d3aa45
14 changed files with 174 additions and 492 deletions

View File

@ -113,11 +113,6 @@ extern PGM_P sPrinterName;
// #define PS_DEFAULT_OFF
// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
//#define TEMP_SENSOR_1_AS_REDUNDANT
#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
// Actual temperature must be close to target for this long before M109 returns success
#define TEMP_RESIDENCY_TIME 3 // (seconds)
#define TEMP_HYSTERESIS 5 // (degC) range of +/- temperatures considered "close" to the target one

View File

@ -10,14 +10,6 @@
#endif
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
//// Heating sanity check:
// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperatureLCD_PROGRESS_BAR
// If the temperature has not increased at the end of that period, the target temperature is set to zero.
// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
// differ by at least 2x WATCH_TEMP_INCREASE
//#define WATCH_TEMP_PERIOD 40000 //40 seconds
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
#ifdef PIDTEMP
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
@ -400,10 +392,6 @@ const unsigned int dropsegments=5; //everything with less than this number of st
//============================= Define Defines ============================
//===========================================================================
#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
#error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
#endif
#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
#error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
#endif

View File

@ -5891,7 +5891,6 @@ Sigma_Exit:
{
setTargetHotendSafe(code_value(), extruder);
}
setWatch();
break;
}
@ -6042,7 +6041,6 @@ Sigma_Exit:
}
#endif
setWatch();
codenum = _millis();
/* See if we are heating up or cooling down */

View File

@ -73,10 +73,6 @@ int current_voltage_raw_bed = 0;
int current_temperature_bed_raw = 0;
float current_temperature_bed = 0.0;
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
int redundant_temperature_raw = 0;
float redundant_temperature = 0.0;
#endif
#ifdef PIDTEMP
@ -175,13 +171,8 @@ static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP;
static int bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP;
#endif
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
static void *heater_ttbl_map[2] = {(void *)HEATER_0_TEMPTABLE, (void *)HEATER_1_TEMPTABLE };
static uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN };
#else
static void *heater_ttbl_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( (void *)HEATER_0_TEMPTABLE, (void *)HEATER_1_TEMPTABLE, (void *)HEATER_2_TEMPTABLE );
static uint8_t heater_ttbllen_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN );
#endif
static void *heater_ttbl_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( (void *)HEATER_0_TEMPTABLE, (void *)HEATER_1_TEMPTABLE, (void *)HEATER_2_TEMPTABLE );
static uint8_t heater_ttbllen_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN );
static float analog2temp(int raw, uint8_t e);
static float analog2tempBed(int raw);
@ -195,11 +186,6 @@ enum TempRunawayStates
TempRunaway_ACTIVE = 2,
};
#ifdef WATCH_TEMP_PERIOD
int watch_start_temp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0);
unsigned long watchmillis[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0);
#endif //WATCH_TEMP_PERIOD
#ifndef SOFT_PWM_SCALE
#define SOFT_PWM_SCALE 0
#endif
@ -728,34 +714,6 @@ void manage_heater()
{
soft_pwm[e] = 0;
}
#ifdef WATCH_TEMP_PERIOD
if(watchmillis[e] && _millis() - watchmillis[e] > WATCH_TEMP_PERIOD)
{
if(degHotend(e) < watch_start_temp[e] + WATCH_TEMP_INCREASE)
{
setTargetHotend(0, e);
LCD_MESSAGEPGM("Heating failed");
SERIAL_ECHO_START;
SERIAL_ECHOLN("Heating failed");
}else{
watchmillis[e] = 0;
}
}
#endif
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
if(fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) {
disable_heater();
if(IsStopped() == false) {
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Extruder switched off. Temperature difference between temp sensors is too high !");
LCD_ALERTMESSAGEPGM("Err: REDUNDANT TEMP ERROR");
}
#ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
Stop();
#endif
}
#endif
} // End extruder for loop
#define FAN_CHECK_PERIOD 5000 //5s
@ -907,11 +865,7 @@ void manage_heater()
// Derived from RepRap FiveD extruder::getTemperature()
// For hot end temperature measurement.
static float analog2temp(int raw, uint8_t e) {
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
if(e > EXTRUDERS)
#else
if(e >= EXTRUDERS)
#endif
{
SERIAL_ERROR_START;
SERIAL_ERROR((int)e);
@ -1054,10 +1008,6 @@ static void updateTemperaturesFromRawValues()
current_temperature_bed = analog2tempBed(current_temperature_bed_raw);
#endif //DEBUG_HEATER_BED_SIM
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
redundant_temperature = analog2temp(redundant_temperature_raw, 1);
#endif
CRITICAL_SECTION_START;
temp_meas_ready = false;
CRITICAL_SECTION_END;
@ -1221,20 +1171,6 @@ void tp_init()
#endif //BED_MAXTEMP
}
void setWatch()
{
#ifdef WATCH_TEMP_PERIOD
for (int e = 0; e < EXTRUDERS; e++)
{
if(degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2))
{
watch_start_temp[e] = degHotend(e);
watchmillis[e] = _millis();
}
}
#endif
}
#if (defined (TEMP_RUNAWAY_BED_HYSTERESIS) && TEMP_RUNAWAY_BED_TIMEOUT > 0) || (defined (TEMP_RUNAWAY_EXTRUDER_HYSTERESIS) && TEMP_RUNAWAY_EXTRUDER_TIMEOUT > 0)
void temp_runaway_check(int _heater_id, float _target_temperature, float _current_temperature, float _output, bool _isbed)
{

View File

@ -74,9 +74,6 @@ extern int current_voltage_raw_pwr;
extern int current_voltage_raw_bed;
#endif
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
extern float redundant_temperature;
#endif
#if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
extern unsigned char soft_pwm_bed;
@ -220,7 +217,6 @@ FORCE_INLINE bool isCoolingBed() {
int getHeaterPower(int heater);
void disable_heater();
void setWatch();
void updatePID();

View File

@ -1661,100 +1661,12 @@ static void lcd_move_menu_axis();
/* Menu implementation */
static void lcd_preheat_farm()
{
setTargetHotend0(FARM_PREHEAT_HOTEND_TEMP);
setTargetBed(FARM_PREHEAT_HPB_TEMP);
fanSpeed = 0;
lcd_return_to_status();
setWatch(); // heater sanity check timer
}
static void lcd_preheat_farm_nozzle()
{
setTargetHotend0(FARM_PREHEAT_HOTEND_TEMP);
setTargetBed(0);
fanSpeed = 0;
lcd_return_to_status();
setWatch(); // heater sanity check timer
}
static void lcd_preheat_pla()
{
setTargetHotend0(PLA_PREHEAT_HOTEND_TEMP);
if (!wizard_active) setTargetBed(PLA_PREHEAT_HPB_TEMP);
fanSpeed = PLA_PREHEAT_FAN_SPEED;
lcd_return_to_status();
setWatch(); // heater sanity check timer
if (wizard_active) lcd_wizard(WizState::Unload);
}
static void lcd_preheat_asa()
{
setTargetHotend0(ASA_PREHEAT_HOTEND_TEMP);
if (!wizard_active) setTargetBed(ASA_PREHEAT_HPB_TEMP);
fanSpeed = ASA_PREHEAT_FAN_SPEED;
lcd_return_to_status();
setWatch(); // heater sanity check timer
if (wizard_active) lcd_wizard(WizState::Unload);
}
static void lcd_preheat_abs()
{
setTargetHotend0(ABS_PREHEAT_HOTEND_TEMP);
if (!wizard_active) setTargetBed(ABS_PREHEAT_HPB_TEMP);
fanSpeed = ABS_PREHEAT_FAN_SPEED;
lcd_return_to_status();
setWatch(); // heater sanity check timer
if (wizard_active) lcd_wizard(WizState::Unload);
}
static void lcd_preheat_pp()
{
setTargetHotend0(PP_PREHEAT_HOTEND_TEMP);
if (!wizard_active) setTargetBed(PP_PREHEAT_HPB_TEMP);
fanSpeed = PP_PREHEAT_FAN_SPEED;
lcd_return_to_status();
setWatch(); // heater sanity check timer
if (wizard_active) lcd_wizard(WizState::Unload);
}
static void lcd_preheat_pet()
{
setTargetHotend0(PET_PREHEAT_HOTEND_TEMP);
if (!wizard_active) setTargetBed(PET_PREHEAT_HPB_TEMP);
fanSpeed = PET_PREHEAT_FAN_SPEED;
lcd_return_to_status();
setWatch(); // heater sanity check timer
if (wizard_active) lcd_wizard(WizState::Unload);
}
static void lcd_preheat_hips()
{
setTargetHotend0(HIPS_PREHEAT_HOTEND_TEMP);
if (!wizard_active) setTargetBed(HIPS_PREHEAT_HPB_TEMP);
fanSpeed = HIPS_PREHEAT_FAN_SPEED;
lcd_return_to_status();
setWatch(); // heater sanity check timer
if (wizard_active) lcd_wizard(WizState::Unload);
}
static void lcd_preheat_flex()
{
setTargetHotend0(FLEX_PREHEAT_HOTEND_TEMP);
if (!wizard_active) setTargetBed(FLEX_PREHEAT_HPB_TEMP);
fanSpeed = FLEX_PREHEAT_FAN_SPEED;
lcd_return_to_status();
setWatch(); // heater sanity check timer
if (wizard_active) lcd_wizard(WizState::Unload);
}
static void lcd_cooldown()
{
setAllTargetHotends(0);
setTargetBed(0);
fanSpeed = 0;
eFilamentAction = FilamentAction::None;
lcd_return_to_status();
}
@ -2021,27 +1933,8 @@ static void lcd_menu_test_restore()
static void lcd_preheat_menu()
{
MENU_BEGIN();
if (!wizard_active) MENU_ITEM_BACK_P(_T(MSG_MAIN));
if (farm_mode) {
MENU_ITEM_FUNCTION_P(PSTR("farm - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), lcd_preheat_farm);
MENU_ITEM_FUNCTION_P(PSTR("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), lcd_preheat_farm_nozzle);
MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown);
} else {
MENU_ITEM_FUNCTION_P(PSTR("PLA - " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PLA_PREHEAT_HPB_TEMP)), lcd_preheat_pla);
MENU_ITEM_FUNCTION_P(PSTR("PET - " STRINGIFY(PET_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PET_PREHEAT_HPB_TEMP)), lcd_preheat_pet);
MENU_ITEM_FUNCTION_P(PSTR("ASA - " STRINGIFY(ASA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ASA_PREHEAT_HPB_TEMP)), lcd_preheat_asa);
MENU_ITEM_FUNCTION_P(PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ABS_PREHEAT_HPB_TEMP)), lcd_preheat_abs);
MENU_ITEM_FUNCTION_P(PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(HIPS_PREHEAT_HPB_TEMP)), lcd_preheat_hips);
MENU_ITEM_FUNCTION_P(PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PP_PREHEAT_HPB_TEMP)), lcd_preheat_pp);
MENU_ITEM_FUNCTION_P(PSTR("FLEX - " STRINGIFY(FLEX_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FLEX_PREHEAT_HPB_TEMP)), lcd_preheat_flex);
if (!wizard_active) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown);
}
MENU_END();
eFilamentAction = FilamentAction::Preheat;
mFilamentMenu();
}
static void lcd_support_menu()
@ -2194,7 +2087,7 @@ FilamentAction eFilamentAction=FilamentAction::None; // must be initialized as '
bool bFilamentFirstRun;
bool bFilamentPreheatState;
bool bFilamentAction=false;
bool bFilamentWaitingFlag=false;
static bool bFilamentWaitingFlag=false;
static void mFilamentPrompt()
{
@ -2219,6 +2112,7 @@ switch(eFilamentAction)
case FilamentAction::MmuEject:
case FilamentAction::MmuCut:
case FilamentAction::None:
case FilamentAction::Preheat:
break;
}
if(lcd_clicked())
@ -2247,290 +2141,220 @@ if(lcd_clicked())
case FilamentAction::MmuEject:
case FilamentAction::MmuCut:
case FilamentAction::None:
case FilamentAction::Preheat:
break;
}
}
}
/*
void _mFilamentItem(uint16_t nTemp,uint16_t nTempBed)
void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
{
static int nTargetOld,nTargetBedOld;
uint8_t nLevel;
static bool bBeep=false;
static int nTargetOld;
static int nTargetBedOld;
uint8_t nLevel;
//if(bPreheatState) // not necessary
nTargetOld=target_temperature[0];
nTargetBedOld=target_temperature_bed;
setTargetHotend0((float)nTemp);
setTargetBed((float)nTempBed);
lcd_timeoutToStatus.stop();
lcd_set_cursor(0,0);
lcdui_print_temp(LCD_STR_THERMOMETER[0],(int)degHotend(0),(int)degTargetHotend(0));
lcd_set_cursor(0,1);
switch(eFilamentAction)
{
case eFILAMENT_ACTION::load:
case eFILAMENT_ACTION::autoLoad:
case eFILAMENT_ACTION::mmuLoad:
lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20 r=1
break;
case eFILAMENT_ACTION::unLoad:
case eFILAMENT_ACTION::mmuUnLoad:
lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 r=1
break;
case eFILAMENT_ACTION::mmuEject:
lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 r=1
break;
case eFILAMENT_ACTION::mmuCut:
lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 r=1
break;
}
lcd_set_cursor(0,3);
lcd_puts_P(_i(">Cancel")); ////MSG_ c=20 r=1
if(lcd_clicked())
{
if(!bFilamentPreheatState)
{
setTargetHotend0(0.0);
setTargetBed(0.0);
menu_back();
}
else {
setTargetHotend0((float)nTargetOld);
setTargetBed((float)nTargetBedOld);
}
menu_back();
if(eFilamentAction==eFILAMENT_ACTION::autoLoad)
eFilamentAction=eFILAMENT_ACTION::none; // i.e. non-autoLoad
}
else {
if(current_temperature[0]>(target_temperature[0]*0.95))
{
switch(eFilamentAction)
{
case eFILAMENT_ACTION::load:
case eFILAMENT_ACTION::autoLoad:
case eFILAMENT_ACTION::unLoad:
menu_submenu(mFilamentPrompt);
break;
case eFILAMENT_ACTION::mmuLoad:
nLevel=1;
if(!bFilamentPreheatState)
nLevel++;
bFilamentAction=true;
menu_back(nLevel);
menu_submenu(mmu_load_to_nozzle_menu);
break;
case eFILAMENT_ACTION::mmuUnLoad:
nLevel=1;
if(!bFilamentPreheatState)
nLevel++;
bFilamentAction=true;
menu_back(nLevel);
extr_unload();
break;
case eFILAMENT_ACTION::mmuEject:
nLevel=1;
if(!bFilamentPreheatState)
nLevel++;
bFilamentAction=true;
menu_back(nLevel);
menu_submenu(mmu_fil_eject_menu);
break;
case eFILAMENT_ACTION::mmuCut:
nLevel=1;
if(!bFilamentPreheatState)
nLevel++;
bFilamentAction=true;
menu_back(nLevel);
menu_submenu(mmu_cut_filament_menu);
break;
}
if(bBeep)
Sound_MakeSound(e_SOUND_TYPE_StandardPrompt);
bBeep=false;
}
else bBeep=true;
}
}
*/
nTargetOld = target_temperature[0];
nTargetBedOld = target_temperature_bed;
setTargetHotend0((float )nTemp);
if (!wizard_active) setTargetBed((float) nTempBed);
void mFilamentItem(uint16_t nTemp,uint16_t nTempBed)
{
static int nTargetOld,nTargetBedOld;
uint8_t nLevel;
if (eFilamentAction == FilamentAction::Preheat)
{
eFilamentAction = FilamentAction::None;
lcd_return_to_status();
if (wizard_active) lcd_wizard(WizState::Unload);
return;
}
//if(bPreheatState) // not necessary
nTargetOld=target_temperature[0];
nTargetBedOld=target_temperature_bed;
setTargetHotend0((float)nTemp);
setTargetBed((float)nTempBed);
lcd_timeoutToStatus.stop();
if(current_temperature[0]>(target_temperature[0]*0.95))
{
switch(eFilamentAction)
{
case FilamentAction::Load:
case FilamentAction::AutoLoad:
case FilamentAction::UnLoad:
if(bFilamentWaitingFlag)
menu_submenu(mFilamentPrompt);
else {
nLevel=bFilamentPreheatState?1:2;
menu_back(nLevel);
if((eFilamentAction==FilamentAction::Load)||(eFilamentAction==FilamentAction::AutoLoad))
{
loading_flag=true;
enquecommand_P(PSTR("M701")); // load filament
if(eFilamentAction==FilamentAction::AutoLoad)
eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
}
if(eFilamentAction==FilamentAction::UnLoad)
enquecommand_P(PSTR("M702")); // unload filament
}
break;
case FilamentAction::MmuLoad:
nLevel=bFilamentPreheatState?1:2;
bFilamentAction=true;
menu_back(nLevel);
menu_submenu(mmu_load_to_nozzle_menu);
break;
case FilamentAction::MmuUnLoad:
nLevel=bFilamentPreheatState?1:2;
bFilamentAction=true;
menu_back(nLevel);
extr_unload();
break;
case FilamentAction::MmuEject:
nLevel=bFilamentPreheatState?1:2;
bFilamentAction=true;
menu_back(nLevel);
menu_submenu(mmu_fil_eject_menu);
break;
case FilamentAction::MmuCut:
lcd_timeoutToStatus.stop();
if (current_temperature[0] > (target_temperature[0] * 0.95))
{
switch (eFilamentAction)
{
case FilamentAction::Load:
case FilamentAction::AutoLoad:
case FilamentAction::UnLoad:
if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt);
else
{
nLevel = bFilamentPreheatState ? 1 : 2;
menu_back(nLevel);
if ((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad))
{
loading_flag = true;
enquecommand_P(PSTR("M701")); // load filament
if (eFilamentAction == FilamentAction::AutoLoad) eFilamentAction = FilamentAction::None; // i.e. non-autoLoad
}
if (eFilamentAction == FilamentAction::UnLoad)
enquecommand_P(PSTR("M702")); // unload filament
}
break;
case FilamentAction::MmuLoad:
nLevel = bFilamentPreheatState ? 1 : 2;
bFilamentAction = true;
menu_back(nLevel);
menu_submenu(mmu_load_to_nozzle_menu);
break;
case FilamentAction::MmuUnLoad:
nLevel = bFilamentPreheatState ? 1 : 2;
bFilamentAction = true;
menu_back(nLevel);
extr_unload();
break;
case FilamentAction::MmuEject:
nLevel = bFilamentPreheatState ? 1 : 2;
bFilamentAction = true;
menu_back(nLevel);
menu_submenu(mmu_fil_eject_menu);
break;
case FilamentAction::MmuCut:
#ifdef MMU_HAS_CUTTER
nLevel=bFilamentPreheatState?1:2;
bFilamentAction=true;
menu_back(nLevel);
menu_submenu(mmu_cut_filament_menu);
nLevel=bFilamentPreheatState?1:2;
bFilamentAction=true;
menu_back(nLevel);
menu_submenu(mmu_cut_filament_menu);
#endif //MMU_HAS_CUTTER
break;
case FilamentAction::None:
break;
}
if(bFilamentWaitingFlag)
Sound_MakeSound(e_SOUND_TYPE_StandardPrompt);
bFilamentWaitingFlag=false;
}
else {
bFilamentWaitingFlag=true;
lcd_set_cursor(0,0);
lcdui_print_temp(LCD_STR_THERMOMETER[0],(int)degHotend(0),(int)degTargetHotend(0));
lcd_set_cursor(0,1);
switch(eFilamentAction)
{
case FilamentAction::Load:
case FilamentAction::AutoLoad:
case FilamentAction::MmuLoad:
lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20 r=1
break;
case FilamentAction::UnLoad:
case FilamentAction::MmuUnLoad:
lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 r=1
break;
case FilamentAction::MmuEject:
lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 r=1
break;
case FilamentAction::MmuCut:
lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 r=1
break;
case FilamentAction::None:
break;
}
lcd_set_cursor(0,3);
lcd_puts_P(_i(">Cancel")); ////MSG_ c=20 r=1
if(lcd_clicked())
{
bFilamentWaitingFlag=false;
if(!bFilamentPreheatState)
{
setTargetHotend0(0.0);
setTargetBed(0.0);
menu_back();
}
else {
setTargetHotend0((float)nTargetOld);
setTargetBed((float)nTargetBedOld);
}
menu_back();
if(eFilamentAction==FilamentAction::AutoLoad)
eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
}
}
break;
case FilamentAction::None:
case FilamentAction::Preheat:
break;
}
if (bFilamentWaitingFlag) Sound_MakeSound(e_SOUND_TYPE_StandardPrompt);
bFilamentWaitingFlag = false;
}
else
{
bFilamentWaitingFlag = true;
lcd_set_cursor(0, 0);
lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0));
lcd_set_cursor(0, 1);
switch (eFilamentAction)
{
case FilamentAction::Load:
case FilamentAction::AutoLoad:
case FilamentAction::MmuLoad:
lcd_puts_P(_i("Preheating to load")); ////MSG_ c=20 r=1
break;
case FilamentAction::UnLoad:
case FilamentAction::MmuUnLoad:
lcd_puts_P(_i("Preheating to unload")); ////MSG_ c=20 r=1
break;
case FilamentAction::MmuEject:
lcd_puts_P(_i("Preheating to eject")); ////MSG_ c=20 r=1
break;
case FilamentAction::MmuCut:
lcd_puts_P(_i("Preheating to cut")); ////MSG_ c=20 r=1
break;
case FilamentAction::None:
case FilamentAction::Preheat:
break;
}
lcd_set_cursor(0, 3);
lcd_puts_P(_i(">Cancel")); ////MSG_ c=20 r=1
if (lcd_clicked())
{
bFilamentWaitingFlag = false;
if (!bFilamentPreheatState)
{
setTargetHotend0(0.0);
setTargetBed(0.0);
menu_back();
}
else
{
setTargetHotend0((float )nTargetOld);
setTargetBed((float) nTargetBedOld);
}
menu_back();
if (eFilamentAction == FilamentAction::AutoLoad) eFilamentAction = FilamentAction::None; // i.e. non-autoLoad
}
}
}
static void mFilamentItem_farm()
{
bFilamentPreheatState = false;
mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, FARM_PREHEAT_HPB_TEMP);
}
static void mFilamentItem_farm_nozzle()
{
bFilamentPreheatState = false;
mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0);
}
static void mFilamentItem_PLA()
{
bFilamentPreheatState=false;
mFilamentItem(PLA_PREHEAT_HOTEND_TEMP,PLA_PREHEAT_HPB_TEMP);
bFilamentPreheatState = false;
mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP);
}
static void mFilamentItem_PET()
{
bFilamentPreheatState=false;
mFilamentItem(PET_PREHEAT_HOTEND_TEMP,PET_PREHEAT_HPB_TEMP);
bFilamentPreheatState = false;
mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP);
}
static void mFilamentItem_ASA()
{
bFilamentPreheatState=false;
mFilamentItem(ASA_PREHEAT_HOTEND_TEMP,ASA_PREHEAT_HPB_TEMP);
bFilamentPreheatState = false;
mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP);
}
static void mFilamentItem_ABS()
{
bFilamentPreheatState=false;
mFilamentItem(ABS_PREHEAT_HOTEND_TEMP,ABS_PREHEAT_HPB_TEMP);
bFilamentPreheatState = false;
mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP);
}
static void mFilamentItem_HIPS()
{
bFilamentPreheatState=false;
mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP,HIPS_PREHEAT_HPB_TEMP);
bFilamentPreheatState = false;
mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP);
}
static void mFilamentItem_PP()
{
bFilamentPreheatState=false;
mFilamentItem(PP_PREHEAT_HOTEND_TEMP,PP_PREHEAT_HPB_TEMP);
bFilamentPreheatState = false;
mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP);
}
static void mFilamentItem_FLEX()
{
bFilamentPreheatState=false;
mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP,FLEX_PREHEAT_HPB_TEMP);
bFilamentPreheatState = false;
mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP);
}
void mFilamentBack()
{
menu_back();
if(eFilamentAction==FilamentAction::AutoLoad)
eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
menu_back();
if (eFilamentAction == FilamentAction::AutoLoad ||
eFilamentAction == FilamentAction::Preheat)
{
eFilamentAction = FilamentAction::None; // i.e. non-autoLoad
}
}
void mFilamentMenu()
{
MENU_BEGIN();
MENU_ITEM_FUNCTION_P(_T(MSG_MAIN),mFilamentBack);
MENU_ITEM_SUBMENU_P(PSTR("PLA - " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PLA_PREHEAT_HPB_TEMP)),mFilamentItem_PLA);
MENU_ITEM_SUBMENU_P(PSTR("PET - " STRINGIFY(PET_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PET_PREHEAT_HPB_TEMP)),mFilamentItem_PET);
MENU_ITEM_SUBMENU_P(PSTR("ASA - " STRINGIFY(ASA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ASA_PREHEAT_HPB_TEMP)),mFilamentItem_ASA);
MENU_ITEM_SUBMENU_P(PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ABS_PREHEAT_HPB_TEMP)),mFilamentItem_ABS);
MENU_ITEM_SUBMENU_P(PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(HIPS_PREHEAT_HPB_TEMP)),mFilamentItem_HIPS);
MENU_ITEM_SUBMENU_P(PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PP_PREHEAT_HPB_TEMP)),mFilamentItem_PP);
MENU_ITEM_SUBMENU_P(PSTR("FLEX - " STRINGIFY(FLEX_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FLEX_PREHEAT_HPB_TEMP)),mFilamentItem_FLEX);
if (!wizard_active) MENU_ITEM_FUNCTION_P(_T(MSG_MAIN),mFilamentBack);
if (farm_mode)
{
MENU_ITEM_FUNCTION_P(PSTR("farm - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), mFilamentItem_farm);
MENU_ITEM_FUNCTION_P(PSTR("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), mFilamentItem_farm_nozzle);
}
else
{
MENU_ITEM_SUBMENU_P(PSTR("PLA - " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PLA_PREHEAT_HPB_TEMP)),mFilamentItem_PLA);
MENU_ITEM_SUBMENU_P(PSTR("PET - " STRINGIFY(PET_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PET_PREHEAT_HPB_TEMP)),mFilamentItem_PET);
MENU_ITEM_SUBMENU_P(PSTR("ASA - " STRINGIFY(ASA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ASA_PREHEAT_HPB_TEMP)),mFilamentItem_ASA);
MENU_ITEM_SUBMENU_P(PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ABS_PREHEAT_HPB_TEMP)),mFilamentItem_ABS);
MENU_ITEM_SUBMENU_P(PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(HIPS_PREHEAT_HPB_TEMP)),mFilamentItem_HIPS);
MENU_ITEM_SUBMENU_P(PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PP_PREHEAT_HPB_TEMP)),mFilamentItem_PP);
MENU_ITEM_SUBMENU_P(PSTR("FLEX - " STRINGIFY(FLEX_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FLEX_PREHEAT_HPB_TEMP)),mFilamentItem_FLEX);
}
if (!wizard_active && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown);
MENU_END();
}

View File

@ -167,6 +167,7 @@ enum class FilamentAction : uint_least8_t
MmuUnLoad,
MmuEject,
MmuCut,
Preheat,
};
extern FilamentAction eFilamentAction;

View File

@ -319,35 +319,27 @@ PREHEAT SETTINGS
#define FARM_PREHEAT_HOTEND_TEMP 250
#define FARM_PREHEAT_HPB_TEMP 80
#define FARM_PREHEAT_FAN_SPEED 0
#define PLA_PREHEAT_HOTEND_TEMP 215
#define PLA_PREHEAT_HPB_TEMP 55
#define PLA_PREHEAT_FAN_SPEED 0
#define ASA_PREHEAT_HOTEND_TEMP 260
#define ASA_PREHEAT_HPB_TEMP 105
#define ASA_PREHEAT_FAN_SPEED 0
#define ABS_PREHEAT_HOTEND_TEMP 255
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 0
#define HIPS_PREHEAT_HOTEND_TEMP 220
#define HIPS_PREHEAT_HPB_TEMP 100
#define HIPS_PREHEAT_FAN_SPEED 0
#define PP_PREHEAT_HOTEND_TEMP 254
#define PP_PREHEAT_HPB_TEMP 100
#define PP_PREHEAT_FAN_SPEED 0
#define PET_PREHEAT_HOTEND_TEMP 240
#define PET_PREHEAT_HPB_TEMP 90
#define PET_PREHEAT_FAN_SPEED 0
#define FLEX_PREHEAT_HOTEND_TEMP 230
#define FLEX_PREHEAT_HPB_TEMP 50
#define FLEX_PREHEAT_FAN_SPEED 0
/*------------------------------------
THERMISTORS SETTINGS

View File

@ -377,35 +377,27 @@
#define FARM_PREHEAT_HOTEND_TEMP 250
#define FARM_PREHEAT_HPB_TEMP 80
#define FARM_PREHEAT_FAN_SPEED 0
#define PLA_PREHEAT_HOTEND_TEMP 215
#define PLA_PREHEAT_HPB_TEMP 60
#define PLA_PREHEAT_FAN_SPEED 0
#define ASA_PREHEAT_HOTEND_TEMP 260
#define ASA_PREHEAT_HPB_TEMP 105
#define ASA_PREHEAT_FAN_SPEED 0
#define ABS_PREHEAT_HOTEND_TEMP 255
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 0
#define HIPS_PREHEAT_HOTEND_TEMP 220
#define HIPS_PREHEAT_HPB_TEMP 100
#define HIPS_PREHEAT_FAN_SPEED 0
#define PP_PREHEAT_HOTEND_TEMP 254
#define PP_PREHEAT_HPB_TEMP 100
#define PP_PREHEAT_FAN_SPEED 0
#define PET_PREHEAT_HOTEND_TEMP 230
#define PET_PREHEAT_HPB_TEMP 85
#define PET_PREHEAT_FAN_SPEED 0
#define FLEX_PREHEAT_HOTEND_TEMP 240
#define FLEX_PREHEAT_HPB_TEMP 50
#define FLEX_PREHEAT_FAN_SPEED 0
/*------------------------------------
THERMISTORS SETTINGS

View File

@ -378,35 +378,27 @@
#define FARM_PREHEAT_HOTEND_TEMP 250
#define FARM_PREHEAT_HPB_TEMP 80
#define FARM_PREHEAT_FAN_SPEED 0
#define PLA_PREHEAT_HOTEND_TEMP 215
#define PLA_PREHEAT_HPB_TEMP 60
#define PLA_PREHEAT_FAN_SPEED 0
#define ASA_PREHEAT_HOTEND_TEMP 260
#define ASA_PREHEAT_HPB_TEMP 105
#define ASA_PREHEAT_FAN_SPEED 0
#define ABS_PREHEAT_HOTEND_TEMP 255
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 0
#define HIPS_PREHEAT_HOTEND_TEMP 220
#define HIPS_PREHEAT_HPB_TEMP 100
#define HIPS_PREHEAT_FAN_SPEED 0
#define PP_PREHEAT_HOTEND_TEMP 254
#define PP_PREHEAT_HPB_TEMP 100
#define PP_PREHEAT_FAN_SPEED 0
#define PET_PREHEAT_HOTEND_TEMP 230
#define PET_PREHEAT_HPB_TEMP 85
#define PET_PREHEAT_FAN_SPEED 0
#define FLEX_PREHEAT_HOTEND_TEMP 240
#define FLEX_PREHEAT_HPB_TEMP 50
#define FLEX_PREHEAT_FAN_SPEED 0
/*------------------------------------
THERMISTORS SETTINGS

View File

@ -377,35 +377,27 @@
#define FARM_PREHEAT_HOTEND_TEMP 250
#define FARM_PREHEAT_HPB_TEMP 80
#define FARM_PREHEAT_FAN_SPEED 0
#define PLA_PREHEAT_HOTEND_TEMP 215
#define PLA_PREHEAT_HPB_TEMP 60
#define PLA_PREHEAT_FAN_SPEED 0
#define ASA_PREHEAT_HOTEND_TEMP 260
#define ASA_PREHEAT_HPB_TEMP 105
#define ASA_PREHEAT_FAN_SPEED 0
#define ABS_PREHEAT_HOTEND_TEMP 255
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 0
#define HIPS_PREHEAT_HOTEND_TEMP 220
#define HIPS_PREHEAT_HPB_TEMP 100
#define HIPS_PREHEAT_FAN_SPEED 0
#define PP_PREHEAT_HOTEND_TEMP 254
#define PP_PREHEAT_HPB_TEMP 100
#define PP_PREHEAT_FAN_SPEED 0
#define PET_PREHEAT_HOTEND_TEMP 230
#define PET_PREHEAT_HPB_TEMP 85
#define PET_PREHEAT_FAN_SPEED 0
#define FLEX_PREHEAT_HOTEND_TEMP 240
#define FLEX_PREHEAT_HPB_TEMP 50
#define FLEX_PREHEAT_FAN_SPEED 0
/*------------------------------------
THERMISTORS SETTINGS

View File

@ -378,35 +378,27 @@
#define FARM_PREHEAT_HOTEND_TEMP 250
#define FARM_PREHEAT_HPB_TEMP 80
#define FARM_PREHEAT_FAN_SPEED 0
#define PLA_PREHEAT_HOTEND_TEMP 215
#define PLA_PREHEAT_HPB_TEMP 60
#define PLA_PREHEAT_FAN_SPEED 0
#define ASA_PREHEAT_HOTEND_TEMP 260
#define ASA_PREHEAT_HPB_TEMP 105
#define ASA_PREHEAT_FAN_SPEED 0
#define ABS_PREHEAT_HOTEND_TEMP 255
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 0
#define HIPS_PREHEAT_HOTEND_TEMP 220
#define HIPS_PREHEAT_HPB_TEMP 100
#define HIPS_PREHEAT_FAN_SPEED 0
#define PP_PREHEAT_HOTEND_TEMP 254
#define PP_PREHEAT_HPB_TEMP 100
#define PP_PREHEAT_FAN_SPEED 0
#define PET_PREHEAT_HOTEND_TEMP 230
#define PET_PREHEAT_HPB_TEMP 85
#define PET_PREHEAT_FAN_SPEED 0
#define FLEX_PREHEAT_HOTEND_TEMP 240
#define FLEX_PREHEAT_HPB_TEMP 50
#define FLEX_PREHEAT_FAN_SPEED 0
/*------------------------------------
THERMISTORS SETTINGS

View File

@ -487,35 +487,27 @@
#define FARM_PREHEAT_HOTEND_TEMP 250
#define FARM_PREHEAT_HPB_TEMP 80
#define FARM_PREHEAT_FAN_SPEED 0
#define PLA_PREHEAT_HOTEND_TEMP 215
#define PLA_PREHEAT_HPB_TEMP 60
#define PLA_PREHEAT_FAN_SPEED 0
#define ASA_PREHEAT_HOTEND_TEMP 260
#define ASA_PREHEAT_HPB_TEMP 105
#define ASA_PREHEAT_FAN_SPEED 0
#define ABS_PREHEAT_HOTEND_TEMP 255
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 0
#define HIPS_PREHEAT_HOTEND_TEMP 220
#define HIPS_PREHEAT_HPB_TEMP 100
#define HIPS_PREHEAT_FAN_SPEED 0
#define PP_PREHEAT_HOTEND_TEMP 254
#define PP_PREHEAT_HPB_TEMP 100
#define PP_PREHEAT_FAN_SPEED 0
#define PET_PREHEAT_HOTEND_TEMP 230
#define PET_PREHEAT_HPB_TEMP 85
#define PET_PREHEAT_FAN_SPEED 0
#define FLEX_PREHEAT_HOTEND_TEMP 240
#define FLEX_PREHEAT_HPB_TEMP 50
#define FLEX_PREHEAT_FAN_SPEED 0
/*------------------------------------
THERMISTORS SETTINGS

View File

@ -489,35 +489,27 @@
#define FARM_PREHEAT_HOTEND_TEMP 250
#define FARM_PREHEAT_HPB_TEMP 80
#define FARM_PREHEAT_FAN_SPEED 0
#define PLA_PREHEAT_HOTEND_TEMP 215
#define PLA_PREHEAT_HPB_TEMP 60
#define PLA_PREHEAT_FAN_SPEED 0
#define ASA_PREHEAT_HOTEND_TEMP 260
#define ASA_PREHEAT_HPB_TEMP 105
#define ASA_PREHEAT_FAN_SPEED 0
#define ABS_PREHEAT_HOTEND_TEMP 255
#define ABS_PREHEAT_HPB_TEMP 100
#define ABS_PREHEAT_FAN_SPEED 0
#define HIPS_PREHEAT_HOTEND_TEMP 220
#define HIPS_PREHEAT_HPB_TEMP 100
#define HIPS_PREHEAT_FAN_SPEED 0
#define PP_PREHEAT_HOTEND_TEMP 254
#define PP_PREHEAT_HPB_TEMP 100
#define PP_PREHEAT_FAN_SPEED 0
#define PET_PREHEAT_HOTEND_TEMP 230
#define PET_PREHEAT_HPB_TEMP 85
#define PET_PREHEAT_FAN_SPEED 0
#define FLEX_PREHEAT_HOTEND_TEMP 240
#define FLEX_PREHEAT_HPB_TEMP 50
#define FLEX_PREHEAT_FAN_SPEED 0
/*------------------------------------
THERMISTORS SETTINGS