Filamen Runout Sensor

- modified filament change position from x=211, y=0, z-add=2 to x=0,y=-2.2 and z-add=20. Changing z-add makes filament changes easier with low layer heights. Moving to front left corner also help to grab the oozing filament during change bit easier.
- added filament runout sensor to LCD screen 'Settings' menu
  - 'Sens Runou  [ON]/[OFF]' en-, disables filament runout sensor detection
  - 'FR_Sens[S to GND]/[S to VCC]' is to select what kind of sensor you connect to y-max pin 24
  - 'FR Pullup [ON]/[OFF]' defines internal pullup. A sensor to GND, like a endstop switch, normally doesn't have a pullup resistor and need 'FR Pullup [ON]' to get valid readings when filament run out. On the other hand most optical sensor have a pullup resistor.
  - the status can be checken under 'Calibration->Show end stops' or using M119 gcode command
This commit is contained in:
3d-gussner 2017-08-23 18:16:32 +02:00 committed by GitHub
parent 9753446e2e
commit dd1931261c
8 changed files with 279 additions and 74 deletions

View File

@ -49,6 +49,11 @@
#define EEPROM_CALIBRATION_STATUS_PINDA (EEPROM_BOWDEN_LENGTH - 1) //0 - not calibrated; 1 - calibrated
#define EEPROM_SD_SORT (EEPROM_CALIBRATION_STATUS_PINDA - 1) //0 -time, 1-alpha, 2-none
#define EEPROM_XYZ_CAL_SKEW (EEPROM_SD_SORT - 4)
// FILAMENT_RUNOUT_SENSOR
#define EEPROM_FIL_RUNOUT_ACTIVE (EEPROM_XYZ_CAL_SKEW - 1) //0 - filament runout sensor disabled; 1 - .. activated
#define EEPROM_FIL_RUNOUT_INVERTING (EEPROM_FIL_RUNOUT_ACTIVE - 1) //0 - filament runout sensor inverted; 1 - .. normal
#define EEPROM_ENDSTOPPULLUP_FIL_RUNOUT (EEPROM_FIL_RUNOUT_INVERTING - 1) //0 - filament runout sensor pullup; 0 - .. normal
// end FILAMENT_RUNOUT_SENSOR
// Currently running firmware, each digit stored as uint16_t.
// The flavor differentiates a dev, alpha, beta, release candidate or a release version.
@ -691,7 +696,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
* Note may require analog pins to be defined for different motherboards
**********************************************************************/
// Uncomment below to enable
//#define FILAMENT_SENSOR
#define FILAMENT_SENSOR
#define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2)
#define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel

View File

@ -287,6 +287,11 @@ extern int bowden_length[4];
extern bool is_usb_printing;
extern bool homing_flag;
extern bool temp_cal_active;
// FILAMENT_RUNOUT_SENSOR
extern bool fil_runout_active;
extern bool FIL_RUNOUT_INVERTING;
extern bool ENDSTOPPULLUP_FIL_RUNOUT;
// end FILAMENT_RUNOUT_SENSOR
extern bool loading_flag;
extern unsigned int usb_printing_counter;

View File

@ -254,6 +254,13 @@ bool homing_flag = false;
bool temp_cal_active = false;
// FILAMENT_RUNOUT_SENSOR
bool fil_runout_active = false;
bool FIL_RUNOUT_INVERTING = false;
bool fil_funout_inv = false;
bool ENDSTOPPULLUP_FIL_RUNOUT = false;
// end FILAMENT_RUNOUT_SENSOR
unsigned long kicktime = millis()+100000;
unsigned int usb_printing_counter;
@ -1240,6 +1247,15 @@ void setup()
}
#endif //DEBUG_DISABLE_STARTMSGS
// FILAMENT_RUNOUT_SENSOR
#ifdef FILAMENT_RUNOUT_SENSOR
fil_runout_active = eeprom_read_byte((uint8_t*)EEPROM_FIL_RUNOUT_ACTIVE);
FIL_RUNOUT_INVERTING = eeprom_read_byte((uint8_t*)EEPROM_FIL_RUNOUT_INVERTING);
ENDSTOPPULLUP_FIL_RUNOUT = eeprom_read_byte((uint8_t*)EEPROM_ENDSTOPPULLUP_FIL_RUNOUT);
#endif
// end FILAMENT_RUNOUT_SENSOR
lcd_update_enable(true);
// Store the currently running firmware into an eeprom,
@ -2058,8 +2074,13 @@ void ramming() {
*/
void process_commands()
{
#ifdef FILAMENT_RUNOUT_SUPPORT
SET_INPUT(FR_SENS);
#ifdef FILAMENT_RUNOUT_SENSOR
SET_INPUT(FIL_RUNOUT_PIN);
if (ENDSTOPPULLUP_FIL_RUNOUT) {
pinMode(FIL_RUNOUT_PIN, INPUT_PULLUP);
} else {
pinMode(FIL_RUNOUT_PIN, INPUT);
}
#endif
#ifdef CMDBUFFER_DEBUG
@ -2198,10 +2219,8 @@ void process_commands()
case 1: // G1
if(Stopped == false) {
#ifdef FILAMENT_RUNOUT_SUPPORT
if(READ(FR_SENS)){
#ifdef FILAMENT_RUNOUT_SENSOR
if((READ(FIL_RUNOUT_PIN) ^ FIL_RUNOUT_INVERTING == 0) && fil_runout_active) {
feedmultiplyBckp=feedmultiply;
float target[4];
float lastpos[4];
@ -4546,7 +4565,28 @@ Sigma_Exit:
}
SERIAL_PROTOCOLLN("");
#endif
break;
// FILAMENT_RUNOUT_SENSOR
// #if fil_runout_active && defined(FIL_RUNOUT_PIN) && FIL_RUNOUT_PIN > -1
#if defined(FIL_RUNOUT_PIN) && FIL_RUNOUT_PIN > -1
if (fil_runout_active == true) {
SERIAL_PROTOCOLRPGM(MSG_FIL_RUNOUT_SETTINGS);
if(READ(FIL_RUNOUT_PIN)^FIL_RUNOUT_INVERTING){
SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT);
}else{
SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN);
}
SERIAL_PROTOCOLLN("");
}
//Debug
// SERIAL_PROTOCOL(fil_runout_active);
// SERIAL_PROTOCOL(FIL_RUNOUT_INVERTING);
// SERIAL_PROTOCOL(ENDSTOPPULLUP_FIL_RUNOUT);
// SERIAL_PROTOCOLLN("");
//end Debug info
#endif
// end FILAMENT_RUNOUT_SENSOR
break;
//TODO: update for all axis, use for loop
#ifdef BLINKM
case 150: // M150

View File

@ -515,7 +515,7 @@ const char * const MSG_CALIBRATE_E_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_CALIBRATE_E_DE
};
const char MSG_CALIBRATE_PINDA_EN[] PROGMEM = "Calibrate";
const char MSG_CALIBRATE_PINDA_EN[] PROGMEM = "PINDA Temp. cal.";
const char MSG_CALIBRATE_PINDA_CZ[] PROGMEM = "Zkalibrovat";
const char MSG_CALIBRATE_PINDA_IT[] PROGMEM = "Calibrare";
const char MSG_CALIBRATE_PINDA_ES[] PROGMEM = "Calibrar";
@ -530,7 +530,7 @@ const char * const MSG_CALIBRATE_PINDA_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_CALIBRATE_PINDA_DE
};
const char MSG_CALIBRATION_PINDA_MENU_EN[] PROGMEM = "Temp. calibration";
const char MSG_CALIBRATION_PINDA_MENU_EN[] PROGMEM = "PINDA Temp. cal.";
const char MSG_CALIBRATION_PINDA_MENU_CZ[] PROGMEM = "Teplot. kalibrace";
const char MSG_CALIBRATION_PINDA_MENU_IT[] PROGMEM = "Taratura temp.";
const char MSG_CALIBRATION_PINDA_MENU_ES[] PROGMEM = "Calibracion temp.";
@ -808,6 +808,16 @@ const char * const MSG_DWELL_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_DWELL_DE
};
const char MSG_ENDSTOPPULLUP_FIL_RUNOUT_OFF_EN[] PROGMEM = "FR Pullup [OFF]";
const char * const MSG_ENDSTOPPULLUP_FIL_RUNOUT_OFF_LANG_TABLE[1] PROGMEM = {
MSG_ENDSTOPPULLUP_FIL_RUNOUT_OFF_EN
};
const char MSG_ENDSTOPPULLUP_FIL_RUNOUT_ON_EN[] PROGMEM = "FR Pullup [ON]";
const char * const MSG_ENDSTOPPULLUP_FIL_RUNOUT_ON_LANG_TABLE[1] PROGMEM = {
MSG_ENDSTOPPULLUP_FIL_RUNOUT_ON_EN
};
const char MSG_ENDSTOPS_HIT_EN[] PROGMEM = "endstops hit: ";
const char * const MSG_ENDSTOPS_HIT_LANG_TABLE[1] PROGMEM = {
MSG_ENDSTOPS_HIT_EN
@ -1092,6 +1102,21 @@ const char * const MSG_FILAMENT_LOADING_T3_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_FILAMENT_LOADING_T3_DE
};
const char MSG_FILAMENT_RUNOUT_SUPPORT_EN[] PROGMEM = "Fil.Runout S";
const char * const MSG_FILAMENT_RUNOUT_SUPPORT_LANG_TABLE[1] PROGMEM = {
MSG_FILAMENT_RUNOUT_SUPPORT_EN
};
const char MSG_FILAMENT_RUNOUT_SUPPORT_HIT_EN[] PROGMEM = "Filament detected";
const char * const MSG_FILAMENT_RUNOUT_SUPPORT_HIT_LANG_TABLE[1] PROGMEM = {
MSG_FILAMENT_RUNOUT_SUPPORT_HIT_EN
};
const char MSG_FILAMENT_RUNOUT_SUPPORT_OPEN_EN[] PROGMEM = "Filament runout";
const char * const MSG_FILAMENT_RUNOUT_SUPPORT_OPEN_LANG_TABLE[1] PROGMEM = {
MSG_FILAMENT_RUNOUT_SUPPORT_OPEN_EN
};
const char MSG_FILE_PRINTED_EN[] PROGMEM = "Done printing file";
const char * const MSG_FILE_PRINTED_LANG_TABLE[1] PROGMEM = {
MSG_FILE_PRINTED_EN
@ -1117,6 +1142,31 @@ const char * const MSG_FIL_ADJUSTING_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_FIL_ADJUSTING_DE
};
const char MSG_FIL_RUNOUT_ACTIVE_OFF_EN[] PROGMEM = "Sens Runout [OFF]";
const char * const MSG_FIL_RUNOUT_ACTIVE_OFF_LANG_TABLE[1] PROGMEM = {
MSG_FIL_RUNOUT_ACTIVE_OFF_EN
};
const char MSG_FIL_RUNOUT_ACTIVE_ON_EN[] PROGMEM = "Sens Runout [ON]";
const char * const MSG_FIL_RUNOUT_ACTIVE_ON_LANG_TABLE[1] PROGMEM = {
MSG_FIL_RUNOUT_ACTIVE_ON_EN
};
const char MSG_FIL_RUNOUT_INVERTING_OFF_EN[] PROGMEM = "FR_Sens[S to VCC]";
const char * const MSG_FIL_RUNOUT_INVERTING_OFF_LANG_TABLE[1] PROGMEM = {
MSG_FIL_RUNOUT_INVERTING_OFF_EN
};
const char MSG_FIL_RUNOUT_INVERTING_ON_EN[] PROGMEM = "FR_Sens[S to GND]";
const char * const MSG_FIL_RUNOUT_INVERTING_ON_LANG_TABLE[1] PROGMEM = {
MSG_FIL_RUNOUT_INVERTING_ON_EN
};
const char MSG_FIL_RUNOUT_SETTINGS_EN[] PROGMEM = "Filament Runout S";
const char * const MSG_FIL_RUNOUT_SETTINGS_LANG_TABLE[1] PROGMEM = {
MSG_FIL_RUNOUT_SETTINGS_EN
};
const char MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_EN[] PROGMEM = "Iteration ";
const char MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_CZ[] PROGMEM = "Iterace ";
const char MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_IT[] PROGMEM = "Reiterazione ";
@ -2032,7 +2082,7 @@ const char * const MSG_PID_EXTRUDER_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_PID_EXTRUDER_DE
};
const char MSG_PID_FINISHED_EN[] PROGMEM = "PID cal. finished";
const char MSG_PID_FINISHED_EN[] PROGMEM = "PID cal. finished ";
const char MSG_PID_FINISHED_CZ[] PROGMEM = "PID kal. ukoncena";
const char MSG_PID_FINISHED_IT[] PROGMEM = "Cal. PID completa";
const char MSG_PID_FINISHED_ES[] PROGMEM = "Cal. PID terminada";
@ -2062,7 +2112,7 @@ const char * const MSG_PID_RUNNING_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_PID_RUNNING_DE
};
const char MSG_PINDA_NOT_CALIBRATED_EN[] PROGMEM = "Temperature calibration has not been run yet";
const char MSG_PINDA_NOT_CALIBRATED_EN[] PROGMEM = "PINDA temperature calibration has not been run yet";
const char MSG_PINDA_NOT_CALIBRATED_CZ[] PROGMEM = "Tiskarna nebyla teplotne zkalibrovana";
const char MSG_PINDA_NOT_CALIBRATED_IT[] PROGMEM = "Taratura della temperatura non ancora eseguita";
const char MSG_PINDA_NOT_CALIBRATED_ES[] PROGMEM = "La temperatura de calibracion no ha sido ajustada";
@ -3170,7 +3220,7 @@ const char * const MSG_TEMPERATURE_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_TEMPERATURE_DE
};
const char MSG_TEMP_CALIBRATION_EN[] PROGMEM = "Temp. cal. ";
const char MSG_TEMP_CALIBRATION_EN[] PROGMEM = "PINDA Temp.cal. ";
const char MSG_TEMP_CALIBRATION_CZ[] PROGMEM = "Tepl. kal. ";
const char MSG_TEMP_CALIBRATION_IT[] PROGMEM = "Cal. temp. ";
const char MSG_TEMP_CALIBRATION_ES[] PROGMEM = "Cal. temp. ";
@ -3185,7 +3235,7 @@ const char * const MSG_TEMP_CALIBRATION_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_TEMP_CALIBRATION_DE
};
const char MSG_TEMP_CALIBRATION_DONE_EN[] PROGMEM = "Temperature calibration is finished. Click to continue.";
const char MSG_TEMP_CALIBRATION_DONE_EN[] PROGMEM = "PINDA temperature calibration is finished. Click to continue.";
const char MSG_TEMP_CALIBRATION_DONE_CZ[] PROGMEM = "Teplotni kalibrace dokoncena. Pokracujte stiskem tlacitka.";
const char MSG_TEMP_CALIBRATION_DONE_IT[] PROGMEM = "Taratura temperatura terminata. Fare click per continuare.";
const char MSG_TEMP_CALIBRATION_DONE_ES[] PROGMEM = "Calibracon temperatura terminada. Presionar para continuar.";
@ -3200,7 +3250,7 @@ const char * const MSG_TEMP_CALIBRATION_DONE_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_TEMP_CALIBRATION_DONE_DE
};
const char MSG_TEMP_CALIBRATION_OFF_EN[] PROGMEM = "Temp. cal. [OFF]";
const char MSG_TEMP_CALIBRATION_OFF_EN[] PROGMEM = "PINDA T.cal.[OFF]";
const char MSG_TEMP_CALIBRATION_OFF_CZ[] PROGMEM = "Tepl. kal. [OFF]";
const char MSG_TEMP_CALIBRATION_OFF_IT[] PROGMEM = "Cal. temp. [OFF]";
const char MSG_TEMP_CALIBRATION_OFF_ES[] PROGMEM = "Cal. temp. [OFF]";
@ -3215,7 +3265,7 @@ const char * const MSG_TEMP_CALIBRATION_OFF_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_TEMP_CALIBRATION_OFF_DE
};
const char MSG_TEMP_CALIBRATION_ON_EN[] PROGMEM = "Temp. cal. [ON]";
const char MSG_TEMP_CALIBRATION_ON_EN[] PROGMEM = "PINDA T.cal. [ON]";
const char MSG_TEMP_CALIBRATION_ON_CZ[] PROGMEM = "Tepl. kal. [ON]";
const char MSG_TEMP_CALIBRATION_ON_IT[] PROGMEM = "Cal. temp. [ON]";
const char MSG_TEMP_CALIBRATION_ON_ES[] PROGMEM = "Cal. temp. [ON]";

View File

@ -156,6 +156,10 @@ extern const char* const MSG_DISABLE_STEPPERS_LANG_TABLE[LANG_NUM];
#define MSG_DISABLE_STEPPERS LANG_TABLE_SELECT(MSG_DISABLE_STEPPERS_LANG_TABLE)
extern const char* const MSG_DWELL_LANG_TABLE[LANG_NUM];
#define MSG_DWELL LANG_TABLE_SELECT(MSG_DWELL_LANG_TABLE)
extern const char* const MSG_ENDSTOPPULLUP_FIL_RUNOUT_OFF_LANG_TABLE[1];
#define MSG_ENDSTOPPULLUP_FIL_RUNOUT_OFF LANG_TABLE_SELECT_EXPLICIT(MSG_ENDSTOPPULLUP_FIL_RUNOUT_OFF_LANG_TABLE, 0)
extern const char* const MSG_ENDSTOPPULLUP_FIL_RUNOUT_ON_LANG_TABLE[1];
#define MSG_ENDSTOPPULLUP_FIL_RUNOUT_ON LANG_TABLE_SELECT_EXPLICIT(MSG_ENDSTOPPULLUP_FIL_RUNOUT_ON_LANG_TABLE, 0)
extern const char* const MSG_ENDSTOPS_HIT_LANG_TABLE[1];
#define MSG_ENDSTOPS_HIT LANG_TABLE_SELECT_EXPLICIT(MSG_ENDSTOPS_HIT_LANG_TABLE, 0)
extern const char* const MSG_ENDSTOP_HIT_LANG_TABLE[1];
@ -218,12 +222,28 @@ extern const char* const MSG_FILAMENT_LOADING_T2_LANG_TABLE[LANG_NUM];
#define MSG_FILAMENT_LOADING_T2 LANG_TABLE_SELECT(MSG_FILAMENT_LOADING_T2_LANG_TABLE)
extern const char* const MSG_FILAMENT_LOADING_T3_LANG_TABLE[LANG_NUM];
#define MSG_FILAMENT_LOADING_T3 LANG_TABLE_SELECT(MSG_FILAMENT_LOADING_T3_LANG_TABLE)
extern const char* const MSG_FILAMENT_RUNOUT_SUPPORT_LANG_TABLE[1];
#define MSG_FILAMENT_RUNOUT_SUPPORT LANG_TABLE_SELECT_EXPLICIT(MSG_FILAMENT_RUNOUT_SUPPORT_LANG_TABLE, 0)
extern const char* const MSG_FILAMENT_RUNOUT_SUPPORT_HIT_LANG_TABLE[1];
#define MSG_FILAMENT_RUNOUT_SUPPORT_HIT LANG_TABLE_SELECT_EXPLICIT(MSG_FILAMENT_RUNOUT_SUPPORT_HIT_LANG_TABLE, 0)
extern const char* const MSG_FILAMENT_RUNOUT_SUPPORT_OPEN_LANG_TABLE[1];
#define MSG_FILAMENT_RUNOUT_SUPPORT_OPEN LANG_TABLE_SELECT_EXPLICIT(MSG_FILAMENT_RUNOUT_SUPPORT_OPEN_LANG_TABLE, 0)
extern const char* const MSG_FILE_PRINTED_LANG_TABLE[1];
#define MSG_FILE_PRINTED LANG_TABLE_SELECT_EXPLICIT(MSG_FILE_PRINTED_LANG_TABLE, 0)
extern const char* const MSG_FILE_SAVED_LANG_TABLE[1];
#define MSG_FILE_SAVED LANG_TABLE_SELECT_EXPLICIT(MSG_FILE_SAVED_LANG_TABLE, 0)
extern const char* const MSG_FIL_ADJUSTING_LANG_TABLE[LANG_NUM];
#define MSG_FIL_ADJUSTING LANG_TABLE_SELECT(MSG_FIL_ADJUSTING_LANG_TABLE)
extern const char* const MSG_FIL_RUNOUT_ACTIVE_OFF_LANG_TABLE[1];
#define MSG_FIL_RUNOUT_ACTIVE_OFF LANG_TABLE_SELECT_EXPLICIT(MSG_FIL_RUNOUT_ACTIVE_OFF_LANG_TABLE, 0)
extern const char* const MSG_FIL_RUNOUT_ACTIVE_ON_LANG_TABLE[1];
#define MSG_FIL_RUNOUT_ACTIVE_ON LANG_TABLE_SELECT_EXPLICIT(MSG_FIL_RUNOUT_ACTIVE_ON_LANG_TABLE, 0)
extern const char* const MSG_FIL_RUNOUT_INVERTING_OFF_LANG_TABLE[1];
#define MSG_FIL_RUNOUT_INVERTING_OFF LANG_TABLE_SELECT_EXPLICIT(MSG_FIL_RUNOUT_INVERTING_OFF_LANG_TABLE, 0)
extern const char* const MSG_FIL_RUNOUT_INVERTING_ON_LANG_TABLE[1];
#define MSG_FIL_RUNOUT_INVERTING_ON LANG_TABLE_SELECT_EXPLICIT(MSG_FIL_RUNOUT_INVERTING_ON_LANG_TABLE, 0)
extern const char* const MSG_FIL_RUNOUT_SETTINGS_LANG_TABLE[1];
#define MSG_FIL_RUNOUT_SETTINGS LANG_TABLE_SELECT_EXPLICIT(MSG_FIL_RUNOUT_SETTINGS_LANG_TABLE, 0)
extern const char* const MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_LANG_TABLE[LANG_NUM];
#define MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION LANG_TABLE_SELECT(MSG_FIND_BED_OFFSET_AND_SKEW_ITERATION_LANG_TABLE)
extern const char* const MSG_FIND_BED_OFFSET_AND_SKEW_LINE1_LANG_TABLE[LANG_NUM];

View File

@ -7,10 +7,10 @@
*/
#define(length=20) WELCOME_MSG CUSTOM_MENDEL_NAME " ready."
#define MSG_SD_INSERTED "Card inserted"
#define(length=20) MSG_SD_INSERTED "Card inserted"
#define MSG_SD_REMOVED "Card removed"
#define MSG_MAIN "Main"
#define MSG_DISABLE_STEPPERS "Disable steppers"
#define(length=20) MSG_DISABLE_STEPPERS "Disable steppers"
#define MSG_AUTO_HOME "Auto home"
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Set origin"
@ -27,7 +27,7 @@
#define MSG_NOZZLE1 "Nozzle2"
#define MSG_NOZZLE2 "Nozzle3"
#define MSG_BED "Bed"
#define(length=14) MSG_FAN_SPEED "Fan speed"
#define(length=20) MSG_FAN_SPEED "Fan speed"
#define MSG_FLOW "Flow"
#define MSG_FLOW0 "Flow 0"
#define MSG_FLOW1 "Flow 1"
@ -51,12 +51,12 @@
#define MSG_STOP_PRINT "Stop print"
#define MSG_CARD_MENU "Print from SD"
#define MSG_NO_CARD "No SD card"
#define MSG_DWELL "Sleep..."
#define MSG_USERWAIT "Wait for user..."
#define MSG_RESUMING "Resuming print"
#define(length=20) MSG_DWELL "Sleep..."
#define(length=20) MSG_USERWAIT "Wait for user..."
#define(length=20) MSG_RESUMING "Resuming print"
#define(length=20) MSG_PRINT_ABORTED "Print aborted"
#define MSG_NO_MOVE "No move."
#define MSG_KILLED "KILLED. "
#define(length=20) MSG_KILLED "KILLED. "
#define MSG_STOPPED "STOPPED. "
#define MSG_FILAMENTCHANGE "Change filament"
#define MSG_INIT_SDCARD "Init. SD card"
@ -64,23 +64,23 @@
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Live adjust Z"
#define MSG_ADJUSTZ "Auto adjust Z?"
#define MSG_PICK_Z "Pick print"
#define(length=20) MSG_ADJUSTZ "Auto adjust Z?"
#define(length=20) MSG_PICK_Z "Pick print"
#define MSG_SETTINGS "Settings"
#define MSG_PREHEAT "Preheat"
#define(length=17) MSG_UNLOAD_FILAMENT "Unload filament"
#define(length=17) MSG_LOAD_FILAMENT "Load filament"
#define(length=17) MSG_LOAD_FILAMENT_1 "Load filament 1"
#define(length=17) MSG_LOAD_FILAMENT_2 "Load filament 2"
#define(length=17) MSG_LOAD_FILAMENT_3 "Load filament 3"
#define(length=17) MSG_LOAD_FILAMENT_4 "Load filament 4"
#define(length=17) MSG_UNLOAD_FILAMENT_1 "Unload filament 1"
#define(length=17) MSG_UNLOAD_FILAMENT_2 "Unload filament 2"
#define(length=17) MSG_UNLOAD_FILAMENT_3 "Unload filament 3"
#define(length=17) MSG_UNLOAD_FILAMENT_4 "Unload filament 4"
#define MSG_UNLOAD_ALL "Unload all"
#define MSG_LOAD_ALL "Load all"
#define(length=20) MSG_UNLOAD_FILAMENT "Unload filament"
#define(length=20) MSG_LOAD_FILAMENT "Load filament"
#define(length=20) MSG_LOAD_FILAMENT_1 "Load filament 1"
#define(length=20) MSG_LOAD_FILAMENT_2 "Load filament 2"
#define(length=20) MSG_LOAD_FILAMENT_3 "Load filament 3"
#define(length=20) MSG_LOAD_FILAMENT_4 "Load filament 4"
#define(length=20) MSG_UNLOAD_FILAMENT_1 "Unload filament 1"
#define(length=20) MSG_UNLOAD_FILAMENT_2 "Unload filament 2"
#define(length=20) MSG_UNLOAD_FILAMENT_3 "Unload filament 3"
#define(length=20) MSG_UNLOAD_FILAMENT_4 "Unload filament 4"
#define(length=20) MSG_UNLOAD_ALL "Unload all"
#define(length=20) MSG_LOAD_ALL "Load all"
#define MSG_RECTRACT "Rectract"
@ -91,11 +91,11 @@
#define MSG_YES "Yes"
#define MSG_NO "No"
#define(length=19) MSG_NOT_LOADED "Filament not loaded"
#define MSG_NOT_COLOR "Color not clear"
#define(length=20) MSG_NOT_COLOR "Color not clear"
#define(length=20) MSG_LOADING_FILAMENT "Loading filament"
#define(length=20) MSG_PLEASE_WAIT "Please wait"
#define MSG_LOADING_COLOR "Loading color"
#define MSG_CHANGE_SUCCESS "Change success!"
#define(length=20) MSG_CHANGE_SUCCESS "Change success!"
#define(length=20) MSG_PRESS "and press the knob"
#define(length=20) MSG_INSERT_FILAMENT "Insert filament"
#define(length=20) MSG_CHANGING_FILAMENT "Changing filament!"
@ -104,7 +104,7 @@
#define MSG_SILENT_MODE_ON "Mode [silent]"
#define MSG_SILENT_MODE_OFF "Mode [high power]"
#define(length=20) MSG_REBOOT "Reboot the printer"
#define(length=20) MSG_TAKE_EFFECT " for take effect"
#define(length=20, lines=2) MSG_TAKE_EFFECT " for take effect"
#define MSG_Enqueing "enqueing \""
#define MSG_POWERUP "PowerUp"
@ -134,6 +134,11 @@
#define MSG_M119_REPORT "Reporting endstop status"
#define MSG_ENDSTOP_HIT "TRIGGERED"
#define MSG_ENDSTOP_OPEN "open"
// FILAMENT_RUNOUT_SUPPORT
#define MSG_FILAMENT_RUNOUT_SUPPORT "Fil.Runout S"
#define MSG_FILAMENT_RUNOUT_SUPPORT_HIT "Filament detected"
#define MSG_FILAMENT_RUNOUT_SUPPORT_OPEN "Filament runout"
// end FILAMENT_RUNOUT_SUPPORT
#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir"
#define MSG_SD_INIT_FAIL "SD init fail"
@ -164,12 +169,12 @@
#define MSG_PRUSA3D_FORUM "forum.prusa3d.com"
#define MSG_PRUSA3D_HOWTO "howto.prusa3d.com"
#define MSG_SELFTEST_ERROR "Selftest error !"
#define(length=20) MSG_SELFTEST_ERROR "Selftest error !"
#define MSG_SELFTEST_PLEASECHECK "Please check :"
#define MSG_SELFTEST_NOTCONNECTED "Not connected"
#define(length=20) MSG_SELFTEST_NOTCONNECTED "Not connected"
#define MSG_SELFTEST_HEATERTHERMISTOR "Heater/Thermistor"
#define MSG_SELFTEST_BEDHEATER "Bed / Heater"
#define MSG_SELFTEST_WIRINGERROR "Wiring error"
#define(length=20) MSG_SELFTEST_WIRINGERROR "Wiring error"
#define MSG_SELFTEST_ENDSTOPS "Endstops"
#define MSG_SELFTEST_MOTOR "Motor"
#define MSG_SELFTEST_ENDSTOP "Endstop"
@ -181,7 +186,7 @@
#define(length=20) MSG_SELFTEST_COOLING_FAN "Front print fan?";
#define(length=20) MSG_SELFTEST_EXTRUDER_FAN "Left hotend fan?";
#define MSG_SELFTEST_FAN_YES "Spinning";
#define MSG_SELFTEST_FAN_NO "Not spinning";
#define(length=20) MSG_SELFTEST_FAN_NO "Not spinning";
#define(length=20) MSG_STATS_TOTALFILAMENT "Total filament :"
#define(length=20) MSG_STATS_TOTALPRINTTIME "Total print time :"
@ -203,7 +208,7 @@
#define MSG_HOMEYZ_PROGRESS "Calibrating Z"
#define MSG_HOMEYZ_DONE "Calibration done"
#define(length=17,lines=1) MSG_SHOW_END_STOPS "Show end stops"
#define(length=20,lines=1) MSG_SHOW_END_STOPS "Show end stops"
#define MSG_CALIBRATE_BED "Calibrate XYZ"
#define MSG_CALIBRATE_BED_RESET "Reset XYZ calibr."
@ -233,9 +238,9 @@
#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR "XYZ calibration compromised. Right front calibration point not reachable."
#define(length=20,lines=8) MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR "XYZ calibration compromised. Front calibration points not reachable."
#define(length=20,lines=4) MSG_BED_LEVELING_FAILED_POINT_LOW "Bed leveling failed. Sensor didnt trigger. Debris on nozzle? Waiting for reset."
#define(length=20,lines=4) MSG_BED_LEVELING_FAILED_POINT_HIGH "Bed leveling failed. Sensor triggered too high. Waiting for reset."
#define(length=20,lines=4) MSG_BED_LEVELING_FAILED_PROBE_DISCONNECTED "Bed leveling failed. Sensor disconnected or cable broken. Waiting for reset."
#define(length=20,lines=6) MSG_BED_LEVELING_FAILED_POINT_LOW "Bed leveling failed. Sensor didnt trigger. Debris on nozzle? Waiting for reset."
#define(length=20,lines=6) MSG_BED_LEVELING_FAILED_POINT_HIGH "Bed leveling failed. Sensor triggered too high. Waiting for reset."
#define(length=20,lines=6) MSG_BED_LEVELING_FAILED_PROBE_DISCONNECTED "Bed leveling failed. Sensor disconnected or cable broken. Waiting for reset."
#define(length=20,lines=2) MSG_NEW_FIRMWARE_AVAILABLE "New firmware version available:"
#define(length=20) MSG_NEW_FIRMWARE_PLEASE_UPGRADE "Please upgrade."
@ -261,37 +266,37 @@
#define(length=20, lines=8) MSG_CLEAN_NOZZLE_E "E calibration finished. Please clean the nozzle. Click when done."
#define(length=20, lines=3) MSG_WAITING_TEMP "Waiting for nozzle and bed cooling"
#define(length=20, lines=2) MSG_FILAMENT_CLEAN "Is color clear?"
#define(lenght=18, lines=1) MSG_UNLOADING_FILAMENT "Unloading filament"
#define(length=20, lines=8) MSG_PAPER "Place a sheet of paper under the nozzle during the calibration of first 4 points. If the nozzle catches the paper, power off the printer immediately."
#define(length=20) MSG_UNLOADING_FILAMENT "Unloading filament"
#define(length=20, lines=10) MSG_PAPER "Place a sheet of paper under the nozzle during the calibration of first 4 points. If the nozzle catches the paper, power off the printer immediately."
#define MSG_BED_CORRECTION_MENU "Bed level correct"
#define(length=20) MSG_BED_CORRECTION_MENU "Bed level correct"
#define(length=14,lines=1) MSG_BED_CORRECTION_LEFT "Left side [um]"
#define(length=14,lines=1) MSG_BED_CORRECTION_RIGHT "Right side[um]"
#define(length=14,lines=1) MSG_BED_CORRECTION_FRONT "Front side[um]"
#define(length=14,lines=1) MSG_BED_CORRECTION_REAR "Rear side [um]"
#define MSG_BED_CORRECTION_RESET "Reset"
#define(length=20) MSG_BED_CORRECTION_RESET "Reset"
#define MSG_MESH_BED_LEVELING "Mesh Bed Leveling"
#define MSG_MENU_CALIBRATION "Calibration"
#define(length=19, lines=1) MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF "SD card [normal]"
#define(length=19, lines=1) MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON "SD card [FlshAir]"
#define(length=20, lines=1) MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF "SD card [normal]"
#define(length=20, lines=1) MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON "SD card [FlshAir]"
#define(length=20, lines=1) MSG_PRINTER_DISCONNECTED "Printer disconnected"
#define(length=20, lines=1) MSG_FINISHING_MOVEMENTS "Finishing movements"
#define(length=20, lines=1) MSG_PRINT_PAUSED "Print paused"
#define(length=20, lines=1) MSG_RESUMING_PRINT "Resuming print"
#define(length=17, lines=1) MSG_PID_EXTRUDER "PID calibration"
#define(length=19, lines=1) MSG_SET_TEMPERATURE "Set temperature:"
#define(length=20, lines=1) MSG_PID_FINISHED "PID cal. finished"
#define(length=20, lines=1) MSG_PID_EXTRUDER "PID calibration"
#define(length=20, lines=1) MSG_SET_TEMPERATURE "Set temperature:"
#define(length=20, lines=1) MSG_PID_FINISHED "PID cal. finished "
#define(length=20, lines=1) MSG_PID_RUNNING "PID cal. "
#define(length=17, lines=1) MSG_CALIBRATE_PINDA "Calibrate"
#define(length=17, lines=1) MSG_CALIBRATION_PINDA_MENU "Temp. calibration"
#define(length=20, lines=4) MSG_PINDA_NOT_CALIBRATED "Temperature calibration has not been run yet"
#define(length=20, lines=1) MSG_CALIBRATE_PINDA "PINDA Temp. cal."
#define(length=20, lines=1) MSG_CALIBRATION_PINDA_MENU "PINDA Temp. cal."
#define(length=20, lines=4) MSG_PINDA_NOT_CALIBRATED "PINDA temperature calibration has not been run yet"
#define(length=20, lines=1) MSG_PINDA_PREHEAT "PINDA Heating"
#define(length=20, lines=1) MSG_TEMP_CALIBRATION "Temp. cal. "
#define(length=20, lines=4) MSG_TEMP_CALIBRATION_DONE "Temperature calibration is finished. Click to continue."
#define(length=20, lines=1) MSG_TEMP_CALIBRATION_ON "Temp. cal. [ON]"
#define(length=20, lines=1) MSG_TEMP_CALIBRATION_OFF "Temp. cal. [OFF]"
#define(length=20, lines=1) MSG_TEMP_CALIBRATION "PINDA Temp.cal. "
#define(length=20, lines=5) MSG_TEMP_CALIBRATION_DONE "PINDA temperature calibration is finished. Click to continue."
#define(length=20, lines=1) MSG_TEMP_CALIBRATION_ON "PINDA T.cal. [ON]"
#define(length=20, lines=1) MSG_TEMP_CALIBRATION_OFF "PINDA T.cal.[OFF]"
#define(length=20, lines=1) MSG_PREPARE_FILAMENT "Prepare new filament"
#define(length=19, lines=1) MSG_ALL "All"
#define(length=19, lines=1) MSG_USED "Used during print"
@ -315,4 +320,11 @@
#define(length=17, lines=1) MSG_SORT_TIME "Sort: [Time]"
#define(length=17, lines=1) MSG_SORT_ALPHA "Sort: [Alphabet]"
#define(length=17, lines=1) MSG_SORT_NONE "Sort: [None]"
#define(length=20, lines=1) MSG_SORTING "Sorting files"
#define(length=20, lines=1) MSG_SORTING "Sorting files"
#define(length=20) MSG_FIL_RUNOUT_SETTINGS "Filament Runout S"
#define(length=20) MSG_FIL_RUNOUT_ACTIVE_ON "Sens Runout [ON]"
#define(length=20) MSG_FIL_RUNOUT_ACTIVE_OFF "Sens Runout [OFF]"
#define(length=20) MSG_ENDSTOPPULLUP_FIL_RUNOUT_ON "FR Pullup [ON]"
#define(length=20) MSG_ENDSTOPPULLUP_FIL_RUNOUT_OFF "FR Pullup [OFF]"
#define(length=20) MSG_FIL_RUNOUT_INVERTING_OFF "FR_Sens[S to VCC]"
#define(length=20) MSG_FIL_RUNOUT_INVERTING_ON "FR_Sens[S to GND]"

View File

@ -32,9 +32,9 @@
#error Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu.
#endif
#define FR_SENS 21
// FILAMENT_RUNOUT_SUPPORT
#define FIL_RUNOUT_PIN 24
// end FILAMENT_RUNOUT_SUPPORT
#define X_STEP_PIN 37
#define X_DIR_PIN 48
@ -46,7 +46,7 @@
#define Y_STEP_PIN 36
#define Y_DIR_PIN 49
#define Y_MIN_PIN 11
#define Y_MAX_PIN 24
#define Y_MAX_PIN -1
#define Y_ENABLE_PIN 28
#define Y_MS1_PIN 69
#define Y_MS2_PIN 39
@ -223,7 +223,9 @@
#error Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu.
#endif
#define FR_SENS 21
// FILAMENT_RUNOUT_SUPPORT
#define FIL_RUNOUT_PIN 24
// end FILAMENT_RUNOUT_SUPPORT
#ifdef SNMM
@ -244,7 +246,7 @@
#define Y_STEP_PIN 36
#define Y_DIR_PIN 49
#define Y_MIN_PIN 11
#define Y_MAX_PIN 24
#define Y_MAX_PIN -1
#define Y_ENABLE_PIN 28
#define Y_MS1_PIN 69
#define Y_MS2_PIN 39

View File

@ -96,6 +96,14 @@ int8_t SDscrool = 0;
int8_t SilentModeMenu = 0;
// FILAMENT_RUNOUT_SENSOR
#ifdef FILAMENT_RUNOUT_SENSOR
static void lcd_fil_runout_settings_menu();
static void lcd_fil_runout_active_set();
static void lcd_fil_runout_inverting_set();
static void lcd_endstoppullup_fil_runout_set();
#endif
// end FILAMENT_RUNOUT_SENSOR
#ifdef SNMM
uint8_t snmm_extruder = 0;
#endif
@ -2007,13 +2015,19 @@ void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, ui
static void lcd_show_end_stops() {
lcd.setCursor(0, 0);
lcd_printPGM((PSTR("End stops diag")));
lcd_printPGM((PSTR("End stops/sens diag")));
lcd.setCursor(0, 1);
lcd_printPGM((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1) ? (PSTR("X1")) : (PSTR("X0")));
lcd.setCursor(0, 2);
lcd_printPGM((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1) ? (PSTR("Y1")) : (PSTR("Y0")));
lcd.setCursor(0, 3);
lcd_printPGM((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1) ? (PSTR("Z1")) : (PSTR("Z0")));
// FILAMENT_RUNOUT_SENSOR
if (fil_runout_active) {
lcd.setCursor(4, 1);
lcd_printPGM((READ(FIL_RUNOUT_PIN) ^ FIL_RUNOUT_INVERTING == 1) ? (PSTR("FR_S1")) : (PSTR("FR_S0")));
}
// end FILAMENT_RUNOUT_SENSOR
}
static void menu_show_end_stops() {
@ -2610,6 +2624,59 @@ void lcd_toshiba_flash_air_compatibility_toggle()
eeprom_update_byte((uint8_t*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY, card.ToshibaFlashAir_isEnabled());
}
// FR_FILAMENT_RUNOUT_SENSOR
void lcd_fil_runout_settings_menu()
{
START_MENU();
MENU_ITEM(back, MSG_SETTINGS, lcd_settings_menu);
// debug info
//lcd.setCursor(1, 5);
//lcd_printPGM((fil_runout_active == 1) ? (PSTR("S_ON ")) : (PSTR("S_OFF")));
//lcd.setCursor(7, 5);
//lcd_printPGM((FIL_RUNOUT_INVERTING == 0) ? (PSTR("I_ON ")) : (PSTR("I_OFF")));
//lcd.setCursor(13, 5);
//lcd_printPGM((ENDSTOPPULLUP_FIL_RUNOUT == 0) ? (PSTR("P_ON ")) : (PSTR("P_OFF")));
// end debug info
if (fil_runout_active == false) {
MENU_ITEM(submenu, MSG_FIL_RUNOUT_ACTIVE_OFF, lcd_fil_runout_active_set);
} else {
MENU_ITEM(submenu, MSG_FIL_RUNOUT_ACTIVE_ON, lcd_fil_runout_active_set);
if (FIL_RUNOUT_INVERTING == false) {
MENU_ITEM(function, MSG_FIL_RUNOUT_INVERTING_OFF, lcd_fil_runout_inverting_set);
} else {
MENU_ITEM(function, MSG_FIL_RUNOUT_INVERTING_ON, lcd_fil_runout_inverting_set);
}
if (ENDSTOPPULLUP_FIL_RUNOUT == false ) {
MENU_ITEM(function, MSG_ENDSTOPPULLUP_FIL_RUNOUT_OFF, lcd_endstoppullup_fil_runout_set);
} else {
MENU_ITEM(function, MSG_ENDSTOPPULLUP_FIL_RUNOUT_ON, lcd_endstoppullup_fil_runout_set);
}
}
END_MENU();
}
void lcd_fil_runout_active_set() {
fil_runout_active = !fil_runout_active;
eeprom_update_byte((unsigned char *)EEPROM_FIL_RUNOUT_ACTIVE, fil_runout_active);
digipot_init();
lcd_goto_menu(lcd_fil_runout_settings_menu, 1);
}
void lcd_fil_runout_inverting_set() {
FIL_RUNOUT_INVERTING = !FIL_RUNOUT_INVERTING;
eeprom_update_byte((unsigned char *)EEPROM_FIL_RUNOUT_INVERTING, FIL_RUNOUT_INVERTING);
digipot_init();
lcd_goto_menu(lcd_fil_runout_settings_menu, 2);
}
void lcd_endstoppullup_fil_runout_set() {
ENDSTOPPULLUP_FIL_RUNOUT = !ENDSTOPPULLUP_FIL_RUNOUT;
eeprom_update_byte((unsigned char *)EEPROM_ENDSTOPPULLUP_FIL_RUNOUT, ENDSTOPPULLUP_FIL_RUNOUT);
digipot_init();
lcd_goto_menu(lcd_fil_runout_settings_menu, 3);
}
// end FILAMENT_RUNOUT_SENSOR
static void lcd_settings_menu()
{
EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu));
@ -2650,8 +2717,12 @@ static void lcd_settings_menu()
MENU_ITEM(submenu, PSTR("Farm number"), lcd_farm_no);
MENU_ITEM(function, PSTR("Disable farm mode"), lcd_disable_farm_mode);
}
END_MENU();
// FILAMENT_RUNOUT_SENSOR
#ifdef FIL_RUNOUT_PIN
MENU_ITEM(submenu, MSG_FIL_RUNOUT_SETTINGS, lcd_fil_runout_settings_menu);
#endif
// end FILAMENT_RUNOUT_SENSOR
END_MENU();
}
static void lcd_calibration_menu()