Quellcode durchsuchen

Merge branch 'ProbeDeployment' into Development

Richard Wackerbarth vor 10 Jahren
Ursprung
Commit
0c7bdf569c
2 geänderte Dateien mit 118 neuen und 41 gelöschten Zeilen
  1. 85
    28
      Marlin/Marlin_main.cpp
  2. 33
    13
      Marlin/example_configurations/delta/kossel_mini/Configuration.h

+ 85
- 28
Marlin/Marlin_main.cpp Datei anzeigen

@@ -1296,32 +1296,73 @@ static void setup_for_endstop_move() {
1296 1296
       }
1297 1297
 
1298 1298
     #elif defined(Z_PROBE_ALLEN_KEY)
1299
+      feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE;
1299 1300
 
1300
-      feedrate = homing_feedrate[X_AXIS];
1301
+      // If endstop is already false, the probe is deployed
1302
+      #ifdef Z_PROBE_ENDSTOP
1303
+        bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
1304
+        if (z_probe_endstop)
1305
+      #else
1306
+        bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
1307
+        if (z_min_endstop)
1308
+      #endif
1309
+        {
1301 1310
 
1302
-      // Move to the start position to initiate deployment
1303
-      destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_X;
1304
-      destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Y;
1305
-      destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Z;
1306
-      prepare_move_raw(); // this will also set_current_to_destination
1311
+          // Move to the start position to initiate deployment
1312
+          destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X;
1313
+          destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y;
1314
+          destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Z;
1315
+          prepare_move_raw(); // this will also set_current_to_destination
1307 1316
 
1308
-      // Home X to touch the belt
1309
-      feedrate = homing_feedrate[X_AXIS]/10;
1310
-      destination[X_AXIS] = 0;
1311
-      prepare_move_raw(); // this will also set_current_to_destination
1312
-      
1313
-      // Home Y for safety
1314
-      feedrate = homing_feedrate[X_AXIS]/2;
1315
-      destination[Y_AXIS] = 0;
1317
+          // Move to engage deployment
1318
+          if (Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE) {
1319
+            feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE;
1320
+          }
1321
+          if (Z_PROBE_ALLEN_KEY_DEPLOY_2_X != Z_PROBE_ALLEN_KEY_DEPLOY_1_X) {
1322
+            destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_X;
1323
+          }
1324
+          if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Y != Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) {
1325
+            destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Y;
1326
+          }
1327
+          if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Z != Z_PROBE_ALLEN_KEY_DEPLOY_1_Z) {
1328
+            destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Z;
1329
+          }
1330
+          prepare_move_raw();
1331
+
1332
+          #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3_X
1333
+            if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE) {
1334
+              feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE;
1335
+            }
1336
+
1337
+            // Move to trigger deployment
1338
+            if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE) {
1339
+              feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE;
1340
+            }
1341
+            if (Z_PROBE_ALLEN_KEY_DEPLOY_3_X != Z_PROBE_ALLEN_KEY_DEPLOY_2_X) {
1342
+              destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_X;
1343
+            }
1344
+            if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Y != Z_PROBE_ALLEN_KEY_DEPLOY_2_Y) {
1345
+              destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Y;
1346
+            }
1347
+            if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Z != Z_PROBE_ALLEN_KEY_DEPLOY_2_Z) {
1348
+              destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Z;
1349
+            }
1350
+            prepare_move_raw();
1351
+          #endif
1352
+      }
1353
+
1354
+      // Partially Home X,Y for safety
1355
+      destination[X_AXIS] = destination[X_AXIS]*0.75;
1356
+      destination[Y_AXIS] = destination[Y_AXIS]*0.75;
1316 1357
       prepare_move_raw(); // this will also set_current_to_destination
1317
-      
1358
+
1318 1359
       st_synchronize();
1319 1360
 
1320 1361
       #ifdef Z_PROBE_ENDSTOP
1321
-        bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
1362
+        z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
1322 1363
         if (z_probe_endstop)
1323 1364
       #else
1324
-        bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
1365
+        z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
1325 1366
         if (z_min_endstop)
1326 1367
       #endif
1327 1368
         {
@@ -1366,25 +1407,41 @@ static void setup_for_endstop_move() {
1366 1407
     #elif defined(Z_PROBE_ALLEN_KEY)
1367 1408
 
1368 1409
       // Move up for safety
1369
-      feedrate = homing_feedrate[X_AXIS];
1410
+      feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE;
1370 1411
       destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
1371 1412
       prepare_move_raw(); // this will also set_current_to_destination
1372 1413
 
1373 1414
       // Move to the start position to initiate retraction
1374
-      destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_X;
1375
-      destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_Y;
1376
-      destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_Z;
1377
-      prepare_move_raw(); // this will also set_current_to_destination
1415
+      destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X;
1416
+      destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Y;
1417
+      destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Z;
1418
+      prepare_move_raw();
1378 1419
 
1379 1420
       // Move the nozzle down to push the probe into retracted position
1380
-      feedrate = homing_feedrate[Z_AXIS]/10;
1381
-      destination[Z_AXIS] = current_position[Z_AXIS] - Z_PROBE_ALLEN_KEY_STOW_DEPTH;
1382
-      prepare_move_raw(); // this will also set_current_to_destination
1421
+      if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE) {
1422
+        feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
1423
+      }
1424
+      if (Z_PROBE_ALLEN_KEY_STOW_2_X != Z_PROBE_ALLEN_KEY_STOW_1_X) {
1425
+        destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_X;
1426
+      }
1427
+      if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y) {
1428
+        destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y;
1429
+      }
1430
+      destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z;
1431
+      prepare_move_raw();
1383 1432
       
1384 1433
       // Move up for safety
1385
-      feedrate = homing_feedrate[Z_AXIS]/2;
1386
-      destination[Z_AXIS] = current_position[Z_AXIS] + Z_PROBE_ALLEN_KEY_STOW_DEPTH * 2;
1387
-      prepare_move_raw(); // this will also set_current_to_destination
1434
+      if (Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE) {
1435
+        feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
1436
+      }
1437
+      if (Z_PROBE_ALLEN_KEY_STOW_3_X != Z_PROBE_ALLEN_KEY_STOW_2_X) {
1438
+        destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_X;
1439
+      }
1440
+      if (Z_PROBE_ALLEN_KEY_STOW_3_Y != Z_PROBE_ALLEN_KEY_STOW_2_Y) {
1441
+        destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Y;
1442
+      }
1443
+      destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Z;
1444
+      prepare_move_raw();
1388 1445
       
1389 1446
       // Home XY for safety
1390 1447
       feedrate = homing_feedrate[X_AXIS]/2;

+ 33
- 13
Marlin/example_configurations/delta/kossel_mini/Configuration.h Datei anzeigen

@@ -401,8 +401,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
401 401
   const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
402 402
   #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
403 403
   #define FILAMENT_RUNOUT_SCRIPT "M600"
404
-#endif 
405
-  
404
+#endif
405
+
406 406
 //===========================================================================
407 407
 //=========================== Manual Bed Leveling ===========================
408 408
 //===========================================================================
@@ -454,10 +454,10 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
454 454
 
455 455
     #define LEFT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS
456 456
     #define RIGHT_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS
457
-    #define FRONT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS  
457
+    #define FRONT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS
458 458
     #define BACK_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS
459 459
 
460
-    #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this      
460
+    #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
461 461
 
462 462
     // Non-linear bed leveling will be used.
463 463
     // Compensate by interpolating between the nearest four Z probe values for each point.
@@ -495,7 +495,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
495 495
 
496 496
 //   #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine.
497 497
                                                                             //Useful to retract a deployable probe.
498
-                                                                           
498
+
499 499
   //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
500 500
   //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
501 501
 
@@ -507,16 +507,36 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
507 507
   // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
508 508
   #define Z_PROBE_ALLEN_KEY
509 509
   #ifdef Z_PROBE_ALLEN_KEY
510
-    #define Z_PROBE_ALLEN_KEY_DEPLOY_X 30
511
-    #define Z_PROBE_ALLEN_KEY_DEPLOY_Y DELTA_PRINTABLE_RADIUS
512
-    #define Z_PROBE_ALLEN_KEY_DEPLOY_Z 100
513
-    
514
-    #define Z_PROBE_ALLEN_KEY_STOW_X     -64
515
-    #define Z_PROBE_ALLEN_KEY_STOW_Y     56
516
-    #define Z_PROBE_ALLEN_KEY_STOW_Z     23
510
+
511
+    // Kossel Mini
512
+    #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0
513
+    #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS
514
+    #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0
515
+    #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_TRAVEL_SPEED
516
+    #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0
517
+    #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS
518
+    #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
519
+    #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_TRAVEL_SPEED/10)
520
+
517 521
     #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20
522
+    // Move the probe into position
523
+    #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0
524
+    #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0
525
+    #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0
526
+    #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_TRAVEL_SPEED
527
+    // Move the nozzle down further to push the probe into retracted position.
528
+    #define Z_PROBE_ALLEN_KEY_STOW_2_X  Z_PROBE_ALLEN_KEY_STOW_1_X
529
+    #define Z_PROBE_ALLEN_KEY_STOW_2_Y  Z_PROBE_ALLEN_KEY_STOW_1_Y
530
+    #define Z_PROBE_ALLEN_KEY_STOW_2_Z  (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH)
531
+    #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_TRAVEL_SPEED/10)
532
+    // Raise things back up slightly so we don't bump into anything
533
+    #define Z_PROBE_ALLEN_KEY_STOW_3_X  Z_PROBE_ALLEN_KEY_STOW_2_X
534
+    #define Z_PROBE_ALLEN_KEY_STOW_3_Y  Z_PROBE_ALLEN_KEY_STOW_2_Y
535
+    #define Z_PROBE_ALLEN_KEY_STOW_3_Z  (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH)
536
+    #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_TRAVEL_SPEED/2)
537
+
518 538
   #endif
519
-  
539
+
520 540
   //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
521 541
   //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
522 542
   // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.

Laden…
Abbrechen
Speichern