Browse Source

Modify MBL to use IJ instead of XY (#12478)

Scott Lahteine 6 years ago
parent
commit
a4c15dc54f
No account linked to committer's email address

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

119
   #endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES
119
   #endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES
120
 
120
 
121
   void mesh_bed_leveling::report_mesh() {
121
   void mesh_bed_leveling::report_mesh() {
122
-    SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(GRID_MAX_POINTS_X) "," STRINGIFY(GRID_MAX_POINTS_Y));
123
-    SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(z_offset, 5);
122
+    SERIAL_PROTOCOLPGM(STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_Y) " mesh. Z offset: ");
123
+    SERIAL_PROTOCOL_F(z_offset, 5);
124
     SERIAL_PROTOCOLLNPGM("\nMeasured points:");
124
     SERIAL_PROTOCOLLNPGM("\nMeasured points:");
125
     print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5,
125
     print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5,
126
       [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; }
126
       [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; }

+ 16
- 23
Marlin/src/gcode/bedlevel/mbl/G29.cpp View File

47
  *
47
  *
48
  * Parameters With MESH_BED_LEVELING:
48
  * Parameters With MESH_BED_LEVELING:
49
  *
49
  *
50
- *  S0              Produce a mesh report
50
+ *  S0              Report the current mesh values
51
  *  S1              Start probing mesh points
51
  *  S1              Start probing mesh points
52
  *  S2              Probe the next mesh point
52
  *  S2              Probe the next mesh point
53
- *  S3 Xn Yn Zn.nn  Manually modify a single point
53
+ *  S3 In Jn Zn.nn  Manually modify a single point
54
  *  S4 Zn.nn        Set z offset. Positive away from bed, negative closer to bed.
54
  *  S4 Zn.nn        Set z offset. Positive away from bed, negative closer to bed.
55
  *  S5              Reset and disable mesh
55
  *  S5              Reset and disable mesh
56
  *
56
  *
57
- * The S0 report the points as below
58
- *
59
- *  +----> X-axis  1-n
60
- *  |
61
- *  |
62
- *  v Y-axis  1-n
63
- *
64
  */
57
  */
65
 void GcodeSuite::G29() {
58
 void GcodeSuite::G29() {
66
 
59
 
75
     return;
68
     return;
76
   }
69
   }
77
 
70
 
78
-  int8_t px, py;
71
+  int8_t ix, iy;
79
 
72
 
80
   switch (state) {
73
   switch (state) {
81
     case MeshReport:
74
     case MeshReport:
126
           soft_endstops_enabled = false;
119
           soft_endstops_enabled = false;
127
         #endif
120
         #endif
128
 
121
 
129
-        mbl.zigzag(mbl_probe_index++, px, py);
130
-        _manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]);
122
+        mbl.zigzag(mbl_probe_index++, ix, iy);
123
+        _manual_goto_xy(mbl.index_to_xpos[ix], mbl.index_to_ypos[iy]);
131
       }
124
       }
132
       else {
125
       else {
133
         // One last "return to the bed" (as originally coded) at completion
126
         // One last "return to the bed" (as originally coded) at completion
158
       break;
151
       break;
159
 
152
 
160
     case MeshSet:
153
     case MeshSet:
161
-      if (parser.seenval('X')) {
162
-        px = parser.value_int() - 1;
163
-        if (!WITHIN(px, 0, GRID_MAX_POINTS_X - 1)) {
164
-          SERIAL_PROTOCOLPAIR("X out of range (0-", int(GRID_MAX_POINTS_X));
154
+      if (parser.seenval('I')) {
155
+        ix = parser.value_int();
156
+        if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) {
157
+          SERIAL_PROTOCOLPAIR("I out of range (0-", int(GRID_MAX_POINTS_X - 1));
165
           SERIAL_PROTOCOLLNPGM(")");
158
           SERIAL_PROTOCOLLNPGM(")");
166
           return;
159
           return;
167
         }
160
         }
168
       }
161
       }
169
       else
162
       else
170
-        return echo_not_entered('X');
163
+        return echo_not_entered('J');
171
 
164
 
172
-      if (parser.seenval('Y')) {
173
-        py = parser.value_int() - 1;
174
-        if (!WITHIN(py, 0, GRID_MAX_POINTS_Y - 1)) {
175
-          SERIAL_PROTOCOLPAIR("Y out of range (0-", int(GRID_MAX_POINTS_Y));
165
+      if (parser.seenval('J')) {
166
+        iy = parser.value_int();
167
+        if (!WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) {
168
+          SERIAL_PROTOCOLPAIR("J out of range (0-", int(GRID_MAX_POINTS_Y - 1));
176
           SERIAL_PROTOCOLLNPGM(")");
169
           SERIAL_PROTOCOLLNPGM(")");
177
           return;
170
           return;
178
         }
171
         }
179
       }
172
       }
180
       else
173
       else
181
-        return echo_not_entered('Y');
174
+        return echo_not_entered('J');
182
 
175
 
183
       if (parser.seenval('Z'))
176
       if (parser.seenval('Z'))
184
-        mbl.z_values[px][py] = parser.value_linear_units();
177
+        mbl.z_values[ix][iy] = parser.value_linear_units();
185
       else
178
       else
186
         return echo_not_entered('Z');
179
         return echo_not_entered('Z');
187
       break;
180
       break;

Loading…
Cancel
Save