Debug of G2-G3 for UBL (#12386)

Changes only affect UBL.  Everything else is left alone.
This commit is contained in:
Roxy-3D 2018-11-13 11:20:21 -06:00 committed by GitHub
parent 9ad3aed0ef
commit cda5ef08fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 4 deletions

View file

@ -227,11 +227,11 @@ void move_to(const float &rx, const float &ry, const float &z, const float &e_de
if (z != last_z) { if (z != last_z) {
last_z = z; last_z = z;
feed_value = planner.settings.max_feedrate_mm_s[Z_AXIS]/(3.0); // Base the feed rate off of the configured Z_AXIS feed rate feed_value = planner.settings.max_feedrate_mm_s[Z_AXIS]/(2.0); // Base the feed rate off of the configured Z_AXIS feed rate
destination[X_AXIS] = current_position[X_AXIS]; destination[X_AXIS] = current_position[X_AXIS];
destination[Y_AXIS] = current_position[Y_AXIS]; destination[Y_AXIS] = current_position[Y_AXIS];
destination[Z_AXIS] = z; // We know the last_z==z or we wouldn't be in this block of code. destination[Z_AXIS] = z; // We know the last_z!=z or we wouldn't be in this block of code.
destination[E_AXIS] = current_position[E_AXIS]; destination[E_AXIS] = current_position[E_AXIS];
G26_line_to_destination(feed_value); 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
// Check if X or Y is involved in the movement. // Check if X or Y is involved in the movement.
// Yes: a 'normal' movement. No: a retract() or recover() // Yes: a 'normal' movement. No: a retract() or recover()
feed_value = has_xy_component ? PLANNER_XY_FEEDRATE() / 10.0 : planner.settings.max_feedrate_mm_s[E_AXIS] / 1.5; feed_value = has_xy_component ? PLANNER_XY_FEEDRATE() / 3.0 : planner.settings.max_feedrate_mm_s[E_AXIS] / 1.5;
if (g26_debug_flag) SERIAL_ECHOLNPAIR("in move_to() feed_value for XY:", feed_value); if (g26_debug_flag) SERIAL_ECHOLNPAIR("in move_to() feed_value for XY:", feed_value);
@ -819,6 +819,19 @@ void GcodeSuite::G26() {
recover_filament(destination); recover_filament(destination);
const float save_feedrate = feedrate_mm_s; const float save_feedrate = feedrate_mm_s;
feedrate_mm_s = PLANNER_XY_FEEDRATE() / 10.0; feedrate_mm_s = PLANNER_XY_FEEDRATE() / 10.0;
if (g26_debug_flag) {
SERIAL_ECHOPAIR(" plan_arc(ex=", endpoint[X_AXIS]);
SERIAL_ECHOPAIR(", ey=", endpoint[Y_AXIS]);
SERIAL_ECHOPAIR(", ez=", endpoint[Z_AXIS]);
SERIAL_ECHOPAIR(", len=", arc_offset);
SERIAL_ECHOPAIR(") -> (ex=", current_position[X_AXIS]);
SERIAL_ECHOPAIR(", ey=", current_position[Y_AXIS]);
SERIAL_ECHOPAIR(", ez=", current_position[Z_AXIS]);
SERIAL_CHAR(')');
SERIAL_EOL();
}
plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc
feedrate_mm_s = save_feedrate; feedrate_mm_s = save_feedrate;
set_destination_from_current(); set_destination_from_current();

View file

@ -70,6 +70,9 @@ void plan_arc(
float r_P = -offset[0], r_Q = -offset[1]; float r_P = -offset[0], r_Q = -offset[1];
const float radius = HYPOT(r_P, r_Q), const float radius = HYPOT(r_P, r_Q),
#if ENABLED(AUTO_BED_LEVELING_UBL)
start_L = current_position[l_axis],
#endif
center_P = current_position[p_axis] - r_P, center_P = current_position[p_axis] - r_P,
center_Q = current_position[q_axis] - r_Q, center_Q = current_position[q_axis] - r_Q,
rt_X = cart[p_axis] - center_P, rt_X = cart[p_axis] - center_P,
@ -179,7 +182,11 @@ void plan_arc(
// Update raw location // Update raw location
raw[p_axis] = center_P + r_P; raw[p_axis] = center_P + r_P;
raw[q_axis] = center_Q + r_Q; raw[q_axis] = center_Q + r_Q;
raw[l_axis] += linear_per_segment; #if ENABLED(AUTO_BED_LEVELING_UBL)
raw[l_axis] = start_L;
#else
raw[l_axis] += linear_per_segment;
#endif
raw[E_AXIS] += extruder_per_segment; raw[E_AXIS] += extruder_per_segment;
clamp_to_software_endstops(raw); clamp_to_software_endstops(raw);
@ -198,6 +205,9 @@ void plan_arc(
// Ensure last segment arrives at target location. // Ensure last segment arrives at target location.
COPY(raw, cart); COPY(raw, cart);
#if ENABLED(AUTO_BED_LEVELING_UBL)
raw[l_axis] = start_L;
#endif
#if HAS_LEVELING && !PLANNER_LEVELING #if HAS_LEVELING && !PLANNER_LEVELING
planner.apply_leveling(raw); planner.apply_leveling(raw);
@ -209,6 +219,9 @@ void plan_arc(
#endif #endif
); );
#if ENABLED(AUTO_BED_LEVELING_UBL)
raw[l_axis] = start_L;
#endif
COPY(current_position, raw); COPY(current_position, raw);
} // plan_arc } // plan_arc