Bläddra i källkod

Debug of G2-G3 for UBL (#12386)

Changes only affect UBL.  Everything else is left alone.
Roxy-3D 6 år sedan
förälder
incheckning
cda5ef08fa
Inget konto är kopplat till bidragsgivarens mejladress
2 ändrade filer med 30 tillägg och 4 borttagningar
  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 Visa fil

@@ -227,11 +227,11 @@ void move_to(const float &rx, const float &ry, const float &z, const float &e_de
227 227
 
228 228
   if (z != last_z) {
229 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 232
     destination[X_AXIS] = current_position[X_AXIS];
233 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 235
     destination[E_AXIS] = current_position[E_AXIS];
236 236
 
237 237
     G26_line_to_destination(feed_value);
@@ -240,7 +240,7 @@ void move_to(const float &rx, const float &ry, const float &z, const float &e_de
240 240
 
241 241
   // Check if X or Y is involved in the movement.
242 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 245
   if (g26_debug_flag) SERIAL_ECHOLNPAIR("in move_to() feed_value for XY:", feed_value);
246 246
 
@@ -819,6 +819,19 @@ void GcodeSuite::G26() {
819 819
         recover_filament(destination);
820 820
         const float save_feedrate = feedrate_mm_s;
821 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 835
         plan_arc(endpoint, arc_offset, false);  // Draw a counter-clockwise arc
823 836
         feedrate_mm_s = save_feedrate;
824 837
         set_destination_from_current();

+ 14
- 1
Marlin/src/gcode/motion/G2_G3.cpp Visa fil

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

Laddar…
Avbryt
Spara