|
|
@ -396,6 +396,8 @@ bool axis_relative_modes[] = AXIS_RELATIVE_MODES,
|
|
|
|
float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DIA),
|
|
|
|
float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DIA),
|
|
|
|
volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0);
|
|
|
|
volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
|
|
|
|
|
|
|
|
|
|
// The distance that XYZ has been offset by G92. Reset by G28.
|
|
|
|
// The distance that XYZ has been offset by G92. Reset by G28.
|
|
|
|
float position_shift[XYZ] = { 0 };
|
|
|
|
float position_shift[XYZ] = { 0 };
|
|
|
|
|
|
|
|
|
|
|
@ -403,6 +405,11 @@ float position_shift[XYZ] = { 0 };
|
|
|
|
// Set by M206, M428, or menu item. Saved to EEPROM.
|
|
|
|
// Set by M206, M428, or menu item. Saved to EEPROM.
|
|
|
|
float home_offset[XYZ] = { 0 };
|
|
|
|
float home_offset[XYZ] = { 0 };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// The above two are combined to save on computes
|
|
|
|
|
|
|
|
float workspace_offset[XYZ] = { 0 };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Software Endstops are based on the configured limits.
|
|
|
|
// Software Endstops are based on the configured limits.
|
|
|
|
#if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)
|
|
|
|
#if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)
|
|
|
|
bool soft_endstops_enabled = true;
|
|
|
|
bool soft_endstops_enabled = true;
|
|
|
@ -1333,6 +1340,8 @@ bool get_target_extruder_from_command(int code) {
|
|
|
|
|
|
|
|
|
|
|
|
#endif // DUAL_X_CARRIAGE
|
|
|
|
#endif // DUAL_X_CARRIAGE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS) || ENABLED(DUAL_X_CARRIAGE) || ENABLED(DELTA)
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Software endstops can be used to monitor the open end of
|
|
|
|
* Software endstops can be used to monitor the open end of
|
|
|
|
* an axis that has a hardware endstop on the other end. Or
|
|
|
|
* an axis that has a hardware endstop on the other end. Or
|
|
|
@ -1342,8 +1351,8 @@ bool get_target_extruder_from_command(int code) {
|
|
|
|
* the software endstop positions must be refreshed to remain
|
|
|
|
* the software endstop positions must be refreshed to remain
|
|
|
|
* at the same positions relative to the machine.
|
|
|
|
* at the same positions relative to the machine.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void update_software_endstops(AxisEnum axis) {
|
|
|
|
void update_software_endstops(const AxisEnum axis) {
|
|
|
|
float offs = LOGICAL_POSITION(0, axis);
|
|
|
|
const float offs = workspace_offset[axis] = LOGICAL_POSITION(0, axis);
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DUAL_X_CARRIAGE)
|
|
|
|
#if ENABLED(DUAL_X_CARRIAGE)
|
|
|
|
if (axis == X_AXIS) {
|
|
|
|
if (axis == X_AXIS) {
|
|
|
@ -1376,8 +1385,10 @@ void update_software_endstops(AxisEnum axis) {
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
if (DEBUGGING(LEVELING)) {
|
|
|
|
if (DEBUGGING(LEVELING)) {
|
|
|
|
SERIAL_ECHOPAIR("For ", axis_codes[axis]);
|
|
|
|
SERIAL_ECHOPAIR("For ", axis_codes[axis]);
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
|
|
SERIAL_ECHOPAIR(" axis:\n home_offset = ", home_offset[axis]);
|
|
|
|
SERIAL_ECHOPAIR(" axis:\n home_offset = ", home_offset[axis]);
|
|
|
|
SERIAL_ECHOPAIR("\n position_shift = ", position_shift[axis]);
|
|
|
|
SERIAL_ECHOPAIR("\n position_shift = ", position_shift[axis]);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
SERIAL_ECHOPAIR("\n soft_endstop_min = ", soft_endstop_min[axis]);
|
|
|
|
SERIAL_ECHOPAIR("\n soft_endstop_min = ", soft_endstop_min[axis]);
|
|
|
|
SERIAL_ECHOLNPAIR("\n soft_endstop_max = ", soft_endstop_max[axis]);
|
|
|
|
SERIAL_ECHOLNPAIR("\n soft_endstop_max = ", soft_endstop_max[axis]);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1387,9 +1398,11 @@ void update_software_endstops(AxisEnum axis) {
|
|
|
|
if (axis == Z_AXIS)
|
|
|
|
if (axis == Z_AXIS)
|
|
|
|
delta_clip_start_height = soft_endstop_max[axis] - delta_safe_distance_from_top();
|
|
|
|
delta_clip_start_height = soft_endstop_max[axis] - delta_safe_distance_from_top();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // NO_WORKSPACE_OFFSETS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Change the home offset for an axis, update the current
|
|
|
|
* Change the home offset for an axis, update the current
|
|
|
|
* position and the software endstops to retain the same
|
|
|
|
* position and the software endstops to retain the same
|
|
|
@ -1398,11 +1411,12 @@ void update_software_endstops(AxisEnum axis) {
|
|
|
|
* Since this changes the current_position, code should
|
|
|
|
* Since this changes the current_position, code should
|
|
|
|
* call sync_plan_position soon after this.
|
|
|
|
* call sync_plan_position soon after this.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
static void set_home_offset(AxisEnum axis, float v) {
|
|
|
|
static void set_home_offset(const AxisEnum axis, const float v) {
|
|
|
|
current_position[axis] += v - home_offset[axis];
|
|
|
|
current_position[axis] += v - home_offset[axis];
|
|
|
|
home_offset[axis] = v;
|
|
|
|
home_offset[axis] = v;
|
|
|
|
update_software_endstops(axis);
|
|
|
|
update_software_endstops(axis);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // NO_WORKSPACE_OFFSETS
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Set an axis' current position to its home position (after homing).
|
|
|
|
* Set an axis' current position to its home position (after homing).
|
|
|
@ -1433,8 +1447,10 @@ static void set_axis_is_at_home(AxisEnum axis) {
|
|
|
|
|
|
|
|
|
|
|
|
axis_known_position[axis] = axis_homed[axis] = true;
|
|
|
|
axis_known_position[axis] = axis_homed[axis] = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
|
|
position_shift[axis] = 0;
|
|
|
|
position_shift[axis] = 0;
|
|
|
|
update_software_endstops(axis);
|
|
|
|
update_software_endstops(axis);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DUAL_X_CARRIAGE)
|
|
|
|
#if ENABLED(DUAL_X_CARRIAGE)
|
|
|
|
if (axis == X_AXIS && (active_extruder == 1 || dual_x_carriage_mode == DXC_DUPLICATION_MODE)) {
|
|
|
|
if (axis == X_AXIS && (active_extruder == 1 || dual_x_carriage_mode == DXC_DUPLICATION_MODE)) {
|
|
|
@ -1507,8 +1523,10 @@ static void set_axis_is_at_home(AxisEnum axis) {
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
if (DEBUGGING(LEVELING)) {
|
|
|
|
if (DEBUGGING(LEVELING)) {
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
|
|
SERIAL_ECHOPAIR("> home_offset[", axis_codes[axis]);
|
|
|
|
SERIAL_ECHOPAIR("> home_offset[", axis_codes[axis]);
|
|
|
|
SERIAL_ECHOLNPAIR("] = ", home_offset[axis]);
|
|
|
|
SERIAL_ECHOLNPAIR("] = ", home_offset[axis]);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
DEBUG_POS("", current_position);
|
|
|
|
DEBUG_POS("", current_position);
|
|
|
|
SERIAL_ECHOPAIR("<<< set_axis_is_at_home(", axis_codes[axis]);
|
|
|
|
SERIAL_ECHOPAIR("<<< set_axis_is_at_home(", axis_codes[axis]);
|
|
|
|
SERIAL_CHAR(')');
|
|
|
|
SERIAL_CHAR(')');
|
|
|
@ -1549,8 +1567,8 @@ inline void line_to_destination(float fr_mm_s) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inline void line_to_destination() { line_to_destination(feedrate_mm_s); }
|
|
|
|
inline void line_to_destination() { line_to_destination(feedrate_mm_s); }
|
|
|
|
|
|
|
|
|
|
|
|
inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
|
|
|
|
inline void set_current_to_destination() { COPY(current_position, destination); }
|
|
|
|
inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
|
|
|
|
inline void set_destination_to_current() { COPY(destination, current_position); }
|
|
|
|
|
|
|
|
|
|
|
|
#if IS_KINEMATIC
|
|
|
|
#if IS_KINEMATIC
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -3557,7 +3575,7 @@ inline void gcode_G28() {
|
|
|
|
HOMEAXIS(X);
|
|
|
|
HOMEAXIS(X);
|
|
|
|
|
|
|
|
|
|
|
|
// Consider the active extruder to be parked
|
|
|
|
// Consider the active extruder to be parked
|
|
|
|
memcpy(raised_parked_position, current_position, sizeof(raised_parked_position));
|
|
|
|
COPY(raised_parked_position, current_position);
|
|
|
|
delayed_move_time = 0;
|
|
|
|
delayed_move_time = 0;
|
|
|
|
active_extruder_parked = true;
|
|
|
|
active_extruder_parked = true;
|
|
|
|
|
|
|
|
|
|
|
@ -4357,7 +4375,7 @@ inline void gcode_G28() {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
float converted[XYZ];
|
|
|
|
float converted[XYZ];
|
|
|
|
memcpy(converted, current_position, sizeof(converted));
|
|
|
|
COPY(converted, current_position);
|
|
|
|
|
|
|
|
|
|
|
|
planner.abl_enabled = true;
|
|
|
|
planner.abl_enabled = true;
|
|
|
|
planner.unapply_leveling(converted); // use conversion machinery
|
|
|
|
planner.unapply_leveling(converted); // use conversion machinery
|
|
|
@ -4379,7 +4397,7 @@ inline void gcode_G28() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// The rotated XY and corrected Z are now current_position
|
|
|
|
// The rotated XY and corrected Z are now current_position
|
|
|
|
memcpy(current_position, converted, sizeof(converted));
|
|
|
|
COPY(current_position, converted);
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("G29 corrected XYZ", current_position);
|
|
|
|
if (DEBUGGING(LEVELING)) DEBUG_POS("G29 corrected XYZ", current_position);
|
|
|
@ -4595,8 +4613,10 @@ inline void gcode_G92() {
|
|
|
|
|
|
|
|
|
|
|
|
if (i != E_AXIS) {
|
|
|
|
if (i != E_AXIS) {
|
|
|
|
didXYZ = true;
|
|
|
|
didXYZ = true;
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
|
|
position_shift[i] += v - p; // Offset the coordinate space
|
|
|
|
position_shift[i] += v - p; // Offset the coordinate space
|
|
|
|
update_software_endstops((AxisEnum)i);
|
|
|
|
update_software_endstops((AxisEnum)i);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -6326,6 +6346,8 @@ inline void gcode_M205() {
|
|
|
|
if (code_seen('E')) planner.max_jerk[E_AXIS] = code_value_axis_units(E_AXIS);
|
|
|
|
if (code_seen('E')) planner.max_jerk[E_AXIS] = code_value_axis_units(E_AXIS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y
|
|
|
|
* M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -6343,6 +6365,8 @@ inline void gcode_M206() {
|
|
|
|
report_current_position();
|
|
|
|
report_current_position();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // NO_WORKSPACE_OFFSETS
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* M665: Set delta configurations
|
|
|
|
* M665: Set delta configurations
|
|
|
@ -7165,6 +7189,8 @@ void quickstop_stepper() {
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* M428: Set home_offset based on the distance between the
|
|
|
|
* M428: Set home_offset based on the distance between the
|
|
|
|
* current_position and the nearest "reference point."
|
|
|
|
* current_position and the nearest "reference point."
|
|
|
@ -7205,6 +7231,8 @@ inline void gcode_M428() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // NO_WORKSPACE_OFFSETS
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* M500: Store settings in EEPROM
|
|
|
|
* M500: Store settings in EEPROM
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -7929,7 +7957,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DXC_AUTO_PARK_MODE:
|
|
|
|
case DXC_AUTO_PARK_MODE:
|
|
|
|
// record raised toolhead position for use by unpark
|
|
|
|
// record raised toolhead position for use by unpark
|
|
|
|
memcpy(raised_parked_position, current_position, sizeof(raised_parked_position));
|
|
|
|
COPY(raised_parked_position, current_position);
|
|
|
|
raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT;
|
|
|
|
raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT;
|
|
|
|
#if ENABLED(max_software_endstops)
|
|
|
|
#if ENABLED(max_software_endstops)
|
|
|
|
NOMORE(raised_parked_position[Z_AXIS], soft_endstop_max[Z_AXIS]);
|
|
|
|
NOMORE(raised_parked_position[Z_AXIS], soft_endstop_max[Z_AXIS]);
|
|
|
@ -8073,10 +8101,14 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|
|
|
// The newly-selected extruder XY is actually at...
|
|
|
|
// The newly-selected extruder XY is actually at...
|
|
|
|
current_position[X_AXIS] += xydiff[X_AXIS];
|
|
|
|
current_position[X_AXIS] += xydiff[X_AXIS];
|
|
|
|
current_position[Y_AXIS] += xydiff[Y_AXIS];
|
|
|
|
current_position[Y_AXIS] += xydiff[Y_AXIS];
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS) || ENABLED(DUAL_X_CARRIAGE)
|
|
|
|
for (uint8_t i = X_AXIS; i <= Y_AXIS; i++) {
|
|
|
|
for (uint8_t i = X_AXIS; i <= Y_AXIS; i++) {
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
|
|
position_shift[i] += xydiff[i];
|
|
|
|
position_shift[i] += xydiff[i];
|
|
|
|
|
|
|
|
#endif
|
|
|
|
update_software_endstops((AxisEnum)i);
|
|
|
|
update_software_endstops((AxisEnum)i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Set the new active extruder
|
|
|
|
// Set the new active extruder
|
|
|
|
active_extruder = tmp_extruder;
|
|
|
|
active_extruder = tmp_extruder;
|
|
|
@ -8631,9 +8663,12 @@ void process_next_command() {
|
|
|
|
case 205: //M205: Set advanced settings
|
|
|
|
case 205: //M205: Set advanced settings
|
|
|
|
gcode_M205();
|
|
|
|
gcode_M205();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
|
|
case 206: // M206: Set home offsets
|
|
|
|
case 206: // M206: Set home offsets
|
|
|
|
gcode_M206();
|
|
|
|
gcode_M206();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
case 665: // M665: Set delta configurations
|
|
|
|
case 665: // M665: Set delta configurations
|
|
|
@ -8797,9 +8832,11 @@ void process_next_command() {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
|
|
case 428: // M428: Apply current_position to home_offset
|
|
|
|
case 428: // M428: Apply current_position to home_offset
|
|
|
|
gcode_M428();
|
|
|
|
gcode_M428();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
case 500: // M500: Store settings in EEPROM
|
|
|
|
case 500: // M500: Store settings in EEPROM
|
|
|
|
gcode_M500();
|
|
|
|
gcode_M500();
|
|
|
@ -9287,7 +9324,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|
|
|
planner.unapply_leveling(cartes);
|
|
|
|
planner.unapply_leveling(cartes);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if (axis == ALL_AXES)
|
|
|
|
if (axis == ALL_AXES)
|
|
|
|
memcpy(current_position, cartes, sizeof(cartes));
|
|
|
|
COPY(current_position, cartes);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
current_position[axis] = cartes[axis];
|
|
|
|
current_position[axis] = cartes[axis];
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -9322,14 +9359,14 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|
|
|
// Split at the left/front border of the right/top square
|
|
|
|
// Split at the left/front border of the right/top square
|
|
|
|
int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2);
|
|
|
|
int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2);
|
|
|
|
if (cx2 != cx1 && TEST(x_splits, gcx)) {
|
|
|
|
if (cx2 != cx1 && TEST(x_splits, gcx)) {
|
|
|
|
memcpy(end, destination, sizeof(end));
|
|
|
|
COPY(end, destination);
|
|
|
|
destination[X_AXIS] = LOGICAL_X_POSITION(mbl.get_probe_x(gcx));
|
|
|
|
destination[X_AXIS] = LOGICAL_X_POSITION(mbl.get_probe_x(gcx));
|
|
|
|
normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]);
|
|
|
|
normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]);
|
|
|
|
destination[Y_AXIS] = MBL_SEGMENT_END(Y);
|
|
|
|
destination[Y_AXIS] = MBL_SEGMENT_END(Y);
|
|
|
|
CBI(x_splits, gcx);
|
|
|
|
CBI(x_splits, gcx);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (cy2 != cy1 && TEST(y_splits, gcy)) {
|
|
|
|
else if (cy2 != cy1 && TEST(y_splits, gcy)) {
|
|
|
|
memcpy(end, destination, sizeof(end));
|
|
|
|
COPY(end, destination);
|
|
|
|
destination[Y_AXIS] = LOGICAL_Y_POSITION(mbl.get_probe_y(gcy));
|
|
|
|
destination[Y_AXIS] = LOGICAL_Y_POSITION(mbl.get_probe_y(gcy));
|
|
|
|
normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]);
|
|
|
|
normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]);
|
|
|
|
destination[X_AXIS] = MBL_SEGMENT_END(X);
|
|
|
|
destination[X_AXIS] = MBL_SEGMENT_END(X);
|
|
|
@ -9349,7 +9386,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|
|
|
mesh_line_to_destination(fr_mm_s, x_splits, y_splits);
|
|
|
|
mesh_line_to_destination(fr_mm_s, x_splits, y_splits);
|
|
|
|
|
|
|
|
|
|
|
|
// Restore destination from stack
|
|
|
|
// Restore destination from stack
|
|
|
|
memcpy(destination, end, sizeof(end));
|
|
|
|
COPY(destination, end);
|
|
|
|
mesh_line_to_destination(fr_mm_s, x_splits, y_splits);
|
|
|
|
mesh_line_to_destination(fr_mm_s, x_splits, y_splits);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -9385,14 +9422,14 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|
|
|
// Split at the left/front border of the right/top square
|
|
|
|
// Split at the left/front border of the right/top square
|
|
|
|
int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2);
|
|
|
|
int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2);
|
|
|
|
if (cx2 != cx1 && TEST(x_splits, gcx)) {
|
|
|
|
if (cx2 != cx1 && TEST(x_splits, gcx)) {
|
|
|
|
memcpy(end, destination, sizeof(end));
|
|
|
|
COPY(end, destination);
|
|
|
|
destination[X_AXIS] = LOGICAL_X_POSITION(bilinear_start[X_AXIS] + ABL_BG_SPACING(X_AXIS) * gcx);
|
|
|
|
destination[X_AXIS] = LOGICAL_X_POSITION(bilinear_start[X_AXIS] + ABL_BG_SPACING(X_AXIS) * gcx);
|
|
|
|
normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]);
|
|
|
|
normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]);
|
|
|
|
destination[Y_AXIS] = LINE_SEGMENT_END(Y);
|
|
|
|
destination[Y_AXIS] = LINE_SEGMENT_END(Y);
|
|
|
|
CBI(x_splits, gcx);
|
|
|
|
CBI(x_splits, gcx);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (cy2 != cy1 && TEST(y_splits, gcy)) {
|
|
|
|
else if (cy2 != cy1 && TEST(y_splits, gcy)) {
|
|
|
|
memcpy(end, destination, sizeof(end));
|
|
|
|
COPY(end, destination);
|
|
|
|
destination[Y_AXIS] = LOGICAL_Y_POSITION(bilinear_start[Y_AXIS] + ABL_BG_SPACING(Y_AXIS) * gcy);
|
|
|
|
destination[Y_AXIS] = LOGICAL_Y_POSITION(bilinear_start[Y_AXIS] + ABL_BG_SPACING(Y_AXIS) * gcy);
|
|
|
|
normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]);
|
|
|
|
normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]);
|
|
|
|
destination[X_AXIS] = LINE_SEGMENT_END(X);
|
|
|
|
destination[X_AXIS] = LINE_SEGMENT_END(X);
|
|
|
@ -9412,7 +9449,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|
|
|
bilinear_line_to_destination(fr_mm_s, x_splits, y_splits);
|
|
|
|
bilinear_line_to_destination(fr_mm_s, x_splits, y_splits);
|
|
|
|
|
|
|
|
|
|
|
|
// Restore destination from stack
|
|
|
|
// Restore destination from stack
|
|
|
|
memcpy(destination, end, sizeof(end));
|
|
|
|
COPY(destination, end);
|
|
|
|
bilinear_line_to_destination(fr_mm_s, x_splits, y_splits);
|
|
|
|
bilinear_line_to_destination(fr_mm_s, x_splits, y_splits);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -9507,7 +9544,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
|
|
|
|
|
|
|
|
|
|
|
// Get the logical current position as starting point
|
|
|
|
// Get the logical current position as starting point
|
|
|
|
float logical[XYZE];
|
|
|
|
float logical[XYZE];
|
|
|
|
memcpy(logical, current_position, sizeof(logical));
|
|
|
|
COPY(logical, current_position);
|
|
|
|
|
|
|
|
|
|
|
|
#define DELTA_VAR logical
|
|
|
|
#define DELTA_VAR logical
|
|
|
|
|
|
|
|
|
|
|
@ -10480,8 +10517,12 @@ void setup() {
|
|
|
|
// This also updates variables in the planner, elsewhere
|
|
|
|
// This also updates variables in the planner, elsewhere
|
|
|
|
Config_RetrieveSettings();
|
|
|
|
Config_RetrieveSettings();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
|
|
// Initialize current position based on home_offset
|
|
|
|
// Initialize current position based on home_offset
|
|
|
|
memcpy(current_position, home_offset, sizeof(home_offset));
|
|
|
|
COPY(current_position, home_offset);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
ZERO(current_position);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Vital to init stepper/planner equivalent for current_position
|
|
|
|
// Vital to init stepper/planner equivalent for current_position
|
|
|
|
SYNC_PLAN_POSITION_KINEMATIC();
|
|
|
|
SYNC_PLAN_POSITION_KINEMATIC();
|
|
|
|