|
@ -64,7 +64,7 @@ |
|
|
#if HAS_LEVELING |
|
|
#if HAS_LEVELING |
|
|
#include "../feature/bedlevel/bedlevel.h" |
|
|
#include "../feature/bedlevel/bedlevel.h" |
|
|
#if ENABLED(X_AXIS_TWIST_COMPENSATION) |
|
|
#if ENABLED(X_AXIS_TWIST_COMPENSATION) |
|
|
#include "../feature/bedlevel/abl/x_twist.h" |
|
|
#include "../feature/x_twist.h" |
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
@ -269,13 +269,17 @@ typedef struct SettingsDataStruct { |
|
|
xy_pos_t bilinear_grid_spacing, bilinear_start; // G29 L F
|
|
|
xy_pos_t bilinear_grid_spacing, bilinear_start; // G29 L F
|
|
|
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) |
|
|
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) |
|
|
bed_mesh_t z_values; // G29
|
|
|
bed_mesh_t z_values; // G29
|
|
|
#if ENABLED(X_AXIS_TWIST_COMPENSATION) |
|
|
|
|
|
XATC xatc; // TBD
|
|
|
|
|
|
#endif |
|
|
|
|
|
#else |
|
|
#else |
|
|
float z_values[3][3]; |
|
|
float z_values[3][3]; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
// X_AXIS_TWIST_COMPENSATION
|
|
|
|
|
|
//
|
|
|
|
|
|
#if ENABLED(X_AXIS_TWIST_COMPENSATION) |
|
|
|
|
|
XATC xatc; // TBD
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
//
|
|
|
//
|
|
|
// AUTO_BED_LEVELING_UBL
|
|
|
// AUTO_BED_LEVELING_UBL
|
|
|
//
|
|
|
//
|
|
@ -873,9 +877,6 @@ void MarlinSettings::postprocess() { |
|
|
sizeof(z_values) == (GRID_MAX_POINTS) * sizeof(z_values[0][0]), |
|
|
sizeof(z_values) == (GRID_MAX_POINTS) * sizeof(z_values[0][0]), |
|
|
"Bilinear Z array is the wrong size." |
|
|
"Bilinear Z array is the wrong size." |
|
|
); |
|
|
); |
|
|
#if ENABLED(X_AXIS_TWIST_COMPENSATION) |
|
|
|
|
|
static_assert(COUNT(xatc.z_offset) == XATC_MAX_POINTS, "XATC Z-offset mesh is the wrong size."); |
|
|
|
|
|
#endif |
|
|
|
|
|
#else |
|
|
#else |
|
|
const xy_pos_t bilinear_start{0}, bilinear_grid_spacing{0}; |
|
|
const xy_pos_t bilinear_start{0}, bilinear_grid_spacing{0}; |
|
|
#endif |
|
|
#endif |
|
@ -889,15 +890,20 @@ void MarlinSettings::postprocess() { |
|
|
|
|
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) |
|
|
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) |
|
|
EEPROM_WRITE(z_values); // 9-256 floats
|
|
|
EEPROM_WRITE(z_values); // 9-256 floats
|
|
|
#if ENABLED(X_AXIS_TWIST_COMPENSATION) |
|
|
|
|
|
EEPROM_WRITE(xatc); |
|
|
|
|
|
#endif |
|
|
|
|
|
#else |
|
|
#else |
|
|
dummyf = 0; |
|
|
dummyf = 0; |
|
|
for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_WRITE(dummyf); |
|
|
for (uint16_t q = grid_max_x * grid_max_y; q--;) EEPROM_WRITE(dummyf); |
|
|
#endif |
|
|
#endif |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
// X Axis Twist Compensation
|
|
|
|
|
|
//
|
|
|
|
|
|
#if ENABLED(X_AXIS_TWIST_COMPENSATION) |
|
|
|
|
|
_FIELD_TEST(xatc); |
|
|
|
|
|
EEPROM_WRITE(xatc); |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
//
|
|
|
//
|
|
|
// Unified Bed Leveling
|
|
|
// Unified Bed Leveling
|
|
|
//
|
|
|
//
|
|
@ -1785,9 +1791,6 @@ void MarlinSettings::postprocess() { |
|
|
EEPROM_READ(bilinear_grid_spacing); // 2 ints
|
|
|
EEPROM_READ(bilinear_grid_spacing); // 2 ints
|
|
|
EEPROM_READ(bilinear_start); // 2 ints
|
|
|
EEPROM_READ(bilinear_start); // 2 ints
|
|
|
EEPROM_READ(z_values); // 9 to 256 floats
|
|
|
EEPROM_READ(z_values); // 9 to 256 floats
|
|
|
#if ENABLED(X_AXIS_TWIST_COMPENSATION) |
|
|
|
|
|
EEPROM_READ(xatc); |
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
} |
|
|
else // EEPROM data is stale
|
|
|
else // EEPROM data is stale
|
|
|
#endif // AUTO_BED_LEVELING_BILINEAR
|
|
|
#endif // AUTO_BED_LEVELING_BILINEAR
|
|
@ -1800,6 +1803,13 @@ void MarlinSettings::postprocess() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
// X Axis Twist Compensation
|
|
|
|
|
|
//
|
|
|
|
|
|
#if ENABLED(X_AXIS_TWIST_COMPENSATION) |
|
|
|
|
|
EEPROM_READ(xatc); |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
//
|
|
|
//
|
|
|
// Unified Bed Leveling active state
|
|
|
// Unified Bed Leveling active state
|
|
|
//
|
|
|
//
|
|
@ -2849,6 +2859,14 @@ void MarlinSettings::reset() { |
|
|
TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = (DEFAULT_LEVELING_FADE_HEIGHT)); |
|
|
TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = (DEFAULT_LEVELING_FADE_HEIGHT)); |
|
|
TERN_(HAS_LEVELING, reset_bed_level()); |
|
|
TERN_(HAS_LEVELING, reset_bed_level()); |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
// X Axis Twist Compensation
|
|
|
|
|
|
//
|
|
|
|
|
|
TERN_(X_AXIS_TWIST_COMPENSATION, xatc.reset()); |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
// Nozzle-to-probe Offset
|
|
|
|
|
|
//
|
|
|
#if HAS_BED_PROBE |
|
|
#if HAS_BED_PROBE |
|
|
constexpr float dpo[] = NOZZLE_TO_PROBE_OFFSET; |
|
|
constexpr float dpo[] = NOZZLE_TO_PROBE_OFFSET; |
|
|
static_assert(COUNT(dpo) == LINEAR_AXES, "NOZZLE_TO_PROBE_OFFSET must contain offsets for each linear axis X, Y, Z...."); |
|
|
static_assert(COUNT(dpo) == LINEAR_AXES, "NOZZLE_TO_PROBE_OFFSET must contain offsets for each linear axis X, Y, Z...."); |
|
@ -3313,14 +3331,14 @@ void MarlinSettings::reset() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// TODO: Create G-code for settings
|
|
|
// TODO: Create G-code for settings
|
|
|
//#if ENABLED(X_AXIS_TWIST_COMPENSATION)
|
|
|
//#if ENABLED(X_AXIS_TWIST_COMPENSATION)
|
|
|
// CONFIG_ECHO_START();
|
|
|
// CONFIG_ECHO_START();
|
|
|
// xatc.print_points();
|
|
|
// xatc.print_points();
|
|
|
//#endif
|
|
|
//#endif
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#endif // HAS_LEVELING
|
|
|
#endif // HAS_LEVELING
|
|
|
|
|
|
|
|
|
//
|
|
|
//
|
|
|