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

+ 18
- 0
Marlin/ultralcd.cpp View File

307
 }
307
 }
308
 #endif
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
 #ifdef BABYSTEPPING
327
 #ifdef BABYSTEPPING
311
 static void lcd_babystep_x()
328
 static void lcd_babystep_x()
312
 {
329
 {
568
 #endif
585
 #endif
569
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
586
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
570
     MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
587
     MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
588
+    MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
571
     //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
589
     //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
572
 #if TEMP_SENSOR_0 != 0
590
 #if TEMP_SENSOR_0 != 0
573
   #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0
591
   #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0

Loading…
Cancel
Save