|
@@ -1620,10 +1620,6 @@ static void setup_for_endstop_or_probe_move() {
|
1620
|
1620
|
feedrate_multiplier = 100;
|
1621
|
1621
|
refresh_cmd_timeout();
|
1622
|
1622
|
}
|
1623
|
|
-static void setup_for_endstop_move() {
|
1624
|
|
- setup_for_endstop_or_probe_move();
|
1625
|
|
- endstops.enable();
|
1626
|
|
-}
|
1627
|
1623
|
|
1628
|
1624
|
static void clean_up_after_endstop_or_probe_move() {
|
1629
|
1625
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
@@ -2348,161 +2344,134 @@ static void clean_up_after_endstop_or_probe_move() {
|
2348
|
2344
|
#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
|
2349
|
2345
|
|
2350
|
2346
|
static void homeaxis(AxisEnum axis) {
|
|
2347
|
+ #define HOMEAXIS_DO(LETTER) \
|
|
2348
|
+ ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
|
|
2349
|
+
|
|
2350
|
+ if (!(axis == X_AXIS ? HOMEAXIS_DO(X) : axis == Y_AXIS ? HOMEAXIS_DO(Y) : axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0)) return;
|
|
2351
|
+
|
2351
|
2352
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
2352
|
2353
|
if (DEBUGGING(LEVELING)) {
|
2353
|
2354
|
SERIAL_ECHOPAIR(">>> homeaxis(", axis);
|
2354
|
2355
|
SERIAL_ECHOLNPGM(")");
|
2355
|
2356
|
}
|
2356
|
2357
|
#endif
|
2357
|
|
- #define HOMEAXIS_DO(LETTER) \
|
2358
|
|
- ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
|
2359
|
|
-
|
2360
|
|
- if (axis == X_AXIS ? HOMEAXIS_DO(X) : axis == Y_AXIS ? HOMEAXIS_DO(Y) : axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0) {
|
2361
|
2358
|
|
2362
|
|
- int axis_home_dir =
|
2363
|
|
- #if ENABLED(DUAL_X_CARRIAGE)
|
2364
|
|
- (axis == X_AXIS) ? x_home_dir(active_extruder) :
|
2365
|
|
- #endif
|
2366
|
|
- home_dir(axis);
|
2367
|
|
-
|
2368
|
|
- // Homing Z towards the bed? Deploy the Z probe or endstop.
|
2369
|
|
- #if HAS_BED_PROBE
|
2370
|
|
- if (axis == Z_AXIS && axis_home_dir < 0) {
|
2371
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
2372
|
|
- if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
|
2373
|
|
- #endif
|
2374
|
|
- if (DEPLOY_PROBE()) return;
|
2375
|
|
- }
|
|
2359
|
+ int axis_home_dir =
|
|
2360
|
+ #if ENABLED(DUAL_X_CARRIAGE)
|
|
2361
|
+ (axis == X_AXIS) ? x_home_dir(active_extruder) :
|
2376
|
2362
|
#endif
|
|
2363
|
+ home_dir(axis);
|
2377
|
2364
|
|
2378
|
|
- // Set the axis position as setup for the move
|
2379
|
|
- current_position[axis] = 0;
|
2380
|
|
- sync_plan_position();
|
2381
|
|
-
|
2382
|
|
- // Set a flag for Z motor locking
|
2383
|
|
- #if ENABLED(Z_DUAL_ENDSTOPS)
|
2384
|
|
- if (axis == Z_AXIS) stepper.set_homing_flag(true);
|
2385
|
|
- #endif
|
|
2365
|
+ // Homing Z towards the bed? Deploy the Z probe or endstop.
|
|
2366
|
+ #if HAS_BED_PROBE
|
|
2367
|
+ if (axis == Z_AXIS && axis_home_dir < 0) {
|
|
2368
|
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
2369
|
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
|
|
2370
|
+ #endif
|
|
2371
|
+ if (DEPLOY_PROBE()) return;
|
|
2372
|
+ }
|
|
2373
|
+ #endif
|
2386
|
2374
|
|
2387
|
|
- // Move towards the endstop until an endstop is triggered
|
2388
|
|
- destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
|
2389
|
|
- feedrate = homing_feedrate[axis];
|
2390
|
|
- line_to_destination();
|
2391
|
|
- stepper.synchronize();
|
|
2375
|
+ // Set the axis position as setup for the move
|
|
2376
|
+ current_position[axis] = 0;
|
|
2377
|
+ sync_plan_position();
|
2392
|
2378
|
|
2393
|
|
- // Set the axis position as setup for the move
|
2394
|
|
- current_position[axis] = 0;
|
2395
|
|
- sync_plan_position();
|
|
2379
|
+ // Set a flag for Z motor locking
|
|
2380
|
+ #if ENABLED(Z_DUAL_ENDSTOPS)
|
|
2381
|
+ if (axis == Z_AXIS) stepper.set_homing_flag(true);
|
|
2382
|
+ #endif
|
2396
|
2383
|
|
2397
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
2398
|
|
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)");
|
2399
|
|
- #endif
|
2400
|
|
- endstops.enable(false); // Disable endstops while moving away
|
|
2384
|
+ // Move towards the endstop until an endstop is triggered
|
|
2385
|
+ destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
|
|
2386
|
+ feedrate = homing_feedrate[axis];
|
|
2387
|
+ line_to_destination();
|
|
2388
|
+ stepper.synchronize();
|
2401
|
2389
|
|
2402
|
|
- // Move away from the endstop by the axis HOME_BUMP_MM
|
2403
|
|
- destination[axis] = -home_bump_mm(axis) * axis_home_dir;
|
2404
|
|
- line_to_destination();
|
2405
|
|
- stepper.synchronize();
|
|
2390
|
+ // Set the axis position as setup for the move
|
|
2391
|
+ current_position[axis] = 0;
|
|
2392
|
+ sync_plan_position();
|
2406
|
2393
|
|
2407
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
2408
|
|
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)");
|
2409
|
|
- #endif
|
2410
|
|
- endstops.enable(true); // Enable endstops for next homing move
|
|
2394
|
+ // Move away from the endstop by the axis HOME_BUMP_MM
|
|
2395
|
+ destination[axis] = -home_bump_mm(axis) * axis_home_dir;
|
|
2396
|
+ line_to_destination();
|
|
2397
|
+ stepper.synchronize();
|
2411
|
2398
|
|
2412
|
|
- // Slow down the feedrate for the next move
|
2413
|
|
- set_homing_bump_feedrate(axis);
|
|
2399
|
+ // Slow down the feedrate for the next move
|
|
2400
|
+ set_homing_bump_feedrate(axis);
|
2414
|
2401
|
|
2415
|
|
- // Move slowly towards the endstop until triggered
|
2416
|
|
- destination[axis] = 2 * home_bump_mm(axis) * axis_home_dir;
|
2417
|
|
- line_to_destination();
|
2418
|
|
- stepper.synchronize();
|
|
2402
|
+ // Move slowly towards the endstop until triggered
|
|
2403
|
+ destination[axis] = 2 * home_bump_mm(axis) * axis_home_dir;
|
|
2404
|
+ line_to_destination();
|
|
2405
|
+ stepper.synchronize();
|
2419
|
2406
|
|
2420
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
2421
|
|
- if (DEBUGGING(LEVELING)) DEBUG_POS("> TRIGGER ENDSTOP", current_position);
|
2422
|
|
- #endif
|
|
2407
|
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
2408
|
+ if (DEBUGGING(LEVELING)) DEBUG_POS("> TRIGGER ENDSTOP", current_position);
|
|
2409
|
+ #endif
|
2423
|
2410
|
|
2424
|
|
- #if ENABLED(Z_DUAL_ENDSTOPS)
|
2425
|
|
- if (axis == Z_AXIS) {
|
2426
|
|
- float adj = fabs(z_endstop_adj);
|
2427
|
|
- bool lockZ1;
|
2428
|
|
- if (axis_home_dir > 0) {
|
2429
|
|
- adj = -adj;
|
2430
|
|
- lockZ1 = (z_endstop_adj > 0);
|
2431
|
|
- }
|
2432
|
|
- else
|
2433
|
|
- lockZ1 = (z_endstop_adj < 0);
|
|
2411
|
+ #if ENABLED(Z_DUAL_ENDSTOPS)
|
|
2412
|
+ if (axis == Z_AXIS) {
|
|
2413
|
+ float adj = fabs(z_endstop_adj);
|
|
2414
|
+ bool lockZ1;
|
|
2415
|
+ if (axis_home_dir > 0) {
|
|
2416
|
+ adj = -adj;
|
|
2417
|
+ lockZ1 = (z_endstop_adj > 0);
|
|
2418
|
+ }
|
|
2419
|
+ else
|
|
2420
|
+ lockZ1 = (z_endstop_adj < 0);
|
2434
|
2421
|
|
2435
|
|
- if (lockZ1) stepper.set_z_lock(true); else stepper.set_z2_lock(true);
|
2436
|
|
- sync_plan_position();
|
|
2422
|
+ if (lockZ1) stepper.set_z_lock(true); else stepper.set_z2_lock(true);
|
|
2423
|
+ sync_plan_position();
|
2437
|
2424
|
|
2438
|
|
- // Move to the adjusted endstop height
|
2439
|
|
- feedrate = homing_feedrate[axis];
|
2440
|
|
- destination[Z_AXIS] = adj;
|
2441
|
|
- line_to_destination();
|
2442
|
|
- stepper.synchronize();
|
|
2425
|
+ // Move to the adjusted endstop height
|
|
2426
|
+ feedrate = homing_feedrate[axis];
|
|
2427
|
+ destination[Z_AXIS] = adj;
|
|
2428
|
+ line_to_destination();
|
|
2429
|
+ stepper.synchronize();
|
2443
|
2430
|
|
2444
|
|
- if (lockZ1) stepper.set_z_lock(false); else stepper.set_z2_lock(false);
|
2445
|
|
- stepper.set_homing_flag(false);
|
2446
|
|
- } // Z_AXIS
|
2447
|
|
- #endif
|
|
2431
|
+ if (lockZ1) stepper.set_z_lock(false); else stepper.set_z2_lock(false);
|
|
2432
|
+ stepper.set_homing_flag(false);
|
|
2433
|
+ } // Z_AXIS
|
|
2434
|
+ #endif
|
2448
|
2435
|
|
2449
|
|
- #if ENABLED(DELTA)
|
2450
|
|
- // retrace by the amount specified in endstop_adj
|
2451
|
|
- if (endstop_adj[axis] * axis_home_dir < 0) {
|
2452
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
2453
|
|
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(false)");
|
2454
|
|
- #endif
|
2455
|
|
- endstops.enable(false); // Disable endstops while moving away
|
2456
|
|
- sync_plan_position();
|
2457
|
|
- destination[axis] = endstop_adj[axis];
|
2458
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
2459
|
|
- if (DEBUGGING(LEVELING)) {
|
2460
|
|
- SERIAL_ECHOPAIR("> endstop_adj = ", endstop_adj[axis]);
|
2461
|
|
- DEBUG_POS("", destination);
|
2462
|
|
- }
|
2463
|
|
- #endif
|
2464
|
|
- line_to_destination();
|
2465
|
|
- stepper.synchronize();
|
2466
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
2467
|
|
- if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)");
|
2468
|
|
- #endif
|
2469
|
|
- endstops.enable(true); // Enable endstops for next homing move
|
2470
|
|
- }
|
|
2436
|
+ #if ENABLED(DELTA)
|
|
2437
|
+ // retrace by the amount specified in endstop_adj
|
|
2438
|
+ if (endstop_adj[axis] * axis_home_dir < 0) {
|
|
2439
|
+ sync_plan_position();
|
|
2440
|
+ destination[axis] = endstop_adj[axis];
|
2471
|
2441
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
2472
|
|
- else {
|
2473
|
|
- if (DEBUGGING(LEVELING)) {
|
2474
|
|
- SERIAL_ECHOPAIR("> endstop_adj * axis_home_dir = ", endstop_adj[axis] * axis_home_dir);
|
2475
|
|
- SERIAL_EOL;
|
2476
|
|
- }
|
|
2442
|
+ if (DEBUGGING(LEVELING)) {
|
|
2443
|
+ SERIAL_ECHOPAIR("> endstop_adj = ", endstop_adj[axis]);
|
|
2444
|
+ DEBUG_POS("", destination);
|
2477
|
2445
|
}
|
2478
|
2446
|
#endif
|
2479
|
|
- #endif
|
2480
|
|
-
|
2481
|
|
- // Set the axis position to its home position (plus home offsets)
|
2482
|
|
- set_axis_is_at_home(axis);
|
|
2447
|
+ line_to_destination();
|
|
2448
|
+ stepper.synchronize();
|
|
2449
|
+ }
|
|
2450
|
+ #endif
|
2483
|
2451
|
|
2484
|
|
- SYNC_PLAN_POSITION_KINEMATIC();
|
|
2452
|
+ // Set the axis position to its home position (plus home offsets)
|
|
2453
|
+ set_axis_is_at_home(axis);
|
2485
|
2454
|
|
2486
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
2487
|
|
- if (DEBUGGING(LEVELING)) DEBUG_POS("> AFTER set_axis_is_at_home", current_position);
|
2488
|
|
- #endif
|
|
2455
|
+ SYNC_PLAN_POSITION_KINEMATIC();
|
2489
|
2456
|
|
2490
|
|
- destination[axis] = current_position[axis];
|
2491
|
|
- endstops.hit_on_purpose(); // clear endstop hit flags
|
2492
|
|
- axis_known_position[axis] = true;
|
2493
|
|
- axis_homed[axis] = true;
|
|
2457
|
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
2458
|
+ if (DEBUGGING(LEVELING)) DEBUG_POS("> AFTER set_axis_is_at_home", current_position);
|
|
2459
|
+ #endif
|
2494
|
2460
|
|
2495
|
|
- // Put away the Z probe
|
2496
|
|
- #if HAS_BED_PROBE
|
2497
|
|
- if (axis == Z_AXIS && axis_home_dir < 0) {
|
2498
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
2499
|
|
- if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
|
2500
|
|
- #endif
|
2501
|
|
- if (STOW_PROBE()) return;
|
2502
|
|
- }
|
2503
|
|
- #endif
|
|
2461
|
+ destination[axis] = current_position[axis];
|
|
2462
|
+ endstops.hit_on_purpose(); // clear endstop hit flags
|
|
2463
|
+ axis_known_position[axis] = true;
|
|
2464
|
+ axis_homed[axis] = true;
|
2504
|
2465
|
|
2505
|
|
- }
|
|
2466
|
+ // Put away the Z probe
|
|
2467
|
+ #if HAS_BED_PROBE
|
|
2468
|
+ if (axis == Z_AXIS && axis_home_dir < 0) {
|
|
2469
|
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
2470
|
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
|
|
2471
|
+ #endif
|
|
2472
|
+ if (STOW_PROBE()) return;
|
|
2473
|
+ }
|
|
2474
|
+ #endif
|
2506
|
2475
|
|
2507
|
2476
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
2508
|
2477
|
if (DEBUGGING(LEVELING)) {
|
|
@@ -2779,8 +2748,6 @@ inline void gcode_G4() {
|
2779
|
2748
|
int x_axis_home_dir = home_dir(X_AXIS);
|
2780
|
2749
|
#endif
|
2781
|
2750
|
|
2782
|
|
- SYNC_PLAN_POSITION_KINEMATIC();
|
2783
|
|
-
|
2784
|
2751
|
float mlx = max_length(X_AXIS), mly = max_length(Y_AXIS),
|
2785
|
2752
|
mlratio = mlx > mly ? mly / mlx : mlx / mly;
|
2786
|
2753
|
|
|
@@ -2789,30 +2756,9 @@ inline void gcode_G4() {
|
2789
|
2756
|
feedrate = min(homing_feedrate[X_AXIS], homing_feedrate[Y_AXIS]) * sqrt(mlratio * mlratio + 1);
|
2790
|
2757
|
line_to_destination();
|
2791
|
2758
|
stepper.synchronize();
|
2792
|
|
-
|
2793
|
|
- set_axis_is_at_home(X_AXIS);
|
2794
|
|
- set_axis_is_at_home(Y_AXIS);
|
2795
|
|
- SYNC_PLAN_POSITION_KINEMATIC();
|
2796
|
|
-
|
2797
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
2798
|
|
- if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 1", current_position);
|
2799
|
|
- #endif
|
2800
|
|
-
|
2801
|
|
- destination[X_AXIS] = current_position[X_AXIS];
|
2802
|
|
- destination[Y_AXIS] = current_position[Y_AXIS];
|
2803
|
|
- line_to_destination();
|
2804
|
|
- stepper.synchronize();
|
2805
|
2759
|
endstops.hit_on_purpose(); // clear endstop hit flags
|
2806
|
2760
|
|
2807
|
|
- current_position[X_AXIS] = destination[X_AXIS];
|
2808
|
|
- current_position[Y_AXIS] = destination[Y_AXIS];
|
2809
|
|
- #if DISABLED(SCARA)
|
2810
|
|
- current_position[Z_AXIS] = destination[Z_AXIS];
|
2811
|
|
- #endif
|
2812
|
|
-
|
2813
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
2814
|
|
- if (DEBUGGING(LEVELING)) DEBUG_POS("> QUICK_HOME 2", current_position);
|
2815
|
|
- #endif
|
|
2761
|
+ destination[X_AXIS] = destination[Y_AXIS] = 0;
|
2816
|
2762
|
}
|
2817
|
2763
|
|
2818
|
2764
|
#endif // QUICK_HOME
|
|
@@ -2866,7 +2812,12 @@ inline void gcode_G28() {
|
2866
|
2812
|
}
|
2867
|
2813
|
#endif
|
2868
|
2814
|
|
2869
|
|
- setup_for_endstop_move();
|
|
2815
|
+ setup_for_endstop_or_probe_move();
|
|
2816
|
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
2817
|
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.enable(true)");
|
|
2818
|
+ #endif
|
|
2819
|
+ endstops.enable(true); // Enable endstops for next homing move
|
|
2820
|
+
|
2870
|
2821
|
|
2871
|
2822
|
#if ENABLED(DELTA)
|
2872
|
2823
|
/**
|
|
@@ -2915,10 +2866,10 @@ inline void gcode_G28() {
|
2915
|
2866
|
#endif
|
2916
|
2867
|
}
|
2917
|
2868
|
|
2918
|
|
- #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0
|
|
2869
|
+ #else
|
2919
|
2870
|
|
2920
|
|
- // Raise Z before homing X or Y, if specified
|
2921
|
2871
|
if (home_all_axis || homeX || homeY) {
|
|
2872
|
+ // Raise Z before homing any other axes and z is not already high enough (never lower z)
|
2922
|
2873
|
float z_dest = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING;
|
2923
|
2874
|
if (z_dest > current_position[Z_AXIS]) {
|
2924
|
2875
|
|
|
@@ -2930,19 +2881,13 @@ inline void gcode_G28() {
|
2930
|
2881
|
#endif
|
2931
|
2882
|
|
2932
|
2883
|
feedrate = homing_feedrate[Z_AXIS];
|
2933
|
|
-
|
2934
|
|
- #if HAS_BED_PROBE
|
2935
|
|
- do_blocking_move_to_z(z_dest);
|
2936
|
|
- #else
|
2937
|
|
- line_to_z(z_dest);
|
2938
|
|
- stepper.synchronize();
|
2939
|
|
- #endif
|
2940
|
|
-
|
|
2884
|
+ line_to_z(z_dest);
|
|
2885
|
+ stepper.synchronize();
|
2941
|
2886
|
destination[Z_AXIS] = current_position[Z_AXIS] = z_dest;
|
2942
|
2887
|
}
|
2943
|
2888
|
}
|
2944
|
2889
|
|
2945
|
|
- #endif // MIN_Z_HEIGHT_FOR_HOMING
|
|
2890
|
+ #endif
|
2946
|
2891
|
|
2947
|
2892
|
#if ENABLED(QUICK_HOME)
|
2948
|
2893
|
|
|
@@ -3044,36 +2989,30 @@ inline void gcode_G28() {
|
3044
|
2989
|
*/
|
3045
|
2990
|
current_position[X_AXIS] = destination[X_AXIS];
|
3046
|
2991
|
current_position[Y_AXIS] = destination[Y_AXIS];
|
3047
|
|
-
|
3048
|
|
- // Home the Z axis
|
3049
|
|
- HOMEAXIS(Z);
|
3050
|
2992
|
}
|
3051
|
2993
|
|
3052
|
|
- else if (homeZ) { // Don't need to Home Z twice
|
|
2994
|
+ // Let's see if X and Y are homed
|
|
2995
|
+ if (axis_unhomed_error(true, true, false)) return;
|
3053
|
2996
|
|
3054
|
|
- // Let's see if X and Y are homed
|
3055
|
|
- if (axis_unhomed_error(true, true, false)) return;
|
|
2997
|
+ /**
|
|
2998
|
+ * Make sure the Z probe is within the physical limits
|
|
2999
|
+ * NOTE: This doesn't necessarily ensure the Z probe is also
|
|
3000
|
+ * within the bed!
|
|
3001
|
+ */
|
|
3002
|
+ float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS];
|
|
3003
|
+ if ( cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
|
|
3004
|
+ && cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
|
|
3005
|
+ && cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)
|
|
3006
|
+ && cpy <= Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)) {
|
3056
|
3007
|
|
3057
|
|
- /**
|
3058
|
|
- * Make sure the Z probe is within the physical limits
|
3059
|
|
- * NOTE: This doesn't necessarily ensure the Z probe is also
|
3060
|
|
- * within the bed!
|
3061
|
|
- */
|
3062
|
|
- float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS];
|
3063
|
|
- if ( cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
|
3064
|
|
- && cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
|
3065
|
|
- && cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)
|
3066
|
|
- && cpy <= Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)) {
|
3067
|
|
-
|
3068
|
|
- // Home the Z axis
|
3069
|
|
- HOMEAXIS(Z);
|
3070
|
|
- }
|
3071
|
|
- else {
|
3072
|
|
- LCD_MESSAGEPGM(MSG_ZPROBE_OUT);
|
3073
|
|
- SERIAL_ECHO_START;
|
3074
|
|
- SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT);
|
3075
|
|
- }
|
3076
|
|
- } // !home_all_axes && homeZ
|
|
3008
|
+ // Home the Z axis
|
|
3009
|
+ HOMEAXIS(Z);
|
|
3010
|
+ }
|
|
3011
|
+ else {
|
|
3012
|
+ LCD_MESSAGEPGM(MSG_ZPROBE_OUT);
|
|
3013
|
+ SERIAL_ECHO_START;
|
|
3014
|
+ SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT);
|
|
3015
|
+ }
|
3077
|
3016
|
|
3078
|
3017
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
3079
|
3018
|
if (DEBUGGING(LEVELING)) {
|
|
@@ -3099,7 +3038,11 @@ inline void gcode_G28() {
|
3099
|
3038
|
|
3100
|
3039
|
#endif // !DELTA (gcode_G28)
|
3101
|
3040
|
|
|
3041
|
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
3042
|
+ if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> endstops.not_homing()");
|
|
3043
|
+ #endif
|
3102
|
3044
|
endstops.not_homing();
|
|
3045
|
+ endstops.hit_on_purpose(); // clear endstop hit flags
|
3103
|
3046
|
|
3104
|
3047
|
// Enable mesh leveling again
|
3105
|
3048
|
#if ENABLED(MESH_BED_LEVELING)
|
|
@@ -3139,8 +3082,6 @@ inline void gcode_G28() {
|
3139
|
3082
|
|
3140
|
3083
|
clean_up_after_endstop_or_probe_move();
|
3141
|
3084
|
|
3142
|
|
- endstops.hit_on_purpose(); // clear endstop hit flags
|
3143
|
|
-
|
3144
|
3085
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
3145
|
3086
|
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< gcode_G28");
|
3146
|
3087
|
#endif
|