Browse Source

(2.0.x) serious bug G33 (#8136)

* (2.0.x) serious bug G33

* Revert config changes

This reverts commit 74b5a98223.
Luc Van Daele 7 years ago
parent
commit
a1a4fc277e
1 changed files with 8 additions and 8 deletions
  1. 8
    8
      Marlin/src/gcode/calibrate/G33.cpp

+ 8
- 8
Marlin/src/gcode/calibrate/G33.cpp View File

@@ -130,7 +130,7 @@ static float probe_G33_points(float z_at_pt[13], const int8_t probe_points, cons
130 130
                 dy = (Y_PROBE_OFFSET_FROM_EXTRUDER);
131 131
   #endif
132 132
 
133
-  for (uint8_t i = 0; i < COUNT(z_at_pt); i++) z_at_pt[i] = 0.0;
133
+  for (uint8_t i = 0; i <= 12; i++) z_at_pt[i] = 0.0;
134 134
 
135 135
   if (!_0p_calibration) {
136 136
 
@@ -143,7 +143,7 @@ static float probe_G33_points(float z_at_pt[13], const int8_t probe_points, cons
143 143
     }
144 144
 
145 145
     if (_7p_calibration) { // probe extra center points
146
-      for (int8_t axis = _7p_multi_circle ? COUNT(z_at_pt) - 2 : COUNT(z_at_pt) - 4; axis > 0; axis -= _7p_multi_circle ? 2 : 4) {
146
+      for (int8_t axis = _7p_multi_circle ? 11 : 9; axis > 0; axis -= _7p_multi_circle ? 2 : 4) {
147 147
         const float a = RADIANS(180 + 30 * axis), r = delta_calibration_radius * 0.1;
148 148
         #if ENABLED(PROBE_MANUALLY)
149 149
           z_at_pt[0] += lcd_probe_pt(cos(a) * r, sin(a) * r);
@@ -158,7 +158,7 @@ static float probe_G33_points(float z_at_pt[13], const int8_t probe_points, cons
158 158
       bool zig_zag = true;
159 159
       const uint8_t start = _4p_opposite_points ? 3 : 1,
160 160
                     step = _4p_calibration ? 4 : _7p_half_circle ? 2 : 1;
161
-      for (uint8_t axis = start; axis < COUNT(z_at_pt); axis += step) {
161
+      for (uint8_t axis = start; axis <= 12; axis += step) {
162 162
         const float zigadd = (zig_zag ? 0.5 : 0.0),
163 163
                     offset_circles = _7p_quadruple_circle ? zigadd + 1.0 :
164 164
                                      _7p_triple_circle    ? zigadd + 0.5 :
@@ -178,14 +178,14 @@ static float probe_G33_points(float z_at_pt[13], const int8_t probe_points, cons
178 178
     }
179 179
 
180 180
     if (_7p_intermed_points) // average intermediates to tower and opposites
181
-      for (uint8_t axis = 1; axis < COUNT(z_at_pt); axis += 2)
181
+      for (uint8_t axis = 1; axis <= 12; axis += 2)
182 182
         z_at_pt[axis] = (z_at_pt[axis] + (z_at_pt[axis + 1] + z_at_pt[(axis + 10) % 12 + 1]) / 2.0) / 2.0;
183 183
 
184 184
     float S1 = z_at_pt[0],
185 185
           S2 = sq(z_at_pt[0]);
186 186
     int16_t N = 1;
187 187
     if (!_1p_calibration) // std dev from zero plane
188
-      for (uint8_t axis = (_4p_opposite_points ? 3 : 1); axis < COUNT(z_at_pt); axis += (_4p_calibration ? 4 : 2)) {
188
+      for (uint8_t axis = (_4p_opposite_points ? 3 : 1); axis <= 12; axis += (_4p_calibration ? 4 : 2)) {
189 189
         S1 += z_at_pt[axis];
190 190
         S2 += sq(z_at_pt[axis]);
191 191
         N++;
@@ -227,7 +227,7 @@ static float probe_G33_points(float z_at_pt[13], const int8_t probe_points, cons
227 227
       SERIAL_EOL();
228 228
 
229 229
       probe_G33_points(z_at_pt, 3, true, false);
230
-      for (int8_t i = 0; i < COUNT(z_at_pt); i++) z_at_pt[i] -= z_at_pt_base[i];
230
+      for (int8_t i = 0; i <= 12; i++) z_at_pt[i] -= z_at_pt_base[i];
231 231
       print_G33_results(z_at_pt, true, true);
232 232
       delta_endstop_adj[axis] += 1.0;
233 233
       switch (axis) {
@@ -257,7 +257,7 @@ static float probe_G33_points(float z_at_pt[13], const int8_t probe_points, cons
257 257
       SERIAL_PROTOCOL(zig_zag == -1 ? "-" : "+");
258 258
       SERIAL_EOL();
259 259
       probe_G33_points(z_at_pt, 3, true, false);
260
-      for (int8_t i = 0; i < COUNT(z_at_pt); i++) z_at_pt[i] -= z_at_pt_base[i];
260
+      for (int8_t i = 0; i <= 12; i++) z_at_pt[i] -= z_at_pt_base[i];
261 261
       print_G33_results(z_at_pt, true, true);
262 262
       delta_radius -= 1.0 * zig_zag;
263 263
       recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
@@ -284,7 +284,7 @@ static float probe_G33_points(float z_at_pt[13], const int8_t probe_points, cons
284 284
       SERIAL_EOL();
285 285
 
286 286
       probe_G33_points(z_at_pt, 3, true, false);
287
-      for (int8_t i = 0; i < COUNT(z_at_pt); i++) z_at_pt[i] -= z_at_pt_base[i];
287
+      for (int8_t i = 0; i <= 12; i++) z_at_pt[i] -= z_at_pt_base[i];
288 288
       print_G33_results(z_at_pt, true, true);
289 289
 
290 290
       delta_tower_angle_trim[axis] -= 1.0;

Loading…
Cancel
Save