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

Loading…
Cancel
Save