🐛 Fix and improve Polargraph (#24847)

Co-Authored-By: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Dan Royer
2022-10-15 22:03:42 -07:00
committed by Scott Lahteine
parent b3e7d1e91e
commit 031ff2d024
13 changed files with 109 additions and 41 deletions

View File

@ -257,7 +257,7 @@ typedef struct SettingsDataStruct {
// HAS_BED_PROBE
//
xyz_pos_t probe_offset;
xyz_pos_t probe_offset; // M851 X Y Z
//
// ABL_PLANAR
@ -319,7 +319,7 @@ typedef struct SettingsDataStruct {
#endif
//
// Kinematic Settings
// Kinematic Settings (Delta, SCARA, TPARA, Polargraph...)
//
#if IS_KINEMATIC
float segments_per_second; // M665 S
@ -330,7 +330,11 @@ typedef struct SettingsDataStruct {
delta_diagonal_rod; // M665 L
abc_float_t delta_tower_angle_trim, // M665 X Y Z
delta_diagonal_rod_trim; // M665 A B C
#elif ENABLED(POLARGRAPH)
xy_pos_t draw_area_min, draw_area_max; // M665 L R T B
float polargraph_max_belt_len; // M665 H
#endif
#endif
//
@ -468,7 +472,7 @@ typedef struct SettingsDataStruct {
//
// SKEW_CORRECTION
//
skew_factor_t planner_skew_factor; // M852 I J K planner.skew_factor
skew_factor_t planner_skew_factor; // M852 I J K
//
// ADVANCED_PAUSE_FEATURE
@ -988,7 +992,7 @@ void MarlinSettings::postprocess() {
}
//
// Kinematic Settings
// Kinematic Settings (Delta, SCARA, TPARA, Polargraph...)
//
#if IS_KINEMATIC
{
@ -1001,6 +1005,11 @@ void MarlinSettings::postprocess() {
EEPROM_WRITE(delta_diagonal_rod); // 1 float
EEPROM_WRITE(delta_tower_angle_trim); // 3 floats
EEPROM_WRITE(delta_diagonal_rod_trim); // 3 floats
#elif ENABLED(POLARGRAPH)
_FIELD_TEST(draw_area_min);
EEPROM_WRITE(draw_area_min); // 2 floats
EEPROM_WRITE(draw_area_max); // 2 floats
EEPROM_WRITE(polargraph_max_belt_len); // 1 float
#endif
}
#endif
@ -1923,7 +1932,7 @@ void MarlinSettings::postprocess() {
}
//
// Kinematic Segments-per-second
// Kinematic Settings (Delta, SCARA, TPARA, Polargraph...)
//
#if IS_KINEMATIC
{
@ -1936,6 +1945,11 @@ void MarlinSettings::postprocess() {
EEPROM_READ(delta_diagonal_rod); // 1 float
EEPROM_READ(delta_tower_angle_trim); // 3 floats
EEPROM_READ(delta_diagonal_rod_trim); // 3 floats
#elif ENABLED(POLARGRAPH)
_FIELD_TEST(draw_area_min);
EEPROM_READ(draw_area_min); // 2 floats
EEPROM_READ(draw_area_max); // 2 floats
EEPROM_READ(polargraph_max_belt_len); // 1 float
#endif
}
#endif
@ -2979,7 +2993,7 @@ void MarlinSettings::reset() {
#endif
//
// Kinematic settings
// Kinematic Settings (Delta, SCARA, TPARA, Polargraph...)
//
#if IS_KINEMATIC
@ -2996,6 +3010,10 @@ void MarlinSettings::reset() {
delta_diagonal_rod = DELTA_DIAGONAL_ROD;
delta_tower_angle_trim = dta;
delta_diagonal_rod_trim = ddr;
#elif ENABLED(POLARGRAPH)
draw_area_min.set(X_MIN_POS, Y_MIN_POS);
draw_area_max.set(X_MAX_POS, Y_MAX_POS);
polargraph_max_belt_len = POLARGRAPH_MAX_BELT_LEN;
#endif
#endif
@ -3492,9 +3510,7 @@ void MarlinSettings::reset() {
//
// LCD Preheat Settings
//
#if HAS_PREHEAT
gcode.M145_report(forReplay);
#endif
TERN_(HAS_PREHEAT, gcode.M145_report(forReplay));
//
// PID