Browse Source

Merge pull request #7448 from thinkyhead/bf1_delta_fixes

Prevent damage if DELTA_HEIGHT is set badly
pull/1/head
Scott Lahteine 7 years ago
committed by GitHub
parent
commit
06541ec885
  1. 761
      Marlin/Marlin_main.cpp
  2. 10
      Marlin/endstops.cpp
  3. 17
      Marlin/language_en.h
  4. 18
      Marlin/ultralcd.cpp

761
Marlin/Marlin_main.cpp

File diff suppressed because it is too large

10
Marlin/endstops.cpp

@ -247,7 +247,7 @@ void Endstops::update() {
#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
#define _ENDSTOP_HIT(AXIS) SBI(endstop_hit_bits, _ENDSTOP(AXIS, MIN))
#define _ENDSTOP_HIT(AXIS, MINMAX) SBI(endstop_hit_bits, _ENDSTOP(AXIS, MINMAX))
// UPDATE_ENDSTOP_BIT: set the current endstop bits for an endstop to its status
#define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
@ -257,7 +257,7 @@ void Endstops::update() {
#define UPDATE_ENDSTOP(AXIS,MINMAX) do { \
UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \
if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX)) && stepper.current_block->steps[_AXIS(AXIS)] > 0) { \
_ENDSTOP_HIT(AXIS); \
_ENDSTOP_HIT(AXIS, MINMAX); \
stepper.endstop_triggered(_AXIS(AXIS)); \
} \
} while(0)
@ -267,9 +267,9 @@ void Endstops::update() {
if (G38_move) {
UPDATE_ENDSTOP_BIT(Z, MIN_PROBE);
if (TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE))) {
if (stepper.current_block->steps[_AXIS(X)] > 0) { _ENDSTOP_HIT(X); stepper.endstop_triggered(_AXIS(X)); }
else if (stepper.current_block->steps[_AXIS(Y)] > 0) { _ENDSTOP_HIT(Y); stepper.endstop_triggered(_AXIS(Y)); }
else if (stepper.current_block->steps[_AXIS(Z)] > 0) { _ENDSTOP_HIT(Z); stepper.endstop_triggered(_AXIS(Z)); }
if (stepper.current_block->steps[_AXIS(X)] > 0) { _ENDSTOP_HIT(X, MIN); stepper.endstop_triggered(_AXIS(X)); }
else if (stepper.current_block->steps[_AXIS(Y)] > 0) { _ENDSTOP_HIT(Y, MIN); stepper.endstop_triggered(_AXIS(Y)); }
else if (stepper.current_block->steps[_AXIS(Z)] > 0) { _ENDSTOP_HIT(Z, MIN); stepper.endstop_triggered(_AXIS(Z)); }
G38_endstop_hit = true;
}
}

17
Marlin/language_en.h

@ -717,7 +717,7 @@
#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrate Center")
#endif
#ifndef MSG_DELTA_SETTINGS
#define MSG_DELTA_SETTINGS _UxGT("Show Delta Settings")
#define MSG_DELTA_SETTINGS _UxGT("Delta Settings")
#endif
#ifndef MSG_DELTA_AUTO_CALIBRATE
#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto Calibration")
@ -725,6 +725,15 @@
#ifndef MSG_DELTA_HEIGHT_CALIBRATE
#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Set Delta Height")
#endif
#ifndef MSG_DELTA_DIAG_ROG
#define MSG_DELTA_DIAG_ROG _UxGT("Diag Rod")
#endif
#ifndef MSG_DELTA_HEIGHT
#define MSG_DELTA_HEIGHT _UxGT("Height")
#endif
#ifndef MSG_DELTA_RADIUS
#define MSG_DELTA_RADIUS _UxGT("Radius")
#endif
#ifndef MSG_INFO_MENU
#define MSG_INFO_MENU _UxGT("About Printer")
#endif
@ -840,6 +849,12 @@
#ifndef MSG_FILAMENT_CHANGE_NOZZLE
#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozzle: ")
#endif
#ifndef MSG_ERR_HOMING_FAILED
#define MSG_ERR_HOMING_FAILED _UxGT("Homing failed")
#endif
#ifndef MSG_ERR_PROBING_FAILED
#define MSG_ERR_PROBING_FAILED _UxGT("Probing failed")
#endif
//
// Filament Change screens show up to 3 lines on a 4-line display

18
Marlin/ultralcd.cpp

@ -2537,15 +2537,23 @@ void kill_screen(const char* lcd_msg) {
void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); }
void _goto_center() { _man_probe_pt(0,0); }
void lcd_delta_G33_settings() {
static float _delta_height = DELTA_HEIGHT;
void _lcd_set_delta_height() {
home_offset[Z_AXIS] = _delta_height - DELTA_HEIGHT;
update_software_endstops(Z_AXIS);
}
void lcd_delta_settings() {
START_MENU();
MENU_BACK(MSG_DELTA_CALIBRATE);
float delta_height = DELTA_HEIGHT + home_offset[Z_AXIS], Tz = 0.00;
MENU_ITEM_EDIT(float52, "Height", &delta_height, delta_height, delta_height);
float Tz = 0.00;
MENU_ITEM_EDIT(float52, MSG_DELTA_DIAG_ROG, &delta_diagonal_rod, DELTA_DIAGONAL_ROD - 5.0, DELTA_DIAGONAL_ROD + 5.0);
_delta_height = DELTA_HEIGHT + home_offset[Z_AXIS];
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_HEIGHT, &_delta_height, _delta_height - 10.0, _delta_height + 10.0, _lcd_set_delta_height);
MENU_ITEM_EDIT(float43, "Ex", &endstop_adj[A_AXIS], -5.0, 5.0);
MENU_ITEM_EDIT(float43, "Ey", &endstop_adj[B_AXIS], -5.0, 5.0);
MENU_ITEM_EDIT(float43, "Ez", &endstop_adj[C_AXIS], -5.0, 5.0);
MENU_ITEM_EDIT(float52, "Radius", &delta_radius, DELTA_RADIUS - 5.0, DELTA_RADIUS + 5.0);
MENU_ITEM_EDIT(float52, MSG_DELTA_RADIUS, &delta_radius, DELTA_RADIUS - 5.0, DELTA_RADIUS + 5.0);
MENU_ITEM_EDIT(float43, "Tx", &delta_tower_angle_trim[A_AXIS], -5.0, 5.0);
MENU_ITEM_EDIT(float43, "Ty", &delta_tower_angle_trim[B_AXIS], -5.0, 5.0);
MENU_ITEM_EDIT(float43, "Tz", &Tz, -5.0, 5.0);
@ -2556,7 +2564,7 @@ void kill_screen(const char* lcd_msg) {
START_MENU();
MENU_BACK(MSG_MAIN);
#if ENABLED(DELTA_AUTO_CALIBRATION)
MENU_ITEM(submenu, MSG_DELTA_SETTINGS, lcd_delta_G33_settings);
MENU_ITEM(submenu, MSG_DELTA_SETTINGS, lcd_delta_settings);
MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33"));
MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 P1"));
#if ENABLED(EEPROM_SETTINGS)

Loading…
Cancel
Save