Browse Source

Patch up Delta Calibration Menu

Scott Lahteine 7 years ago
parent
commit
641e0936d4

+ 0
- 3
Marlin/example_configurations/delta/biv2.5/Configuration.h View File

@@ -453,10 +453,7 @@
453 453
   #define DELTA_PRINTABLE_RADIUS 160.0
454 454
 
455 455
   // Delta calibration menu
456
-  // uncomment to add three points calibration menu option.
457 456
   // See http://minow.blogspot.com/index.html#4918805519571907051
458
-  // If needed, adjust the X, Y, Z calibration coordinates
459
-  // in ultralcd.cpp@lcd_delta_calibrate_menu()
460 457
   //#define DELTA_CALIBRATION_MENU
461 458
 
462 459
   // After homing move down to a height where XY movement is unconstrained

+ 0
- 3
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -453,10 +453,7 @@
453 453
   #define DELTA_PRINTABLE_RADIUS 140.0
454 454
 
455 455
   // Delta calibration menu
456
-  // uncomment to add three points calibration menu option.
457 456
   // See http://minow.blogspot.com/index.html#4918805519571907051
458
-  // If needed, adjust the X, Y, Z calibration coordinates
459
-  // in ultralcd.cpp@lcd_delta_calibrate_menu()
460 457
   //#define DELTA_CALIBRATION_MENU
461 458
 
462 459
   // After homing move down to a height where XY movement is unconstrained

+ 0
- 3
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -453,10 +453,7 @@
453 453
   #define DELTA_PRINTABLE_RADIUS 90.0
454 454
 
455 455
   // Delta calibration menu
456
-  // uncomment to add three points calibration menu option.
457 456
   // See http://minow.blogspot.com/index.html#4918805519571907051
458
-  // If needed, adjust the X, Y, Z calibration coordinates
459
-  // in ultralcd.cpp@lcd_delta_calibrate_menu()
460 457
   //#define DELTA_CALIBRATION_MENU
461 458
 
462 459
   // After homing move down to a height where XY movement is unconstrained

+ 0
- 3
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

@@ -440,10 +440,7 @@
440 440
   #define DELTA_PRINTABLE_RADIUS 127.0
441 441
 
442 442
   // Delta calibration menu
443
-  // uncomment to add three points calibration menu option.
444 443
   // See http://minow.blogspot.com/index.html#4918805519571907051
445
-  // If needed, adjust the X, Y, Z calibration coordinates
446
-  // in ultralcd.cpp@lcd_delta_calibrate_menu()
447 444
   //#define DELTA_CALIBRATION_MENU
448 445
 
449 446
   // After homing move down to a height where XY movement is unconstrained

+ 0
- 3
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

@@ -451,10 +451,7 @@
451 451
   #define DELTA_PRINTABLE_RADIUS 140.0
452 452
 
453 453
   // Delta calibration menu
454
-  // uncomment to add three points calibration menu option.
455 454
   // See http://minow.blogspot.com/index.html#4918805519571907051
456
-  // If needed, adjust the X, Y, Z calibration coordinates
457
-  // in ultralcd.cpp@lcd_delta_calibrate_menu()
458 455
   //#define DELTA_CALIBRATION_MENU
459 456
 
460 457
   // After homing move down to a height where XY movement is unconstrained

+ 48
- 12
Marlin/ultralcd.cpp View File

@@ -1367,14 +1367,50 @@ KeepDrawing:
1367 1367
     END_MENU();
1368 1368
   }
1369 1369
 
1370
+  float move_menu_scale;
1371
+
1370 1372
   #if ENABLED(DELTA_CALIBRATION_MENU)
1371 1373
 
1374
+    void lcd_move_z();
1375
+    void lcd_delta_calibrate_menu();
1376
+
1377
+    void _lcd_calibrate_homing() {
1378
+      if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_HOMING));
1379
+      lcdDrawUpdate =
1380
+        #if ENABLED(DOGLCD)
1381
+          LCDVIEW_CALL_REDRAW_NEXT
1382
+        #else
1383
+          LCDVIEW_CALL_NO_REDRAW
1384
+        #endif
1385
+      ;
1386
+      if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
1387
+        lcd_goto_previous_menu();
1388
+    }
1389
+
1390
+    void _lcd_delta_calibrate_home() {
1391
+      enqueue_and_echo_commands_P(PSTR("G28"));
1392
+      lcd_goto_screen(_lcd_calibrate_homing);
1393
+    }
1394
+
1395
+    // Move directly to the tower position with uninterpolated moves
1396
+    // If we used interpolated moves it would cause this to become re-entrant
1372 1397
     void _goto_tower_pos(const float &a) {
1373
-      do_blocking_move_to(
1374
-        a < 0 ? X_HOME_POS : sin(a) * -(DELTA_PRINTABLE_RADIUS),
1375
-        a < 0 ? Y_HOME_POS : cos(a) *  (DELTA_PRINTABLE_RADIUS),
1376
-        4
1377
-      );
1398
+      if (no_reentrance) return;
1399
+
1400
+      current_position[Z_AXIS] = max(Z_HOMING_HEIGHT, Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5;
1401
+      line_to_current(Z_AXIS);
1402
+
1403
+      current_position[X_AXIS] = a < 0 ? X_HOME_POS : sin(a) * -(DELTA_PRINTABLE_RADIUS);
1404
+      current_position[Y_AXIS] = a < 0 ? Y_HOME_POS : cos(a) *  (DELTA_PRINTABLE_RADIUS);
1405
+      line_to_current(Z_AXIS);
1406
+
1407
+      current_position[Z_AXIS] = 4.0;
1408
+      line_to_current(Z_AXIS);
1409
+
1410
+      lcd_synchronize();
1411
+
1412
+      move_menu_scale = 0.1;
1413
+      lcd_goto_screen(lcd_move_z);
1378 1414
     }
1379 1415
 
1380 1416
     void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
@@ -1385,18 +1421,18 @@ KeepDrawing:
1385 1421
     void lcd_delta_calibrate_menu() {
1386 1422
       START_MENU();
1387 1423
       MENU_BACK(MSG_MAIN);
1388
-      MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
1389
-      MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
1390
-      MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
1391
-      MENU_ITEM(function, MSG_DELTA_CALIBRATE_Z, _goto_tower_z);
1392
-      MENU_ITEM(function, MSG_DELTA_CALIBRATE_CENTER, _goto_center);
1424
+      MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home);
1425
+      if (axis_homed[Z_AXIS]) {
1426
+        MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
1427
+        MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
1428
+        MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Z, _goto_tower_z);
1429
+        MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_CENTER, _goto_center);
1430
+      }
1393 1431
       END_MENU();
1394 1432
     }
1395 1433
 
1396 1434
   #endif // DELTA_CALIBRATION_MENU
1397 1435
 
1398
-  float move_menu_scale;
1399
-
1400 1436
   /**
1401 1437
    * If the most recent manual move hasn't been fed to the planner yet,
1402 1438
    * and the planner can accept one, send immediately

Loading…
Cancel
Save