Browse Source

Adjustable delta_diagonal_rod_trim (#18423)

vanilla_fb_2.0.x
Fabio Santos 4 years ago
committed by GitHub
parent
commit
29753baeee
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      Marlin/src/gcode/calibrate/M665.cpp
  2. 15
      Marlin/src/module/configuration_store.cpp
  3. 10
      Marlin/src/module/delta.cpp
  4. 1
      Marlin/src/module/delta.h

8
Marlin/src/gcode/calibrate/M665.cpp

@ -38,8 +38,11 @@
* R = delta radius
* S = segments per second
* X = Alpha (Tower 1) angle trim
* Y = Beta (Tower 2) angle trim
* Y = Beta (Tower 2) angle trim
* Z = Gamma (Tower 3) angle trim
* A = Alpha (Tower 1) digonal rod trim
* B = Beta (Tower 2) digonal rod trim
* C = Gamma (Tower 3) digonal rod trim
*/
void GcodeSuite::M665() {
if (parser.seen('H')) delta_height = parser.value_linear_units();
@ -49,6 +52,9 @@
if (parser.seen('X')) delta_tower_angle_trim.a = parser.value_float();
if (parser.seen('Y')) delta_tower_angle_trim.b = parser.value_float();
if (parser.seen('Z')) delta_tower_angle_trim.c = parser.value_float();
if (parser.seen('A')) delta_diagonal_rod_trim.a = parser.value_float();
if (parser.seen('B')) delta_diagonal_rod_trim.b = parser.value_float();
if (parser.seen('C')) delta_diagonal_rod_trim.c = parser.value_float();
recalc_delta_settings();
}

15
Marlin/src/module/configuration_store.cpp

@ -257,11 +257,12 @@ typedef struct SettingsDataStruct {
//
#if ENABLED(DELTA)
float delta_height; // M666 H
abc_float_t delta_endstop_adj; // M666 XYZ
abc_float_t delta_endstop_adj; // M666 X Y Z
float delta_radius, // M665 R
delta_diagonal_rod, // M665 L
delta_segments_per_second; // M665 S
abc_float_t delta_tower_angle_trim; // M665 XYZ
abc_float_t delta_tower_angle_trim, // M665 X Y Z
delta_diagonal_rod_trim; // M665 A B C
#elif HAS_EXTRA_ENDSTOPS
float x2_endstop_adj, // M666 X
y2_endstop_adj, // M666 Y
@ -775,6 +776,7 @@ void MarlinSettings::postprocess() {
EEPROM_WRITE(delta_diagonal_rod); // 1 float
EEPROM_WRITE(delta_segments_per_second); // 1 float
EEPROM_WRITE(delta_tower_angle_trim); // 3 floats
EEPROM_WRITE(delta_diagonal_rod_trim); // 3 floats
#elif HAS_EXTRA_ENDSTOPS
@ -1638,6 +1640,7 @@ void MarlinSettings::postprocess() {
EEPROM_READ(delta_diagonal_rod); // 1 float
EEPROM_READ(delta_segments_per_second); // 1 float
EEPROM_READ(delta_tower_angle_trim); // 3 floats
EEPROM_READ(delta_diagonal_rod_trim); // 3 floats
#elif HAS_EXTRA_ENDSTOPS
@ -2510,13 +2513,14 @@ void MarlinSettings::reset() {
//
#if ENABLED(DELTA)
const abc_float_t adj = DELTA_ENDSTOP_ADJ, dta = DELTA_TOWER_ANGLE_TRIM;
const abc_float_t adj = DELTA_ENDSTOP_ADJ, dta = DELTA_TOWER_ANGLE_TRIM, ddr = DELTA_DIAGONAL_ROD_TRIM_TOWER;
delta_height = DELTA_HEIGHT;
delta_endstop_adj = adj;
delta_radius = DELTA_RADIUS;
delta_diagonal_rod = DELTA_DIAGONAL_ROD;
delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND;
delta_tower_angle_trim = dta;
delta_diagonal_rod_trim = ddr;
#endif
#if ENABLED(X_DUAL_ENDSTOPS)
@ -3065,7 +3069,7 @@ void MarlinSettings::reset() {
, SP_Z_STR, LINEAR_UNIT(delta_endstop_adj.c)
);
CONFIG_ECHO_HEADING("Delta settings: L<diagonal_rod> R<radius> H<height> S<segments_per_s> XYZ<tower angle corrections>");
CONFIG_ECHO_HEADING("Delta settings: L<diagonal rod> R<radius> H<height> S<segments per sec> XYZ<tower angle trim> ABC<rod trim>");
CONFIG_ECHO_START();
SERIAL_ECHOLNPAIR_P(
PSTR(" M665 L"), LINEAR_UNIT(delta_diagonal_rod)
@ -3075,6 +3079,9 @@ void MarlinSettings::reset() {
, SP_X_STR, LINEAR_UNIT(delta_tower_angle_trim.a)
, SP_Y_STR, LINEAR_UNIT(delta_tower_angle_trim.b)
, SP_Z_STR, LINEAR_UNIT(delta_tower_angle_trim.c)
, PSTR(" A"), LINEAR_UNIT(delta_diagonal_rod_trim.a)
, PSTR(" B"), LINEAR_UNIT(delta_diagonal_rod_trim.b)
, PSTR(" C"), LINEAR_UNIT(delta_diagonal_rod_trim.c)
);
#elif HAS_EXTRA_ENDSTOPS

10
Marlin/src/module/delta.cpp

@ -59,6 +59,7 @@ abc_float_t delta_tower_angle_trim;
xy_float_t delta_tower[ABC];
abc_float_t delta_diagonal_rod_2_tower;
float delta_clip_start_height = Z_MAX_POS;
abc_float_t delta_diagonal_rod_trim;
float delta_safe_distance_from_top();
@ -67,17 +68,16 @@ float delta_safe_distance_from_top();
* settings have been changed (e.g., by M665).
*/
void recalc_delta_settings() {
constexpr abc_float_t trt = DELTA_RADIUS_TRIM_TOWER,
drt = DELTA_DIAGONAL_ROD_TRIM_TOWER;
constexpr abc_float_t trt = DELTA_RADIUS_TRIM_TOWER;
delta_tower[A_AXIS].set(cos(RADIANS(210 + delta_tower_angle_trim.a)) * (delta_radius + trt.a), // front left tower
sin(RADIANS(210 + delta_tower_angle_trim.a)) * (delta_radius + trt.a));
delta_tower[B_AXIS].set(cos(RADIANS(330 + delta_tower_angle_trim.b)) * (delta_radius + trt.b), // front right tower
sin(RADIANS(330 + delta_tower_angle_trim.b)) * (delta_radius + trt.b));
delta_tower[C_AXIS].set(cos(RADIANS( 90 + delta_tower_angle_trim.c)) * (delta_radius + trt.c), // back middle tower
sin(RADIANS( 90 + delta_tower_angle_trim.c)) * (delta_radius + trt.c));
delta_diagonal_rod_2_tower.set(sq(delta_diagonal_rod + drt.a),
sq(delta_diagonal_rod + drt.b),
sq(delta_diagonal_rod + drt.c));
delta_diagonal_rod_2_tower.set(sq(delta_diagonal_rod + delta_diagonal_rod_trim.a),
sq(delta_diagonal_rod + delta_diagonal_rod_trim.b),
sq(delta_diagonal_rod + delta_diagonal_rod_trim.c));
update_software_endstops(Z_AXIS);
set_all_unhomed();
}

1
Marlin/src/module/delta.h

@ -37,6 +37,7 @@ extern abc_float_t delta_tower_angle_trim;
extern xy_float_t delta_tower[ABC];
extern abc_float_t delta_diagonal_rod_2_tower;
extern float delta_clip_start_height;
extern abc_float_t delta_diagonal_rod_trim;
/**
* Recalculate factors used for delta kinematics whenever

Loading…
Cancel
Save