Browse Source

Debug of G2-G3 for UBL (#12386)

Changes only affect UBL.  Everything else is left alone.
Roxy-3D 6 years ago
parent
commit
cda5ef08fa
No account linked to committer's email address
2 changed files with 30 additions and 4 deletions
  1. 16
    3
      Marlin/src/gcode/bedlevel/G26.cpp
  2. 14
    1
      Marlin/src/gcode/motion/G2_G3.cpp

+ 16
- 3
Marlin/src/gcode/bedlevel/G26.cpp View File

227
 
227
 
228
   if (z != last_z) {
228
   if (z != last_z) {
229
     last_z = z;
229
     last_z = z;
230
-    feed_value = planner.settings.max_feedrate_mm_s[Z_AXIS]/(3.0);  // Base the feed rate off of the configured Z_AXIS feed rate
230
+    feed_value = planner.settings.max_feedrate_mm_s[Z_AXIS]/(2.0);  // Base the feed rate off of the configured Z_AXIS feed rate
231
 
231
 
232
     destination[X_AXIS] = current_position[X_AXIS];
232
     destination[X_AXIS] = current_position[X_AXIS];
233
     destination[Y_AXIS] = current_position[Y_AXIS];
233
     destination[Y_AXIS] = current_position[Y_AXIS];
234
-    destination[Z_AXIS] = z;                          // We know the last_z==z or we wouldn't be in this block of code.
234
+    destination[Z_AXIS] = z;                          // We know the last_z!=z or we wouldn't be in this block of code.
235
     destination[E_AXIS] = current_position[E_AXIS];
235
     destination[E_AXIS] = current_position[E_AXIS];
236
 
236
 
237
     G26_line_to_destination(feed_value);
237
     G26_line_to_destination(feed_value);
240
 
240
 
241
   // Check if X or Y is involved in the movement.
241
   // Check if X or Y is involved in the movement.
242
   // Yes: a 'normal' movement. No: a retract() or recover()
242
   // Yes: a 'normal' movement. No: a retract() or recover()
243
-  feed_value = has_xy_component ? PLANNER_XY_FEEDRATE() / 10.0 : planner.settings.max_feedrate_mm_s[E_AXIS] / 1.5;
243
+  feed_value = has_xy_component ? PLANNER_XY_FEEDRATE() / 3.0 : planner.settings.max_feedrate_mm_s[E_AXIS] / 1.5;
244
 
244
 
245
   if (g26_debug_flag) SERIAL_ECHOLNPAIR("in move_to() feed_value for XY:", feed_value);
245
   if (g26_debug_flag) SERIAL_ECHOLNPAIR("in move_to() feed_value for XY:", feed_value);
246
 
246
 
819
         recover_filament(destination);
819
         recover_filament(destination);
820
         const float save_feedrate = feedrate_mm_s;
820
         const float save_feedrate = feedrate_mm_s;
821
         feedrate_mm_s = PLANNER_XY_FEEDRATE() / 10.0;
821
         feedrate_mm_s = PLANNER_XY_FEEDRATE() / 10.0;
822
+
823
+        if (g26_debug_flag) {
824
+          SERIAL_ECHOPAIR(" plan_arc(ex=", endpoint[X_AXIS]);
825
+          SERIAL_ECHOPAIR(", ey=", endpoint[Y_AXIS]);
826
+          SERIAL_ECHOPAIR(", ez=", endpoint[Z_AXIS]);
827
+          SERIAL_ECHOPAIR(", len=", arc_offset);
828
+          SERIAL_ECHOPAIR(") -> (ex=", current_position[X_AXIS]);
829
+          SERIAL_ECHOPAIR(", ey=", current_position[Y_AXIS]);
830
+          SERIAL_ECHOPAIR(", ez=", current_position[Z_AXIS]);
831
+          SERIAL_CHAR(')');
832
+          SERIAL_EOL();
833
+        }
834
+
822
         plan_arc(endpoint, arc_offset, false);  // Draw a counter-clockwise arc
835
         plan_arc(endpoint, arc_offset, false);  // Draw a counter-clockwise arc
823
         feedrate_mm_s = save_feedrate;
836
         feedrate_mm_s = save_feedrate;
824
         set_destination_from_current();
837
         set_destination_from_current();

+ 14
- 1
Marlin/src/gcode/motion/G2_G3.cpp View File

70
   float r_P = -offset[0], r_Q = -offset[1];
70
   float r_P = -offset[0], r_Q = -offset[1];
71
 
71
 
72
   const float radius = HYPOT(r_P, r_Q),
72
   const float radius = HYPOT(r_P, r_Q),
73
+              #if ENABLED(AUTO_BED_LEVELING_UBL)
74
+                start_L  = current_position[l_axis],
75
+              #endif
73
               center_P = current_position[p_axis] - r_P,
76
               center_P = current_position[p_axis] - r_P,
74
               center_Q = current_position[q_axis] - r_Q,
77
               center_Q = current_position[q_axis] - r_Q,
75
               rt_X = cart[p_axis] - center_P,
78
               rt_X = cart[p_axis] - center_P,
179
     // Update raw location
182
     // Update raw location
180
     raw[p_axis] = center_P + r_P;
183
     raw[p_axis] = center_P + r_P;
181
     raw[q_axis] = center_Q + r_Q;
184
     raw[q_axis] = center_Q + r_Q;
182
-    raw[l_axis] += linear_per_segment;
185
+    #if ENABLED(AUTO_BED_LEVELING_UBL)
186
+      raw[l_axis] = start_L;
187
+    #else
188
+      raw[l_axis] += linear_per_segment;
189
+    #endif
183
     raw[E_AXIS] += extruder_per_segment;
190
     raw[E_AXIS] += extruder_per_segment;
184
 
191
 
185
     clamp_to_software_endstops(raw);
192
     clamp_to_software_endstops(raw);
198
 
205
 
199
   // Ensure last segment arrives at target location.
206
   // Ensure last segment arrives at target location.
200
   COPY(raw, cart);
207
   COPY(raw, cart);
208
+  #if ENABLED(AUTO_BED_LEVELING_UBL)
209
+    raw[l_axis] = start_L;
210
+  #endif
201
 
211
 
202
   #if HAS_LEVELING && !PLANNER_LEVELING
212
   #if HAS_LEVELING && !PLANNER_LEVELING
203
     planner.apply_leveling(raw);
213
     planner.apply_leveling(raw);
209
     #endif
219
     #endif
210
   );
220
   );
211
 
221
 
222
+  #if ENABLED(AUTO_BED_LEVELING_UBL)
223
+    raw[l_axis] = start_L;
224
+  #endif
212
   COPY(current_position, raw);
225
   COPY(current_position, raw);
213
 } // plan_arc
226
 } // plan_arc
214
 
227
 

Loading…
Cancel
Save