Proposed feature: Set Home Offsets

Add an item to the LCD menu that applies the current axis position to
the “add_homeing” offset.
This commit is contained in:
Scott Lahteine 2014-10-05 13:35:45 -07:00
parent cb4a6dd2dc
commit 2f6c57eadc
2 changed files with 29 additions and 0 deletions

View File

@ -155,6 +155,7 @@
#define MSG_AUTOSTART "Autostart" #define MSG_AUTOSTART "Autostart"
#define MSG_DISABLE_STEPPERS "Disable steppers" #define MSG_DISABLE_STEPPERS "Disable steppers"
#define MSG_AUTO_HOME "Auto home" #define MSG_AUTO_HOME "Auto home"
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Set origin" #define MSG_SET_ORIGIN "Set origin"
#define MSG_PREHEAT_PLA "Preheat PLA" #define MSG_PREHEAT_PLA "Preheat PLA"
#define MSG_PREHEAT_PLA0 "Preheat PLA 1" #define MSG_PREHEAT_PLA0 "Preheat PLA 1"
@ -279,6 +280,7 @@
#define MSG_AUTOSTART "Autostart" #define MSG_AUTOSTART "Autostart"
#define MSG_DISABLE_STEPPERS "Wylacz silniki" #define MSG_DISABLE_STEPPERS "Wylacz silniki"
#define MSG_AUTO_HOME "Auto. poz. zerowa" #define MSG_AUTO_HOME "Auto. poz. zerowa"
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Ustaw punkt zero" #define MSG_SET_ORIGIN "Ustaw punkt zero"
#define MSG_PREHEAT_PLA "Rozgrzej PLA" #define MSG_PREHEAT_PLA "Rozgrzej PLA"
#define MSG_PREHEAT_PLA0 "Rozgrzej PLA 1" #define MSG_PREHEAT_PLA0 "Rozgrzej PLA 1"
@ -406,6 +408,7 @@
#define MSG_AUTOSTART "Demarrage auto" #define MSG_AUTOSTART "Demarrage auto"
#define MSG_DISABLE_STEPPERS "Arreter moteurs" #define MSG_DISABLE_STEPPERS "Arreter moteurs"
#define MSG_AUTO_HOME "Home auto." #define MSG_AUTO_HOME "Home auto."
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Regler origine" #define MSG_SET_ORIGIN "Regler origine"
#define MSG_PREHEAT_PLA " Prechauffage PLA" #define MSG_PREHEAT_PLA " Prechauffage PLA"
#define MSG_PREHEAT_PLA0 "Prechauff. PLA 1" #define MSG_PREHEAT_PLA0 "Prechauff. PLA 1"
@ -534,6 +537,7 @@
#define MSG_AUTOSTART "Autostart" #define MSG_AUTOSTART "Autostart"
#define MSG_DISABLE_STEPPERS "Stepper abschalt." #define MSG_DISABLE_STEPPERS "Stepper abschalt."
#define MSG_AUTO_HOME "Auto Nullpunkt" #define MSG_AUTO_HOME "Auto Nullpunkt"
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Setze Nullpunkt" #define MSG_SET_ORIGIN "Setze Nullpunkt"
#define MSG_PREHEAT_PLA "Vorwärmen PLA" #define MSG_PREHEAT_PLA "Vorwärmen PLA"
#define MSG_PREHEAT_PLA0 "Vorwärmen PLA 1" #define MSG_PREHEAT_PLA0 "Vorwärmen PLA 1"
@ -661,6 +665,7 @@
#define MSG_AUTOSTART " Autostart" #define MSG_AUTOSTART " Autostart"
#define MSG_DISABLE_STEPPERS "Apagar motores" #define MSG_DISABLE_STEPPERS "Apagar motores"
#define MSG_AUTO_HOME "Llevar al origen" #define MSG_AUTO_HOME "Llevar al origen"
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Establecer cero" #define MSG_SET_ORIGIN "Establecer cero"
#define MSG_PREHEAT_PLA "Precalentar PLA" #define MSG_PREHEAT_PLA "Precalentar PLA"
#define MSG_PREHEAT_PLA0 "Precalentar PLA 1" #define MSG_PREHEAT_PLA0 "Precalentar PLA 1"
@ -794,6 +799,7 @@
#define MSG_AUTOSTART "Автостарт" #define MSG_AUTOSTART "Автостарт"
#define MSG_DISABLE_STEPPERS "Выкл. двигатели" #define MSG_DISABLE_STEPPERS "Выкл. двигатели"
#define MSG_AUTO_HOME "Парковка" #define MSG_AUTO_HOME "Парковка"
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Запомнить ноль" #define MSG_SET_ORIGIN "Запомнить ноль"
#define MSG_PREHEAT_PLA "Преднагрев PLA" #define MSG_PREHEAT_PLA "Преднагрев PLA"
#define MSG_PREHEAT_PLA0 "Преднагрев PLA0" #define MSG_PREHEAT_PLA0 "Преднагрев PLA0"
@ -919,6 +925,7 @@
#define MSG_AUTOSTART "Autostart" #define MSG_AUTOSTART "Autostart"
#define MSG_DISABLE_STEPPERS "Disabilita Motori" #define MSG_DISABLE_STEPPERS "Disabilita Motori"
#define MSG_AUTO_HOME "Auto Home" #define MSG_AUTO_HOME "Auto Home"
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Imposta Origine" #define MSG_SET_ORIGIN "Imposta Origine"
#define MSG_PREHEAT_PLA "Preriscalda PLA" #define MSG_PREHEAT_PLA "Preriscalda PLA"
#define MSG_PREHEAT_PLA0 "Preriscalda PLA 1" #define MSG_PREHEAT_PLA0 "Preriscalda PLA 1"
@ -1044,6 +1051,7 @@
#define MSG_AUTOSTART "Autostart" #define MSG_AUTOSTART "Autostart"
#define MSG_DISABLE_STEPPERS " Apagar motores" #define MSG_DISABLE_STEPPERS " Apagar motores"
#define MSG_AUTO_HOME "Ir para origen" #define MSG_AUTO_HOME "Ir para origen"
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Estabelecer orig." #define MSG_SET_ORIGIN "Estabelecer orig."
#define MSG_PREHEAT_PLA "Pre-aquecer PLA" #define MSG_PREHEAT_PLA "Pre-aquecer PLA"
#define MSG_PREHEAT_PLA0 " pre-aquecer PLA 1" #define MSG_PREHEAT_PLA0 " pre-aquecer PLA 1"
@ -1176,6 +1184,7 @@
#define MSG_AUTOSTART "Automaatti" #define MSG_AUTOSTART "Automaatti"
#define MSG_DISABLE_STEPPERS "Vapauta moottorit" #define MSG_DISABLE_STEPPERS "Vapauta moottorit"
#define MSG_AUTO_HOME "Aja referenssiin" #define MSG_AUTO_HOME "Aja referenssiin"
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Aseta origo" #define MSG_SET_ORIGIN "Aseta origo"
#define MSG_PREHEAT_PLA "Esilammita PLA" #define MSG_PREHEAT_PLA "Esilammita PLA"
#define MSG_PREHEAT_PLA0 "Esilammita PLA 1" #define MSG_PREHEAT_PLA0 "Esilammita PLA 1"
@ -1299,6 +1308,7 @@
#define MSG_AUTOSTART " Autostart" #define MSG_AUTOSTART " Autostart"
#define MSG_DISABLE_STEPPERS "Amortar motors" #define MSG_DISABLE_STEPPERS "Amortar motors"
#define MSG_AUTO_HOME "Levar a l'orichen" #define MSG_AUTO_HOME "Levar a l'orichen"
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Establir zero" #define MSG_SET_ORIGIN "Establir zero"
#define MSG_PREHEAT_PLA "Precalentar PLA" #define MSG_PREHEAT_PLA "Precalentar PLA"
#define MSG_PREHEAT_PLA0 "Precalentar PLA0" #define MSG_PREHEAT_PLA0 "Precalentar PLA0"
@ -1431,6 +1441,7 @@
#define MSG_AUTOSTART "Autostart" #define MSG_AUTOSTART "Autostart"
#define MSG_DISABLE_STEPPERS "Motoren uit" #define MSG_DISABLE_STEPPERS "Motoren uit"
#define MSG_AUTO_HOME "Auto home" #define MSG_AUTO_HOME "Auto home"
#define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Nulpunt instellen" #define MSG_SET_ORIGIN "Nulpunt instellen"
#define MSG_PREHEAT_PLA "PLA voorverwarmen" #define MSG_PREHEAT_PLA "PLA voorverwarmen"
#define MSG_PREHEAT_PLA0 "PLA voorverw. 0" #define MSG_PREHEAT_PLA0 "PLA voorverw. 0"

View File

@ -307,6 +307,23 @@ static void lcd_autostart_sd()
} }
#endif #endif
void lcd_set_home_offsets()
{
for(int8_t i=0; i < NUM_AXIS; i++) {
if (i != E_AXIS) {
add_homeing[i] -= current_position[i];
current_position[i] = 0.0;
}
}
plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]);
// Audio feedback
enquecommand_P(PSTR("M300 S659 P200"));
enquecommand_P(PSTR("M300 S698 P200"));
lcd_return_to_status();
}
#ifdef BABYSTEPPING #ifdef BABYSTEPPING
static void lcd_babystep_x() static void lcd_babystep_x()
{ {
@ -566,6 +583,7 @@ static void lcd_prepare_menu()
#endif #endif
MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
//MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0")); //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
#if TEMP_SENSOR_0 != 0 #if TEMP_SENSOR_0 != 0
#if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0 #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0