|
@@ -3177,8 +3177,7 @@ static void lcd_main_menu()
|
|
MENU_ITEM(submenu, MSG_UNLOAD_FILAMENT, fil_unload_menu);
|
|
MENU_ITEM(submenu, MSG_UNLOAD_FILAMENT, fil_unload_menu);
|
|
MENU_ITEM(submenu, MSG_CHANGE_EXTR, change_extr_menu);
|
|
MENU_ITEM(submenu, MSG_CHANGE_EXTR, change_extr_menu);
|
|
#endif
|
|
#endif
|
|
- //MENU_ITEM(function, PSTR("belt test"), belt_test);
|
|
|
|
- MENU_ITEM(submenu, MSG_SETTINGS, lcd_settings_menu);
|
|
|
|
|
|
+ MENU_ITEM(submenu, MSG_SETTINGS, lcd_settings_menu);
|
|
if(!isPrintPaused) MENU_ITEM(submenu, MSG_MENU_CALIBRATION, lcd_calibration_menu);
|
|
if(!isPrintPaused) MENU_ITEM(submenu, MSG_MENU_CALIBRATION, lcd_calibration_menu);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3562,252 +3561,6 @@ menu_edit_type(float, float51, ftostr51, 10)
|
|
menu_edit_type(float, float52, ftostr52, 100)
|
|
menu_edit_type(float, float52, ftostr52, 100)
|
|
menu_edit_type(unsigned long, long5, ftostr5, 0.01)
|
|
menu_edit_type(unsigned long, long5, ftostr5, 0.01)
|
|
|
|
|
|
-
|
|
|
|
-static void belt_test() {
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /*lcd_update_enable(false);
|
|
|
|
- float coordinate[2] = { 253, 215.5 };
|
|
|
|
- float max = 10;
|
|
|
|
- float step = 0.5; //mm
|
|
|
|
- float change_belt = 2.5; //mm
|
|
|
|
- float excellent = 1;
|
|
|
|
-
|
|
|
|
- //set motor current higherdigipot_current(0, 850); //set motor current higher
|
|
|
|
- //current_position[Z_AXIS] += 15;
|
|
|
|
- //plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);
|
|
|
|
-
|
|
|
|
- for (int j = 0; j < 2; j++) {
|
|
|
|
- lcd_implementation_clear();
|
|
|
|
- j == 0 ? lcd_printPGM(PSTR("Testing X belt")) : lcd_printPGM(PSTR("Testing Y belt"));
|
|
|
|
- for (int i = 0; i < max*(1 / step); i++) {
|
|
|
|
-
|
|
|
|
- if (i == 0) {
|
|
|
|
- current_position[j] += coordinate[j] + max;
|
|
|
|
- j == 0 ? digipot_current(0, 130):digipot_current(0, 60);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- current_position[j] += ((float)i - 1.f)*step;
|
|
|
|
- }
|
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);
|
|
|
|
- st_synchronize();
|
|
|
|
- digipot_current(0, 500);
|
|
|
|
- if (i == 0) current_position[j] -= coordinate[j];
|
|
|
|
- else current_position[j] -= (float)i * step;
|
|
|
|
- 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(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1) || (READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1)) {
|
|
|
|
- //lcd_display_message_fullscreen_P(PSTR("Endstop hit"));
|
|
|
|
- lcd.setCursor(0, 0);
|
|
|
|
- if (i < (excellent / step)) lcd_printPGM(PSTR("Excelent condition ")); //1 mm
|
|
|
|
- else if (i < (change_belt / step)) lcd_printPGM(PSTR("Belt ok ")); //2.5 mm
|
|
|
|
- else lcd_printPGM(PSTR("Change the belt ")); //>2.5mm
|
|
|
|
-
|
|
|
|
- delay_keep_alive(5000);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- i = max*(1 / step);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- lcd.setCursor((change_belt / step), 1); lcd_printPGM(PSTR("|"));
|
|
|
|
- lcd.setCursor((change_belt / step), 2); lcd_printPGM(PSTR("|"));
|
|
|
|
- lcd.setCursor((change_belt / step), 3); lcd_printPGM(PSTR("|"));
|
|
|
|
-
|
|
|
|
- lcd.setCursor(i, 2);
|
|
|
|
- if (i == (change_belt / step)) lcd_printPGM(PSTR("+"));
|
|
|
|
- else lcd_printPGM(PSTR("-"));
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- enquecommand_P(PSTR("G28 W"));
|
|
|
|
- lcd_update_enable(true);
|
|
|
|
- digipot_current(0, 800);
|
|
|
|
- lcd_update(2);
|
|
|
|
- return;*/
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- 13.f - BED_ZERO_REF_X, 6.4f - BED_ZERO_REF_Y,
|
|
|
|
- 115.f - BED_ZERO_REF_X, 6.4f - BED_ZERO_REF_Y,
|
|
|
|
- 216.f - BED_ZERO_REF_X, 6.4f - BED_ZERO_REF_Y,
|
|
|
|
-
|
|
|
|
- 216.f - BED_ZERO_REF_X, 104.4f - BED_ZERO_REF_Y,
|
|
|
|
- 115.f - BED_ZERO_REF_X, 104.4f - BED_ZERO_REF_Y,
|
|
|
|
- 13.f - BED_ZERO_REF_X, 104.4f - BED_ZERO_REF_Y,
|
|
|
|
-
|
|
|
|
- 13.f - BED_ZERO_REF_X, 202.4f - BED_ZERO_REF_Y,
|
|
|
|
- 115.f - BED_ZERO_REF_X, 202.4f - BED_ZERO_REF_Y,
|
|
|
|
- 216.f - BED_ZERO_REF_X, 202.4f - BED_ZERO_REF_Y
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- #define BED_ZERO_REF_X (- 22.f + X_PROBE_OFFSET_FROM_EXTRUDER)
|
|
|
|
- #define BED_ZERO_REF_Y (- 0.6f + Y_PROBE_OFFSET_FROM_EXTRUDER)
|
|
|
|
-
|
|
|
|
- #define X_PROBE_OFFSET_FROM_EXTRUDER 23 // Z probe to nozzle X offset: -left +right
|
|
|
|
- #define Y_PROBE_OFFSET_FROM_EXTRUDER 9 // Z probe to nozzle Y offset: -front +behind
|
|
|
|
- #define Z_PROBE_OFFSET_FROM_EXTRUDER -0.4
|
|
|
|
-
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
-/*
|
|
|
|
-
|
|
|
|
- lcd_update_enable(false);
|
|
|
|
- float coordinate[2] = { 210, 190 };
|
|
|
|
- float max = 10;
|
|
|
|
- float step = 0.5; //mm
|
|
|
|
- float change_belt = 2.5; //mm
|
|
|
|
- float excellent = 1;
|
|
|
|
- float safety_a = 20;
|
|
|
|
-
|
|
|
|
- //set motor current higherdigipot_current(0, 850); //set motor current higher
|
|
|
|
- current_position[Z_AXIS] -= 0.4;
|
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);
|
|
|
|
- st_synchronize();
|
|
|
|
- for (int j = 0; j < 2; j++) {
|
|
|
|
- lcd_implementation_clear();
|
|
|
|
- j == 0 ? lcd_printPGM(PSTR("Testing X belt")) : lcd_printPGM(PSTR("Testing Y belt"));
|
|
|
|
- for (int i = 0; i < max*(1 / step); i++) {
|
|
|
|
-
|
|
|
|
- if (i == 0) {
|
|
|
|
- current_position[j] += coordinate[j] - safety_a;
|
|
|
|
- //j == 0 ? digipot_current(0, 130):digipot_current(0, 60);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- current_position[j] += ((float)i - 1.f)*step;
|
|
|
|
- }
|
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);
|
|
|
|
- st_synchronize();
|
|
|
|
- if (i == 0) {
|
|
|
|
- for (int k = 0; k < (safety_a + max)*(1 / step); k++) {
|
|
|
|
- current_position[j] += step ;
|
|
|
|
- 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(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1)) {
|
|
|
|
- k = 2000;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //digipot_current(0, 500);
|
|
|
|
- if (i == 0) current_position[j] -= coordinate[j];
|
|
|
|
- else current_position[j] -= (float)i * step;
|
|
|
|
- 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(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1) || (READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1)) {
|
|
|
|
- //lcd_display_message_fullscreen_P(PSTR("Endstop hit"));
|
|
|
|
- lcd.setCursor(0, 0);
|
|
|
|
- //if (i < (excellent / step)) lcd_printPGM(PSTR("Change it ")); //1 mm
|
|
|
|
- if (i < (change_belt / step)) lcd_printPGM(PSTR("Change the belt ")); //2.5 mm
|
|
|
|
- else lcd_printPGM(PSTR("Belt ok ")); //>2.5mm
|
|
|
|
-
|
|
|
|
- delay_keep_alive(5000);
|
|
|
|
- current_position[j] += 14;
|
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);
|
|
|
|
- st_synchronize();
|
|
|
|
-
|
|
|
|
- i = max*(1 / step);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- lcd.setCursor((change_belt / step), 1); lcd_printPGM(PSTR("|"));
|
|
|
|
- lcd.setCursor((change_belt / step), 2); lcd_printPGM(PSTR("|"));
|
|
|
|
- lcd.setCursor((change_belt / step), 3); lcd_printPGM(PSTR("|"));
|
|
|
|
-
|
|
|
|
- lcd.setCursor(i, 2);
|
|
|
|
- if (i == (change_belt / step)) lcd_printPGM(PSTR("+"));
|
|
|
|
- else lcd_printPGM(PSTR("-"));
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- enquecommand_P(PSTR("G28 W"));
|
|
|
|
- lcd_update_enable(true);
|
|
|
|
- //digipot_current(0, 800);
|
|
|
|
- lcd_update(2);
|
|
|
|
- return;*/
|
|
|
|
-
|
|
|
|
-/*
|
|
|
|
-
|
|
|
|
-lcd_update_enable(false);
|
|
|
|
-float coordinate[2] = { 210, 190 };
|
|
|
|
-float max = 10;
|
|
|
|
-float step = 0.5; //mm
|
|
|
|
-float change_belt = 2.5; //mm
|
|
|
|
-float excellent = 1;
|
|
|
|
-float safety_a = 20;
|
|
|
|
-
|
|
|
|
-//set motor current higherdigipot_current(0, 850); //set motor current higher
|
|
|
|
-current_position[Z_AXIS] -= 0.4;
|
|
|
|
-plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);
|
|
|
|
-st_synchronize();
|
|
|
|
-for (int j = 0; j < 2; j++) {
|
|
|
|
- lcd_implementation_clear();
|
|
|
|
- j == 0 ? lcd_printPGM(PSTR("Testing X belt")) : lcd_printPGM(PSTR("Testing Y belt"));
|
|
|
|
- current_position[j] += coordinate[j] - safety_a;
|
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);
|
|
|
|
- st_synchronize();
|
|
|
|
- for (int k = 0; k < (safety_a + max)*(1 / step); k++) {
|
|
|
|
- current_position[j] += step;
|
|
|
|
- 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(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING == 1)) {
|
|
|
|
- k = 2000;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- current_position[j] -= coordinate[j];
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- else current_position[j] -= (float)i * step;
|
|
|
|
- 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(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING == 1) || (READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING == 1)) {
|
|
|
|
- //lcd_display_message_fullscreen_P(PSTR("Endstop hit"));
|
|
|
|
- lcd.setCursor(0, 0);
|
|
|
|
- //if (i < (excellent / step)) lcd_printPGM(PSTR("Change it ")); //1 mm
|
|
|
|
- if (i < (change_belt / step)) lcd_printPGM(PSTR("Change the belt ")); //2.5 mm
|
|
|
|
- else lcd_printPGM(PSTR("Belt ok ")); //>2.5mm
|
|
|
|
-
|
|
|
|
- delay_keep_alive(5000);
|
|
|
|
- current_position[j] += 14;
|
|
|
|
- plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], 50, active_extruder);
|
|
|
|
- st_synchronize();
|
|
|
|
-
|
|
|
|
- i = max*(1 / step);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- lcd.setCursor((change_belt / step), 1); lcd_printPGM(PSTR("|"));
|
|
|
|
- lcd.setCursor((change_belt / step), 2); lcd_printPGM(PSTR("|"));
|
|
|
|
- lcd.setCursor((change_belt / step), 3); lcd_printPGM(PSTR("|"));
|
|
|
|
-
|
|
|
|
- lcd.setCursor(i, 2);
|
|
|
|
- if (i == (change_belt / step)) lcd_printPGM(PSTR("+"));
|
|
|
|
- else lcd_printPGM(PSTR("-"));
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-enquecommand_P(PSTR("G28 W"));
|
|
|
|
-lcd_update_enable(true);
|
|
|
|
-//digipot_current(0, 800);
|
|
|
|
-lcd_update(2);
|
|
|
|
-return;
|
|
|
|
-
|
|
|
|
-*/
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static void lcd_selftest()
|
|
static void lcd_selftest()
|
|
{
|
|
{
|
|
int _progress = 0;
|
|
int _progress = 0;
|