|
|
@ -23,93 +23,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
|
|
|
|
|
|
|
|
|
|
|
#include "../bedlevel.h"
|
|
|
|
#include "../bedlevel.h"
|
|
|
|
#include "../../../module/planner.h"
|
|
|
|
#include "../../../module/planner.h"
|
|
|
|
#include "../../../module/stepper.h"
|
|
|
|
#include "../../../module/stepper.h"
|
|
|
|
#include "../../../module/motion.h"
|
|
|
|
#include "../../../module/motion.h"
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
#include "../../../module/delta.h"
|
|
|
|
#include "../../../module/delta.h"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#include "../../../Marlin.h"
|
|
|
|
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern float destination[XYZE];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if AVR_AT90USB1286_FAMILY // Teensyduino & Printrboard IDE extensions have compile errors without this
|
|
|
|
|
|
|
|
inline void set_current_from_destination() { COPY(current_position, destination); }
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
extern void set_current_from_destination();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void debug_echo_axis(const AxisEnum axis) {
|
|
|
|
#include "../../../Marlin.h"
|
|
|
|
if (current_position[axis] == destination[axis])
|
|
|
|
#include <math.h>
|
|
|
|
SERIAL_ECHOPGM("-------------");
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
SERIAL_ECHO_F(destination[X_AXIS], 6);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void debug_current_and_destination(const char *title) {
|
|
|
|
#if AVR_AT90USB1286_FAMILY // Teensyduino & Printrboard IDE extensions have compile errors without this
|
|
|
|
|
|
|
|
inline void set_current_from_destination() { COPY(current_position, destination); }
|
|
|
|
// if the title message starts with a '!' it is so important, we are going to
|
|
|
|
#else
|
|
|
|
// ignore the status of the g26_debug_flag
|
|
|
|
extern void set_current_from_destination();
|
|
|
|
if (*title != '!' && !g26_debug_flag) return;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
const float de = destination[E_AXIS] - current_position[E_AXIS];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (de == 0.0) return; // Printing moves only
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const float dx = destination[X_AXIS] - current_position[X_AXIS],
|
|
|
|
|
|
|
|
dy = destination[Y_AXIS] - current_position[Y_AXIS],
|
|
|
|
|
|
|
|
xy_dist = HYPOT(dx, dy);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (xy_dist == 0.0) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SERIAL_ECHOPGM(" fpmm=");
|
|
|
|
|
|
|
|
const float fpmm = de / xy_dist;
|
|
|
|
|
|
|
|
SERIAL_ECHO_F(fpmm, 6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SERIAL_ECHOPGM(" current=( ");
|
|
|
|
|
|
|
|
SERIAL_ECHO_F(current_position[X_AXIS], 6);
|
|
|
|
|
|
|
|
SERIAL_ECHOPGM(", ");
|
|
|
|
|
|
|
|
SERIAL_ECHO_F(current_position[Y_AXIS], 6);
|
|
|
|
|
|
|
|
SERIAL_ECHOPGM(", ");
|
|
|
|
|
|
|
|
SERIAL_ECHO_F(current_position[Z_AXIS], 6);
|
|
|
|
|
|
|
|
SERIAL_ECHOPGM(", ");
|
|
|
|
|
|
|
|
SERIAL_ECHO_F(current_position[E_AXIS], 6);
|
|
|
|
|
|
|
|
SERIAL_ECHOPGM(" ) destination=( ");
|
|
|
|
|
|
|
|
debug_echo_axis(X_AXIS);
|
|
|
|
|
|
|
|
SERIAL_ECHOPGM(", ");
|
|
|
|
|
|
|
|
debug_echo_axis(Y_AXIS);
|
|
|
|
|
|
|
|
SERIAL_ECHOPGM(", ");
|
|
|
|
|
|
|
|
debug_echo_axis(Z_AXIS);
|
|
|
|
|
|
|
|
SERIAL_ECHOPGM(", ");
|
|
|
|
|
|
|
|
debug_echo_axis(E_AXIS);
|
|
|
|
|
|
|
|
SERIAL_ECHOPGM(" ) ");
|
|
|
|
|
|
|
|
SERIAL_ECHO(title);
|
|
|
|
|
|
|
|
SERIAL_EOL();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
#if !UBL_SEGMENTED
|
|
|
|
|
|
|
|
|
|
|
|
void unified_bed_leveling::line_to_destination_cartesian(const float &feed_rate, uint8_t extruder) {
|
|
|
|
void unified_bed_leveling::line_to_destination_cartesian(const float &feed_rate, const uint8_t extruder) {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Much of the nozzle movement will be within the same cell. So we will do as little computation
|
|
|
|
* Much of the nozzle movement will be within the same cell. So we will do as little computation
|
|
|
|
* as possible to determine if this is the case. If this move is within the same cell, we will
|
|
|
|
* as possible to determine if this is the case. If this move is within the same cell, we will
|
|
|
|
* just do the required Z-Height correction, call the Planner's buffer_line() routine, and leave
|
|
|
|
* just do the required Z-Height correction, call the Planner's buffer_line() routine, and leave
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
const float start[XYZE] = {
|
|
|
|
#if ENABLED(SKEW_CORRECTION)
|
|
|
|
current_position[X_AXIS],
|
|
|
|
// For skew correction just adjust the destination point and we're done
|
|
|
|
current_position[Y_AXIS],
|
|
|
|
float start[XYZE] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS] },
|
|
|
|
current_position[Z_AXIS],
|
|
|
|
end[XYZE] = { destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS] };
|
|
|
|
current_position[E_AXIS]
|
|
|
|
planner.skew(start[X_AXIS], start[Y_AXIS], start[Z_AXIS]);
|
|
|
|
},
|
|
|
|
planner.skew(end[X_AXIS], end[Y_AXIS], end[Z_AXIS]);
|
|
|
|
end[XYZE] = {
|
|
|
|
#else
|
|
|
|
destination[X_AXIS],
|
|
|
|
const float (&start)[XYZE] = current_position,
|
|
|
|
destination[Y_AXIS],
|
|
|
|
(&end)[XYZE] = destination;
|
|
|
|
destination[Z_AXIS],
|
|
|
|
#endif
|
|
|
|
destination[E_AXIS]
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const int cell_start_xi = get_cell_index_x(start[X_AXIS]),
|
|
|
|
const int cell_start_xi = get_cell_index_x(start[X_AXIS]),
|
|
|
|
cell_start_yi = get_cell_index_y(start[Y_AXIS]),
|
|
|
|
cell_start_yi = get_cell_index_y(start[Y_AXIS]),
|
|
|
@ -117,13 +66,13 @@
|
|
|
|
cell_dest_yi = get_cell_index_y(end[Y_AXIS]);
|
|
|
|
cell_dest_yi = get_cell_index_y(end[Y_AXIS]);
|
|
|
|
|
|
|
|
|
|
|
|
if (g26_debug_flag) {
|
|
|
|
if (g26_debug_flag) {
|
|
|
|
SERIAL_ECHOPAIR(" ubl.line_to_destination(xe=", end[X_AXIS]);
|
|
|
|
SERIAL_ECHOPAIR(" ubl.line_to_destination_cartesian(xe=", destination[X_AXIS]);
|
|
|
|
SERIAL_ECHOPAIR(", ye=", end[Y_AXIS]);
|
|
|
|
SERIAL_ECHOPAIR(", ye=", destination[Y_AXIS]);
|
|
|
|
SERIAL_ECHOPAIR(", ze=", end[Z_AXIS]);
|
|
|
|
SERIAL_ECHOPAIR(", ze=", destination[Z_AXIS]);
|
|
|
|
SERIAL_ECHOPAIR(", ee=", end[E_AXIS]);
|
|
|
|
SERIAL_ECHOPAIR(", ee=", destination[E_AXIS]);
|
|
|
|
SERIAL_CHAR(')');
|
|
|
|
SERIAL_CHAR(')');
|
|
|
|
SERIAL_EOL();
|
|
|
|
SERIAL_EOL();
|
|
|
|
debug_current_and_destination(PSTR("Start of ubl.line_to_destination()"));
|
|
|
|
debug_current_and_destination(PSTR("Start of ubl.line_to_destination_cartesian()"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (cell_start_xi == cell_dest_xi && cell_start_yi == cell_dest_yi) { // if the whole move is within the same cell,
|
|
|
|
if (cell_start_xi == cell_dest_xi && cell_start_yi == cell_dest_yi) { // if the whole move is within the same cell,
|
|
|
@ -139,11 +88,11 @@
|
|
|
|
// Note: There is no Z Correction in this case. We are off the grid and don't know what
|
|
|
|
// Note: There is no Z Correction in this case. We are off the grid and don't know what
|
|
|
|
// a reasonable correction would be.
|
|
|
|
// a reasonable correction would be.
|
|
|
|
|
|
|
|
|
|
|
|
planner._buffer_line(end[X_AXIS], end[Y_AXIS], end[Z_AXIS], end[E_AXIS], feed_rate, extruder);
|
|
|
|
planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS], end[E_AXIS], feed_rate, extruder);
|
|
|
|
set_current_from_destination();
|
|
|
|
set_current_from_destination();
|
|
|
|
|
|
|
|
|
|
|
|
if (g26_debug_flag)
|
|
|
|
if (g26_debug_flag)
|
|
|
|
debug_current_and_destination(PSTR("out of bounds in ubl.line_to_destination()"));
|
|
|
|
debug_current_and_destination(PSTR("out of bounds in ubl.line_to_destination_cartesian()"));
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -183,10 +132,10 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if (isnan(z0)) z0 = 0.0;
|
|
|
|
if (isnan(z0)) z0 = 0.0;
|
|
|
|
|
|
|
|
|
|
|
|
planner._buffer_line(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + z0, end[E_AXIS], feed_rate, extruder);
|
|
|
|
planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + z0, end[E_AXIS], feed_rate, extruder);
|
|
|
|
|
|
|
|
|
|
|
|
if (g26_debug_flag)
|
|
|
|
if (g26_debug_flag)
|
|
|
|
debug_current_and_destination(PSTR("FINAL_MOVE in ubl.line_to_destination()"));
|
|
|
|
debug_current_and_destination(PSTR("FINAL_MOVE in ubl.line_to_destination_cartesian()"));
|
|
|
|
|
|
|
|
|
|
|
|
set_current_from_destination();
|
|
|
|
set_current_from_destination();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -274,7 +223,7 @@
|
|
|
|
* Without this check, it is possible for the algorithm to generate a zero length move in the case
|
|
|
|
* Without this check, it is possible for the algorithm to generate a zero length move in the case
|
|
|
|
* where the line is heading down and it is starting right on a Mesh Line boundary. For how often that
|
|
|
|
* where the line is heading down and it is starting right on a Mesh Line boundary. For how often that
|
|
|
|
* happens, it might be best to remove the check and always 'schedule' the move because
|
|
|
|
* happens, it might be best to remove the check and always 'schedule' the move because
|
|
|
|
* the planner._buffer_line() routine will filter it if that happens.
|
|
|
|
* the planner.buffer_segment() routine will filter it if that happens.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if (ry != start[Y_AXIS]) {
|
|
|
|
if (ry != start[Y_AXIS]) {
|
|
|
|
if (!inf_normalized_flag) {
|
|
|
|
if (!inf_normalized_flag) {
|
|
|
@ -287,12 +236,12 @@
|
|
|
|
z_position = end[Z_AXIS];
|
|
|
|
z_position = end[Z_AXIS];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
planner._buffer_line(rx, ry, z_position + z0, e_position, feed_rate, extruder);
|
|
|
|
planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder);
|
|
|
|
} //else printf("FIRST MOVE PRUNED ");
|
|
|
|
} //else printf("FIRST MOVE PRUNED ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (g26_debug_flag)
|
|
|
|
if (g26_debug_flag)
|
|
|
|
debug_current_and_destination(PSTR("vertical move done in ubl.line_to_destination()"));
|
|
|
|
debug_current_and_destination(PSTR("vertical move done in ubl.line_to_destination_cartesian()"));
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Check if we are at the final destination. Usually, we won't be, but if it is on a Y Mesh Line, we are done.
|
|
|
|
// Check if we are at the final destination. Usually, we won't be, but if it is on a Y Mesh Line, we are done.
|
|
|
@ -338,7 +287,7 @@
|
|
|
|
* Without this check, it is possible for the algorithm to generate a zero length move in the case
|
|
|
|
* Without this check, it is possible for the algorithm to generate a zero length move in the case
|
|
|
|
* where the line is heading left and it is starting right on a Mesh Line boundary. For how often
|
|
|
|
* where the line is heading left and it is starting right on a Mesh Line boundary. For how often
|
|
|
|
* that happens, it might be best to remove the check and always 'schedule' the move because
|
|
|
|
* that happens, it might be best to remove the check and always 'schedule' the move because
|
|
|
|
* the planner._buffer_line() routine will filter it if that happens.
|
|
|
|
* the planner.buffer_segment() routine will filter it if that happens.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if (rx != start[X_AXIS]) {
|
|
|
|
if (rx != start[X_AXIS]) {
|
|
|
|
if (!inf_normalized_flag) {
|
|
|
|
if (!inf_normalized_flag) {
|
|
|
@ -351,12 +300,12 @@
|
|
|
|
z_position = end[Z_AXIS];
|
|
|
|
z_position = end[Z_AXIS];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
planner._buffer_line(rx, ry, z_position + z0, e_position, feed_rate, extruder);
|
|
|
|
planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder);
|
|
|
|
} //else printf("FIRST MOVE PRUNED ");
|
|
|
|
} //else printf("FIRST MOVE PRUNED ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (g26_debug_flag)
|
|
|
|
if (g26_debug_flag)
|
|
|
|
debug_current_and_destination(PSTR("horizontal move done in ubl.line_to_destination()"));
|
|
|
|
debug_current_and_destination(PSTR("horizontal move done in ubl.line_to_destination_cartesian()"));
|
|
|
|
|
|
|
|
|
|
|
|
if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS])
|
|
|
|
if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS])
|
|
|
|
goto FINAL_MOVE;
|
|
|
|
goto FINAL_MOVE;
|
|
|
@ -413,7 +362,7 @@
|
|
|
|
e_position = end[E_AXIS];
|
|
|
|
e_position = end[E_AXIS];
|
|
|
|
z_position = end[Z_AXIS];
|
|
|
|
z_position = end[Z_AXIS];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
planner._buffer_line(rx, next_mesh_line_y, z_position + z0, e_position, feed_rate, extruder);
|
|
|
|
planner.buffer_segment(rx, next_mesh_line_y, z_position + z0, e_position, feed_rate, extruder);
|
|
|
|
current_yi += dyi;
|
|
|
|
current_yi += dyi;
|
|
|
|
yi_cnt--;
|
|
|
|
yi_cnt--;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -441,7 +390,7 @@
|
|
|
|
z_position = end[Z_AXIS];
|
|
|
|
z_position = end[Z_AXIS];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
planner._buffer_line(next_mesh_line_x, ry, z_position + z0, e_position, feed_rate, extruder);
|
|
|
|
planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, feed_rate, extruder);
|
|
|
|
current_xi += dxi;
|
|
|
|
current_xi += dxi;
|
|
|
|
xi_cnt--;
|
|
|
|
xi_cnt--;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -450,7 +399,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (g26_debug_flag)
|
|
|
|
if (g26_debug_flag)
|
|
|
|
debug_current_and_destination(PSTR("generic move done in ubl.line_to_destination()"));
|
|
|
|
debug_current_and_destination(PSTR("generic move done in ubl.line_to_destination_cartesian()"));
|
|
|
|
|
|
|
|
|
|
|
|
if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS])
|
|
|
|
if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS])
|
|
|
|
goto FINAL_MOVE;
|
|
|
|
goto FINAL_MOVE;
|
|
|
@ -458,223 +407,222 @@
|
|
|
|
set_current_from_destination();
|
|
|
|
set_current_from_destination();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if UBL_DELTA
|
|
|
|
#else // UBL_SEGMENTED
|
|
|
|
|
|
|
|
|
|
|
|
// macro to inline copy exactly 4 floats, don't rely on sizeof operator
|
|
|
|
#if IS_SCARA // scale the feed rate from mm/s to degrees/s
|
|
|
|
#define COPY_XYZE( target, source ) { \
|
|
|
|
static float scara_feed_factor, scara_oldA, scara_oldB;
|
|
|
|
target[X_AXIS] = source[X_AXIS]; \
|
|
|
|
#endif
|
|
|
|
target[Y_AXIS] = source[Y_AXIS]; \
|
|
|
|
|
|
|
|
target[Z_AXIS] = source[Z_AXIS]; \
|
|
|
|
|
|
|
|
target[E_AXIS] = source[E_AXIS]; \
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if IS_SCARA // scale the feed rate from mm/s to degrees/s
|
|
|
|
// We don't want additional apply_leveling() performed by regular buffer_line or buffer_line_kinematic,
|
|
|
|
static float scara_feed_factor, scara_oldA, scara_oldB;
|
|
|
|
// so we call buffer_segment directly here. Per-segmented leveling and kinematics performed first.
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// We don't want additional apply_leveling() performed by regular buffer_line or buffer_line_kinematic,
|
|
|
|
inline void _O2 ubl_buffer_segment_raw(const float (&in_raw)[XYZE], const float &fr) {
|
|
|
|
// so we call _buffer_line directly here. Per-segmented leveling and kinematics performed first.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void _O2 ubl_buffer_segment_raw(const float raw[XYZE], const float &fr) {
|
|
|
|
#if ENABLED(SKEW_CORRECTION)
|
|
|
|
|
|
|
|
float raw[XYZE] = { in_raw[X_AXIS], in_raw[Y_AXIS], in_raw[Z_AXIS] };
|
|
|
|
|
|
|
|
planner.skew(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS]);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
const float (&raw)[XYZE] = in_raw;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DELTA) // apply delta inverse_kinematics
|
|
|
|
#if ENABLED(DELTA) // apply delta inverse_kinematics
|
|
|
|
|
|
|
|
|
|
|
|
DELTA_RAW_IK();
|
|
|
|
DELTA_RAW_IK();
|
|
|
|
planner._buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], fr, active_extruder);
|
|
|
|
planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_AXIS], fr, active_extruder);
|
|
|
|
|
|
|
|
|
|
|
|
#elif IS_SCARA // apply scara inverse_kinematics (should be changed to save raw->logical->raw)
|
|
|
|
#elif IS_SCARA // apply scara inverse_kinematics (should be changed to save raw->logical->raw)
|
|
|
|
|
|
|
|
|
|
|
|
inverse_kinematics(raw); // this writes delta[ABC] from raw[XYZE]
|
|
|
|
inverse_kinematics(raw); // this writes delta[ABC] from raw[XYZE]
|
|
|
|
// should move the feedrate scaling to scara inverse_kinematics
|
|
|
|
// should move the feedrate scaling to scara inverse_kinematics
|
|
|
|
|
|
|
|
|
|
|
|
const float adiff = FABS(delta[A_AXIS] - scara_oldA),
|
|
|
|
const float adiff = FABS(delta[A_AXIS] - scara_oldA),
|
|
|
|
bdiff = FABS(delta[B_AXIS] - scara_oldB);
|
|
|
|
bdiff = FABS(delta[B_AXIS] - scara_oldB);
|
|
|
|
scara_oldA = delta[A_AXIS];
|
|
|
|
scara_oldA = delta[A_AXIS];
|
|
|
|
scara_oldB = delta[B_AXIS];
|
|
|
|
scara_oldB = delta[B_AXIS];
|
|
|
|
float s_feedrate = max(adiff, bdiff) * scara_feed_factor;
|
|
|
|
float s_feedrate = max(adiff, bdiff) * scara_feed_factor;
|
|
|
|
|
|
|
|
|
|
|
|
planner._buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], s_feedrate, active_extruder);
|
|
|
|
planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], in_raw[E_AXIS], s_feedrate, active_extruder);
|
|
|
|
|
|
|
|
|
|
|
|
#else // CARTESIAN
|
|
|
|
#else // CARTESIAN
|
|
|
|
|
|
|
|
|
|
|
|
planner._buffer_line(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], raw[E_AXIS], fr, active_extruder);
|
|
|
|
planner.buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], in_raw[E_AXIS], fr, active_extruder);
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if IS_SCARA
|
|
|
|
#if IS_SCARA
|
|
|
|
#define DELTA_SEGMENT_MIN_LENGTH 0.25 // SCARA minimum segment size is 0.25mm
|
|
|
|
#define DELTA_SEGMENT_MIN_LENGTH 0.25 // SCARA minimum segment size is 0.25mm
|
|
|
|
#elif ENABLED(DELTA)
|
|
|
|
#elif ENABLED(DELTA)
|
|
|
|
#define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DELTA_SEGMENTS_PER_SECOND)
|
|
|
|
#define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DELTA_SEGMENTS_PER_SECOND)
|
|
|
|
#else // CARTESIAN
|
|
|
|
#else // CARTESIAN
|
|
|
|
#ifdef LEVELED_SEGMENT_LENGTH
|
|
|
|
#ifdef LEVELED_SEGMENT_LENGTH
|
|
|
|
#define DELTA_SEGMENT_MIN_LENGTH LEVELED_SEGMENT_LENGTH
|
|
|
|
#define DELTA_SEGMENT_MIN_LENGTH LEVELED_SEGMENT_LENGTH
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
#define DELTA_SEGMENT_MIN_LENGTH 1.00 // mm (similar to G2/G3 arc segmentation)
|
|
|
|
#define DELTA_SEGMENT_MIN_LENGTH 1.00 // mm (similar to G2/G3 arc segmentation)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Prepare a segmented linear move for DELTA/SCARA/CARTESIAN with UBL and FADE semantics.
|
|
|
|
* Prepare a segmented linear move for DELTA/SCARA/CARTESIAN with UBL and FADE semantics.
|
|
|
|
* This calls planner._buffer_line multiple times for small incremental moves.
|
|
|
|
* This calls planner.buffer_segment multiple times for small incremental moves.
|
|
|
|
* Returns true if did NOT move, false if moved (requires current_position update).
|
|
|
|
* Returns true if did NOT move, false if moved (requires current_position update).
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool _O2 unified_bed_leveling::prepare_segmented_line_to(const float (&rtarget)[XYZE], const float &feedrate) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!position_is_reachable(rtarget[X_AXIS], rtarget[Y_AXIS])) // fail if moving outside reachable boundary
|
|
|
|
|
|
|
|
return true; // did not move, so current_position still accurate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const float total[XYZE] = {
|
|
|
|
|
|
|
|
rtarget[X_AXIS] - current_position[X_AXIS],
|
|
|
|
|
|
|
|
rtarget[Y_AXIS] - current_position[Y_AXIS],
|
|
|
|
|
|
|
|
rtarget[Z_AXIS] - current_position[Z_AXIS],
|
|
|
|
|
|
|
|
rtarget[E_AXIS] - current_position[E_AXIS]
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const float cartesian_xy_mm = HYPOT(total[X_AXIS], total[Y_AXIS]); // total horizontal xy distance
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if IS_KINEMATIC
|
|
|
|
|
|
|
|
const float seconds = cartesian_xy_mm / feedrate; // seconds to move xy distance at requested rate
|
|
|
|
|
|
|
|
uint16_t segments = lroundf(delta_segments_per_second * seconds), // preferred number of segments for distance @ feedrate
|
|
|
|
|
|
|
|
seglimit = lroundf(cartesian_xy_mm * (1.0 / (DELTA_SEGMENT_MIN_LENGTH))); // number of segments at minimum segment length
|
|
|
|
|
|
|
|
NOMORE(segments, seglimit); // limit to minimum segment length (fewer segments)
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
uint16_t segments = lroundf(cartesian_xy_mm * (1.0 / (DELTA_SEGMENT_MIN_LENGTH))); // cartesian fixed segment length
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
bool _O2 unified_bed_leveling::prepare_segmented_line_to(const float rtarget[XYZE], const float &feedrate) {
|
|
|
|
NOLESS(segments, 1); // must have at least one segment
|
|
|
|
|
|
|
|
const float inv_segments = 1.0 / segments; // divide once, multiply thereafter
|
|
|
|
if (!position_is_reachable(rtarget[X_AXIS], rtarget[Y_AXIS])) // fail if moving outside reachable boundary
|
|
|
|
|
|
|
|
return true; // did not move, so current_position still accurate
|
|
|
|
#if IS_SCARA // scale the feed rate from mm/s to degrees/s
|
|
|
|
|
|
|
|
scara_feed_factor = cartesian_xy_mm * inv_segments * feedrate;
|
|
|
|
const float total[XYZE] = {
|
|
|
|
scara_oldA = stepper.get_axis_position_degrees(A_AXIS);
|
|
|
|
rtarget[X_AXIS] - current_position[X_AXIS],
|
|
|
|
scara_oldB = stepper.get_axis_position_degrees(B_AXIS);
|
|
|
|
rtarget[Y_AXIS] - current_position[Y_AXIS],
|
|
|
|
#endif
|
|
|
|
rtarget[Z_AXIS] - current_position[Z_AXIS],
|
|
|
|
|
|
|
|
rtarget[E_AXIS] - current_position[E_AXIS]
|
|
|
|
const float diff[XYZE] = {
|
|
|
|
};
|
|
|
|
total[X_AXIS] * inv_segments,
|
|
|
|
|
|
|
|
total[Y_AXIS] * inv_segments,
|
|
|
|
const float cartesian_xy_mm = HYPOT(total[X_AXIS], total[Y_AXIS]); // total horizontal xy distance
|
|
|
|
total[Z_AXIS] * inv_segments,
|
|
|
|
|
|
|
|
total[E_AXIS] * inv_segments
|
|
|
|
#if IS_KINEMATIC
|
|
|
|
};
|
|
|
|
const float seconds = cartesian_xy_mm / feedrate; // seconds to move xy distance at requested rate
|
|
|
|
|
|
|
|
uint16_t segments = lroundf(delta_segments_per_second * seconds), // preferred number of segments for distance @ feedrate
|
|
|
|
// Note that E segment distance could vary slightly as z mesh height
|
|
|
|
seglimit = lroundf(cartesian_xy_mm * (1.0 / (DELTA_SEGMENT_MIN_LENGTH))); // number of segments at minimum segment length
|
|
|
|
// changes for each segment, but small enough to ignore.
|
|
|
|
NOMORE(segments, seglimit); // limit to minimum segment length (fewer segments)
|
|
|
|
|
|
|
|
#else
|
|
|
|
float raw[XYZE] = {
|
|
|
|
uint16_t segments = lroundf(cartesian_xy_mm * (1.0 / (DELTA_SEGMENT_MIN_LENGTH))); // cartesian fixed segment length
|
|
|
|
current_position[X_AXIS],
|
|
|
|
#endif
|
|
|
|
current_position[Y_AXIS],
|
|
|
|
|
|
|
|
current_position[Z_AXIS],
|
|
|
|
NOLESS(segments, 1); // must have at least one segment
|
|
|
|
current_position[E_AXIS]
|
|
|
|
const float inv_segments = 1.0 / segments; // divide once, multiply thereafter
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#if IS_SCARA // scale the feed rate from mm/s to degrees/s
|
|
|
|
// Only compute leveling per segment if ubl active and target below z_fade_height.
|
|
|
|
scara_feed_factor = cartesian_xy_mm * inv_segments * feedrate;
|
|
|
|
if (!planner.leveling_active || !planner.leveling_active_at_z(rtarget[Z_AXIS])) { // no mesh leveling
|
|
|
|
scara_oldA = stepper.get_axis_position_degrees(A_AXIS);
|
|
|
|
while (--segments) {
|
|
|
|
scara_oldB = stepper.get_axis_position_degrees(B_AXIS);
|
|
|
|
LOOP_XYZE(i) raw[i] += diff[i];
|
|
|
|
#endif
|
|
|
|
ubl_buffer_segment_raw(raw, feedrate);
|
|
|
|
|
|
|
|
|
|
|
|
const float diff[XYZE] = {
|
|
|
|
|
|
|
|
total[X_AXIS] * inv_segments,
|
|
|
|
|
|
|
|
total[Y_AXIS] * inv_segments,
|
|
|
|
|
|
|
|
total[Z_AXIS] * inv_segments,
|
|
|
|
|
|
|
|
total[E_AXIS] * inv_segments
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Note that E segment distance could vary slightly as z mesh height
|
|
|
|
|
|
|
|
// changes for each segment, but small enough to ignore.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float raw[XYZE] = {
|
|
|
|
|
|
|
|
current_position[X_AXIS],
|
|
|
|
|
|
|
|
current_position[Y_AXIS],
|
|
|
|
|
|
|
|
current_position[Z_AXIS],
|
|
|
|
|
|
|
|
current_position[E_AXIS]
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Only compute leveling per segment if ubl active and target below z_fade_height.
|
|
|
|
|
|
|
|
if (!planner.leveling_active || !planner.leveling_active_at_z(rtarget[Z_AXIS])) { // no mesh leveling
|
|
|
|
|
|
|
|
while (--segments) {
|
|
|
|
|
|
|
|
LOOP_XYZE(i) raw[i] += diff[i];
|
|
|
|
|
|
|
|
ubl_buffer_segment_raw(raw, feedrate);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ubl_buffer_segment_raw(rtarget, feedrate);
|
|
|
|
|
|
|
|
return false; // moved but did not set_current_from_destination();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ubl_buffer_segment_raw(rtarget, feedrate);
|
|
|
|
|
|
|
|
return false; // moved but did not set_current_from_destination();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Otherwise perform per-segment leveling
|
|
|
|
// Otherwise perform per-segment leveling
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
|
|
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
|
|
|
const float fade_scaling_factor = planner.fade_scaling_factor_for_z(rtarget[Z_AXIS]);
|
|
|
|
const float fade_scaling_factor = planner.fade_scaling_factor_for_z(rtarget[Z_AXIS]);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// increment to first segment destination
|
|
|
|
// increment to first segment destination
|
|
|
|
LOOP_XYZE(i) raw[i] += diff[i];
|
|
|
|
LOOP_XYZE(i) raw[i] += diff[i];
|
|
|
|
|
|
|
|
|
|
|
|
for(;;) { // for each mesh cell encountered during the move
|
|
|
|
for(;;) { // for each mesh cell encountered during the move
|
|
|
|
|
|
|
|
|
|
|
|
// Compute mesh cell invariants that remain constant for all segments within cell.
|
|
|
|
// Compute mesh cell invariants that remain constant for all segments within cell.
|
|
|
|
// Note for cell index, if point is outside the mesh grid (in MESH_INSET perimeter)
|
|
|
|
// Note for cell index, if point is outside the mesh grid (in MESH_INSET perimeter)
|
|
|
|
// the bilinear interpolation from the adjacent cell within the mesh will still work.
|
|
|
|
// the bilinear interpolation from the adjacent cell within the mesh will still work.
|
|
|
|
// Inner loop will exit each time (because out of cell bounds) but will come back
|
|
|
|
// Inner loop will exit each time (because out of cell bounds) but will come back
|
|
|
|
// in top of loop and again re-find same adjacent cell and use it, just less efficient
|
|
|
|
// in top of loop and again re-find same adjacent cell and use it, just less efficient
|
|
|
|
// for mesh inset area.
|
|
|
|
// for mesh inset area.
|
|
|
|
|
|
|
|
|
|
|
|
int8_t cell_xi = (raw[X_AXIS] - (MESH_MIN_X)) * (1.0 / (MESH_X_DIST)),
|
|
|
|
int8_t cell_xi = (raw[X_AXIS] - (MESH_MIN_X)) * (1.0 / (MESH_X_DIST)),
|
|
|
|
cell_yi = (raw[Y_AXIS] - (MESH_MIN_Y)) * (1.0 / (MESH_X_DIST));
|
|
|
|
cell_yi = (raw[Y_AXIS] - (MESH_MIN_Y)) * (1.0 / (MESH_X_DIST));
|
|
|
|
|
|
|
|
|
|
|
|
cell_xi = constrain(cell_xi, 0, (GRID_MAX_POINTS_X) - 1);
|
|
|
|
cell_xi = constrain(cell_xi, 0, (GRID_MAX_POINTS_X) - 1);
|
|
|
|
cell_yi = constrain(cell_yi, 0, (GRID_MAX_POINTS_Y) - 1);
|
|
|
|
cell_yi = constrain(cell_yi, 0, (GRID_MAX_POINTS_Y) - 1);
|
|
|
|
|
|
|
|
|
|
|
|
const float x0 = mesh_index_to_xpos(cell_xi), // 64 byte table lookup avoids mul+add
|
|
|
|
const float x0 = mesh_index_to_xpos(cell_xi), // 64 byte table lookup avoids mul+add
|
|
|
|
y0 = mesh_index_to_ypos(cell_yi);
|
|
|
|
y0 = mesh_index_to_ypos(cell_yi);
|
|
|
|
|
|
|
|
|
|
|
|
float z_x0y0 = z_values[cell_xi ][cell_yi ], // z at lower left corner
|
|
|
|
float z_x0y0 = z_values[cell_xi ][cell_yi ], // z at lower left corner
|
|
|
|
z_x1y0 = z_values[cell_xi+1][cell_yi ], // z at upper left corner
|
|
|
|
z_x1y0 = z_values[cell_xi+1][cell_yi ], // z at upper left corner
|
|
|
|
z_x0y1 = z_values[cell_xi ][cell_yi+1], // z at lower right corner
|
|
|
|
z_x0y1 = z_values[cell_xi ][cell_yi+1], // z at lower right corner
|
|
|
|
z_x1y1 = z_values[cell_xi+1][cell_yi+1]; // z at upper right corner
|
|
|
|
z_x1y1 = z_values[cell_xi+1][cell_yi+1]; // z at upper right corner
|
|
|
|
|
|
|
|
|
|
|
|
if (isnan(z_x0y0)) z_x0y0 = 0; // ideally activating planner.leveling_active (G29 A)
|
|
|
|
if (isnan(z_x0y0)) z_x0y0 = 0; // ideally activating planner.leveling_active (G29 A)
|
|
|
|
if (isnan(z_x1y0)) z_x1y0 = 0; // should refuse if any invalid mesh points
|
|
|
|
if (isnan(z_x1y0)) z_x1y0 = 0; // should refuse if any invalid mesh points
|
|
|
|
if (isnan(z_x0y1)) z_x0y1 = 0; // in order to avoid isnan tests per cell,
|
|
|
|
if (isnan(z_x0y1)) z_x0y1 = 0; // in order to avoid isnan tests per cell,
|
|
|
|
if (isnan(z_x1y1)) z_x1y1 = 0; // thus guessing zero for undefined points
|
|
|
|
if (isnan(z_x1y1)) z_x1y1 = 0; // thus guessing zero for undefined points
|
|
|
|
|
|
|
|
|
|
|
|
float cx = raw[X_AXIS] - x0, // cell-relative x and y
|
|
|
|
float cx = raw[X_AXIS] - x0, // cell-relative x and y
|
|
|
|
cy = raw[Y_AXIS] - y0;
|
|
|
|
cy = raw[Y_AXIS] - y0;
|
|
|
|
|
|
|
|
|
|
|
|
const float z_xmy0 = (z_x1y0 - z_x0y0) * (1.0 / (MESH_X_DIST)), // z slope per x along y0 (lower left to lower right)
|
|
|
|
const float z_xmy0 = (z_x1y0 - z_x0y0) * (1.0 / (MESH_X_DIST)), // z slope per x along y0 (lower left to lower right)
|
|
|
|
z_xmy1 = (z_x1y1 - z_x0y1) * (1.0 / (MESH_X_DIST)); // z slope per x along y1 (upper left to upper right)
|
|
|
|
z_xmy1 = (z_x1y1 - z_x0y1) * (1.0 / (MESH_X_DIST)); // z slope per x along y1 (upper left to upper right)
|
|
|
|
|
|
|
|
|
|
|
|
float z_cxy0 = z_x0y0 + z_xmy0 * cx; // z height along y0 at cx (changes for each cx in cell)
|
|
|
|
float z_cxy0 = z_x0y0 + z_xmy0 * cx; // z height along y0 at cx (changes for each cx in cell)
|
|
|
|
|
|
|
|
|
|
|
|
const float z_cxy1 = z_x0y1 + z_xmy1 * cx, // z height along y1 at cx
|
|
|
|
const float z_cxy1 = z_x0y1 + z_xmy1 * cx, // z height along y1 at cx
|
|
|
|
z_cxyd = z_cxy1 - z_cxy0; // z height difference along cx from y0 to y1
|
|
|
|
z_cxyd = z_cxy1 - z_cxy0; // z height difference along cx from y0 to y1
|
|
|
|
|
|
|
|
|
|
|
|
float z_cxym = z_cxyd * (1.0 / (MESH_Y_DIST)); // z slope per y along cx from y0 to y1 (changes for each cx in cell)
|
|
|
|
float z_cxym = z_cxyd * (1.0 / (MESH_Y_DIST)); // z slope per y along cx from y0 to y1 (changes for each cx in cell)
|
|
|
|
|
|
|
|
|
|
|
|
// float z_cxcy = z_cxy0 + z_cxym * cy; // interpolated mesh z height along cx at cy (do inside the segment loop)
|
|
|
|
// float z_cxcy = z_cxy0 + z_cxym * cy; // interpolated mesh z height along cx at cy (do inside the segment loop)
|
|
|
|
|
|
|
|
|
|
|
|
// As subsequent segments step through this cell, the z_cxy0 intercept will change
|
|
|
|
// As subsequent segments step through this cell, the z_cxy0 intercept will change
|
|
|
|
// and the z_cxym slope will change, both as a function of cx within the cell, and
|
|
|
|
// and the z_cxym slope will change, both as a function of cx within the cell, and
|
|
|
|
// each change by a constant for fixed segment lengths.
|
|
|
|
// each change by a constant for fixed segment lengths.
|
|
|
|
|
|
|
|
|
|
|
|
const float z_sxy0 = z_xmy0 * diff[X_AXIS], // per-segment adjustment to z_cxy0
|
|
|
|
const float z_sxy0 = z_xmy0 * diff[X_AXIS], // per-segment adjustment to z_cxy0
|
|
|
|
z_sxym = (z_xmy1 - z_xmy0) * (1.0 / (MESH_Y_DIST)) * diff[X_AXIS]; // per-segment adjustment to z_cxym
|
|
|
|
z_sxym = (z_xmy1 - z_xmy0) * (1.0 / (MESH_Y_DIST)) * diff[X_AXIS]; // per-segment adjustment to z_cxym
|
|
|
|
|
|
|
|
|
|
|
|
for(;;) { // for all segments within this mesh cell
|
|
|
|
for(;;) { // for all segments within this mesh cell
|
|
|
|
|
|
|
|
|
|
|
|
if (--segments == 0) // if this is last segment, use rtarget for exact
|
|
|
|
if (--segments == 0) // if this is last segment, use rtarget for exact
|
|
|
|
COPY(raw, rtarget);
|
|
|
|
COPY(raw, rtarget);
|
|
|
|
|
|
|
|
|
|
|
|
const float z_cxcy = (z_cxy0 + z_cxym * cy) // interpolated mesh z height along cx at cy
|
|
|
|
const float z_cxcy = (z_cxy0 + z_cxym * cy) // interpolated mesh z height along cx at cy
|
|
|
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
|
|
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
|
|
|
* fade_scaling_factor // apply fade factor to interpolated mesh height
|
|
|
|
* fade_scaling_factor // apply fade factor to interpolated mesh height
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
const float z = raw[Z_AXIS];
|
|
|
|
const float z = raw[Z_AXIS];
|
|
|
|
raw[Z_AXIS] += z_cxcy;
|
|
|
|
raw[Z_AXIS] += z_cxcy;
|
|
|
|
ubl_buffer_segment_raw(raw, feedrate);
|
|
|
|
ubl_buffer_segment_raw(raw, feedrate);
|
|
|
|
raw[Z_AXIS] = z;
|
|
|
|
raw[Z_AXIS] = z;
|
|
|
|
|
|
|
|
|
|
|
|
if (segments == 0) // done with last segment
|
|
|
|
if (segments == 0) // done with last segment
|
|
|
|
return false; // did not set_current_from_destination()
|
|
|
|
return false; // did not set_current_from_destination()
|
|
|
|
|
|
|
|
|
|
|
|
LOOP_XYZE(i) raw[i] += diff[i];
|
|
|
|
LOOP_XYZE(i) raw[i] += diff[i];
|
|
|
|
|
|
|
|
|
|
|
|
cx += diff[X_AXIS];
|
|
|
|
cx += diff[X_AXIS];
|
|
|
|
cy += diff[Y_AXIS];
|
|
|
|
cy += diff[Y_AXIS];
|
|
|
|
|
|
|
|
|
|
|
|
if (!WITHIN(cx, 0, MESH_X_DIST) || !WITHIN(cy, 0, MESH_Y_DIST)) // done within this cell, break to next
|
|
|
|
if (!WITHIN(cx, 0, MESH_X_DIST) || !WITHIN(cy, 0, MESH_Y_DIST)) // done within this cell, break to next
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
// Next segment still within same mesh cell, adjust the per-segment
|
|
|
|
// Next segment still within same mesh cell, adjust the per-segment
|
|
|
|
// slope and intercept to compute next z height.
|
|
|
|
// slope and intercept to compute next z height.
|
|
|
|
|
|
|
|
|
|
|
|
z_cxy0 += z_sxy0; // adjust z_cxy0 by per-segment z_sxy0
|
|
|
|
z_cxy0 += z_sxy0; // adjust z_cxy0 by per-segment z_sxy0
|
|
|
|
z_cxym += z_sxym; // adjust z_cxym by per-segment z_sxym
|
|
|
|
z_cxym += z_sxym; // adjust z_cxym by per-segment z_sxym
|
|
|
|
|
|
|
|
|
|
|
|
} // segment loop
|
|
|
|
} // segment loop
|
|
|
|
} // cell loop
|
|
|
|
} // cell loop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // UBL_DELTA
|
|
|
|
#endif // UBL_SEGMENTED
|
|
|
|
|
|
|
|
|
|
|
|
#endif // AUTO_BED_LEVELING_UBL
|
|
|
|
#endif // AUTO_BED_LEVELING_UBL
|
|
|
|