selftest, max endstops undefined, initialization of extruder fan, y offset from extruder

This commit is contained in:
PavelSindler 2018-02-06 17:01:09 +01:00
parent abf956b86f
commit 0c98ec5f6b
7 changed files with 117 additions and 135 deletions

View File

@ -237,8 +237,6 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o
#define DEFAULT_PWM_MOTOR_CURRENT_LOUD {400, 750, 750} // {XY,Z,E} #define DEFAULT_PWM_MOTOR_CURRENT_LOUD {400, 750, 750} // {XY,Z,E}
#endif #endif
#define RPM_FANS
/*------------------------------------ /*------------------------------------
PAT9125 SETTINGS PAT9125 SETTINGS
*------------------------------------*/ *------------------------------------*/
@ -273,7 +271,7 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o
#define MESH_HOME_Z_SEARCH 5 //Z lift for homing, mesh bed leveling etc. #define MESH_HOME_Z_SEARCH 5 //Z lift for homing, mesh bed leveling etc.
#define X_PROBE_OFFSET_FROM_EXTRUDER 23 // Z probe to nozzle X offset: -left +right #define X_PROBE_OFFSET_FROM_EXTRUDER 23 // Z probe to nozzle X offset: -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Z probe to nozzle Y offset: -front +behind #define Y_PROBE_OFFSET_FROM_EXTRUDER 9 // Z probe to nozzle Y offset: -front +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -0.4 // Z probe to nozzle Z offset: -below (always!) #define Z_PROBE_OFFSET_FROM_EXTRUDER -0.4 // Z probe to nozzle Z offset: -below (always!)
#endif #endif
@ -463,6 +461,8 @@ const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic o
#define M600_TIMEOUT 600 //seconds #define M600_TIMEOUT 600 //seconds
#define TACH0PULLUP
//#define SUPPORT_VERBOSITY //#define SUPPORT_VERBOSITY
#endif //__CONFIGURATION_PRUSA_H #endif //__CONFIGURATION_PRUSA_H

View File

@ -26,7 +26,7 @@
#define X_STEP_PIN 37 #define X_STEP_PIN 37
#define X_DIR_PIN 48 #define X_DIR_PIN 48
#define X_MIN_PIN 12 #define X_MIN_PIN 12
#define X_MAX_PIN 30 #define X_MAX_PIN -1
#define X_ENABLE_PIN 29 #define X_ENABLE_PIN 29
#define X_MS1_PIN 40 #define X_MS1_PIN 40
#define X_MS2_PIN 41 #define X_MS2_PIN 41
@ -34,7 +34,7 @@
#define Y_STEP_PIN 36 #define Y_STEP_PIN 36
#define Y_DIR_PIN 49 #define Y_DIR_PIN 49
#define Y_MIN_PIN 11 #define Y_MIN_PIN 11
#define Y_MAX_PIN 24 #define Y_MAX_PIN -1
#define Y_ENABLE_PIN 28 #define Y_ENABLE_PIN 28
#define Y_MS1_PIN 69 #define Y_MS1_PIN 69
#define Y_MS2_PIN 39 #define Y_MS2_PIN 39
@ -85,6 +85,7 @@
#define PS_ON_PIN -1 #define PS_ON_PIN -1
#define KILL_PIN -1 // 80 with Smart Controller LCD #define KILL_PIN -1 // 80 with Smart Controller LCD
#define SUICIDE_PIN -1 // PIN that has to be turned on right after start, to keep power flowing. #define SUICIDE_PIN -1 // PIN that has to be turned on right after start, to keep power flowing.
#define TACH_0 30 // noctua extruder fan
#ifdef ULTRA_LCD #ifdef ULTRA_LCD
@ -135,6 +136,3 @@
#define LOGIC_ANALYZER_CH6_ENABLE do { cbi(UCSR2B, TXEN2); cbi(UCSR2B, RXEN2); cbi(UCSR2B, RXCIE2); SET_OUTPUT(LOGIC_ANALYZER_CH6); } while (0) #define LOGIC_ANALYZER_CH6_ENABLE do { cbi(UCSR2B, TXEN2); cbi(UCSR2B, RXEN2); cbi(UCSR2B, RXCIE2); SET_OUTPUT(LOGIC_ANALYZER_CH6); } while (0)
#define LOGIC_ANALYZER_CH7_ENABLE SET_OUTPUT(LOGIC_ANALYZER_CH7) #define LOGIC_ANALYZER_CH7_ENABLE SET_OUTPUT(LOGIC_ANALYZER_CH7)
TACH_0
TACH_1

View File

@ -1056,6 +1056,13 @@ void st_init()
#endif #endif
#endif #endif
#if defined(TACH_0) && TACH_0 > -1
SET_INPUT(TACH_0);
#ifdef TACH0PULLUP
WRITE(TACH_0, HIGH);
#endif
#endif
//Initialize Step Pins //Initialize Step Pins
#if defined(X_STEP_PIN) && (X_STEP_PIN > -1) #if defined(X_STEP_PIN) && (X_STEP_PIN > -1)

View File

@ -454,7 +454,7 @@ void setExtruderAutoFanState(int pin, bool state)
analogWrite(pin, newFanSpeed); analogWrite(pin, newFanSpeed);
} }
#if (defined(TACH_0)) #if (defined(TACH_0) && TACH_0 >-1) || (defined(TACH_1) && TACH_1 > -1)
void countFanSpeed() void countFanSpeed()
{ {
@ -528,7 +528,7 @@ void fanSpeedError(unsigned char _fan) {
break; break;
} }
} }
#endif //(defined(TACH_0)) #endif //(defined(TACH_0) && TACH_0 >-1) || (defined(TACH_1) && TACH_1 > -1)
void checkExtruderAutoFans() void checkExtruderAutoFans()
@ -711,10 +711,10 @@ void manage_heater()
(defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1) (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1)
if(millis() - extruder_autofan_last_check > 1000) // only need to check fan state very infrequently if(millis() - extruder_autofan_last_check > 1000) // only need to check fan state very infrequently
{ {
#if (defined(TACH_0)) #if (defined(TACH_0) && TACH_0 >-1) || (defined(TACH_1) && TACH_1 > -1)
countFanSpeed(); countFanSpeed();
checkFanSpeed(); checkFanSpeed();
#endif //(defined(TACH_0)) #endif //(defined(TACH_0) && TACH_0 >-1) || (defined(TACH_1) && TACH_1 > -1)
checkExtruderAutoFans(); checkExtruderAutoFans();
extruder_autofan_last_check = millis(); extruder_autofan_last_check = millis();
} }
@ -1913,7 +1913,7 @@ ISR(TIMER0_COMPB_vect)
} }
#endif //BABYSTEPPING #endif //BABYSTEPPING
#if (defined(TACH_0)) #if (defined(TACH_0) && TACH_0 > -1)
check_fans(); check_fans();
#endif //(defined(TACH_0)) #endif //(defined(TACH_0))
@ -1990,8 +1990,8 @@ void check_min_temp()
check_min_temp_heater0(); check_min_temp_heater0();
check_min_temp_bed(); check_min_temp_bed();
} }
#if (defined(TACH_0)) #if (defined(TACH_0) && TACH_0 > -1)
void check_fans() { void check_fans() {
if (READ(TACH_0) != fan_state[0]) { if (READ(TACH_0) != fan_state[0]) {
fan_edge_counter[0] ++; fan_edge_counter[0] ++;

View File

@ -227,7 +227,7 @@ void setExtruderAutoFanState(int pin, bool state);
void checkExtruderAutoFans(); void checkExtruderAutoFans();
#if (defined(TACH_0)) #if (defined(TACH_0) && TACH_0 > -1)
void countFanSpeed(); void countFanSpeed();
void checkFanSpeed(); void checkFanSpeed();

View File

@ -1483,6 +1483,7 @@ static void lcd_menu_extruder_info()
// Display Nozzle fan RPM // Display Nozzle fan RPM
#if (defined(TACH_1))
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
lcd_printPGM(MSG_INFO_PRINT_FAN); lcd_printPGM(MSG_INFO_PRINT_FAN);
@ -1491,7 +1492,7 @@ static void lcd_menu_extruder_info()
lcd.setCursor(12, 1); lcd.setCursor(12, 1);
lcd.print(itostr4(fan_speed_RPM[1])); lcd.print(itostr4(fan_speed_RPM[1]));
lcd.print(" RPM"); lcd.print(" RPM");
#endif
// Display X and Y difference from Filament sensor // Display X and Y difference from Filament sensor
@ -3707,7 +3708,7 @@ void lcd_wizard(int state) {
case CALIBRATION_STATUS_CALIBRATED: end = true; eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0); break; case CALIBRATION_STATUS_CALIBRATED: end = true; eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0); break;
default: state = 2; break; //if calibration status is unknown, run wizard from the beginning default: state = 2; break; //if calibration status is unknown, run wizard from the beginning
} }
break; break;
case 2: //selftest case 2: //selftest
lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_SELFTEST); lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_SELFTEST);
wizard_event = lcd_selftest(); wizard_event = lcd_selftest();
@ -5629,7 +5630,11 @@ static bool lcd_selftest()
if (_result) if (_result)
{ {
_progress = lcd_selftest_screen(0, _progress, 3, true, 2000); _progress = lcd_selftest_screen(0, _progress, 3, true, 2000);
#if (defined(TACH_1))
_result = lcd_selftest_fan_dialog(1); _result = lcd_selftest_fan_dialog(1);
#else //defined(TACH_1)
_result = lcd_selftest_manual_fan_check(1, false);
#endif //defined(TACH_1)
} }
if (_result) if (_result)
@ -5888,13 +5893,11 @@ static bool lcd_selfcheck_axis_sg(char axis) {
return true; return true;
} }
#endif //TMC2130 #endif //TMC2130
#ifndef TMC2130
static bool lcd_selfcheck_axis(int _axis, int _travel) static bool lcd_selfcheck_axis(int _axis, int _travel)
{ {
bool _stepdone = false; bool _stepdone = false;
bool _stepresult = false; bool _stepresult = false;
int _progress = 0; int _progress = 0;
@ -5902,41 +5905,39 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
int _err_endstop = 0; int _err_endstop = 0;
int _lcd_refresh = 0; int _lcd_refresh = 0;
_travel = _travel + (_travel / 10); _travel = _travel + (_travel / 10);
do { do {
current_position[_axis] = current_position[_axis] - 1; current_position[_axis] = current_position[_axis] - 1;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
st_synchronize(); st_synchronize();
if (/*x_min_endstop || y_min_endstop || */(READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1)) if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ||
((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1))
{ {
if (_axis == 0) if (_axis == 0)
{ {
_stepresult = (x_min_endstop) ? true : false; _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false;
_err_endstop = (y_min_endstop) ? 1 : 2; _err_endstop = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? 1 : 2;
} }
if (_axis == 1) if (_axis == 1)
{ {
_stepresult = (y_min_endstop) ? true : false; _stepresult = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? true : false;
_err_endstop = (x_min_endstop) ? 0 : 2; _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 2;
} }
if (_axis == 2) if (_axis == 2)
{ {
_stepresult = (READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1) ? true : false; _stepresult = ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) ? true : false;
_err_endstop = (x_min_endstop) ? 0 : 1; _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 1;
/*disable_x(); /*disable_x();
disable_y(); disable_y();
disable_z();*/ disable_z();*/
} }
_stepdone = true; _stepdone = true;
} }
#ifdef TMC2130
tmc2130_home_exit();
#endif
if (_lcd_refresh < 6) if (_lcd_refresh < 6)
{ {
@ -5944,7 +5945,7 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
} }
else else
{ {
_progress = lcd_selftest_screen(4 + _axis, _progress, 3, false, 0); _progress = lcd_selftest_screen(2 + _axis, _progress, 3, false, 0);
_lcd_refresh = 0; _lcd_refresh = 0;
} }
@ -5953,7 +5954,7 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
//delay(100); //delay(100);
(_travel_done <= _travel) ? _travel_done++ : _stepdone = true; (_travel_done <= _travel) ? _travel_done++ : _stepdone = true;
} while (!_stepdone); } while (!_stepdone);
@ -5983,7 +5984,6 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
} }
} }
return _stepresult; return _stepresult;
} }
@ -5991,124 +5991,100 @@ static bool lcd_selfcheck_pulleys(int axis)
{ {
float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD; float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD;
float tmp_motor[3] = DEFAULT_PWM_MOTOR_CURRENT; float tmp_motor[3] = DEFAULT_PWM_MOTOR_CURRENT;
float current_position_init, current_position_final; float current_position_init;
float move; float move;
bool endstop_triggered = false; bool endstop_triggered = false;
bool result = true;
int i; int i;
unsigned long timeout_counter; unsigned long timeout_counter;
refresh_cmd_timeout(); refresh_cmd_timeout();
manage_inactivity(true); manage_inactivity(true);
if (axis == 0) move = 50; //X_AXIS if (axis == 0) move = 50; //X_AXIS
else move = 50; //Y_AXIS else move = 50; //Y_AXIS
//current_position_init = current_position[axis]; current_position_init = current_position[axis];
current_position_init = st_get_position_mm(axis);
current_position[axis] += 5; current_position[axis] += 2;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
refresh_cmd_timeout(); refresh_cmd_timeout();
current_position[axis] = current_position[axis] + move; current_position[axis] = current_position[axis] + move;
//digipot_current(0, 850); //set motor current higher digipot_current(0, 850); //set motor current higher
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 200, active_extruder); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 200, active_extruder);
st_synchronize(); st_synchronize();
//if (SilentModeMenu == 1) digipot_current(0, tmp_motor[0]); //set back to normal operation currents if (SilentModeMenu == 1) digipot_current(0, tmp_motor[0]); //set back to normal operation currents
//else digipot_current(0, tmp_motor_loud[0]); //set motor current back else digipot_current(0, tmp_motor_loud[0]); //set motor current back
current_position[axis] = current_position[axis] - move; current_position[axis] = current_position[axis] - move;
#ifdef TMC2130 plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);
tmc2130_home_enter(X_AXIS_MASK << axis); st_synchronize();
#endif if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder); ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) {
lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
st_synchronize(); return(false);
if ((x_min_endstop) || (y_min_endstop)) { }
}
timeout_counter = millis() + 2500;
endstop_triggered = false;
manage_inactivity(true);
while (!endstop_triggered) {
if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) {
endstop_triggered = true;
if (current_position_init - 1 <= current_position[axis] && current_position_init + 1 >= current_position[axis]) {
current_position[axis] += 15;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
st_synchronize();
return(true);
}
else {
lcd_selftest_error(8, (axis == 0) ? "X" : "Y", ""); lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
return(false); return(false);
} }
#ifdef TMC2130
tmc2130_home_exit();
#endif
} }
timeout_counter = millis() + 2500; else {
endstop_triggered = false; current_position[axis] -= 1;
manage_inactivity(true); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
while (!endstop_triggered) { st_synchronize();
if ((x_min_endstop) || (y_min_endstop)) { if (millis() > timeout_counter) {
#ifdef TMC2130
tmc2130_home_exit();
#endif
endstop_triggered = true;
current_position_final = st_get_position_mm(axis);
SERIAL_ECHOPGM("current_pos_init:");
MYSERIAL.println(current_position_init);
SERIAL_ECHOPGM("current_pos:");
MYSERIAL.println(current_position_final);
lcd_selftest_error(8, (axis == 0) ? "X" : "Y", ""); lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
return(false);
if (current_position_init - 1 <= current_position_final && current_position_init + 1 >= current_position_final) {
current_position[axis] += 15;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
st_synchronize();
return(true);
}
else {
return(false);
}
} }
else { }
#ifdef TMC2130 }
tmc2130_home_exit(); return(true);
#endif
//current_position[axis] -= 1;
current_position[axis] += 50;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
current_position[axis] -= 100;
#ifdef TMC2130
tmc2130_home_enter(X_AXIS_MASK << axis);
#endif
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
st_synchronize();
if (millis() > timeout_counter) {
lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
return(false);
}
}
}
} }
static bool lcd_selfcheck_endstops() static bool lcd_selfcheck_endstops()
{/* {
bool _result = true; bool _result = true;
if (x_min_endstop || y_min_endstop || READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1) if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ||
((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1))
{ {
current_position[0] = (x_min_endstop) ? current_position[0] = current_position[0] + 10 : current_position[0]; if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) current_position[0] += 10;
current_position[1] = (y_min_endstop) ? current_position[1] = current_position[1] + 10 : current_position[1]; if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) current_position[1] += 10;
current_position[2] = (READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1) ? current_position[2] = current_position[2] + 10 : current_position[2]; if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10;
} }
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[0] / 60, active_extruder); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[0] / 60, active_extruder);
delay(500); delay(500);
if (x_min_endstop || y_min_endstop || READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1) if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ||
((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1))
{ {
_result = false; _result = false;
char _error[4] = ""; char _error[4] = "";
if (x_min_endstop) strcat(_error, "X"); if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X");
if (y_min_endstop) strcat(_error, "Y"); if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y");
if (READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1) strcat(_error, "Z"); if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z");
lcd_selftest_error(3, _error, ""); lcd_selftest_error(3, _error, "");
} }
manage_heater(); manage_heater();
manage_inactivity(true); manage_inactivity(true);
return _result; return _result;
*/
} }
#endif //not defined TMC2130
static bool lcd_selfcheck_check_heater(bool _isbed) static bool lcd_selfcheck_check_heater(bool _isbed)
{ {
@ -6321,7 +6297,7 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite)
switch (_fan) switch (_fan)
{ {
case 1: case 0:
// extruder cooling fan // extruder cooling fan
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
if(check_opposite == true) lcd_printPGM(MSG_SELFTEST_COOLING_FAN); if(check_opposite == true) lcd_printPGM(MSG_SELFTEST_COOLING_FAN);
@ -6329,7 +6305,7 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite)
SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN);
WRITE(EXTRUDER_0_AUTO_FAN_PIN, 1); WRITE(EXTRUDER_0_AUTO_FAN_PIN, 1);
break; break;
case 2: case 1:
// object cooling fan // object cooling fan
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
if (check_opposite == true) lcd_printPGM(MSG_SELFTEST_EXTRUDER_FAN); if (check_opposite == true) lcd_printPGM(MSG_SELFTEST_EXTRUDER_FAN);
@ -6350,12 +6326,12 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite)
{ {
switch (_fan) switch (_fan)
{ {
case 1: case 0:
// extruder cooling fan // extruder cooling fan
SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN);
WRITE(EXTRUDER_0_AUTO_FAN_PIN, 1); WRITE(EXTRUDER_0_AUTO_FAN_PIN, 1);
break; break;
case 2: case 1:
// object cooling fan // object cooling fan
SET_OUTPUT(FAN_PIN); SET_OUTPUT(FAN_PIN);
analogWrite(FAN_PIN, 255); analogWrite(FAN_PIN, 255);
@ -6440,9 +6416,9 @@ static bool lcd_selftest_fan_dialog(int _fan)
else if (fan_speed[1] < 34) { //fan is spinning, but measured RPM are too low for print fan, it must be left extruder fan else if (fan_speed[1] < 34) { //fan is spinning, but measured RPM are too low for print fan, it must be left extruder fan
//check fans manually //check fans manually
_result = lcd_selftest_manual_fan_check(2, true); //turn on print fan and check that left extruder fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); //turn on print fan and check that left extruder fan is not spinning
if (_result) { if (_result) {
_result = lcd_selftest_manual_fan_check(2, false); //print fan is stil turned on; check that it is spinning _result = lcd_selftest_manual_fan_check(1, false); //print fan is stil turned on; check that it is spinning
if (!_result) _errno = 6; //print fan not spinning if (!_result) _errno = 6; //print fan not spinning
} }
else { else {
@ -6466,8 +6442,6 @@ static bool lcd_selftest_fan_dialog(int _fan)
static int lcd_selftest_screen(int _step, int _progress, int _progress_scale, bool _clear, int _delay) static int lcd_selftest_screen(int _step, int _progress, int _progress_scale, bool _clear, int _delay)
{ {
//SERIAL_ECHOPGM("Step:");
//MYSERIAL.println(_step);
lcd_next_update_millis = millis() + (LCD_UPDATE_INTERVAL * 10000); lcd_next_update_millis = millis() + (LCD_UPDATE_INTERVAL * 10000);

View File

@ -36,21 +36,24 @@ void lcd_mylang();
static void lcd_selftest_v(); static void lcd_selftest_v();
static bool lcd_selftest(); static bool lcd_selftest();
static bool lcd_selfcheck_endstops();
#ifdef TMC2130 #ifdef TMC2130
static void reset_crash_det(char axis); static void reset_crash_det(char axis);
static bool lcd_selfcheck_axis_sg(char axis); static bool lcd_selfcheck_axis_sg(char axis);
#endif //TMC2130 #else
static bool lcd_selfcheck_endstops();
static bool lcd_selfcheck_axis(int _axis, int _travel); static bool lcd_selfcheck_axis(int _axis, int _travel);
static bool lcd_selfcheck_pulleys(int axis);
#endif //TMC2130
static bool lcd_selfcheck_check_heater(bool _isbed); static bool lcd_selfcheck_check_heater(bool _isbed);
static int lcd_selftest_screen(int _step, int _progress, int _progress_scale, bool _clear, int _delay); static int lcd_selftest_screen(int _step, int _progress, int _progress_scale, bool _clear, int _delay);
static void lcd_selftest_screen_step(int _row, int _col, int _state, const char *_name, const char *_indicator); static void lcd_selftest_screen_step(int _row, int _col, int _state, const char *_name, const char *_indicator);
static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite);
static bool lcd_selftest_fan_dialog(int _fan); static bool lcd_selftest_fan_dialog(int _fan);
static bool lcd_selftest_fsensor(); static bool lcd_selftest_fsensor();
static void lcd_selftest_error(int _error_no, const char *_error_1, const char *_error_2); static void lcd_selftest_error(int _error_no, const char *_error_1, const char *_error_2);
void lcd_menu_statistics(); void lcd_menu_statistics();
static bool lcd_selfcheck_pulleys(int axis);
extern const char* lcd_display_message_fullscreen_P(const char *msg, uint8_t &nlines); extern const char* lcd_display_message_fullscreen_P(const char *msg, uint8_t &nlines);
inline const char* lcd_display_message_fullscreen_P(const char *msg) inline const char* lcd_display_message_fullscreen_P(const char *msg)