|
|
|
@ -2012,14 +2012,14 @@ 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.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")));
|
|
|
|
|
lcd.setCursor(0, 0);
|
|
|
|
|
lcd_printPGM((PSTR("End stops 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")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void menu_show_end_stops() {
|
|
|
|
@ -4246,16 +4246,14 @@ static void lcd_selftest()
|
|
|
|
|
if (_result)
|
|
|
|
|
{
|
|
|
|
|
_progress = lcd_selftest_screen(3, _progress, 3, true, 1000);
|
|
|
|
|
//_result = lcd_selfcheck_check_heater(false);
|
|
|
|
|
_result = lcd_selfcheck_check_heater(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_result)
|
|
|
|
|
{
|
|
|
|
|
//current_position[Z_AXIS] += 15; //move Z axis higher to avoid false triggering of Z end stop in case that we are very low - just above heatbed
|
|
|
|
|
_progress = lcd_selftest_screen(4, _progress, 3, true, 2000);
|
|
|
|
|
//_result = lcd_selfcheck_axis(X_AXIS, X_MAX_POS);
|
|
|
|
|
homeaxis(X_AXIS);
|
|
|
|
|
|
|
|
|
|
_result = lcd_selfcheck_axis_sg(X_AXIS);//, X_MAX_POS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_result)
|
|
|
|
@ -4263,13 +4261,14 @@ static void lcd_selftest()
|
|
|
|
|
_progress = lcd_selftest_screen(4, _progress, 3, true, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_result = lcd_selfcheck_pulleys(X_AXIS);
|
|
|
|
|
//_result = lcd_selfcheck_pulleys(X_AXIS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_result)
|
|
|
|
|
{
|
|
|
|
|
_progress = lcd_selftest_screen(5, _progress, 3, true, 1500);
|
|
|
|
|
_result = lcd_selfcheck_axis_sg(Y_AXIS);
|
|
|
|
|
//_result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4282,17 +4281,28 @@ static void lcd_selftest()
|
|
|
|
|
|
|
|
|
|
if (_result)
|
|
|
|
|
{
|
|
|
|
|
current_position[X_AXIS] = current_position[X_AXIS] - 3;
|
|
|
|
|
current_position[Y_AXIS] = current_position[Y_AXIS] - 14;
|
|
|
|
|
//current_position[X_AXIS] = current_position[X_AXIS] + 14;
|
|
|
|
|
//current_position[Y_AXIS] = current_position[Y_AXIS] + 12;
|
|
|
|
|
#ifdef HAVE_TMC2130_DRIVERS
|
|
|
|
|
tmc2130_home_exit();
|
|
|
|
|
#endif
|
|
|
|
|
current_position[X_AXIS] = current_position[X_AXIS] + 14;
|
|
|
|
|
current_position[Y_AXIS] = current_position[Y_AXIS] + 12;
|
|
|
|
|
|
|
|
|
|
//homeaxis(X_AXIS);
|
|
|
|
|
//homeaxis(Y_AXIS);
|
|
|
|
|
current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
|
|
|
|
|
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();
|
|
|
|
|
_progress = lcd_selftest_screen(6, _progress, 3, true, 1500);
|
|
|
|
|
//_result = lcd_selfcheck_axis(2, Z_MAX_POS);
|
|
|
|
|
//enquecommand_P(PSTR("G28 W"));
|
|
|
|
|
_result = lcd_selfcheck_axis(2, Z_MAX_POS);
|
|
|
|
|
enquecommand_P(PSTR("G28 W"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_result)
|
|
|
|
|
{
|
|
|
|
|
_progress = lcd_selftest_screen(7, _progress, 3, true, 2000);
|
|
|
|
|
//_result = lcd_selfcheck_check_heater(true);
|
|
|
|
|
_result = lcd_selfcheck_check_heater(true);
|
|
|
|
|
}
|
|
|
|
|
if (_result)
|
|
|
|
|
{
|
|
|
|
@ -4318,8 +4328,114 @@ static void lcd_selftest()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static bool lcd_selfcheck_axis_sg(char axis) {
|
|
|
|
|
|
|
|
|
|
float axis_length, current_position_init, current_position_final;
|
|
|
|
|
float measured_axis_length[2];
|
|
|
|
|
float margin = 100;
|
|
|
|
|
float max_error_mm = 10;
|
|
|
|
|
switch (axis) {
|
|
|
|
|
case 0: axis_length = X_MAX_POS; break;
|
|
|
|
|
case 1: axis_length = Y_MAX_POS + 8; break;
|
|
|
|
|
default: axis_length = 210; break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (char i = 0; i < 2; i++) {
|
|
|
|
|
SERIAL_ECHOPGM("Current position:");
|
|
|
|
|
MYSERIAL.println(current_position[axis]);
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
current_position[axis] -= (axis_length + margin);
|
|
|
|
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
current_position[axis] -= margin;
|
|
|
|
|
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();
|
|
|
|
|
current_position[axis] -= axis_length;
|
|
|
|
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_TMC2130_DRIVERS
|
|
|
|
|
tmc2130_home_enter(axis);
|
|
|
|
|
#endif
|
|
|
|
|
st_synchronize();
|
|
|
|
|
#ifdef HAVE_TMC2130_DRIVERS
|
|
|
|
|
tmc2130_home_exit();
|
|
|
|
|
#endif
|
|
|
|
|
//current_position[axis] = st_get_position_mm(axis);
|
|
|
|
|
//plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
|
|
|
|
|
|
|
SERIAL_ECHOPGM("Current position:");
|
|
|
|
|
MYSERIAL.println(current_position[axis]);
|
|
|
|
|
current_position_init = st_get_position_mm(axis);
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
current_position[axis] += margin;
|
|
|
|
|
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();
|
|
|
|
|
current_position[axis] += axis_length;
|
|
|
|
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
|
|
|
|
|
#ifdef HAVE_TMC2130_DRIVERS
|
|
|
|
|
tmc2130_home_enter(axis);
|
|
|
|
|
#endif
|
|
|
|
|
st_synchronize();
|
|
|
|
|
#ifdef HAVE_TMC2130_DRIVERS
|
|
|
|
|
tmc2130_home_exit();
|
|
|
|
|
#endif
|
|
|
|
|
//current_position[axis] = st_get_position_mm(axis);
|
|
|
|
|
//plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
|
|
SERIAL_ECHOPGM("Current position:");
|
|
|
|
|
MYSERIAL.println(current_position[axis]);
|
|
|
|
|
current_position_final = st_get_position_mm(axis);
|
|
|
|
|
}
|
|
|
|
|
measured_axis_length[i] = abs(current_position_final - current_position_init);
|
|
|
|
|
SERIAL_ECHOPGM("Measured axis length:");
|
|
|
|
|
MYSERIAL.println(measured_axis_length[i]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (abs(measured_axis_length[i] - axis_length) > max_error_mm) {
|
|
|
|
|
//axis length
|
|
|
|
|
#ifdef HAVE_TMC2130_DRIVERS
|
|
|
|
|
tmc2130_home_exit();
|
|
|
|
|
#endif
|
|
|
|
|
const char *_error_1;
|
|
|
|
|
const char *_error_2;
|
|
|
|
|
|
|
|
|
|
if (axis == X_AXIS) _error_1 = "X";
|
|
|
|
|
if (axis == Y_AXIS) _error_1 = "Y";
|
|
|
|
|
if (axis == Z_AXIS) _error_1 = "Z";
|
|
|
|
|
|
|
|
|
|
lcd_selftest_error(9, _error_1, _error_2);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SERIAL_ECHOPGM("Axis length difference:");
|
|
|
|
|
MYSERIAL.println(abs(measured_axis_length[0] - measured_axis_length[1]));
|
|
|
|
|
|
|
|
|
|
if (abs(measured_axis_length[0] - measured_axis_length[1]) > 1) {
|
|
|
|
|
//loose pulleys
|
|
|
|
|
const char *_error_1;
|
|
|
|
|
const char *_error_2;
|
|
|
|
|
|
|
|
|
|
if (axis == X_AXIS) _error_1 = "X";
|
|
|
|
|
if (axis == Y_AXIS) _error_1 = "Y";
|
|
|
|
|
if (axis == Z_AXIS) _error_1 = "Z";
|
|
|
|
|
|
|
|
|
|
lcd_selftest_error(8, _error_1, _error_2);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static bool lcd_selfcheck_axis(int _axis, int _travel)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
bool _stepdone = false;
|
|
|
|
|
bool _stepresult = false;
|
|
|
|
|
int _progress = 0;
|
|
|
|
@ -4327,37 +4443,41 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
|
|
|
|
|
int _err_endstop = 0;
|
|
|
|
|
int _lcd_refresh = 0;
|
|
|
|
|
_travel = _travel + (_travel / 10);
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
st_synchronize();
|
|
|
|
|
|
|
|
|
|
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 (/*x_min_endstop || y_min_endstop || */(READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1))
|
|
|
|
|
{
|
|
|
|
|
if (_axis == 0)
|
|
|
|
|
{
|
|
|
|
|
_stepresult = (READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1) ? true : false;
|
|
|
|
|
_err_endstop = (READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1) ? 1 : 2;
|
|
|
|
|
_stepresult = (x_min_endstop) ? true : false;
|
|
|
|
|
_err_endstop = (y_min_endstop) ? 1 : 2;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (_axis == 1)
|
|
|
|
|
{
|
|
|
|
|
_stepresult = (READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1) ? true : false;
|
|
|
|
|
_err_endstop = (READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1) ? 0 : 2;
|
|
|
|
|
_stepresult = (y_min_endstop) ? true : false;
|
|
|
|
|
_err_endstop = (x_min_endstop) ? 0 : 2;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (_axis == 2)
|
|
|
|
|
{
|
|
|
|
|
_stepresult = (READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1) ? true : false;
|
|
|
|
|
_err_endstop = (READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1) ? 0 : 1;
|
|
|
|
|
_err_endstop = (x_min_endstop) ? 0 : 1;
|
|
|
|
|
/*disable_x();
|
|
|
|
|
disable_y();
|
|
|
|
|
disable_z();*/
|
|
|
|
|
}
|
|
|
|
|
_stepdone = true;
|
|
|
|
|
}
|
|
|
|
|
#ifdef HAVE_TMC2130_DRIVERS
|
|
|
|
|
tmc2130_home_exit();
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (_lcd_refresh < 6)
|
|
|
|
|
{
|
|
|
|
@ -4374,7 +4494,7 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
|
|
|
|
|
|
|
|
|
|
//delay(100);
|
|
|
|
|
(_travel_done <= _travel) ? _travel_done++ : _stepdone = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} while (!_stepdone);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -4404,6 +4524,7 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return _stepresult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4411,7 +4532,7 @@ static bool lcd_selfcheck_pulleys(int axis)
|
|
|
|
|
{
|
|
|
|
|
float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD;
|
|
|
|
|
float tmp_motor[3] = DEFAULT_PWM_MOTOR_CURRENT;
|
|
|
|
|
float current_position_init;
|
|
|
|
|
float current_position_init, current_position_final;
|
|
|
|
|
float move;
|
|
|
|
|
bool endstop_triggered = false;
|
|
|
|
|
bool result = true;
|
|
|
|
@ -4423,80 +4544,111 @@ static bool lcd_selfcheck_pulleys(int axis)
|
|
|
|
|
if (axis == 0) move = 50; //X_AXIS
|
|
|
|
|
else move = 50; //Y_AXIS
|
|
|
|
|
|
|
|
|
|
current_position_init = current_position[axis];
|
|
|
|
|
|
|
|
|
|
current_position[axis] += 2;
|
|
|
|
|
//current_position_init = current_position[axis];
|
|
|
|
|
current_position_init = st_get_position_mm(axis);
|
|
|
|
|
current_position[axis] += 5;
|
|
|
|
|
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++) {
|
|
|
|
|
refresh_cmd_timeout();
|
|
|
|
|
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);
|
|
|
|
|
st_synchronize();
|
|
|
|
|
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
|
|
|
|
|
//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
|
|
|
|
|
current_position[axis] = current_position[axis] - move;
|
|
|
|
|
#ifdef HAVE_TMC2130_DRIVERS
|
|
|
|
|
tmc2130_home_enter(axis);
|
|
|
|
|
#endif
|
|
|
|
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);
|
|
|
|
|
|
|
|
|
|
st_synchronize();
|
|
|
|
|
if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1) || (READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1)) {
|
|
|
|
|
if ((x_min_endstop) || (y_min_endstop)) {
|
|
|
|
|
lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
|
|
|
|
|
return(false);
|
|
|
|
|
}
|
|
|
|
|
#ifdef HAVE_TMC2130_DRIVERS
|
|
|
|
|
tmc2130_home_exit();
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
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)) {
|
|
|
|
|
if ((x_min_endstop) || (y_min_endstop)) {
|
|
|
|
|
#ifdef HAVE_TMC2130_DRIVERS
|
|
|
|
|
tmc2130_home_exit();
|
|
|
|
|
#endif
|
|
|
|
|
endstop_triggered = true;
|
|
|
|
|
if (current_position_init - 1 <= current_position[axis] && current_position_init + 1 >= current_position[axis]) {
|
|
|
|
|
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", "");
|
|
|
|
|
|
|
|
|
|
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 {
|
|
|
|
|
lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
|
|
|
|
|
|
|
|
|
|
return(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
current_position[axis] -= 1;
|
|
|
|
|
#ifdef HAVE_TMC2130_DRIVERS
|
|
|
|
|
tmc2130_home_exit();
|
|
|
|
|
#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 HAVE_TMC2130_DRIVERS
|
|
|
|
|
tmc2130_home_enter(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()
|
|
|
|
|
{
|
|
|
|
|
{/*
|
|
|
|
|
bool _result = true;
|
|
|
|
|
|
|
|
|
|
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 (x_min_endstop || y_min_endstop || READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1)
|
|
|
|
|
{
|
|
|
|
|
current_position[0] = (READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1) ? current_position[0] = current_position[0] + 10 : current_position[0];
|
|
|
|
|
current_position[1] = (READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1) ? current_position[1] = current_position[1] + 10 : current_position[1];
|
|
|
|
|
current_position[0] = (x_min_endstop) ? current_position[0] = current_position[0] + 10 : current_position[0];
|
|
|
|
|
current_position[1] = (y_min_endstop) ? current_position[1] = current_position[1] + 10 : current_position[1];
|
|
|
|
|
current_position[2] = (READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1) ? current_position[2] = current_position[2] + 10 : current_position[2];
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
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 (x_min_endstop || y_min_endstop || READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1)
|
|
|
|
|
{
|
|
|
|
|
_result = false;
|
|
|
|
|
char _error[4] = "";
|
|
|
|
|
if (READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1) strcat(_error, "X");
|
|
|
|
|
if (READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1) strcat(_error, "Y");
|
|
|
|
|
if (x_min_endstop) strcat(_error, "X");
|
|
|
|
|
if (y_min_endstop) strcat(_error, "Y");
|
|
|
|
|
if (READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1) strcat(_error, "Z");
|
|
|
|
|
lcd_selftest_error(3, _error, "");
|
|
|
|
|
}
|
|
|
|
|
manage_heater();
|
|
|
|
|
manage_inactivity(true);
|
|
|
|
|
return _result;
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bool lcd_selfcheck_check_heater(bool _isbed)
|
|
|
|
@ -4647,6 +4799,14 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
|
|
|
|
|
lcd.setCursor(18, 3);
|
|
|
|
|
lcd.print(_error_1);
|
|
|
|
|
break;
|
|
|
|
|
case 9:
|
|
|
|
|
lcd.setCursor(0, 2);
|
|
|
|
|
lcd_printPGM(MSG_SELFTEST_AXIS_LENGTH);
|
|
|
|
|
lcd.setCursor(0, 3);
|
|
|
|
|
lcd_printPGM(MSG_SELFTEST_AXIS);
|
|
|
|
|
lcd.setCursor(18, 3);
|
|
|
|
|
lcd.print(_error_1);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delay(1000);
|
|
|
|
|