Quellcode durchsuchen

Accurate bed leveling: x loop inside y and zigzag motion

Francesco Santini vor 11 Jahren
Ursprung
Commit
da2a6f9a31
1 geänderte Dateien mit 19 neuen und 2 gelöschten Zeilen
  1. 19
    2
      Marlin/Marlin_main.cpp

+ 19
- 2
Marlin/Marlin_main.cpp Datei anzeigen

@@ -1368,10 +1368,26 @@ void process_commands()
1368 1368
             
1369 1369
             
1370 1370
             int probePointCounter = 0;
1371
+            bool zig = true;
1371 1372
             
1372
-            for (int xProbe=LEFT_PROBE_BED_POSITION; xProbe <= RIGHT_PROBE_BED_POSITION; xProbe += xGridSpacing)
1373
+            for (int yProbe=FRONT_PROBE_BED_POSITION; yProbe <= BACK_PROBE_BED_POSITION; yProbe += yGridSpacing)
1373 1374
             {
1374
-              for (int yProbe=FRONT_PROBE_BED_POSITION; yProbe <= BACK_PROBE_BED_POSITION; yProbe += yGridSpacing)
1375
+              int xProbe, xInc;
1376
+              if (zig)
1377
+              {
1378
+                xProbe = LEFT_PROBE_BED_POSITION;
1379
+                //xEnd = RIGHT_PROBE_BED_POSITION;
1380
+                xInc = xGridSpacing;
1381
+                zig = false;
1382
+              } else // zag
1383
+              {
1384
+                xProbe = RIGHT_PROBE_BED_POSITION;
1385
+                //xEnd = LEFT_PROBE_BED_POSITION;
1386
+                xInc = -xGridSpacing;
1387
+                zig = true;
1388
+              }
1389
+              
1390
+              for (int xCount=0; xCount < ACCURATE_BED_LEVELING_POINTS; xCount++)
1375 1391
               {
1376 1392
                 if (probePointCounter == 0)
1377 1393
                 {
@@ -1403,6 +1419,7 @@ void process_commands()
1403 1419
                 eqnAMatrix[probePointCounter + 1*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = yProbe;
1404 1420
                 eqnAMatrix[probePointCounter + 2*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = 1;
1405 1421
                 probePointCounter++;
1422
+                xProbe += xInc;
1406 1423
               }
1407 1424
             }
1408 1425
             clean_up_after_endstop_move();

Laden…
Abbrechen
Speichern