Merge pull request #323 from PavelSindler/selftest_fans_swapped

selftest updates
This commit is contained in:
PavelSindler 2017-12-14 19:38:56 +01:00 committed by GitHub
commit 72a4161fea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 64 additions and 15 deletions

View file

@ -1655,6 +1655,13 @@ const char * const MSG_SELFTEST_FAN_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_SELFTEST_FAN_CZ MSG_SELFTEST_FAN_CZ
}; };
const char MSG_SELFTEST_FANS_EN[] PROGMEM = "Front/left fans";
const char MSG_SELFTEST_FANS_CZ[] PROGMEM = "Predni/levy vent.";
const char * const MSG_SELFTEST_FANS_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_SELFTEST_FANS_EN,
MSG_SELFTEST_FANS_CZ
};
const char MSG_SELFTEST_FAN_NO_EN[] PROGMEM = "Not spinning"; const char MSG_SELFTEST_FAN_NO_EN[] PROGMEM = "Not spinning";
const char MSG_SELFTEST_FAN_NO_CZ[] PROGMEM = "Netoci se"; const char MSG_SELFTEST_FAN_NO_CZ[] PROGMEM = "Netoci se";
const char * const MSG_SELFTEST_FAN_NO_LANG_TABLE[LANG_NUM] PROGMEM = { const char * const MSG_SELFTEST_FAN_NO_LANG_TABLE[LANG_NUM] PROGMEM = {
@ -1703,6 +1710,13 @@ const char * const MSG_SELFTEST_START_LANG_TABLE[1] PROGMEM = {
MSG_SELFTEST_START_EN MSG_SELFTEST_START_EN
}; };
const char MSG_SELFTEST_SWAPPED_EN[] PROGMEM = "Swapped";
const char MSG_SELFTEST_SWAPPED_CZ[] PROGMEM = "Prohozene";
const char * const MSG_SELFTEST_SWAPPED_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_SELFTEST_SWAPPED_EN,
MSG_SELFTEST_SWAPPED_CZ
};
const char MSG_SELFTEST_WIRINGERROR_EN[] PROGMEM = "Wiring error"; const char MSG_SELFTEST_WIRINGERROR_EN[] PROGMEM = "Wiring error";
const char MSG_SELFTEST_WIRINGERROR_CZ[] PROGMEM = "Chyba zapojeni"; const char MSG_SELFTEST_WIRINGERROR_CZ[] PROGMEM = "Chyba zapojeni";
const char * const MSG_SELFTEST_WIRINGERROR_LANG_TABLE[LANG_NUM] PROGMEM = { const char * const MSG_SELFTEST_WIRINGERROR_LANG_TABLE[LANG_NUM] PROGMEM = {

View file

@ -560,6 +560,8 @@ extern const char* const MSG_SELFTEST_FAILED_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_FAILED LANG_TABLE_SELECT(MSG_SELFTEST_FAILED_LANG_TABLE) #define MSG_SELFTEST_FAILED LANG_TABLE_SELECT(MSG_SELFTEST_FAILED_LANG_TABLE)
extern const char* const MSG_SELFTEST_FAN_LANG_TABLE[LANG_NUM]; extern const char* const MSG_SELFTEST_FAN_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_FAN LANG_TABLE_SELECT(MSG_SELFTEST_FAN_LANG_TABLE) #define MSG_SELFTEST_FAN LANG_TABLE_SELECT(MSG_SELFTEST_FAN_LANG_TABLE)
extern const char* const MSG_SELFTEST_FANS_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_FANS LANG_TABLE_SELECT(MSG_SELFTEST_FANS_LANG_TABLE)
extern const char* const MSG_SELFTEST_FAN_NO_LANG_TABLE[LANG_NUM]; extern const char* const MSG_SELFTEST_FAN_NO_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_FAN_NO LANG_TABLE_SELECT(MSG_SELFTEST_FAN_NO_LANG_TABLE) #define MSG_SELFTEST_FAN_NO LANG_TABLE_SELECT(MSG_SELFTEST_FAN_NO_LANG_TABLE)
extern const char* const MSG_SELFTEST_FAN_YES_LANG_TABLE[LANG_NUM]; extern const char* const MSG_SELFTEST_FAN_YES_LANG_TABLE[LANG_NUM];
@ -576,6 +578,8 @@ extern const char* const MSG_SELFTEST_PLEASECHECK_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_PLEASECHECK LANG_TABLE_SELECT(MSG_SELFTEST_PLEASECHECK_LANG_TABLE) #define MSG_SELFTEST_PLEASECHECK LANG_TABLE_SELECT(MSG_SELFTEST_PLEASECHECK_LANG_TABLE)
extern const char* const MSG_SELFTEST_START_LANG_TABLE[1]; extern const char* const MSG_SELFTEST_START_LANG_TABLE[1];
#define MSG_SELFTEST_START LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_START_LANG_TABLE, 0) #define MSG_SELFTEST_START LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_START_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_SWAPPED_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_SWAPPED LANG_TABLE_SELECT(MSG_SELFTEST_SWAPPED_LANG_TABLE)
extern const char* const MSG_SELFTEST_WIRINGERROR_LANG_TABLE[LANG_NUM]; extern const char* const MSG_SELFTEST_WIRINGERROR_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_WIRINGERROR LANG_TABLE_SELECT(MSG_SELFTEST_WIRINGERROR_LANG_TABLE) #define MSG_SELFTEST_WIRINGERROR LANG_TABLE_SELECT(MSG_SELFTEST_WIRINGERROR_LANG_TABLE)
extern const char* const MSG_SERIAL_ERROR_MENU_STRUCTURE_LANG_TABLE[1]; extern const char* const MSG_SERIAL_ERROR_MENU_STRUCTURE_LANG_TABLE[1];

View file

@ -180,6 +180,8 @@
#define MSG_SELFTEST_ENDSTOP "Endstop" #define MSG_SELFTEST_ENDSTOP "Endstop"
#define MSG_SELFTEST_ENDSTOP_NOTHIT "Endstop not hit" #define MSG_SELFTEST_ENDSTOP_NOTHIT "Endstop not hit"
#define MSG_SELFTEST_OK "Self test OK" #define MSG_SELFTEST_OK "Self test OK"
#define MSG_SELFTEST_FANS "Predni/levy vent."
#define MSG_SELFTEST_SWAPPED "Prohozene"
#define MSG_SELFTEST_FAN "Test ventilatoru" #define MSG_SELFTEST_FAN "Test ventilatoru"
#define MSG_SELFTEST_COOLING_FAN "Predni tiskovy vent?" #define MSG_SELFTEST_COOLING_FAN "Predni tiskovy vent?"

View file

@ -173,6 +173,8 @@
#define MSG_SELFTEST_ENDSTOPS "Endstops" #define MSG_SELFTEST_ENDSTOPS "Endstops"
#define MSG_SELFTEST_MOTOR "Motor" #define MSG_SELFTEST_MOTOR "Motor"
#define MSG_SELFTEST_ENDSTOP "Endstop" #define MSG_SELFTEST_ENDSTOP "Endstop"
#define MSG_SELFTEST_FANS "Front/left fans"
#define MSG_SELFTEST_SWAPPED "Swapped"
#define(length=20,lines=1) MSG_SELFTEST_ENDSTOP_NOTHIT "Endstop not hit" #define(length=20,lines=1) MSG_SELFTEST_ENDSTOP_NOTHIT "Endstop not hit"
#define MSG_SELFTEST_OK "Self test OK" #define MSG_SELFTEST_OK "Self test OK"

View file

@ -2426,8 +2426,10 @@ void lcd_adjust_z() {
} }
/*void lcd_wait_for_cool_down() { void lcd_wait_for_cool_down() {
lcd_set_custom_characters_degree(); lcd_set_custom_characters_degree();
setTargetHotend(0,0);
setTargetBed(0);
while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) { while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) {
lcd_display_message_fullscreen_P(MSG_WAITING_TEMP); lcd_display_message_fullscreen_P(MSG_WAITING_TEMP);
@ -2444,9 +2446,11 @@ void lcd_adjust_z() {
lcd.print(LCD_STR_DEGREE); lcd.print(LCD_STR_DEGREE);
lcd_set_custom_characters(); lcd_set_custom_characters();
delay_keep_alive(1000); delay_keep_alive(1000);
serialecho_temperatures();
} }
lcd_set_custom_characters_arrows(); lcd_set_custom_characters_arrows();
}*/ lcd_update_enable(true);
}
// Lets the user move the Z carriage up to the end stoppers. // Lets the user move the Z carriage up to the end stoppers.
// When done, it sets the current Z to Z_MAX_POS and returns true. // When done, it sets the current Z to Z_MAX_POS and returns true.
@ -5444,14 +5448,14 @@ static bool lcd_selftest()
{ {
int _progress = 0; int _progress = 0;
bool _result = false; bool _result = false;
lcd_wait_for_cool_down();
lcd_implementation_clear(); lcd_implementation_clear();
lcd.setCursor(0, 0); lcd_printPGM(MSG_SELFTEST_START); lcd.setCursor(0, 0); lcd_printPGM(MSG_SELFTEST_START);
#ifdef TMC2130 #ifdef TMC2130
FORCE_HIGH_POWER_START; FORCE_HIGH_POWER_START;
#endif // TMC2130 #endif // TMC2130
delay(2000); delay(2000);
KEEPALIVE_STATE(IN_HANDLER);
_progress = lcd_selftest_screen(-1, _progress, 3, true, 2000); _progress = lcd_selftest_screen(-1, _progress, 3, true, 2000);
_result = lcd_selftest_fan_dialog(0); _result = lcd_selftest_fan_dialog(0);
@ -5467,7 +5471,7 @@ static bool lcd_selftest()
//_progress = lcd_selftest_screen(2, _progress, 3, true, 2000); //_progress = lcd_selftest_screen(2, _progress, 3, true, 2000);
_result = true;// lcd_selfcheck_endstops(); _result = true;// lcd_selfcheck_endstops();
} }
if (_result) if (_result)
{ {
_progress = lcd_selftest_screen(3, _progress, 3, true, 1000); _progress = lcd_selftest_screen(3, _progress, 3, true, 1000);
@ -5565,6 +5569,7 @@ static bool lcd_selftest()
#ifdef TMC2130 #ifdef TMC2130
FORCE_HIGH_POWER_END; FORCE_HIGH_POWER_END;
#endif // TMC2130 #endif // TMC2130
KEEPALIVE_STATE(NOT_BUSY);
return(_result); return(_result);
} }
@ -5935,6 +5940,7 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
target_temperature_bed = (_isbed) ? 100 : 0; target_temperature_bed = (_isbed) ? 100 : 0;
manage_heater(); manage_heater();
manage_inactivity(true); manage_inactivity(true);
KEEPALIVE_STATE(NOT_BUSY); //we are sending temperatures on serial line, so no need to send host keepalive messages
do { do {
_counter++; _counter++;
@ -5951,6 +5957,7 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
MYSERIAL.print("Hotend temp:"); MYSERIAL.print("Hotend temp:");
MYSERIAL.println(degHotend(0)); MYSERIAL.println(degHotend(0));
}*/ }*/
if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds
} while (_docycle); } while (_docycle);
@ -5985,6 +5992,7 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
manage_heater(); manage_heater();
manage_inactivity(true); manage_inactivity(true);
KEEPALIVE_STATE(IN_HANDLER);
return _stepresult; return _stepresult;
} }
@ -6076,6 +6084,14 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
lcd.setCursor(18, 3); lcd.setCursor(18, 3);
lcd.print(_error_1); lcd.print(_error_1);
break; break;
case 10:
lcd.setCursor(0, 2);
lcd_printPGM(MSG_SELFTEST_FANS);
lcd.setCursor(0, 3);
lcd_printPGM(MSG_SELFTEST_SWAPPED);
lcd.setCursor(18, 3);
lcd.print(_error_1);
break;
} }
delay(1000); delay(1000);
@ -6105,26 +6121,37 @@ static bool lcd_selftest_fan_dialog(int _fan)
delay(2000); //delay_keep_alive would turn off extruder fan, because temerature is too low delay(2000); //delay_keep_alive would turn off extruder fan, because temerature is too low
manage_heater(); //count average fan speed from 2s delay and turn off fans manage_heater(); //count average fan speed from 2s delay and turn off fans
if (!fan_speed[0]) _result = false; if (!fan_speed[0]) _result = false;
/*SERIAL_ECHOPGM("Extruder fan speed: "); //SERIAL_ECHOPGM("Extruder fan speed: ");
MYSERIAL.println(fan_speed[0]); //MYSERIAL.println(fan_speed[0]);
SERIAL_ECHOPGM("Print fan speed: "); //SERIAL_ECHOPGM("Print fan speed: ");
MYSERIAL.print(fan_speed[1]);*/ //MYSERIAL.print(fan_speed[1]);
break; break;
case 1: case 1:
//will it work with Thotend > 50 C ? //will it work with Thotend > 50 C ?
fanSpeed = 255; //print fan fanSpeed = 150; //print fan
delay_keep_alive(2000); for (uint8_t i = 0; i < 5; i++) {
delay_keep_alive(1000);
lcd.setCursor(14, 3);
lcd.print("-");
delay_keep_alive(1000);
lcd.setCursor(14, 3);
lcd.print("|");
}
fanSpeed = 0; fanSpeed = 0;
manage_heater(); //turn off fan manage_heater(); //turn off fan
manage_inactivity(true); //to turn off print fan manage_inactivity(true); //to turn off print fan
if (!fan_speed[1]) { if (!fan_speed[1]) {
_result = false; _errno = 7; _result = false; _errno = 7;
} }
/*SERIAL_ECHOPGM("Extruder fan speed: "); else if (fan_speed[1] < 40) { //fan is spinning, but measured RPM are too low for print fan, it must be left extruder fan
MYSERIAL.println(fan_speed[0]); _result = false; _errno = 10;
}
//SERIAL_ECHOPGM("Extruder fan speed: ");
//MYSERIAL.println(fan_speed[0]);
SERIAL_ECHOPGM("Print fan speed: "); SERIAL_ECHOPGM("Print fan speed: ");
MYSERIAL.print(fan_speed[1]);*/ MYSERIAL.print(fan_speed[1]);
break; break;
} }
if (!_result) if (!_result)

View file

@ -257,7 +257,7 @@ void lcd_farm_sdcard_menu();
void lcd_farm_sdcard_menu_w(); void lcd_farm_sdcard_menu_w();
//void get_description(); //void get_description();
//void lcd_wait_for_cool_down(); void lcd_wait_for_cool_down();
void adjust_bed_reset(); void adjust_bed_reset();
void lcd_extr_cal_reset(); void lcd_extr_cal_reset();