Browse Source

Merge pull request #1096 from thinkyhead/set-home

Proposed feature: Set Home Offsets
Erik van der Zalm 10 years ago
parent
commit
0f2e0525df
2 changed files with 29 additions and 0 deletions
  1. 11
    0
      Marlin/language.h
  2. 18
    0
      Marlin/ultralcd.cpp

+ 11
- 0
Marlin/language.h View File

@@ -155,6 +155,7 @@
155 155
 	#define MSG_AUTOSTART "Autostart"
156 156
 	#define MSG_DISABLE_STEPPERS "Disable steppers"
157 157
 	#define MSG_AUTO_HOME "Auto home"
158
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
158 159
 	#define MSG_SET_ORIGIN "Set origin"
159 160
 	#define MSG_PREHEAT_PLA "Preheat PLA"
160 161
 	#define MSG_PREHEAT_PLA0 "Preheat PLA 1"
@@ -279,6 +280,7 @@
279 280
 	#define MSG_AUTOSTART "Autostart"
280 281
 	#define MSG_DISABLE_STEPPERS "Wylacz silniki"
281 282
 	#define MSG_AUTO_HOME "Auto. poz. zerowa"
283
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
282 284
 	#define MSG_SET_ORIGIN "Ustaw punkt zero"
283 285
 	#define MSG_PREHEAT_PLA "Rozgrzej PLA"
284 286
 	#define MSG_PREHEAT_PLA0 "Rozgrzej PLA 1"
@@ -406,6 +408,7 @@
406 408
 	#define MSG_AUTOSTART "Demarrage auto"
407 409
 	#define MSG_DISABLE_STEPPERS "Arreter moteurs"
408 410
 	#define MSG_AUTO_HOME "Home auto."
411
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
409 412
 	#define MSG_SET_ORIGIN "Regler origine"
410 413
 	#define MSG_PREHEAT_PLA " Prechauffage PLA"
411 414
 	#define MSG_PREHEAT_PLA0 "Prechauff. PLA 1"
@@ -534,6 +537,7 @@
534 537
 	#define MSG_AUTOSTART        "Autostart"
535 538
 	#define MSG_DISABLE_STEPPERS "Stepper abschalt."
536 539
 	#define MSG_AUTO_HOME        "Auto Nullpunkt"
540
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
537 541
 	#define MSG_SET_ORIGIN       "Setze Nullpunkt"
538 542
 	#define MSG_PREHEAT_PLA      "Vorwärmen PLA"
539 543
 	#define MSG_PREHEAT_PLA0     "Vorwärmen PLA 1"
@@ -661,6 +665,7 @@
661 665
 	#define MSG_AUTOSTART " Autostart"
662 666
 	#define MSG_DISABLE_STEPPERS "Apagar motores"
663 667
 	#define MSG_AUTO_HOME "Llevar al origen"
668
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
664 669
 	#define MSG_SET_ORIGIN "Establecer cero"
665 670
 	#define MSG_PREHEAT_PLA "Precalentar PLA"
666 671
 	#define MSG_PREHEAT_PLA0 "Precalentar PLA 1"
@@ -794,6 +799,7 @@
794 799
 	#define MSG_AUTOSTART						"Автостарт"
795 800
 	#define MSG_DISABLE_STEPPERS 				"Выкл. двигатели"
796 801
 	#define MSG_AUTO_HOME						"Парковка"
802
+	#define MSG_SET_HOME_OFFSETS				"Set home offsets"
797 803
 	#define MSG_SET_ORIGIN						"Запомнить ноль"
798 804
 	#define MSG_PREHEAT_PLA 					"Преднагрев PLA"
799 805
 	#define MSG_PREHEAT_PLA0					"Преднагрев PLA0"
@@ -919,6 +925,7 @@
919 925
 	#define MSG_AUTOSTART            "Autostart"
920 926
 	#define MSG_DISABLE_STEPPERS     "Disabilita Motori"
921 927
 	#define MSG_AUTO_HOME            "Auto Home"
928
+	#define MSG_SET_HOME_OFFSETS     "Set home offsets"
922 929
 	#define MSG_SET_ORIGIN           "Imposta Origine"
923 930
 	#define MSG_PREHEAT_PLA          "Preriscalda PLA"
924 931
 	#define MSG_PREHEAT_PLA0         "Preriscalda PLA 1"
@@ -1044,6 +1051,7 @@
1044 1051
 	#define MSG_AUTOSTART "Autostart"
1045 1052
 	#define MSG_DISABLE_STEPPERS " Apagar motores"
1046 1053
 	#define MSG_AUTO_HOME "Ir para origen"
1054
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
1047 1055
 	#define MSG_SET_ORIGIN "Estabelecer orig."
1048 1056
 	#define MSG_PREHEAT_PLA "Pre-aquecer PLA"
1049 1057
 	#define MSG_PREHEAT_PLA0 " pre-aquecer PLA 1"
@@ -1176,6 +1184,7 @@
1176 1184
 	#define MSG_AUTOSTART "Automaatti"
1177 1185
 	#define MSG_DISABLE_STEPPERS "Vapauta moottorit"
1178 1186
 	#define MSG_AUTO_HOME "Aja referenssiin"
1187
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
1179 1188
 	#define MSG_SET_ORIGIN "Aseta origo"
1180 1189
 	#define MSG_PREHEAT_PLA "Esilammita PLA"
1181 1190
 	#define MSG_PREHEAT_PLA0 "Esilammita PLA 1"
@@ -1299,6 +1308,7 @@
1299 1308
 	#define MSG_AUTOSTART " Autostart"
1300 1309
 	#define MSG_DISABLE_STEPPERS "Amortar motors"
1301 1310
 	#define MSG_AUTO_HOME "Levar a l'orichen"
1311
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
1302 1312
 	#define MSG_SET_ORIGIN "Establir zero"
1303 1313
 	#define MSG_PREHEAT_PLA "Precalentar PLA"
1304 1314
 	#define MSG_PREHEAT_PLA0 "Precalentar PLA0"
@@ -1431,6 +1441,7 @@
1431 1441
 	#define MSG_AUTOSTART "Autostart"
1432 1442
 	#define MSG_DISABLE_STEPPERS "Motoren uit"
1433 1443
 	#define MSG_AUTO_HOME "Auto home"
1444
+	#define MSG_SET_HOME_OFFSETS "Set home offsets"
1434 1445
 	#define MSG_SET_ORIGIN "Nulpunt instellen"
1435 1446
 	#define MSG_PREHEAT_PLA "PLA voorverwarmen"
1436 1447
 	#define MSG_PREHEAT_PLA0 "PLA voorverw. 0"

+ 18
- 0
Marlin/ultralcd.cpp View File

@@ -307,6 +307,23 @@ static void lcd_autostart_sd()
307 307
 }
308 308
 #endif
309 309
 
310
+void lcd_set_home_offsets()
311
+{
312
+    for(int8_t i=0; i < NUM_AXIS; i++) {
313
+      if (i != E_AXIS) {
314
+        add_homeing[i] -= current_position[i];
315
+        current_position[i] = 0.0;
316
+      }
317
+    }
318
+    plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]);
319
+
320
+    // Audio feedback
321
+    enquecommand_P(PSTR("M300 S659 P200"));
322
+    enquecommand_P(PSTR("M300 S698 P200"));
323
+    lcd_return_to_status();
324
+}
325
+
326
+
310 327
 #ifdef BABYSTEPPING
311 328
 static void lcd_babystep_x()
312 329
 {
@@ -568,6 +585,7 @@ static void lcd_prepare_menu()
568 585
 #endif
569 586
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
570 587
     MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
588
+    MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
571 589
     //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
572 590
 #if TEMP_SENSOR_0 != 0
573 591
   #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0

Loading…
Cancel
Save