|
|
@ -564,12 +564,15 @@ static uint8_t target_extruder; |
|
|
|
|
|
|
|
// these are the default values, can be overriden with M665
|
|
|
|
float delta_radius = DELTA_RADIUS, |
|
|
|
delta_tower1_x = -SIN_60 * (delta_radius + DELTA_RADIUS_TRIM_TOWER_1), // front left tower
|
|
|
|
delta_tower1_y = -COS_60 * (delta_radius + DELTA_RADIUS_TRIM_TOWER_1), |
|
|
|
delta_tower2_x = SIN_60 * (delta_radius + DELTA_RADIUS_TRIM_TOWER_2), // front right tower
|
|
|
|
delta_tower2_y = -COS_60 * (delta_radius + DELTA_RADIUS_TRIM_TOWER_2), |
|
|
|
delta_tower3_x = 0, // back middle tower
|
|
|
|
delta_tower3_y = (delta_radius + DELTA_RADIUS_TRIM_TOWER_3), |
|
|
|
delta_tower_angle_trim_1 = DELTA_TOWER_ANGLE_TRIM_1, |
|
|
|
delta_tower_angle_trim_2 = DELTA_TOWER_ANGLE_TRIM_2, |
|
|
|
delta_tower_angle_trim_3 = DELTA_TOWER_ANGLE_TRIM_3, |
|
|
|
delta_tower1_x = -sin( (60 - delta_tower_angle_trim_1) * PI/180) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_1), // front left tower
|
|
|
|
delta_tower1_y = -cos( (60 - delta_tower_angle_trim_1) * PI/180) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_1), |
|
|
|
delta_tower2_x = sin( (60 + delta_tower_angle_trim_2) * PI/180) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_2), // front right tower
|
|
|
|
delta_tower2_y = -cos( (60 + delta_tower_angle_trim_2) * PI/180) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_2), |
|
|
|
delta_tower3_x = -sin( ( delta_tower_angle_trim_3) * PI/180), // back middle tower
|
|
|
|
delta_tower3_y = cos( ( delta_tower_angle_trim_3) * PI/180) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_3), |
|
|
|
delta_diagonal_rod = DELTA_DIAGONAL_ROD, |
|
|
|
delta_diagonal_rod_trim_tower_1 = DELTA_DIAGONAL_ROD_TRIM_TOWER_1, |
|
|
|
delta_diagonal_rod_trim_tower_2 = DELTA_DIAGONAL_ROD_TRIM_TOWER_2, |
|
|
@ -6337,6 +6340,9 @@ inline void gcode_M205() { |
|
|
|
if (code_seen('A')) delta_diagonal_rod_trim_tower_1 = code_value_linear_units(); |
|
|
|
if (code_seen('B')) delta_diagonal_rod_trim_tower_2 = code_value_linear_units(); |
|
|
|
if (code_seen('C')) delta_diagonal_rod_trim_tower_3 = code_value_linear_units(); |
|
|
|
if (code_seen('I')) delta_tower_angle_trim_1 = code_value_linear_units(); |
|
|
|
if (code_seen('J')) delta_tower_angle_trim_2 = code_value_linear_units(); |
|
|
|
if (code_seen('K')) delta_tower_angle_trim_3 = code_value_linear_units(); |
|
|
|
recalc_delta_settings(delta_radius, delta_diagonal_rod); |
|
|
|
} |
|
|
|
/**
|
|
|
@ -9140,12 +9146,12 @@ void ok_to_send() { |
|
|
|
* settings have been changed (e.g., by M665). |
|
|
|
*/ |
|
|
|
void recalc_delta_settings(float radius, float diagonal_rod) { |
|
|
|
delta_tower1_x = -SIN_60 * (radius + DELTA_RADIUS_TRIM_TOWER_1); // front left tower
|
|
|
|
delta_tower1_y = -COS_60 * (radius + DELTA_RADIUS_TRIM_TOWER_1); |
|
|
|
delta_tower2_x = SIN_60 * (radius + DELTA_RADIUS_TRIM_TOWER_2); // front right tower
|
|
|
|
delta_tower2_y = -COS_60 * (radius + DELTA_RADIUS_TRIM_TOWER_2); |
|
|
|
delta_tower3_x = 0.0; // back middle tower
|
|
|
|
delta_tower3_y = (radius + DELTA_RADIUS_TRIM_TOWER_3); |
|
|
|
delta_tower1_x = -sin( (60 - delta_tower_angle_trim_1) * PI/180) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_1), // front left tower
|
|
|
|
delta_tower1_y = -cos( (60 - delta_tower_angle_trim_1) * PI/180) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_1), |
|
|
|
delta_tower2_x = sin( (60 + delta_tower_angle_trim_2) * PI/180) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_2), // front right tower
|
|
|
|
delta_tower2_y = -cos( (60 + delta_tower_angle_trim_2) * PI/180) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_2), |
|
|
|
delta_tower3_x = -sin( ( delta_tower_angle_trim_3) * PI/180), // back middle tower
|
|
|
|
delta_tower3_y = cos( ( delta_tower_angle_trim_3) * PI/180) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_3), |
|
|
|
delta_diagonal_rod_2_tower_1 = sq(diagonal_rod + delta_diagonal_rod_trim_tower_1); |
|
|
|
delta_diagonal_rod_2_tower_2 = sq(diagonal_rod + delta_diagonal_rod_trim_tower_2); |
|
|
|
delta_diagonal_rod_2_tower_3 = sq(diagonal_rod + delta_diagonal_rod_trim_tower_3); |
|
|
|