Browse Source

zprobe_offset => probe_offset

Scott Lahteine 5 years ago
parent
commit
4e8d9fe59b

+ 9
- 9
Marlin/src/core/utility.cpp View File

79
     );
79
     );
80
 
80
 
81
     #if HAS_BED_PROBE
81
     #if HAS_BED_PROBE
82
-      SERIAL_ECHOPAIR("Probe Offset X:", zprobe_offset[X_AXIS], " Y:", zprobe_offset[Y_AXIS], " Z:", zprobe_offset[Z_AXIS]);
83
-      if (zprobe_offset[X_AXIS] > 0)
82
+      SERIAL_ECHOPAIR("Probe Offset X:", probe_offset[X_AXIS], " Y:", probe_offset[Y_AXIS], " Z:", probe_offset[Z_AXIS]);
83
+      if (probe_offset[X_AXIS] > 0)
84
         SERIAL_ECHOPGM(" (Right");
84
         SERIAL_ECHOPGM(" (Right");
85
-      else if (zprobe_offset[X_AXIS] < 0)
85
+      else if (probe_offset[X_AXIS] < 0)
86
         SERIAL_ECHOPGM(" (Left");
86
         SERIAL_ECHOPGM(" (Left");
87
-      else if (zprobe_offset[Y_AXIS] != 0)
87
+      else if (probe_offset[Y_AXIS] != 0)
88
         SERIAL_ECHOPGM(" (Middle");
88
         SERIAL_ECHOPGM(" (Middle");
89
       else
89
       else
90
         SERIAL_ECHOPGM(" (Aligned With");
90
         SERIAL_ECHOPGM(" (Aligned With");
91
 
91
 
92
-      if (zprobe_offset[Y_AXIS] > 0) {
92
+      if (probe_offset[Y_AXIS] > 0) {
93
         #if IS_SCARA
93
         #if IS_SCARA
94
           SERIAL_ECHOPGM("-Distal");
94
           SERIAL_ECHOPGM("-Distal");
95
         #else
95
         #else
96
           SERIAL_ECHOPGM("-Back");
96
           SERIAL_ECHOPGM("-Back");
97
         #endif
97
         #endif
98
       }
98
       }
99
-      else if (zprobe_offset[Y_AXIS] < 0) {
99
+      else if (probe_offset[Y_AXIS] < 0) {
100
         #if IS_SCARA
100
         #if IS_SCARA
101
           SERIAL_ECHOPGM("-Proximal");
101
           SERIAL_ECHOPGM("-Proximal");
102
         #else
102
         #else
103
           SERIAL_ECHOPGM("-Front");
103
           SERIAL_ECHOPGM("-Front");
104
         #endif
104
         #endif
105
       }
105
       }
106
-      else if (zprobe_offset[X_AXIS] != 0)
106
+      else if (probe_offset[X_AXIS] != 0)
107
         SERIAL_ECHOPGM("-Center");
107
         SERIAL_ECHOPGM("-Center");
108
 
108
 
109
-      if (zprobe_offset[Z_AXIS] < 0)
109
+      if (probe_offset[Z_AXIS] < 0)
110
         SERIAL_ECHOPGM(" & Below");
110
         SERIAL_ECHOPGM(" & Below");
111
-      else if (zprobe_offset[Z_AXIS] > 0)
111
+      else if (probe_offset[Z_AXIS] > 0)
112
         SERIAL_ECHOPGM(" & Above");
112
         SERIAL_ECHOPGM(" & Above");
113
       else
113
       else
114
         SERIAL_ECHOPGM(" & Same Z as");
114
         SERIAL_ECHOPGM(" & Same Z as");

+ 2
- 2
Marlin/src/feature/bedlevel/ubl/ubl.cpp View File

180
     // Add XY probe offset from extruder because probe_pt() subtracts them when
180
     // Add XY probe offset from extruder because probe_pt() subtracts them when
181
     // moving to the xy position to be measured. This ensures better agreement between
181
     // moving to the xy position to be measured. This ensures better agreement between
182
     // the current Z position after G28 and the mesh values.
182
     // the current Z position after G28 and the mesh values.
183
-    const float current_xi = find_closest_x_index(current_position[X_AXIS] + zprobe_offset[X_AXIS]),
184
-                current_yi = find_closest_y_index(current_position[Y_AXIS] + zprobe_offset[Y_AXIS]);
183
+    const float current_xi = find_closest_x_index(current_position[X_AXIS] + probe_offset[X_AXIS]),
184
+                current_yi = find_closest_y_index(current_position[Y_AXIS] + probe_offset[Y_AXIS]);
185
 
185
 
186
     if (!lcd) SERIAL_EOL();
186
     if (!lcd) SERIAL_EOL();
187
     for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) {
187
     for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) {

+ 9
- 9
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

453
               SERIAL_ECHO(g29_y_pos);
453
               SERIAL_ECHO(g29_y_pos);
454
               SERIAL_ECHOLNPGM(").\n");
454
               SERIAL_ECHOLNPGM(").\n");
455
             }
455
             }
456
-            probe_entire_mesh(g29_x_pos + zprobe_offset[X_AXIS], g29_y_pos + zprobe_offset[Y_AXIS],
456
+            probe_entire_mesh(g29_x_pos + probe_offset[X_AXIS], g29_y_pos + probe_offset[Y_AXIS],
457
                               parser.seen('T'), parser.seen('E'), parser.seen('U'));
457
                               parser.seen('T'), parser.seen('E'), parser.seen('U'));
458
 
458
 
459
             report_current_position();
459
             report_current_position();
482
                 g29_x_pos = X_HOME_POS;
482
                 g29_x_pos = X_HOME_POS;
483
                 g29_y_pos = Y_HOME_POS;
483
                 g29_y_pos = Y_HOME_POS;
484
               #else // cartesian
484
               #else // cartesian
485
-                g29_x_pos = zprobe_offset[X_AXIS] > 0 ? X_BED_SIZE : 0;
486
-                g29_y_pos = zprobe_offset[Y_AXIS] < 0 ? Y_BED_SIZE : 0;
485
+                g29_x_pos = probe_offset[X_AXIS] > 0 ? X_BED_SIZE : 0;
486
+                g29_y_pos = probe_offset[Y_AXIS] < 0 ? Y_BED_SIZE : 0;
487
               #endif
487
               #endif
488
             }
488
             }
489
 
489
 
800
       restore_ubl_active_state_and_leave();
800
       restore_ubl_active_state_and_leave();
801
 
801
 
802
       do_blocking_move_to_xy(
802
       do_blocking_move_to_xy(
803
-        constrain(rx - zprobe_offset[X_AXIS], MESH_MIN_X, MESH_MAX_X),
804
-        constrain(ry - zprobe_offset[Y_AXIS], MESH_MIN_Y, MESH_MAX_Y)
803
+        constrain(rx - probe_offset[X_AXIS], MESH_MIN_X, MESH_MAX_X),
804
+        constrain(ry - probe_offset[Y_AXIS], MESH_MIN_Y, MESH_MAX_Y)
805
       );
805
       );
806
     }
806
     }
807
 
807
 
1281
     out_mesh.distance = -99999.9f;
1281
     out_mesh.distance = -99999.9f;
1282
 
1282
 
1283
     // Get our reference position. Either the nozzle or probe location.
1283
     // Get our reference position. Either the nozzle or probe location.
1284
-    const float px = rx + (probe_as_reference == USE_PROBE_AS_REFERENCE ? zprobe_offset[X_AXIS] : 0),
1285
-                py = ry + (probe_as_reference == USE_PROBE_AS_REFERENCE ? zprobe_offset[Y_AXIS] : 0);
1284
+    const float px = rx + (probe_as_reference == USE_PROBE_AS_REFERENCE ? probe_offset[X_AXIS] : 0),
1285
+                py = ry + (probe_as_reference == USE_PROBE_AS_REFERENCE ? probe_offset[Y_AXIS] : 0);
1286
 
1286
 
1287
     float best_so_far = 99999.99f;
1287
     float best_so_far = 99999.99f;
1288
 
1288
 
1500
                 DEBUG_ECHOPAIR_F("   correction: ", get_z_correction(rx, ry), 7);
1500
                 DEBUG_ECHOPAIR_F("   correction: ", get_z_correction(rx, ry), 7);
1501
               }
1501
               }
1502
 
1502
 
1503
-              measured_z -= get_z_correction(rx, ry) /* + zprobe_offset[Z_AXIS] */ ;
1503
+              measured_z -= get_z_correction(rx, ry) /* + probe_offset[Z_AXIS] */ ;
1504
 
1504
 
1505
               if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR_F("   final >>>---> ", measured_z, 7);
1505
               if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR_F("   final >>>---> ", measured_z, 7);
1506
 
1506
 
1712
       adjust_mesh_to_mean(g29_c_flag, g29_constant);
1712
       adjust_mesh_to_mean(g29_c_flag, g29_constant);
1713
 
1713
 
1714
       #if HAS_BED_PROBE
1714
       #if HAS_BED_PROBE
1715
-        SERIAL_ECHOLNPAIR_F("Probe Offset M851 Z", zprobe_offset[Z_AXIS], 7);
1715
+        SERIAL_ECHOLNPAIR_F("Probe Offset M851 Z", probe_offset[Z_AXIS], 7);
1716
       #endif
1716
       #endif
1717
 
1717
 
1718
       SERIAL_ECHOLNPAIR("MESH_MIN_X  " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); serial_delay(50);
1718
       SERIAL_ECHOLNPAIR("MESH_MIN_X  " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); serial_delay(50);

+ 2
- 2
Marlin/src/gcode/bedlevel/G42.cpp View File

49
     if (hasJ) destination[Y_AXIS] = _GET_MESH_Y(iy);
49
     if (hasJ) destination[Y_AXIS] = _GET_MESH_Y(iy);
50
     #if HAS_BED_PROBE
50
     #if HAS_BED_PROBE
51
       if (parser.boolval('P')) {
51
       if (parser.boolval('P')) {
52
-        if (hasI) destination[X_AXIS] -= zprobe_offset[X_AXIS];
53
-        if (hasJ) destination[Y_AXIS] -= zprobe_offset[Y_AXIS];
52
+        if (hasI) destination[X_AXIS] -= probe_offset[X_AXIS];
53
+        if (hasJ) destination[Y_AXIS] -= probe_offset[Y_AXIS];
54
       }
54
       }
55
     #endif
55
     #endif
56
 
56
 

+ 2
- 2
Marlin/src/gcode/bedlevel/abl/G29.cpp View File

947
         planner.leveling_active = false;
947
         planner.leveling_active = false;
948
 
948
 
949
         // Use the last measured distance to the bed, if possible
949
         // Use the last measured distance to the bed, if possible
950
-        if ( NEAR(current_position[X_AXIS], xProbe - zprobe_offset[X_AXIS])
951
-          && NEAR(current_position[Y_AXIS], yProbe - zprobe_offset[Y_AXIS])
950
+        if ( NEAR(current_position[X_AXIS], xProbe - probe_offset[X_AXIS])
951
+          && NEAR(current_position[Y_AXIS], yProbe - probe_offset[Y_AXIS])
952
         ) {
952
         ) {
953
           const float simple_z = current_position[Z_AXIS] - measured_z;
953
           const float simple_z = current_position[Z_AXIS] - measured_z;
954
           if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Probed Z", simple_z, "  Matrix Z", converted[Z_AXIS], "  Discrepancy ", simple_z - converted[Z_AXIS]);
954
           if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Probed Z", simple_z, "  Matrix Z", converted[Z_AXIS], "  Discrepancy ", simple_z - converted[Z_AXIS]);

+ 2
- 2
Marlin/src/gcode/calibrate/G28.cpp View File

136
     destination[Z_AXIS] = current_position[Z_AXIS]; // Z is already at the right height
136
     destination[Z_AXIS] = current_position[Z_AXIS]; // Z is already at the right height
137
 
137
 
138
     #if HOMING_Z_WITH_PROBE
138
     #if HOMING_Z_WITH_PROBE
139
-      destination[X_AXIS] -= zprobe_offset[X_AXIS];
140
-      destination[Y_AXIS] -= zprobe_offset[Y_AXIS];
139
+      destination[X_AXIS] -= probe_offset[X_AXIS];
140
+      destination[Y_AXIS] -= probe_offset[Y_AXIS];
141
     #endif
141
     #endif
142
 
142
 
143
     if (position_is_reachable(destination[X_AXIS], destination[Y_AXIS])) {
143
     if (position_is_reachable(destination[X_AXIS], destination[Y_AXIS])) {

+ 4
- 4
Marlin/src/gcode/calibrate/M48.cpp View File

77
   float X_current = current_position[X_AXIS],
77
   float X_current = current_position[X_AXIS],
78
         Y_current = current_position[Y_AXIS];
78
         Y_current = current_position[Y_AXIS];
79
 
79
 
80
-  const float X_probe_location = parser.linearval('X', X_current + zprobe_offset[X_AXIS]),
81
-              Y_probe_location = parser.linearval('Y', Y_current + zprobe_offset[Y_AXIS]);
80
+  const float X_probe_location = parser.linearval('X', X_current + probe_offset[X_AXIS]),
81
+              Y_probe_location = parser.linearval('Y', Y_current + probe_offset[Y_AXIS]);
82
 
82
 
83
   if (!position_is_reachable_by_probe(X_probe_location, Y_probe_location)) {
83
   if (!position_is_reachable_by_probe(X_probe_location, Y_probe_location)) {
84
     SERIAL_ECHOLNPGM("? (X,Y) out of bounds.");
84
     SERIAL_ECHOLNPGM("? (X,Y) out of bounds.");
165
           while (angle < 0.0) angle += 360.0;   // outside of this range.   It looks like they behave correctly with
165
           while (angle < 0.0) angle += 360.0;   // outside of this range.   It looks like they behave correctly with
166
                                                 // numbers outside of the range, but just to be safe we clamp them.
166
                                                 // numbers outside of the range, but just to be safe we clamp them.
167
 
167
 
168
-          X_current = X_probe_location - zprobe_offset[X_AXIS] + cos(RADIANS(angle)) * radius;
169
-          Y_current = Y_probe_location - zprobe_offset[Y_AXIS] + sin(RADIANS(angle)) * radius;
168
+          X_current = X_probe_location - probe_offset[X_AXIS] + cos(RADIANS(angle)) * radius;
169
+          Y_current = Y_probe_location - probe_offset[Y_AXIS] + sin(RADIANS(angle)) * radius;
170
 
170
 
171
           #if DISABLED(DELTA)
171
           #if DISABLED(DELTA)
172
             LIMIT(X_current, X_MIN_POS, X_MAX_POS);
172
             LIMIT(X_current, X_MIN_POS, X_MAX_POS);

+ 2
- 2
Marlin/src/gcode/motion/M290.cpp View File

42
         && active_extruder == 0
42
         && active_extruder == 0
43
       #endif
43
       #endif
44
     ) {
44
     ) {
45
-      zprobe_offset[Z_AXIS] += offs;
45
+      probe_offset[Z_AXIS] += offs;
46
       SERIAL_ECHO_START();
46
       SERIAL_ECHO_START();
47
-      SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET MSG_Z ": ", zprobe_offset[Z_AXIS]);
47
+      SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET MSG_Z ": ", probe_offset[Z_AXIS]);
48
     }
48
     }
49
     #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
49
     #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
50
       else {
50
       else {

+ 2
- 2
Marlin/src/gcode/probe/G30.cpp View File

39
  *   E   Engage the probe for each probe (default 1)
39
  *   E   Engage the probe for each probe (default 1)
40
  */
40
  */
41
 void GcodeSuite::G30() {
41
 void GcodeSuite::G30() {
42
-  const float xpos = parser.linearval('X', current_position[X_AXIS] + zprobe_offset[X_AXIS]),
43
-              ypos = parser.linearval('Y', current_position[Y_AXIS] + zprobe_offset[Y_AXIS]);
42
+  const float xpos = parser.linearval('X', current_position[X_AXIS] + probe_offset[X_AXIS]),
43
+              ypos = parser.linearval('Y', current_position[Y_AXIS] + probe_offset[Y_AXIS]);
44
 
44
 
45
   if (!position_is_reachable_by_probe(xpos, ypos)) return;
45
   if (!position_is_reachable_by_probe(xpos, ypos)) return;
46
 
46
 

+ 7
- 7
Marlin/src/gcode/probe/M851.cpp View File

36
   // Show usage with no parameters
36
   // Show usage with no parameters
37
   if (!parser.seen("XYZ")) {
37
   if (!parser.seen("XYZ")) {
38
     SERIAL_ECHO_START();
38
     SERIAL_ECHO_START();
39
-    SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET " X", zprobe_offset[X_AXIS],
40
-                                       " Y", zprobe_offset[Y_AXIS],
41
-                                       " Z", zprobe_offset[Z_AXIS]);
39
+    SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET " X", probe_offset[X_AXIS],
40
+                                       " Y", probe_offset[Y_AXIS],
41
+                                       " Z", probe_offset[Z_AXIS]);
42
     return;
42
     return;
43
   }
43
   }
44
 
44
 
45
   // Get the modified offsets
45
   // Get the modified offsets
46
   const float offs[] = {
46
   const float offs[] = {
47
-    parser.floatval('X', zprobe_offset[X_AXIS]),
48
-    parser.floatval('Y', zprobe_offset[Y_AXIS]),
49
-    parser.floatval('Z', zprobe_offset[Z_AXIS])
47
+    parser.floatval('X', probe_offset[X_AXIS]),
48
+    parser.floatval('Y', probe_offset[Y_AXIS]),
49
+    parser.floatval('Z', probe_offset[Z_AXIS])
50
   };
50
   };
51
 
51
 
52
   // Error-check
52
   // Error-check
64
   }
64
   }
65
 
65
 
66
   // Save the new offsets
66
   // Save the new offsets
67
-  LOOP_XYZ(a) zprobe_offset[a] = offs[a];
67
+  LOOP_XYZ(a) probe_offset[a] = offs[a];
68
 }
68
 }
69
 
69
 
70
 #endif // HAS_BED_PROBE
70
 #endif // HAS_BED_PROBE

+ 3
- 3
Marlin/src/lcd/extensible_ui/ui_api.cpp View File

708
           #if EXTRUDERS > 1
708
           #if EXTRUDERS > 1
709
             && (linked_nozzles || active_extruder == 0)
709
             && (linked_nozzles || active_extruder == 0)
710
           #endif
710
           #endif
711
-        ) zprobe_offset[Z_AXIS] += mm;
711
+        ) probe_offset[Z_AXIS] += mm;
712
       #else
712
       #else
713
         UNUSED(mm);
713
         UNUSED(mm);
714
       #endif
714
       #endif
746
 
746
 
747
   float getZOffset_mm() {
747
   float getZOffset_mm() {
748
     #if HAS_BED_PROBE
748
     #if HAS_BED_PROBE
749
-      return zprobe_offset[Z_AXIS];
749
+      return probe_offset[Z_AXIS];
750
     #elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
750
     #elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
751
       return babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];
751
       return babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];
752
     #else
752
     #else
757
   void setZOffset_mm(const float value) {
757
   void setZOffset_mm(const float value) {
758
     #if HAS_BED_PROBE
758
     #if HAS_BED_PROBE
759
       if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
759
       if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
760
-        zprobe_offset[Z_AXIS] = value;
760
+        probe_offset[Z_AXIS] = value;
761
     #elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
761
     #elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
762
       babystep.add_mm(Z_AXIS, (value - babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]));
762
       babystep.add_mm(Z_AXIS, (value - babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]));
763
     #else
763
     #else

+ 4
- 4
Marlin/src/lcd/menu/menu.cpp View File

402
       ui.encoderPosition = 0;
402
       ui.encoderPosition = 0;
403
 
403
 
404
       const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment,
404
       const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment,
405
-                  new_probe_offset = zprobe_offset[Z_AXIS] + diff,
405
+                  new_probe_offset = probe_offset[Z_AXIS] + diff,
406
                   new_offs =
406
                   new_offs =
407
                     #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
407
                     #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
408
                       do_probe ? new_probe_offset : hotend_offset[Z_AXIS][active_extruder] - diff
408
                       do_probe ? new_probe_offset : hotend_offset[Z_AXIS][active_extruder] - diff
414
 
414
 
415
         babystep.add_steps(Z_AXIS, babystep_increment);
415
         babystep.add_steps(Z_AXIS, babystep_increment);
416
 
416
 
417
-        if (do_probe) zprobe_offset[Z_AXIS] = new_offs;
417
+        if (do_probe) probe_offset[Z_AXIS] = new_offs;
418
         #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
418
         #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
419
           else hotend_offset[Z_AXIS][active_extruder] = new_offs;
419
           else hotend_offset[Z_AXIS][active_extruder] = new_offs;
420
         #endif
420
         #endif
428
           draw_edit_screen(PSTR(MSG_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder]));
428
           draw_edit_screen(PSTR(MSG_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder]));
429
         else
429
         else
430
       #endif
430
       #endif
431
-          draw_edit_screen(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_offset[Z_AXIS]));
431
+          draw_edit_screen(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(probe_offset[Z_AXIS]));
432
 
432
 
433
       #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY)
433
       #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY)
434
-        if (do_probe) _lcd_zoffset_overlay_gfx(zprobe_offset[Z_AXIS]);
434
+        if (do_probe) _lcd_zoffset_overlay_gfx(probe_offset[Z_AXIS]);
435
       #endif
435
       #endif
436
     }
436
     }
437
   }
437
   }

+ 1
- 1
Marlin/src/lcd/menu/menu_bed_leveling.cpp View File

279
   #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
279
   #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
280
     MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
280
     MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
281
   #elif HAS_BED_PROBE
281
   #elif HAS_BED_PROBE
282
-    MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_offset[Z_AXIS], Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
282
+    MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &probe_offset[Z_AXIS], Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
283
   #endif
283
   #endif
284
 
284
 
285
   #if ENABLED(LEVEL_BED_CORNERS)
285
   #if ENABLED(LEVEL_BED_CORNERS)

+ 1
- 1
Marlin/src/lcd/menu/menu_configuration.cpp View File

347
   #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
347
   #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
348
     MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
348
     MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
349
   #elif HAS_BED_PROBE
349
   #elif HAS_BED_PROBE
350
-    MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_offset[Z_AXIS], Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
350
+    MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &probe_offset[Z_AXIS], Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
351
   #endif
351
   #endif
352
 
352
 
353
   const bool busy = printer_busy();
353
   const bool busy = printer_busy();

+ 9
- 9
Marlin/src/module/configuration_store.cpp View File

176
   // HAS_BED_PROBE
176
   // HAS_BED_PROBE
177
   //
177
   //
178
 
178
 
179
-  float zprobe_offset[XYZ];
179
+  float probe_offset[XYZ];
180
 
180
 
181
   //
181
   //
182
   // ABL_PLANAR
182
   // ABL_PLANAR
613
     // Probe Z Offset
613
     // Probe Z Offset
614
     //
614
     //
615
     {
615
     {
616
-      _FIELD_TEST(zprobe_offset[Z_AXIS]);
617
-      EEPROM_WRITE(zprobe_offset);
616
+      _FIELD_TEST(probe_offset[Z_AXIS]);
617
+      EEPROM_WRITE(probe_offset);
618
     }
618
     }
619
 
619
 
620
     //
620
     //
1415
       // Probe Z Offset
1415
       // Probe Z Offset
1416
       //
1416
       //
1417
       {
1417
       {
1418
-        _FIELD_TEST(zprobe_offset[Z_AXIS]);
1418
+        _FIELD_TEST(probe_offset[Z_AXIS]);
1419
 
1419
 
1420
         #if HAS_BED_PROBE
1420
         #if HAS_BED_PROBE
1421
-          float (&zpo)[XYZ] = zprobe_offset;
1421
+          float (&zpo)[XYZ] = probe_offset;
1422
         #else
1422
         #else
1423
           float zpo[XYZ];
1423
           float zpo[XYZ];
1424
         #endif
1424
         #endif
2322
     #endif
2322
     #endif
2323
     constexpr float dpo[XYZ] = NOZZLE_TO_PROBE_OFFSET;
2323
     constexpr float dpo[XYZ] = NOZZLE_TO_PROBE_OFFSET;
2324
     static_assert(COUNT(dpo) == 3, "NOZZLE_TO_PROBE_OFFSET must contain offsets for X, Y, and Z.");
2324
     static_assert(COUNT(dpo) == 3, "NOZZLE_TO_PROBE_OFFSET must contain offsets for X, Y, and Z.");
2325
-    LOOP_XYZ(a) zprobe_offset[a] = dpo[a];
2325
+    LOOP_XYZ(a) probe_offset[a] = dpo[a];
2326
   #endif
2326
   #endif
2327
 
2327
 
2328
   //
2328
   //
3071
         say_units(true);
3071
         say_units(true);
3072
       }
3072
       }
3073
       CONFIG_ECHO_START();
3073
       CONFIG_ECHO_START();
3074
-      SERIAL_ECHOLNPAIR("  M851 X", LINEAR_UNIT(zprobe_offset[X_AXIS]),
3075
-                              " Y", LINEAR_UNIT(zprobe_offset[Y_AXIS]),
3076
-                              " Z", LINEAR_UNIT(zprobe_offset[Z_AXIS]));
3074
+      SERIAL_ECHOLNPAIR("  M851 X", LINEAR_UNIT(probe_offset[X_AXIS]),
3075
+                              " Y", LINEAR_UNIT(probe_offset[Y_AXIS]),
3076
+                              " Z", LINEAR_UNIT(probe_offset[Z_AXIS]));
3077
     #endif
3077
     #endif
3078
 
3078
 
3079
     /**
3079
     /**

+ 1
- 1
Marlin/src/module/delta.cpp View File

233
   // Move all carriages together linearly until an endstop is hit.
233
   // Move all carriages together linearly until an endstop is hit.
234
   destination[Z_AXIS] = (delta_height
234
   destination[Z_AXIS] = (delta_height
235
     #if HAS_BED_PROBE
235
     #if HAS_BED_PROBE
236
-      - zprobe_offset[Z_AXIS]
236
+      - probe_offset[Z_AXIS]
237
     #endif
237
     #endif
238
     + 10);
238
     + 10);
239
   buffer_line_to_destination(homing_feedrate(X_AXIS));
239
   buffer_line_to_destination(homing_feedrate(X_AXIS));

+ 4
- 4
Marlin/src/module/motion.cpp View File

505
       soft_endstop[axis].min = base_min_pos(axis);
505
       soft_endstop[axis].min = base_min_pos(axis);
506
       soft_endstop[axis].max = (axis == Z_AXIS ? delta_height
506
       soft_endstop[axis].max = (axis == Z_AXIS ? delta_height
507
       #if HAS_BED_PROBE
507
       #if HAS_BED_PROBE
508
-        - zprobe_offset[Z_AXIS]
508
+        - probe_offset[Z_AXIS]
509
       #endif
509
       #endif
510
       : base_max_pos(axis));
510
       : base_max_pos(axis));
511
 
511
 
1340
   #elif ENABLED(DELTA)
1340
   #elif ENABLED(DELTA)
1341
     current_position[axis] = (axis == Z_AXIS ? delta_height
1341
     current_position[axis] = (axis == Z_AXIS ? delta_height
1342
     #if HAS_BED_PROBE
1342
     #if HAS_BED_PROBE
1343
-      - zprobe_offset[Z_AXIS]
1343
+      - probe_offset[Z_AXIS]
1344
     #endif
1344
     #endif
1345
     : base_home_pos(axis));
1345
     : base_home_pos(axis));
1346
   #else
1346
   #else
1354
     if (axis == Z_AXIS) {
1354
     if (axis == Z_AXIS) {
1355
       #if HOMING_Z_WITH_PROBE
1355
       #if HOMING_Z_WITH_PROBE
1356
 
1356
 
1357
-        current_position[Z_AXIS] -= zprobe_offset[Z_AXIS];
1357
+        current_position[Z_AXIS] -= probe_offset[Z_AXIS];
1358
 
1358
 
1359
-        if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***\n> zprobe_offset[Z_AXIS] = ", zprobe_offset[Z_AXIS]);
1359
+        if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***\n> probe_offset[Z_AXIS] = ", probe_offset[Z_AXIS]);
1360
 
1360
 
1361
       #else
1361
       #else
1362
 
1362
 

+ 2
- 2
Marlin/src/module/motion.h View File

284
     // Return true if the both nozzle and the probe can reach the given point.
284
     // Return true if the both nozzle and the probe can reach the given point.
285
     // Note: This won't work on SCARA since the probe offset rotates with the arm.
285
     // Note: This won't work on SCARA since the probe offset rotates with the arm.
286
     inline bool position_is_reachable_by_probe(const float &rx, const float &ry) {
286
     inline bool position_is_reachable_by_probe(const float &rx, const float &ry) {
287
-      return position_is_reachable(rx - zprobe_offset[X_AXIS], ry - zprobe_offset[Y_AXIS])
287
+      return position_is_reachable(rx - probe_offset[X_AXIS], ry - probe_offset[Y_AXIS])
288
              && position_is_reachable(rx, ry, ABS(MIN_PROBE_EDGE));
288
              && position_is_reachable(rx, ry, ABS(MIN_PROBE_EDGE));
289
     }
289
     }
290
   #endif
290
   #endif
313
      *          nozzle must be be able to reach +10,-10.
313
      *          nozzle must be be able to reach +10,-10.
314
      */
314
      */
315
     inline bool position_is_reachable_by_probe(const float &rx, const float &ry) {
315
     inline bool position_is_reachable_by_probe(const float &rx, const float &ry) {
316
-      return position_is_reachable(rx - zprobe_offset[X_AXIS], ry - zprobe_offset[Y_AXIS])
316
+      return position_is_reachable(rx - probe_offset[X_AXIS], ry - probe_offset[Y_AXIS])
317
           && WITHIN(rx, probe_min_x() - slop, probe_max_x() + slop)
317
           && WITHIN(rx, probe_min_x() - slop, probe_max_x() + slop)
318
           && WITHIN(ry, probe_min_y() - slop, probe_max_y() + slop);
318
           && WITHIN(ry, probe_min_y() - slop, probe_max_y() + slop);
319
     }
319
     }

+ 11
- 11
Marlin/src/module/probe.cpp View File

56
   #include "../feature/backlash.h"
56
   #include "../feature/backlash.h"
57
 #endif
57
 #endif
58
 
58
 
59
-float zprobe_offset[XYZ]; // Initialized by settings.load()
59
+float probe_offset[XYZ]; // Initialized by settings.load()
60
 
60
 
61
 #if ENABLED(BLTOUCH)
61
 #if ENABLED(BLTOUCH)
62
   #include "../feature/bltouch.h"
62
   #include "../feature/bltouch.h"
91
     #if ENABLED(DELTA) || IS_SCARA
91
     #if ENABLED(DELTA) || IS_SCARA
92
       PROBE_X_MIN, MESH_MIN_X
92
       PROBE_X_MIN, MESH_MIN_X
93
     #else
93
     #else
94
-      (X_MIN_BED) + (MIN_PROBE_EDGE), (X_MIN_POS) + zprobe_offset[X_AXIS]
94
+      (X_MIN_BED) + (MIN_PROBE_EDGE), (X_MIN_POS) + probe_offset[X_AXIS]
95
     #endif
95
     #endif
96
   );
96
   );
97
 }
97
 }
100
     #if ENABLED(DELTA) || IS_SCARA
100
     #if ENABLED(DELTA) || IS_SCARA
101
       PROBE_X_MAX, MESH_MAX_X
101
       PROBE_X_MAX, MESH_MAX_X
102
     #else
102
     #else
103
-      (X_MAX_BED) - (MIN_PROBE_EDGE), (X_MAX_POS) + zprobe_offset[X_AXIS]
103
+      (X_MAX_BED) - (MIN_PROBE_EDGE), (X_MAX_POS) + probe_offset[X_AXIS]
104
     #endif
104
     #endif
105
   );
105
   );
106
 }
106
 }
109
     #if ENABLED(DELTA) || IS_SCARA
109
     #if ENABLED(DELTA) || IS_SCARA
110
       PROBE_Y_MIN, MESH_MIN_Y
110
       PROBE_Y_MIN, MESH_MIN_Y
111
     #else
111
     #else
112
-      (Y_MIN_BED) + (MIN_PROBE_EDGE), (Y_MIN_POS) + zprobe_offset[Y_AXIS]
112
+      (Y_MIN_BED) + (MIN_PROBE_EDGE), (Y_MIN_POS) + probe_offset[Y_AXIS]
113
     #endif
113
     #endif
114
   );
114
   );
115
 }
115
 }
118
     #if ENABLED(DELTA) || IS_SCARA
118
     #if ENABLED(DELTA) || IS_SCARA
119
       PROBE_Y_MAX, MESH_MAX_Y
119
       PROBE_Y_MAX, MESH_MAX_Y
120
     #else
120
     #else
121
-      (Y_MAX_BED) - (MIN_PROBE_EDGE), (Y_MAX_POS) + zprobe_offset[Y_AXIS]
121
+      (Y_MAX_BED) - (MIN_PROBE_EDGE), (Y_MAX_POS) + probe_offset[Y_AXIS]
122
     #endif
122
     #endif
123
   );
123
   );
124
 }
124
 }
300
   if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("do_probe_raise(", z_raise, ")");
300
   if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("do_probe_raise(", z_raise, ")");
301
 
301
 
302
   float z_dest = z_raise;
302
   float z_dest = z_raise;
303
-  if (zprobe_offset[Z_AXIS] < 0) z_dest -= zprobe_offset[Z_AXIS];
303
+  if (probe_offset[Z_AXIS] < 0) z_dest -= probe_offset[Z_AXIS];
304
 
304
 
305
   NOMORE(z_dest, Z_MAX_POS);
305
   NOMORE(z_dest, Z_MAX_POS);
306
 
306
 
580
 
580
 
581
   // Stop the probe before it goes too low to prevent damage.
581
   // Stop the probe before it goes too low to prevent damage.
582
   // If Z isn't known then probe to -10mm.
582
   // If Z isn't known then probe to -10mm.
583
-  const float z_probe_low_point = TEST(axis_known_position, Z_AXIS) ? -zprobe_offset[Z_AXIS] + Z_PROBE_LOW_POINT : -10.0;
583
+  const float z_probe_low_point = TEST(axis_known_position, Z_AXIS) ? -probe_offset[Z_AXIS] + Z_PROBE_LOW_POINT : -10.0;
584
 
584
 
585
   // Double-probing does a fast probe followed by a slow probe
585
   // Double-probing does a fast probe followed by a slow probe
586
   #if TOTAL_PROBING == 2
586
   #if TOTAL_PROBING == 2
605
 
605
 
606
     // If the nozzle is well over the travel height then
606
     // If the nozzle is well over the travel height then
607
     // move down quickly before doing the slow probe
607
     // move down quickly before doing the slow probe
608
-    const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0 + (zprobe_offset[Z_AXIS] < 0 ? -zprobe_offset[Z_AXIS] : 0);
608
+    const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0 + (probe_offset[Z_AXIS] < 0 ? -probe_offset[Z_AXIS] : 0);
609
     if (current_position[Z_AXIS] > z) {
609
     if (current_position[Z_AXIS] > z) {
610
       // Probe down fast. If the probe never triggered, raise for probe clearance
610
       // Probe down fast. If the probe never triggered, raise for probe clearance
611
       if (!do_probe_move(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST)))
611
       if (!do_probe_move(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST)))
735
   float nx = rx, ny = ry;
735
   float nx = rx, ny = ry;
736
   if (probe_relative) {
736
   if (probe_relative) {
737
     if (!position_is_reachable_by_probe(rx, ry)) return NAN;  // The given position is in terms of the probe
737
     if (!position_is_reachable_by_probe(rx, ry)) return NAN;  // The given position is in terms of the probe
738
-    nx -= zprobe_offset[X_AXIS];                     // Get the nozzle position
739
-    ny -= zprobe_offset[Y_AXIS];
738
+    nx -= probe_offset[X_AXIS];                     // Get the nozzle position
739
+    ny -= probe_offset[Y_AXIS];
740
   }
740
   }
741
   else if (!position_is_reachable(nx, ny)) return NAN;        // The given position is in terms of the nozzle
741
   else if (!position_is_reachable(nx, ny)) return NAN;        // The given position is in terms of the nozzle
742
 
742
 
757
 
757
 
758
   float measured_z = NAN;
758
   float measured_z = NAN;
759
   if (!DEPLOY_PROBE()) {
759
   if (!DEPLOY_PROBE()) {
760
-    measured_z = run_z_probe() + zprobe_offset[Z_AXIS];
760
+    measured_z = run_z_probe() + probe_offset[Z_AXIS];
761
 
761
 
762
     const bool big_raise = raise_after == PROBE_PT_BIG_RAISE;
762
     const bool big_raise = raise_after == PROBE_PT_BIG_RAISE;
763
     if (big_raise || raise_after == PROBE_PT_RAISE)
763
     if (big_raise || raise_after == PROBE_PT_RAISE)

+ 2
- 2
Marlin/src/module/probe.h View File

29
 
29
 
30
 #if HAS_BED_PROBE
30
 #if HAS_BED_PROBE
31
 
31
 
32
-  extern float zprobe_offset[XYZ];
32
+  extern float probe_offset[XYZ];
33
   bool set_probe_deployed(const bool deploy);
33
   bool set_probe_deployed(const bool deploy);
34
   #ifdef Z_AFTER_PROBING
34
   #ifdef Z_AFTER_PROBING
35
     void move_z_after_probing();
35
     void move_z_after_probing();
51
 
51
 
52
 #else
52
 #else
53
 
53
 
54
-  constexpr float zprobe_offset[XYZ] = { 0 };
54
+  constexpr float probe_offset[XYZ] = { 0 };
55
   #define DEPLOY_PROBE()
55
   #define DEPLOY_PROBE()
56
   #define STOW_PROBE()
56
   #define STOW_PROBE()
57
 
57
 

Loading…
Cancel
Save