Skip to content

Commit 4ff87ce

Browse files
⛙ Merge w/Marlin
2 parents 4746bf0 + e99d801 commit 4ff87ce

File tree

223 files changed

+2189
-2089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+2189
-2089
lines changed

Marlin/Configuration.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -726,13 +726,13 @@
726726
#if ENABLED(PID_PARAMS_PER_HOTEND)
727727
// Specify up to one value per hotend here, according to your setup.
728728
// If there are fewer values, the last one applies to the remaining hotends.
729-
#define DEFAULT_Kp_LIST { 22.20, 22.20 }
730-
#define DEFAULT_Ki_LIST { 1.08, 1.08 }
731-
#define DEFAULT_Kd_LIST { 114.00, 114.00 }
729+
#define DEFAULT_KP_LIST { 22.20, 22.20 }
730+
#define DEFAULT_KI_LIST { 1.08, 1.08 }
731+
#define DEFAULT_KD_LIST { 114.00, 114.00 }
732732
#else
733-
#define DEFAULT_Kp 13.19
734-
#define DEFAULT_Ki 0.77
735-
#define DEFAULT_Kd 56.05
733+
#define DEFAULT_KP 13.19
734+
#define DEFAULT_KI 0.77
735+
#define DEFAULT_KD 56.05
736736
#endif
737737
#else
738738
#define BANG_MAX 255 // Limit hotend current while in bang-bang mode; 255=full current
@@ -830,9 +830,9 @@
830830

831831
// 120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
832832
// from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
833-
#define DEFAULT_bedKp 128.06
834-
#define DEFAULT_bedKi 24.95
835-
#define DEFAULT_bedKd 438.07
833+
#define DEFAULT_BED_KP 128.06
834+
#define DEFAULT_BED_KI 24.95
835+
#define DEFAULT_BED_KD 438.07
836836

837837
// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
838838
#else
@@ -913,9 +913,9 @@
913913

914914
// Lasko "MyHeat Personal Heater" (200w) modified with a Fotek SSR-10DA to control only the heating element
915915
// and placed inside the small Creality printer enclosure tent.
916-
#define DEFAULT_chamberKp 37.04
917-
#define DEFAULT_chamberKi 1.40
918-
#define DEFAULT_chamberKd 655.17
916+
#define DEFAULT_CHAMBER_KP 37.04
917+
#define DEFAULT_CHAMBER_KI 1.40
918+
#define DEFAULT_CHAMBER_KD 655.17
919919
// M309 P37.04 I1.04 D655.17
920920

921921
// FIND YOUR OWN: "M303 E-2 C8 S50" to run autotune on the chamber at 50 degreesC for 8 cycles.

Marlin/Configuration_adv.h

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -421,14 +421,19 @@
421421
// A well-chosen Kc value should add just enough power to melt the increased material volume.
422422
//#define PID_EXTRUSION_SCALING
423423
#if ENABLED(PID_EXTRUSION_SCALING)
424-
#define DEFAULT_Kc (100) // heating power = Kc * e_speed
425424
#define LPQ_MAX_LEN 50
425+
#define DEFAULT_KC 100 // heating power = Kc * e_speed
426+
#if ENABLED(PID_PARAMS_PER_HOTEND)
427+
// Specify up to one value per hotend here, according to your setup.
428+
// If there are fewer values, the last one applies to the remaining hotends.
429+
#define DEFAULT_KC_LIST { DEFAULT_KC, DEFAULT_KC } // heating power = Kc * e_speed
430+
#endif
426431
#endif
427432

428433
/**
429434
* Add an additional term to the heater power, proportional to the fan speed.
430435
* A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan.
431-
* You can either just add a constant compensation with the DEFAULT_Kf value
436+
* You can either just add a constant compensation with the DEFAULT_KF value
432437
* or follow the instruction below to get speed-dependent compensation.
433438
*
434439
* Constant compensation (use only with fan speeds of 0% and 100%)
@@ -459,21 +464,26 @@
459464
#if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION)
460465
// The alternative definition is used for an easier configuration.
461466
// Just figure out Kf at full speed (255) and PID_FAN_SCALING_MIN_SPEED.
462-
// DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly.
467+
// DEFAULT_KF and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly.
463468

464-
#define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf
465-
#define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf
469+
#define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_KF
470+
#define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_KF
466471
#define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING
467472

468-
#define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED)
469-
#define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0
473+
#define DEFAULT_KF (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED)
474+
#define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_KF)/255.0
470475

471476
#else
472477
#define PID_FAN_SCALING_LIN_FACTOR (0) // Power-loss due to cooling = Kf * (fan_speed)
473-
#define DEFAULT_Kf 10 // A constant value added to the PID-tuner
478+
#define DEFAULT_KF 10 // A constant value added to the PID-tuner
474479
#define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING
475480
#endif
476481
#endif
482+
#if ENABLED(PID_PARAMS_PER_HOTEND)
483+
// Specify up to one value per hotend here, according to your setup.
484+
// If there are fewer values, the last one applies to the remaining hotends.
485+
#define DEFAULT_KF_LIST { DEFAULT_KF, DEFAULT_KF }
486+
#endif
477487
#endif
478488

479489
/**
@@ -492,15 +502,15 @@
492502
#define AUTOTEMP
493503
#if ENABLED(AUTOTEMP)
494504
#define AUTOTEMP_OLDWEIGHT 0.98 // Factor used to weight previous readings (0.0 < value < 1.0)
495-
#define AUTOTEMP_MIN 210
496-
#define AUTOTEMP_MAX 250
505+
#define AUTOTEMP_MIN 210
506+
#define AUTOTEMP_MAX 250
497507
#define AUTOTEMP_FACTOR 0.1f
498508
// Turn on AUTOTEMP on M104/M109 by default using proportions set here
499509
//#define AUTOTEMP_PROPORTIONAL
500510
#if ENABLED(AUTOTEMP_PROPORTIONAL)
501-
#define AUTOTEMP_MIN_P 0 // (°C) Added to the target temperature
502-
#define AUTOTEMP_MAX_P 5 // (°C) Added to the target temperature
503-
#define AUTOTEMP_FACTOR_P 1 // Apply this F parameter by default (overridden by M104/M109 F)
511+
#define AUTOTEMP_MIN_P 0 // (°C) Added to the target temperature
512+
#define AUTOTEMP_MAX_P 5 // (°C) Added to the target temperature
513+
#define AUTOTEMP_FACTOR_P 1 // Apply this F parameter by default (overridden by M104/M109 F)
504514
#endif
505515
#endif
506516

@@ -1197,14 +1207,17 @@
11971207
// smoothing acceleration peaks, which may also smooth curved surfaces.
11981208
#endif
11991209

1200-
#define FTM_TRAJECTORY_TYPE TRAPEZOIDAL // Block acceleration profile (TRAPEZOIDAL, POLY5, POLY6)
1201-
// TRAPEZOIDAL: Continuous Velocity. Max acceleration is respected.
1202-
// POLY5: Like POLY6 with 1.5x but uses less CPU.
1203-
// POLY6: Continuous Acceleration (aka S_CURVE).
1204-
// POLY trajectories not only reduce resonances without rounding corners, but also
1205-
// reduce extruder strain due to linear advance.
1210+
#define FTM_POLYS // Disable POLY5/6 to save ~3k of Flash. Preserves TRAPEZOIDAL.
1211+
#if ENABLED(FTM_POLYS)
1212+
#define FTM_TRAJECTORY_TYPE TRAPEZOIDAL // Block acceleration profile (TRAPEZOIDAL, POLY5, POLY6)
1213+
// TRAPEZOIDAL: Continuous Velocity. Max acceleration is respected.
1214+
// POLY5: Like POLY6 with 1.5x but uses less CPU.
1215+
// POLY6: Continuous Acceleration (aka S_CURVE).
1216+
// POLY trajectories not only reduce resonances without rounding corners, but also
1217+
// reduce extruder strain due to linear advance.
12061218

1207-
#define FTM_POLY6_ACCELERATION_OVERSHOOT 1.875f // Max acceleration overshoot factor for POLY6 (1.25 to 1.875)
1219+
#define FTM_POLY6_ACCELERATION_OVERSHOOT 1.875f // Max acceleration overshoot factor for POLY6 (1.25 to 1.875)
1220+
#endif
12081221

12091222
/**
12101223
* Advanced configuration

Marlin/Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* here we define this default string as the date where the latest release
4242
* version was tagged.
4343
*/
44-
//#define STRING_DISTRIBUTION_DATE "2025-11-29"
44+
//#define STRING_DISTRIBUTION_DATE "2025-12-01"
4545

4646
#define STRING_DISTRIBUTION_DATE __DATE__
4747
#define STRING_DISTRIBUTION_TIME __TIME__

Marlin/src/HAL/GD32_MFL/timers.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
// Defines
3030
// ------------------------
3131

32-
// Timer configuration constants
33-
#define STEPPER_TIMER_RATE 2000000
34-
#define TEMP_TIMER_FREQUENCY 1000
35-
3632
// Timer instance definitions
3733
#define MF_TIMER_STEP 3
3834
#define MF_TIMER_TEMP 1
@@ -43,12 +39,17 @@
4339

4440
extern uint32_t GetStepperTimerClkFreq();
4541

42+
// Timer configuration constants
43+
#define STEPPER_TIMER_RATE 2000000
44+
#define TEMP_TIMER_FREQUENCY 1000
45+
4646
// Timer prescaler calculations
47-
#define STEPPER_TIMER_PRESCALE (GetStepperTimerClkFreq() / STEPPER_TIMER_RATE) // Prescaler = 30
48-
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
49-
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // Stepper timer ticks per µs
50-
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE
47+
#define STEPPER_TIMER_PRESCALE (GetStepperTimerClkFreq() / STEPPER_TIMER_RATE) // Prescaler = 30
48+
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000UL) // (MHz) Stepper Timer ticks per µs
49+
50+
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // (Hz) Frequency of Pulse Timer
5151
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
52+
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
5253

5354
// Timer interrupt priorities
5455
#define STEP_TIMER_IRQ_PRIORITY 2

Marlin/src/HAL/HC32/MarlinHAL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class MarlinHAL {
6767

6868
static void delay_ms(const int ms);
6969

70-
// Tasks, called from idle()
70+
// Tasks, called from marlin.idle()
7171
static void idletask();
7272

7373
// Reset

Marlin/src/HAL/HC32/timers.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ extern Timer0 step_timer;
6565
#define STEP_TIMER_PRIORITY DDL_IRQ_PRIORITY_00 // Top priority, nothing else uses it
6666
#define STEPPER_TIMER_PRESCALE 16UL // 12.5MHz
6767

68-
#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // 50MHz / 16 = 3.125MHz
69-
#define STEPPER_TIMER_TICKS_PER_US (STEPPER_TIMER_RATE / 1000000UL) // Integer 3
68+
#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // 50MHz / 16 = 3.125MHz
69+
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000UL) // Integer 3
7070

7171
// Pulse timer (== stepper timer)
7272
#define MF_TIMER_PULSE MF_TIMER_STEP
@@ -110,11 +110,11 @@ inline void HAL_timer_isr_epilogue(const timer_channel_t) {}
110110
//
111111
// HAL function aliases
112112
//
113-
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_STEP)
114-
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_STEP)
115-
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(MF_TIMER_STEP)
113+
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_STEP)
114+
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_STEP)
115+
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(MF_TIMER_STEP)
116116

117-
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_TEMP)
117+
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_TEMP)
118118
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_TEMP);
119119

120120
//

Marlin/src/HAL/NATIVE_SIM/HAL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class MarlinHAL {
197197

198198
static void delay_ms(const int ms) { delay(ms); }
199199

200-
// Tasks, called from idle()
200+
// Tasks, called from marlin.idle()
201201
static void idletask();
202202

203203
// Reset

Marlin/src/HAL/NATIVE_SIM/timers.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,22 @@ typedef uint64_t hal_timer_t;
5454
#endif
5555
#define SYSTICK_TIMER_FREQUENCY 1000
5656

57-
#define TEMP_TIMER_RATE 1'000'000
58-
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
57+
#define TEMP_TIMER_RATE 1'000'000 // (Hz) Temperature Timer count rate
58+
#define TEMP_TIMER_FREQUENCY 1000 // (Hz) Temperature ISR call frequency
5959

60-
#define STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE)
61-
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1'000'000) // stepper timer ticks per µs
60+
#define STEPPER_TIMER_RATE HAL_TIMER_RATE // (Hz) Frequency of Stepper Timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE)
61+
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1'000'000) // (MHz) Stepper Timer ticks per µs
6262
#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / STEPPER_TIMER_TICKS_PER_US)
6363

64-
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer
65-
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
66-
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
64+
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // (Hz) Frequency of Pulse Timer
65+
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
66+
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
6767

68-
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_STEP)
69-
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_STEP)
70-
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(MF_TIMER_STEP)
68+
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_STEP)
69+
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_STEP)
70+
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(MF_TIMER_STEP)
7171

72-
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_TEMP)
72+
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_TEMP)
7373
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_TEMP)
7474

7575
#ifndef HAL_STEP_TIMER_ISR

Marlin/src/HAL/RP2040/HAL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class MarlinHAL {
144144

145145
static void delay_ms(const int ms) { delay(ms); }
146146

147-
// Tasks, called from idle()
147+
// Tasks, called from marlin.idle()
148148
static void idletask() { TERN_(HAS_SD_HOST_DRIVE, tuh_task()); }
149149

150150
// Reset

Marlin/src/HAL/RP2040/timers.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,21 @@ typedef uint64_t hal_timer_t;
5858
#endif
5959

6060
#define TEMP_TIMER_RATE HAL_TIMER_RATE
61-
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
61+
#define TEMP_TIMER_FREQUENCY 1000 // (Hz) Temperature ISR frequency
6262

6363
#define STEPPER_TIMER_RATE HAL_TIMER_RATE / 10 // 100khz roughly
6464
#define STEPPER_TIMER_TICKS_PER_US (0.1) // fixed value as we use a microsecond timesource
6565
#define STEPPER_TIMER_PRESCALE (10)
6666

67-
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer
68-
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
69-
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
67+
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // (Hz) Frequency of Pulse Timer
68+
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
69+
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
7070

71-
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_STEP)
72-
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_STEP)
73-
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(MF_TIMER_STEP)
71+
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_STEP)
72+
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_STEP)
73+
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(MF_TIMER_STEP)
7474

75-
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_TEMP)
75+
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_TEMP)
7676
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_TEMP)
7777

7878
#ifndef HAL_STEP_TIMER_ISR

0 commit comments

Comments
 (0)