Преглед изворни кода

Account for coordinate space more in G28 / G29 / M48

Scott Lahteine пре 9 година
родитељ
комит
2595a40a61
1 измењених фајлова са 16 додато и 16 уклоњено
  1. 16
    16
      Marlin/Marlin_main.cpp

+ 16
- 16
Marlin/Marlin_main.cpp Прегледај датотеку

@@ -3075,7 +3075,7 @@ inline void gcode_G28() {
3075 3075
            * NOTE: This doesn't necessarily ensure the Z probe is also
3076 3076
            * within the bed!
3077 3077
            */
3078
-          float cpx = current_position[X_AXIS], cpy = current_position[Y_AXIS];
3078
+          float cpx = RAW_CURRENT_POSITION(X_AXIS), cpy = RAW_CURRENT_POSITION(Y_AXIS);
3079 3079
           if (   cpx >= X_MIN_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
3080 3080
               && cpx <= X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER)
3081 3081
               && cpy >= Y_MIN_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER)
@@ -3472,36 +3472,36 @@ inline void gcode_G28() {
3472 3472
 
3473 3473
       xy_probe_feedrate_mm_m = code_seen('S') ? (int)code_value_linear_units() : XY_PROBE_SPEED;
3474 3474
 
3475
-      int left_probe_bed_position = code_seen('L') ? (int)code_value_axis_units(X_AXIS) : LEFT_PROBE_BED_POSITION,
3476
-          right_probe_bed_position = code_seen('R') ? (int)code_value_axis_units(X_AXIS) : RIGHT_PROBE_BED_POSITION,
3477
-          front_probe_bed_position = code_seen('F') ? (int)code_value_axis_units(Y_AXIS) : FRONT_PROBE_BED_POSITION,
3478
-          back_probe_bed_position = code_seen('B') ? (int)code_value_axis_units(Y_AXIS) : BACK_PROBE_BED_POSITION;
3475
+      int left_probe_bed_position = code_seen('L') ? (int)code_value_axis_units(X_AXIS) : LOGICAL_X_POSITION(LEFT_PROBE_BED_POSITION),
3476
+          right_probe_bed_position = code_seen('R') ? (int)code_value_axis_units(X_AXIS) : LOGICAL_X_POSITION(RIGHT_PROBE_BED_POSITION),
3477
+          front_probe_bed_position = code_seen('F') ? (int)code_value_axis_units(Y_AXIS) : LOGICAL_Y_POSITION(FRONT_PROBE_BED_POSITION),
3478
+          back_probe_bed_position = code_seen('B') ? (int)code_value_axis_units(Y_AXIS) : LOGICAL_Y_POSITION(BACK_PROBE_BED_POSITION);
3479 3479
 
3480
-      bool left_out_l = left_probe_bed_position < MIN_PROBE_X,
3480
+      bool left_out_l = left_probe_bed_position < LOGICAL_X_POSITION(MIN_PROBE_X),
3481 3481
            left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - (MIN_PROBE_EDGE),
3482
-           right_out_r = right_probe_bed_position > MAX_PROBE_X,
3482
+           right_out_r = right_probe_bed_position > LOGICAL_X_POSITION(MAX_PROBE_X),
3483 3483
            right_out = right_out_r || right_probe_bed_position < left_probe_bed_position + MIN_PROBE_EDGE,
3484
-           front_out_f = front_probe_bed_position < MIN_PROBE_Y,
3484
+           front_out_f = front_probe_bed_position < LOGICAL_Y_POSITION(MIN_PROBE_Y),
3485 3485
            front_out = front_out_f || front_probe_bed_position > back_probe_bed_position - (MIN_PROBE_EDGE),
3486
-           back_out_b = back_probe_bed_position > MAX_PROBE_Y,
3486
+           back_out_b = back_probe_bed_position > LOGICAL_Y_POSITION(MAX_PROBE_Y),
3487 3487
            back_out = back_out_b || back_probe_bed_position < front_probe_bed_position + MIN_PROBE_EDGE;
3488 3488
 
3489 3489
       if (left_out || right_out || front_out || back_out) {
3490 3490
         if (left_out) {
3491 3491
           out_of_range_error(PSTR("(L)eft"));
3492
-          left_probe_bed_position = left_out_l ? MIN_PROBE_X : right_probe_bed_position - (MIN_PROBE_EDGE);
3492
+          left_probe_bed_position = left_out_l ? LOGICAL_X_POSITION(MIN_PROBE_X) : right_probe_bed_position - (MIN_PROBE_EDGE);
3493 3493
         }
3494 3494
         if (right_out) {
3495 3495
           out_of_range_error(PSTR("(R)ight"));
3496
-          right_probe_bed_position = right_out_r ? MAX_PROBE_X : left_probe_bed_position + MIN_PROBE_EDGE;
3496
+          right_probe_bed_position = right_out_r ? LOGICAL_Y_POSITION(MAX_PROBE_X) : left_probe_bed_position + MIN_PROBE_EDGE;
3497 3497
         }
3498 3498
         if (front_out) {
3499 3499
           out_of_range_error(PSTR("(F)ront"));
3500
-          front_probe_bed_position = front_out_f ? MIN_PROBE_Y : back_probe_bed_position - (MIN_PROBE_EDGE);
3500
+          front_probe_bed_position = front_out_f ? LOGICAL_Y_POSITION(MIN_PROBE_Y) : back_probe_bed_position - (MIN_PROBE_EDGE);
3501 3501
         }
3502 3502
         if (back_out) {
3503 3503
           out_of_range_error(PSTR("(B)ack"));
3504
-          back_probe_bed_position = back_out_b ? MAX_PROBE_Y : front_probe_bed_position + MIN_PROBE_EDGE;
3504
+          back_probe_bed_position = back_out_b ? LOGICAL_Y_POSITION(MAX_PROBE_Y) : front_probe_bed_position + MIN_PROBE_EDGE;
3505 3505
         }
3506 3506
         return;
3507 3507
       }
@@ -4208,7 +4208,7 @@ inline void gcode_M42() {
4208 4208
 
4209 4209
     float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : X_current + X_PROBE_OFFSET_FROM_EXTRUDER;
4210 4210
     #if DISABLED(DELTA)
4211
-      if (X_probe_location < MIN_PROBE_X || X_probe_location > MAX_PROBE_X) {
4211
+      if (X_probe_location < LOGICAL_X_POSITION(MIN_PROBE_X) || X_probe_location > LOGICAL_X_POSITION(MAX_PROBE_X)) {
4212 4212
         out_of_range_error(PSTR("X"));
4213 4213
         return;
4214 4214
       }
@@ -4216,12 +4216,12 @@ inline void gcode_M42() {
4216 4216
 
4217 4217
     float Y_probe_location = code_seen('Y') ? code_value_axis_units(Y_AXIS) : Y_current + Y_PROBE_OFFSET_FROM_EXTRUDER;
4218 4218
     #if DISABLED(DELTA)
4219
-      if (Y_probe_location < MIN_PROBE_Y || Y_probe_location > MAX_PROBE_Y) {
4219
+      if (Y_probe_location < LOGICAL_Y_POSITION(MIN_PROBE_Y) || Y_probe_location > LOGICAL_Y_POSITION(MAX_PROBE_Y)) {
4220 4220
         out_of_range_error(PSTR("Y"));
4221 4221
         return;
4222 4222
       }
4223 4223
     #else
4224
-      if (HYPOT(X_probe_location, Y_probe_location) > DELTA_PROBEABLE_RADIUS) {
4224
+      if (HYPOT(RAW_X_POSITION(X_probe_location), RAW_Y_POSITION(Y_probe_location)) > DELTA_PROBEABLE_RADIUS) {
4225 4225
         SERIAL_PROTOCOLLNPGM("? (X,Y) location outside of probeable radius.");
4226 4226
         return;
4227 4227
       }

Loading…
Откажи
Сачувај