Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d096f9a
Smooth Linear Advance with extruder synchronisation
dbuezas Feb 24, 2025
d5bbf43
keep shaper private parts private
dbuezas Feb 24, 2025
2641451
tom's feedback
dbuezas Feb 25, 2025
1934d3b
fix ambiguous assignment
dbuezas Feb 25, 2025
0c82bd6
Undo unnecessary variable reordering
dbuezas Feb 26, 2025
52e439d
indentation
dbuezas Feb 26, 2025
08de18f
undo empty line removal
dbuezas Feb 26, 2025
1161ac2
rename Planner::lookahead with get_future_block
dbuezas Feb 26, 2025
f8b7da5
move vars to Stepper
dbuezas Feb 26, 2025
1ba3806
Fix off by one bug in get_future_block
dbuezas Feb 26, 2025
ba2aa17
Fix after moving vars to Stepper::
dbuezas Feb 26, 2025
9bf6325
Comment cruise_time var
dbuezas Feb 26, 2025
ac4439d
xy_to_e_step_ratio => e_step_ratio
dbuezas Feb 26, 2025
3375cf5
Smoothen total extrusion instead of only LA term (more silent extruder)
dbuezas Feb 26, 2025
da55973
Fix missing semi colon
dbuezas Feb 26, 2025
0718cc1
fix last_set_direction
dbuezas Feb 26, 2025
cf177d2
Remove accidentally default def of LIN_ADVANCE
dbuezas Feb 26, 2025
f8c0b87
Fix S_CURVE_ACCELERATION only macro
dbuezas Feb 26, 2025
18870c4
Rename isr step countdown var
dbuezas Mar 2, 2025
88245fb
Maxes extruder_advance_tau private and adds accessors
dbuezas Mar 11, 2025
1377c1d
Fixes "la_advance_steps does not exist for SMOOTH_LIN_ADV"
dbuezas Mar 11, 2025
5d10849
Renames target_pressure => target_adv_steps
dbuezas Mar 11, 2025
0da9b4d
Don't smooth planned extrusion since that's not delay compensated
dbuezas Mar 19, 2025
30b89e4
Do lookahead during unretractions
dbuezas Mar 19, 2025
8629643
correct indentation
dbuezas Mar 19, 2025
4485e36
Merge branch 'dbuezas/smooth-linear-advance' of https://github.com/db…
classicrocker883 Apr 9, 2025
7addaf2
update menu item
classicrocker883 Apr 9, 2025
5891806
remove ()
classicrocker883 Apr 9, 2025
6a92b0e
Merge branch '2025-April' of https://github.com/classicrocker883/MRis…
classicrocker883 Apr 10, 2025
659f152
Update - SMOOTH_LIN_ADV
classicrocker883 Apr 10, 2025
c58287e
Merge branch '2025-April' of https://github.com/classicrocker883/MRis…
classicrocker883 Apr 10, 2025
3e286a2
fix settings get_advance_tau
classicrocker883 Apr 10, 2025
4403ca3
update config_adv input_shaping
classicrocker883 Apr 10, 2025
0901437
Update - stepper.cpp
classicrocker883 Apr 10, 2025
31be45b
disable INPUT_SHAPING /revert
classicrocker883 Apr 10, 2025
38868de
added extra advance_TAU variables to settingsdata struct
classicrocker883 Apr 11, 2025
07df7d6
remove field_test (possible EEPROM error fix)
classicrocker883 Apr 11, 2025
e94423d
Update Gcode _report()'s
classicrocker883 Apr 11, 2025
b674c42
Update - dwin.cpp set TAU
classicrocker883 Apr 11, 2025
55ac318
Update - fix EOL
classicrocker883 Apr 12, 2025
775fb24
Update - Gcode _report()'s final
classicrocker883 Apr 12, 2025
6a0fb66
Update - LA TAU LCD
classicrocker883 Apr 13, 2025
e1a83a8
Update dwin.cpp SetPFloatOnClick
classicrocker883 Apr 14, 2025
12518e8
Update - M900
classicrocker883 Apr 15, 2025
2db1744
Merge branch '2025-April' of https://github.com/classicrocker883/MRis…
classicrocker883 Apr 22, 2025
fb417de
Merge branch '2025-June' of https://github.com/classicrocker883/MRisc…
classicrocker883 Jun 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2357,9 +2357,9 @@
#define LIN_ADVANCE
#if ENABLED(LIN_ADVANCE)
#if ENABLED(DISTINCT_E_FACTORS)
#define ADVANCE_K { 0.00 } // (mm) Compression length per 1mm/s extruder speed, per extruder
#define ADVANCE_K { 0.00 } // (mm) Compression length per 1mm/s extruder speed, per extruder
#else
#define ADVANCE_K 0.00 // (mm) Compression length applying to all extruders
#define ADVANCE_K 0.00 // (mm) Compression length applying to all extruders
#endif
//#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L.
//#define LA_DEBUG // Print debug information to serial during operation. Disable for production use.
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/gcode/feature/advance/M900.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ void GcodeSuite::M900() {
SERIAL_EOL();
#endif
#endif
#if ENABLED(SMOOTH_LIN_ADV)
SERIAL_ECHOLNPGM("Advance TAU=", Stepper::get_advance_tau());
#endif

#endif // !ADVANCE_K_EXTRA
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ void DWIN_DrawStatusMessage() {
void Draw_Print_Labels() {
DWINUI::Draw_String( 46, 173, GET_TEXT_F(MSG_INFO_PRINT_TIME));
DWINUI::Draw_String(181, 173, GET_TEXT_F(MSG_REMAINING_TIME));
TERN_(SHOW_INTERACTION_TIME, DWINUI::Draw_String(100, 215, F("Until Filament Change"));)
TERN_(SHOuW_INTERACTION_TIME, DWINUI::Draw_String(100, 215, F("Until Filament Change"));)
}

static uint8_t _percent_done = 100;
Expand Down
5 changes: 5 additions & 0 deletions Marlin/src/lcd/menu/menu_tune.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ void menu_tune() {
#endif
#endif

#if ENABLED(SMOOTH_LIN_ADV)
editable.decimal = Stepper::get_advance_tau();
EDIT_ITEM(float54, MSG_ADVANCE_TAU, &editable.decimal, 0.0f, 0.5f, []{ Stepper::set_advance_tau(editable.decimal); });
#endif

//
// Nonlinear Extrusion state
//
Expand Down
18 changes: 13 additions & 5 deletions Marlin/src/module/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t
uint32_t cruise_rate = block->nominal_rate;
#endif

// Steps for acceleration, plateau and deceleration
// Steps for acceleration, plateau, and deceleration
int32_t plateau_steps = block->step_event_count,
accelerate_steps = 0,
decelerate_steps = 0;
Expand All @@ -828,9 +828,11 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t
inverse_accel = 1.0f / accel;
const float half_inverse_accel = 0.5f * inverse_accel,
nominal_rate_sq = FLOAT_SQ(block->nominal_rate),
// Steps required for acceleration, deceleration to/from nominal rate
decelerate_steps_float = half_inverse_accel * (nominal_rate_sq - FLOAT_SQ(final_rate)),
accelerate_steps_float = half_inverse_accel * (nominal_rate_sq - FLOAT_SQ(initial_rate));
initial_rate_sq = FLOAT_SQ(initial_rate),
final_rate_sq = FLOAT_SQ(final_rate),
// Steps required for acceleration and deceleration to/from nominal rate
decelerate_steps_float = half_inverse_accel * (nominal_rate_sq - final_rate_sq),
accelerate_steps_float = half_inverse_accel * (nominal_rate_sq - initial_rate_sq);
// Aims to fully reach nominal and final rates
accelerate_steps = CEIL(accelerate_steps_float);
decelerate_steps = CEIL(decelerate_steps_float);
Expand All @@ -856,7 +858,7 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t

#if ANY(S_CURVE_ACCELERATION, SMOOTH_LIN_ADVANCE)
const float rate_factor = inverse_accel * (STEPPER_TIMER_RATE);
// Jerk controlled speed requires to express speed versus time, NOT steps
// Jerk-controlled speed requires expressing speed versus time, NOT steps
uint32_t acceleration_time = rate_factor * float(cruise_rate - initial_rate),
deceleration_time = rate_factor * float(cruise_rate - final_rate);
#endif
Expand Down Expand Up @@ -893,6 +895,12 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t
}
#endif

#if ENABLED(LA_DEBUG)
SERIAL_ECHOLNPAIR("Accelerate Steps: ", accelerate_steps);
SERIAL_ECHOLNPAIR("Decelerate Steps: ", decelerate_steps);
SERIAL_ECHOLNPAIR("Plateau Steps: ", plateau_steps);
#endif

#if ENABLED(LASER_POWER_TRAP)
/**
* Laser Trapezoid Calculations
Expand Down
12 changes: 10 additions & 2 deletions Marlin/src/module/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2463,7 +2463,7 @@ void MarlinSettings::postprocess() {
#endif
EEPROM_READ(lpq_len);
}
// #endif
// #endif

//
// PIDTEMPBED
Expand Down Expand Up @@ -2582,7 +2582,7 @@ void MarlinSettings::postprocess() {
//
// Firmware Retraction
//
// #if ENABLED(FWRETRACT)
// #if ENABLED(FWRETRACT)
{
_FIELD_TEST(fwretract_settings);
fwretract_settings_t fwretract_settings;
Expand Down Expand Up @@ -2800,6 +2800,14 @@ void MarlinSettings::postprocess() {
if (!validating)
DISTINCT_E_LOOP() stepper.set_advance_tau(tau[e], e);
#endif

#if ENABLED(SMOOTH_LIN_ADV)
float extruder_advance_TAU;
EEPROM_READ(extruder_advance_TAU);
if (!validating) {
Stepper::set_advance_tau(extruder_advance_TAU);
}
#endif
}
#endif

Expand Down
Loading