Prusa MINI Firmware overview
|
Go to the documentation of this file.
30 #include "../inc/MarlinConfig.h"
32 #if ENABLED(AUTO_POWER_CONTROL)
33 #include "../feature/power.h"
36 #ifndef SOFT_PWM_SCALE
37 #define SOFT_PWM_SCALE 0
41 #define HOTEND_INDEX 0
44 #define HOTEND_INDEX e
49 typedef enum : int8_t {
56 typedef struct {
float Kp, Ki, Kd; }
PID_t;
57 typedef struct {
float Kp, Ki, Kd, Kc; }
PIDC_t;
58 #if ENABLED(PID_EXTRUSION_SCALING)
61 typedef uint16_t lpq_ptr_t;
69 #define DUMMY_PID_VALUE 3000.0f
72 #define _PID_Kp(H) Temperature::temp_hotend[H].pid.Kp
73 #define _PID_Ki(H) Temperature::temp_hotend[H].pid.Ki
74 #define _PID_Kd(H) Temperature::temp_hotend[H].pid.Kd
75 #if ENABLED(PID_EXTRUSION_SCALING)
76 #define _PID_Kc(H) Temperature::temp_hotend[H].pid.Kc
81 #define _PID_Kp(H) DUMMY_PID_VALUE
82 #define _PID_Ki(H) DUMMY_PID_VALUE
83 #define _PID_Kd(H) DUMMY_PID_VALUE
87 #define PID_PARAM(F,H) _PID_##F(H)
95 PrepareTemp_0, MeasureTemp_0,
98 PrepareTemp_BED, MeasureTemp_BED,
101 PrepareTemp_CHAMBER, MeasureTemp_CHAMBER,
104 PrepareTemp_1, MeasureTemp_1,
107 PrepareTemp_2, MeasureTemp_2,
110 PrepareTemp_3, MeasureTemp_3,
113 PrepareTemp_4, MeasureTemp_4,
116 PrepareTemp_5, MeasureTemp_5,
119 PrepareJoy_X, MeasureJoy_X,
122 PrepareJoy_Y, MeasureJoy_Y,
125 PrepareJoy_Z, MeasureJoy_Z,
127 #if ENABLED(FILAMENT_WIDTH_SENSOR)
128 Prepare_FILWIDTH, Measure_FILWIDTH,
131 Prepare_ADC_KEY, Measure_ADC_KEY,
140 #define MIN_ADC_ISR_LOOPS 10
142 #define ACTUAL_ADC_SAMPLES _MAX(int(MIN_ADC_ISR_LOOPS), int(SensorsReady))
145 #define PID_K2 (1-float(PID_K1))
146 #define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / TEMP_TIMER_FREQUENCY)
149 #define scalePID_i(i) ( float(i) * PID_dT )
150 #define unscalePID_i(i) ( float(i) / PID_dT )
151 #define scalePID_d(d) ( float(d) / PID_dT )
152 #define unscalePID_d(d) ( float(d) * PID_dT )
155 #define G26_CLICK_CAN_CANCEL (HAS_LCD_MENU && ENABLED(G26_MESH_VALIDATION))
185 #if ENABLED(PIDTEMPBED)
191 #if HAS_HEATED_CHAMBER
193 #elif HAS_TEMP_CHAMBER
201 inline void update(
const millis_t &ms) {
if (!timed_out && timeout_ms &&
ELAPSED(ms, timeout_ms)) timed_out =
true; }
203 inline void reset() { timeout_ms = 0; timed_out =
false; }
220 #define THERMISTOR_ADC_RESOLUTION 1024 // 10-bit ADC .. shame to waste 12-bits of resolution on 32-bit
221 #define THERMISTOR_ABS_ZERO_C -273.15f // bbbbrrrrr cold !
222 #define THERMISTOR_RESISTANCE_NOMINAL_C 25.0f // mmmmm comfortable
224 #if HAS_USER_THERMISTORS
226 enum CustomThermistorIndex :
uint8_t {
227 #if ENABLED(HEATER_0_USER_THERMISTOR)
230 #if ENABLED(HEATER_1_USER_THERMISTOR)
233 #if ENABLED(HEATER_2_USER_THERMISTOR)
236 #if ENABLED(HEATER_3_USER_THERMISTOR)
239 #if ENABLED(HEATER_4_USER_THERMISTOR)
242 #if ENABLED(HEATER_5_USER_THERMISTOR)
245 #if ENABLED(HEATER_BED_USER_THERMISTOR)
248 #if ENABLED(HEATER_CHAMBER_USER_THERMISTOR)
260 res_25, res_25_recip,
274 #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
275 #define HOTEND_TEMPS (HOTENDS + 1)
277 #define HOTEND_TEMPS HOTENDS
283 static bed_info_t temp_bed;
287 static chamber_info_t temp_chamber;
290 #if ENABLED(AUTO_POWER_E_FANS)
294 #if ENABLED(AUTO_POWER_CHAMBER_FAN)
295 static uint8_t chamberfan_speed;
298 #if ENABLED(FAN_SOFT_PWM)
303 #if ENABLED(PREVENT_COLD_EXTRUSION)
304 static bool allow_cold_extrude;
321 #if HEATER_IDLE_HANDLER
326 #if HAS_HEATED_CHAMBER
337 static volatile bool temp_meas_ready;
343 #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
344 static uint16_t redundant_temperature_raw;
345 static float redundant_temperature;
348 #if ENABLED(PID_EXTRUSION_SCALING)
349 static int32_t last_e_position, lpq[LPQ_MAX_LEN];
350 static lpq_ptr_t lpq_ptr;
361 #if DISABLED(PIDTEMPBED)
365 static int16_t mintemp_raw_BED;
368 static int16_t maxtemp_raw_BED;
372 #if HAS_HEATED_CHAMBER
376 static millis_t next_chamber_check_ms;
377 #ifdef CHAMBER_MINTEMP
378 static int16_t mintemp_raw_CHAMBER;
380 #ifdef CHAMBER_MAXTEMP
381 static int16_t maxtemp_raw_CHAMBER;
385 #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
389 #ifdef MILLISECONDS_PREHEAT_TIME
394 static millis_t next_auto_fan_check_ms;
397 #if ENABLED(PROBING_HEATERS_OFF)
403 static uint32_t current_ADCKey_raw;
407 #if ENABLED(PID_EXTRUSION_SCALING)
408 static int16_t lpq_len;
421 #if HAS_USER_THERMISTORS
422 static user_thermistor_t user_thermistor[USER_THERMISTORS];
423 static void log_user_thermistor(
const uint8_t t_index,
const bool eprom=
false);
424 static void reset_user_thermistors();
425 static float user_thermistor_to_deg_c(
const uint8_t t_index,
const int raw);
426 static bool set_pull_up_res(int8_t t_index,
float value) {
428 if (!
WITHIN(value, 1, 1000000))
return false;
429 user_thermistor[t_index].series_res = value;
432 static bool set_res25(int8_t t_index,
float value) {
433 if (!
WITHIN(value, 1, 10000000))
return false;
434 user_thermistor[t_index].res_25 = value;
435 user_thermistor[t_index].pre_calc =
true;
438 static bool set_beta(int8_t t_index,
float value) {
439 if (!
WITHIN(value, 1, 1000000))
return false;
440 user_thermistor[t_index].beta = value;
441 user_thermistor[t_index].pre_calc =
true;
444 static bool set_sh_coeff(int8_t t_index,
float value) {
445 if (!
WITHIN(value, -0.01f, 0.01f))
return false;
446 user_thermistor[t_index].sh_c_coeff = value;
447 user_thermistor[t_index].pre_calc =
true;
453 static float analog_to_celsius_hotend(
const int raw,
const uint8_t e);
457 static float analog_to_celsius_bed(
const int raw);
460 static float analog_to_celsius_chamber(
const int raw);
466 #define FANS_LOOP(I) LOOP_L_N(I, FAN_COUNT)
468 static void set_fan_speed(
const uint8_t target,
const uint16_t speed);
470 #if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE)
471 static bool fans_paused;
477 #if ENABLED(ADAPTIVE_FAN_SLOWING)
482 return (fs * uint16_t(
483 #
if ENABLED(ADAPTIVE_FAN_SLOWING)
484 fan_speed_scaler[target]
492 return scaledFanSpeed(target, fan_speed[target]);
495 #if ENABLED(EXTRA_FAN_SPEED)
497 static void set_temp_fan_speed(
const uint8_t fan,
const uint16_t tmp_temp);
500 #if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE)
501 void set_fans_paused(
const bool p);
504 #endif // FAN_COUNT > 0
508 FANS_LOOP(
i) set_fan_speed(
i, 0);
526 #ifdef MILLISECONDS_PREHEAT_TIME
537 #define is_preheating(n) (false)
552 #if ENABLED(SHOW_TEMP_ADC_VALUES)
578 static void setTargetHotend(
const int16_t celsius,
const uint8_t E_NAME) {
580 #ifdef MILLISECONDS_PREHEAT_TIME
582 reset_preheat_time(ee);
583 else if (temp_hotend[ee].target == 0)
584 start_preheat_time(ee);
586 #if ENABLED(AUTO_POWER_CONTROL)
589 temp_hotend[ee].
target =
_MIN(celsius, temp_range[ee].maxtemp - 15);
602 static bool wait_for_hotend(
const uint8_t target_extruder,
const bool no_wait_for_cooling=
true
604 ,
const bool click_to_cancel=
false
617 #if ENABLED(SHOW_TEMP_ADC_VALUES)
618 FORCE_INLINE static int16_t rawBedTemp() {
return temp_bed.raw; }
620 FORCE_INLINE static float degBed() {
return temp_bed.celsius; }
621 FORCE_INLINE static int16_t degTargetBed() {
return temp_bed.target; }
622 FORCE_INLINE static bool isHeatingBed() {
return temp_bed.target > temp_bed.celsius; }
623 FORCE_INLINE static bool isCoolingBed() {
return temp_bed.target < temp_bed.celsius; }
626 static void start_watching_bed();
628 static inline void start_watching_bed() {}
631 static void setTargetBed(
const int16_t celsius) {
632 #if ENABLED(AUTO_POWER_CONTROL)
642 start_watching_bed();
645 static bool wait_for_bed(
const bool no_wait_for_cooling=
true
647 ,
const bool click_to_cancel=
false
651 #endif // HAS_HEATED_BED
654 #if ENABLED(SHOW_TEMP_ADC_VALUES)
655 FORCE_INLINE static int16_t rawChamberTemp() {
return temp_chamber.raw; }
657 FORCE_INLINE static float degChamber() {
return temp_chamber.celsius; }
658 #if HAS_HEATED_CHAMBER
659 FORCE_INLINE static int16_t degTargetChamber() {
return temp_chamber.target; }
660 FORCE_INLINE static bool isHeatingChamber() {
return temp_chamber.target > temp_chamber.celsius; }
661 FORCE_INLINE static bool isCoolingChamber() {
return temp_chamber.target < temp_chamber.celsius; }
663 static bool wait_for_chamber(
const bool no_wait_for_cooling=
true);
665 #endif // HAS_TEMP_CHAMBER
673 #if HAS_HEATED_CHAMBER
674 static void setTargetChamber(
const int16_t celsius) {
675 temp_chamber.target =
676 #ifdef CHAMBER_MAXTEMP
684 #endif // HAS_HEATED_CHAMBER
700 static void PID_autotune(
const float &target,
const heater_ind_t hotend,
const int8_t ncycles,
const bool set_result=
false);
702 #if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING)
703 static bool adaptive_fan_slowing;
704 #elif ENABLED(ADAPTIVE_FAN_SLOWING)
705 static constexpr
bool adaptive_fan_slowing =
true;
713 #if ENABLED(PID_EXTRUSION_SCALING)
721 #if ENABLED(PROBING_HEATERS_OFF)
722 static void pause(
const bool p);
726 #if HEATER_IDLE_HANDLER
736 start_watching_bed();
740 #endif // HEATER_IDLE_HANDLER
744 #
if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
745 ,
const bool include_r=
false
748 #if ENABLED(AUTO_REPORT_TEMPERATURES)
749 static uint8_t auto_report_temp_interval;
750 static millis_t next_temp_report_ms;
751 static void auto_report_temperatures();
752 static inline void set_auto_report_interval(
uint8_t v) {
754 auto_report_temp_interval = v;
755 next_temp_report_ms =
millis() + 1000UL * v;
761 static void set_heating_message(
const uint8_t e);
765 static void set_current_temp_raw();
766 static void updateTemperaturesFromRawValues();
768 #define HAS_MAX6675 EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675)
770 #if BOTH(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675)
776 #define READ_MAX6675(N) read_max6675(N)
778 #define READ_MAX6675(N) read_max6675()
780 static int read_max6675(
787 static void checkExtruderAutoFans();
789 static float get_pid_output_hotend(
const uint8_t e);
791 #if ENABLED(PIDTEMPBED)
792 static float get_pid_output_bed();
795 #if HAS_HEATED_CHAMBER
796 static float get_pid_output_chamber();
803 #define HAS_THERMAL_PROTECTION (EITHER(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_CHAMBER) || HAS_THERMALLY_PROTECTED_BED)
805 #if HAS_THERMAL_PROTECTION
807 enum TRState :
char { TRInactive, TRFirstHeating, TRStable, TRRunaway };
811 TRState
state = TRInactive;
812 } tr_state_machine_t;
814 #if ENABLED(THERMAL_PROTECTION_HOTENDS)
815 static tr_state_machine_t tr_state_machine[
HOTENDS];
817 #if HAS_THERMALLY_PROTECTED_BED
818 static tr_state_machine_t tr_state_machine_bed;
820 #if ENABLED(THERMAL_PROTECTION_CHAMBER)
821 static tr_state_machine_t tr_state_machine_chamber;
824 static void thermal_runaway_protection(tr_state_machine_t &
state,
const float ¤t,
const float &target,
const heater_ind_t heater_id,
const uint16_t period_seconds,
const uint16_t hysteresis_degc);
826 #endif // HAS_THERMAL_PROTECTION
#define ACCUMULATE_ADC(obj)
#define HEATER_0_RAW_LO_TEMP
Definition: thermistors.h:255
#define WITHIN(N, L, H)
Definition: macros.h:195
#define PENDING(NOW, SOON)
Definition: millis_t.h:28
#define MSG_INVALID_EXTRUDER_NUM
Definition: language.h:286
#define GET_TEXT(MSG)
Definition: multi_language.h:72
static void reset_heater_idle_timer(const uint8_t E_NAME)
Definition: temperature.h:728
Definition: temperature.h:217
#define THERMISTOR_ADC_RESOLUTION
Definition: temperature.h:220
static FORCE_INLINE bool tooColdToExtrude(const uint8_t)
Definition: temperature.h:314
#define MSG_T_MINTEMP
Definition: language.h:296
#define SERIAL_CHAR(x)
Definition: serial.h:69
uint8_t count
Definition: temperature.cpp:2327
Definition: temperature.h:175
#define MAX_BED_POWER
Definition: Configuration_A3ides_2209_MINI.h:481
PID_t hotend_pid_t
Definition: temperature.h:66
#define TEMP_AD8495(RAW)
Definition: temperature.cpp:1187
#define NOLESS(v, n)
Definition: macros.h:127
float celsius
Definition: temperature.h:161
void sample(const uint16_t s)
Definition: temperature.h:163
#define M_PI
Definition: Marduino.h:79
#define PORT_REDIRECT(p)
Definition: serial.h:66
#define HEATER_BED_PIN
Definition: pins_ESP32.h:83
#define MSG_T_MIN
Definition: language.h:269
#define CHAMBER_MAXTEMP
Definition: Configuration_A3ides_2209_MINI.h:397
#define _O2
Definition: macros.h:45
PrinterEventLEDs printerEventLEDs
#define TEMPDIR(N)
Definition: temperature.cpp:267
void update(const millis_t &ms)
Definition: temperature.h:201
#define FAN1_PIN
Definition: pins_AZSMZ_MINI.h:87
#define BANG_MAX
Definition: Configuration_A3ides_2209_MINI.h:406
#define HEATER_1_TEMPTABLE
Definition: thermistors.h:178
#define SERIAL_ECHO(x)
Definition: serial.h:70
#define MSG_KI
Definition: language.h:275
static FORCE_INLINE bool hotEnoughToExtrude(const uint8_t e)
Definition: temperature.h:318
#define HEATER_2_TEMPTABLE_LEN
Definition: thermistors.h:189
Definition: temperature.h:134
#define PIDTEMPBED
Definition: Configuration_A3ides_2209_MINI.h:471
static heater_idle_t chamber_idle
Definition: temperature.h:327
#define OUT_WRITE(IO, V)
Definition: fastio.h:108
#define ARRAY_BY_HOTENDS(V...)
Definition: Conditionals_post.h:539
#define MSG_PID_DEBUG_ITERM
Definition: language.h:283
static void isr()
Definition: temperature.cpp:2346
static FORCE_INLINE int16_t degTargetHotend(const uint8_t E_NAME)
Definition: temperature.h:562
#define INIT_CHAMBER_AUTO_FAN_PIN(P)
Definition: temperature.cpp:1530
Definition: temperature.h:52
#define HEATER_CHAMBER_PIN
Definition: Configuration_A3ides_2209_MINI.h:355
#define HEATER_5_RAW_HI_TEMP
Definition: thermistors.h:299
#define E0_AUTO_FAN_PIN
Definition: Configuration_A3ides_2209_MINI_adv.h:285
#define MSG_PID_DEBUG_PTERM
Definition: language.h:282
#define HEATER_1_MINTEMP
Definition: Configuration_A3ides_2209_MINI.h:379
#define TEMP_WINDOW
Definition: Configuration_A3ides_2209_MINI.h:367
#define PROGMEM
Definition: pgmspace.h:29
Definition: L6470_Marlin.h:30
Definition: L6470_Marlin.h:30
#define FAN2_PIN
Definition: pins_CHEAPTRONICv2.h:92
#define MSG_PID_DEBUG
Definition: language.h:279
#define LOW
Definition: wiring_constants.h:70
void spiInit(uint8_t spiRate)
#define PID_MAX
Definition: Configuration_A3ides_2209_MINI.h:407
#define RECIPROCAL(x)
Definition: macros.h:273
list gcode
Definition: g29_auto.py:44
void reset()
Definition: temperature.h:203
#define EXTRUDER_AUTO_FAN_SPEED
Definition: Configuration_A3ides_2209_MINI_adv.h:293
#define MIN_POWER
Definition: Conditionals_post.h:1246
#define HAL_READ_ADC()
Definition: HAL.h:360
#define MSG_T_MAXTEMP
Definition: language.h:295
#define INIT_FAN_PIN(P)
Definition: temperature.cpp:1523
Stepper stepper
Definition: stepper.cpp:82
#define _MAX(V...)
Definition: macros.h:346
float Kp
Definition: temperature.h:56
#define THERMISTOR_RESISTANCE_NOMINAL_C
Definition: temperature.h:222
#define HEATER_3_RAW_HI_TEMP
Definition: thermistors.h:281
#define SERIAL_ECHOPAIR(V...)
Definition: serial.h:114
#define HAS_HEATED_BED
Definition: Conditionals_post.h:1044
#define E1_AUTO_FAN_PIN
Definition: Configuration_A3ides_2209_MINI_adv.h:286
start
Definition: g29_auto.py:150
Definition: L6470_Marlin.h:30
#define SCAN_THERMISTOR_TABLE(TBL, LEN)
Definition: temperature.cpp:1193
#define MSG_PID_DEBUG_CTERM
Definition: language.h:285
#define MSG_BIAS
Definition: language.h:267
#define PID_K2
Definition: temperature.h:145
#define HEATER_0_MINTEMP
Definition: Configuration_A3ides_2209_MINI.h:378
#define PGM_P
Definition: pgmspace.h:30
#define HEATER_3_RAW_LO_TEMP
Definition: thermistors.h:282
#define G26_CLICK_CAN_CANCEL
Definition: temperature.h:155
#define TEMP_TIMER_NUM
Definition: HAL.h:128
uint8_t i
Definition: screen_test_graph.c:72
#define HEATER_1_RAW_HI_TEMP
Definition: thermistors.h:263
#define HEATER_4_TEMPTABLE
Definition: thermistors.h:208
#define _MIN(V...)
Definition: macros.h:333
#define MIN_ADC_ISR_LOOPS
Definition: temperature.h:140
static volatile fsensor_t state
Definition: filament_sensor.c:23
#define HEATER_2_RAW_HI_TEMP
Definition: thermistors.h:272
#define EXTRUDE_MINTEMP
Definition: Configuration_A3ides_2209_MINI.h:517
void start(const millis_t &ms)
Definition: temperature.h:202
#define HEATER_2_TEMPTABLE
Definition: thermistors.h:188
#define TEMP_BED_PIN
Definition: pins_ESP32.h:76
#define BED_MAXTEMP
Definition: Configuration_A3ides_2209_MINI.h:396
void kill(PGM_P const lcd_error, PGM_P const lcd_component, const bool steppers_off)
Definition: Marlin.cpp:718
#define HEATER_0_TEMPTABLE_LEN
Definition: thermistors.h:169
Definition: temperature.h:57
#define HEATER_4_RAW_HI_TEMP
Definition: thermistors.h:290
uint32_t millis(void)
Definition: wiring_time.c:29
#define HEATER_IDLE_HANDLER
Definition: Conditionals_post.h:1429
#define MSG_KP
Definition: language.h:274
#define HEATER_4_TEMPTABLE_LEN
Definition: thermistors.h:209
#define LIMIT(v, n1, n2)
Definition: macros.h:139
static void manage_heater() _O2
Definition: temperature.cpp:975
#define HEATER_CHAMBER_RAW_LO_TEMP
Definition: thermistors.h:318
Definition: temperature.h:93
#define SERIAL_ECHO_START()
Definition: serial.h:179
#define HEATER_PSTR(h)
Definition: temperature.cpp:107
Definition: temperature.h:158
#define TEMP_2_PIN
Definition: pins_MKS_SBASE.h:96
static bool killed_by_M112
Definition: emergency_parser.h:65
#define CHAMBER_AUTO_FAN_SPEED
Definition: Configuration_adv.h:360
void expire()
Definition: temperature.h:204
static FORCE_INLINE float degHotend(const uint8_t E_NAME)
Definition: temperature.h:544
#define CHAMBER_AUTO_FAN_TEMPERATURE
Definition: Configuration_adv.h:359
Definition: temperature.h:52
#define MSG_HEATER_CHAMBER
Definition: language.h:289
float Kp
Definition: temperature.h:57
FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t)
Definition: HAL.h:149
#define KEEPALIVE_STATE(N)
Definition: gcode.h:365
ADCSensorState
Definition: temperature.h:92
static void poll()
Definition: endstops.cpp:272
bool IsRunning()
Definition: Marlin.h:331
void loud_kill(PGM_P const lcd_msg, const heater_ind_t heater)
Definition: temperature.cpp:723
#define HEATER_3_TEMPTABLE_LEN
Definition: thermistors.h:199
#define HEATER_1_RAW_LO_TEMP
Definition: thermistors.h:264
#define HEATER_0_RAW_HI_TEMP
Definition: thermistors.h:254
int16_t raw_min
Definition: temperature.h:218
EmergencyParser emergency_parser
#define OUT_WRITE_OD(IO, V)
Definition: fastio.h:115
bool Running
Definition: Marlin.cpp:181
#define HAL_ADC_READY()
Definition: HAL.h:361
#define HEATER_2_PIN
Definition: pins_COHESION3D_REMIX.h:116
#define MSG_PID_DEBUG_OUTPUT
Definition: language.h:281
#define NOMORE(v, n)
Definition: macros.h:133
#define FAN_PIN
Definition: pins_ESP32.h:82
uint8_t soft_pwm_amount
Definition: temperature.h:170
static FORCE_INLINE void init()
Definition: private_spi.h:31
#define CHAMBER_TEMPTABLE_LEN
Definition: thermistors.h:237
#define HAL_timer_isr_prologue(TIMER_NUM)
Definition: HAL.h:196
#define SET_INPUT_PULLUP(IO)
Definition: fastio.h:100
#define MSG_PID_DEBUG_DTERM
Definition: language.h:284
Definition: temperature.h:198
#define ABS(a)
Definition: macros.h:266
float Ki
Definition: temperature.h:56
#define HEATER_4_RAW_LO_TEMP
Definition: thermistors.h:291
#define E2_AUTO_FAN_PIN
Definition: Configuration_A3ides_2209_MINI_adv.h:287
#define pgm_read_byte(addr)
Definition: pgmspace.h:95
#define HEATER_0_PIN
Definition: pins_ESP32.h:81
static int16_t getHeaterPower(const heater_ind_t heater)
Definition: temperature.cpp:607
#define HEATER_3_PIN
Definition: pins_CNCONTROLS_11.h:68
static void PID_autotune(const float &target, const heater_ind_t hotend, const int8_t ncycles, const bool set_result=false)
#define COUNT_6675
Definition: temperature.h:773
Definition: temperature.h:133
#define HEATER_5_TEMPTABLE
Definition: thermistors.h:218
#define FORCE_INLINE
Definition: macros.h:40
#define TEMP_TIMER_FREQUENCY
Definition: HAL.h:131
#define PSTR(str)
Definition: pgmspace.h:31
#define E4_AUTO_FAN_PIN
Definition: Configuration_A3ides_2209_MINI_adv.h:289
Definition: L6470_Marlin.h:30
T pid
Definition: temperature.h:176
#define SERIAL_BOTH
Definition: serial.h:49
static FORCE_INLINE bool targetTooColdToExtrude(const uint8_t)
Definition: temperature.h:315
#define FILWIDTH_PIN
Definition: pins_RAMPS_LINUX.h:211
#define HEATER_5_RAW_LO_TEMP
Definition: thermistors.h:300
static void print_heater_states(const uint8_t target_extruder)
Definition: L6470_Marlin.h:30
bool elapsed(const millis_t &ms)
Definition: temperature.h:211
#define WATCH_HOTENDS
Definition: Conditionals_post.h:1061
#define ENABLE_TEMPERATURE_INTERRUPT()
Definition: HAL.h:145
#define HEATER_1_TEMPTABLE_LEN
Definition: thermistors.h:179
static FORCE_INLINE uint8_t receive()
Definition: private_spi.h:33
Definition: temperature.h:52
#define COUNT(a)
Definition: macros.h:200
millis_t timeout_ms
Definition: temperature.h:199
Definition: temperature.h:51
FilamentWidthSensor filwidth
#define MSG_STOPPED_HEATER
Definition: language.h:291
#define HEATER_5_TEMPTABLE_LEN
Definition: thermistors.h:219
#define TEMP_CHAMBER_PIN
Definition: pins_CNCONTROLS_15.h:54
#define HAL_START_ADC(pin)
Definition: HAL.h:357
#define MSG_PID_TEMP_TOO_HIGH
Definition: language.h:265
Definition: temperature.h:168
#define DISABLED(V...)
Definition: macros.h:178
millis_t next_ms
Definition: temperature.h:210
#define HEATER_5_PIN
Definition: pins.h:757
int16_t raw
Definition: temperature.h:160
static heater_idle_t hotend_idle[HOTENDS]
Definition: temperature.h:322
#define cu(x)
Definition: macros.h:97
static void update_volumetric()
Definition: filwidth.h:108
#define HEATER_0_MAXTEMP
Definition: Configuration_A3ides_2209_MINI.h:390
#define HEATER_2_RAW_LO_TEMP
Definition: thermistors.h:273
#define READ_MAX6675(N)
Definition: temperature.h:778
#define constrain(amt, low, high)
Definition: wiring_constants.h:79
#define WRITE(IO, V)
Definition: fastio.h:96
#define E3_AUTO_FAN_PIN
Definition: Configuration_A3ides_2209_MINI_adv.h:288
static void accumulate(const uint16_t adc)
Definition: filwidth.h:63
#define MISO_PIN
Definition: spi_pins.h:58
#define SERIAL_ECHOPGM(S)
Definition: serial.h:173
static FORCE_INLINE bool targetHotEnoughToExtrude(const uint8_t e)
Definition: temperature.h:319
#define HEATER_1_PIN
Definition: pins_RAMPS_LINUX.h:196
#define TEMP_RESIDENCY_TIME
Definition: Configuration_A3ides_2209_MINI.h:366
int16_t mintemp
Definition: temperature.h:217
bool timed_out
Definition: temperature.h:200
#define WATCH_BED
Definition: Conditionals_post.h:1062
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
#define HAS_HEATED_CHAMBER
Definition: Conditionals_post.h:1025
#define HOTEND_LOOP()
Definition: Conditionals_LCD.h:436
#define L(CODE)
Definition: macros.h:76
#define HEATER_3_TEMPTABLE
Definition: thermistors.h:198
#define MSG_KD
Definition: language.h:276
Definition: temperature.h:51
void update()
Definition: temperature.h:164
#define TEMP_CHAMBER_HYSTERESIS
Definition: Configuration_A3ides_2209_MINI.h:374
#define ELAPSED(NOW, SOON)
Definition: millis_t.h:29
static void disable_all_heaters()
Definition: temperature.cpp:1926
#define HEATER_4_PIN
Definition: pins.h:754
#define MAX6675_SS2_PIN
Definition: pins_MIGHTYBOARD_REVE.h:142
const uint8_t[]
Definition: 404_html.c:3
#define TEMP_3_PIN
Definition: pins_RAMPS_RE_ARM.h:169
#define THERMISTOR_ABS_ZERO_C
Definition: temperature.h:221
#define MAX_REDUNDANT_TEMP_SENSOR_DIFF
Definition: Configuration_A3ides_2209_MINI.h:364
#define _PWM_MOD(N, S, T)
static void reading_ready()
Definition: filwidth.h:74
#define SCK_PIN
Definition: spi_pins.h:55
#define _BV(bit)
Definition: wiring_constants.h:99
void HAL_adc_init()
Definition: HAL.h:345
#define MSG_T_MAX
Definition: language.h:270
#define MSG_CLASSIC_PID
Definition: language.h:273
Definition: temperature.h:51
static float steps_to_mm[XYZE_N]
Definition: planner.h:254
void delay(uint32_t ms)
Definition: wiring_time.c:42
#define HAL_ANALOG_SELECT(pin)
Definition: HAL.h:342
#define MSG_PID_DEBUG_INPUT
Definition: language.h:280
#define MSG_REDUNDANCY
Definition: language.h:292
#define MSG_HEATER_BED
Definition: language.h:288
#define TEMP_HYSTERESIS
Definition: Configuration_A3ides_2209_MINI.h:368
#define INIT_E_AUTO_FAN_PIN(P)
Definition: temperature.cpp:1525
Definition: temperature.h:208
#define OVERSAMPLENR
Definition: thermistors.h:26
#define HAL_timer_isr_epilogue(TIMER_NUM)
Definition: HAL.h:197
#define E5_AUTO_FAN_PIN
Definition: Configuration_A3ides_2209_MINI_adv.h:290
void reset()
Definition: temperature.h:162
Definition: temperature.h:218
#define MOSI_PIN
Definition: spi_pins.h:61
static void start_watching_hotend(const uint8_t=0)
Definition: temperature.h:573
#define MSG_TU
Definition: language.h:272
static void reset_bed_idle_timer()
Definition: temperature.h:734
HAL_TEMP_TIMER_ISR()
Definition: temperature.cpp:2313
#define SERIAL_ERROR_START()
Definition: serial.h:180
#define EXTRUDERS
Definition: Configuration_A3ides_2209_MINI.h:148
#define CHAMBER_MINTEMP
Definition: Configuration_A3ides_2209_MINI.h:385
#define FAN_COUNT
Definition: Conditionals_post.h:1292
#define SERIAL_ECHOPAIR_F(S, V...)
Definition: serial.h:176
static heater_idle_t bed_idle
Definition: temperature.h:324
constexpr uint8_t ui8_to_percent(const uint8_t i)
Definition: utility.h:81
#define HEATER_1_MAXTEMP
Definition: Configuration_A3ides_2209_MINI.h:391
#define HIGH
Definition: wiring_constants.h:71
#define DISABLE_HEATER(NR)
#define ARRAY_N(N, V...)
Definition: macros.h:227
Definition: L6470_Marlin.h:30
static void start_watching_chamber()
Definition: temperature.h:670
#define MAX6675_SS_PIN
Definition: pins_RAMPS_LINUX.h:138
#define TEMP_1_PIN
Definition: pins_RAMPS_LINUX.h:131
#define MSG_D
Definition: language.h:268
#define HEATER_0_TEMPTABLE
Definition: thermistors.h:168
#define SERIAL_EOL()
Definition: serial.h:181
#define MSG_KU
Definition: language.h:271
#define CHAMBER_AUTO_FAN_PIN
Definition: Configuration_A3ides_2209_MINI_adv.h:291
Definition: temperature.h:50
int16_t raw_min
Definition: temperature.h:216
#define HEATER_BED_RAW_HI_TEMP
Definition: thermistors.h:308
#define TEMP_BED_RESIDENCY_TIME
Definition: Configuration_A3ides_2209_MINI.h:370
Definition: temperature.h:267
#define TEMP_BED_HYSTERESIS
Definition: Configuration_A3ides_2209_MINI.h:372
#define BED_MINTEMP
Definition: Configuration_A3ides_2209_MINI.h:384
uint16_t target
Definition: temperature.h:209
#define TEST(n, b)
Definition: macros.h:81
int
Definition: createSpeedLookupTable.py:15
static void update_measured_mm()
Definition: filwidth.h:77
bool elapsed()
Definition: temperature.h:212
bool add(const uint8_t mask, const uint8_t amount)
Definition: temperature.cpp:2328
#define DELAY_NS(x)
Definition: Delay.h:172
#define HOTENDS
Definition: Conditionals_LCD.h:425
Temperature thermalManager
Definition: temperature.cpp:89
#define TEMP_5_PIN
Definition: pins.h:779
struct TempInfo temp_info_t
static int32_t position(const AxisEnum axis)
Definition: stepper.cpp:2214
#define BOTH(V1, V2)
Definition: macros.h:183
#define BEEPER_PIN
Definition: pins_CHEAPTRONICv2.h:125
#define EXTRUDER_AUTO_FAN_TEMPERATURE
Definition: Configuration_A3ides_2209_MINI_adv.h:292
#define PID_PARAM(F, H)
Definition: temperature.h:87
Definition: temperature.h:52
#define TEMP_0_PIN
Definition: pins_ESP32.h:75
int16_t target
Definition: temperature.h:169
bool wait_for_heatup
Definition: Marlin.cpp:184
#define SS_PIN
Definition: spi_pins.h:64
static void readings_ready()
Definition: temperature.cpp:2182
void serialprintPGM(PGM_P str)
Definition: serial.cpp:35
#define TEMP_BED_WINDOW
Definition: Configuration_A3ides_2209_MINI.h:371
#define is_preheating(n)
Definition: temperature.h:537
#define SBI(A, B)
Definition: macros.h:85
#define S_FMT
Definition: macros.h:68
Definition: temperature.h:216
#define E_NAME
Definition: temperature.h:42
#define SERIAL_ECHOLNPGM(S)
Definition: serial.h:174
static void tick()
Definition: planner.h:750
#define MSG_PID_TIMEOUT
Definition: language.h:266
Definition: temperature.h:52
#define MSG_PID_AUTOTUNE_START
Definition: language.h:262
void idle()
Definition: Marlin.cpp:629
#define _PWM_FAN
Definition: hwio_a3ides.h:43
#define MSG_T_THERMAL_RUNAWAY
Definition: language.h:294
Definition: temperature.h:56
#define BED_TEMPTABLE_LEN
Definition: thermistors.h:228
Temperature thermalManager
Definition: temperature.cpp:89
#define UNUSED(X)
Definition: stm32f4xx_hal_def.h:74
Endstops endstops
Definition: endstops.cpp:51
void watchdog_refresh()
Definition: HAL.h:28
static volatile bool in_temp_isr
Definition: temperature.h:271
#define HEATER_BED_RAW_LO_TEMP
Definition: thermistors.h:309
uint32_t millis_t
Definition: millis_t.h:26
heater_info_t hotend_info_t
Definition: temperature.h:182
void init()
Definition: temperature.cpp:1539
float Kd
Definition: temperature.h:56
constexpr uint8_t active_extruder
Definition: motion.h:107
#define CONTROLLER_FAN_PIN
Definition: pins_MEGACONTROLLER.h:121
#define TEMP_4_PIN
Definition: pins.h:776
Definition: temperature.h:52
static void zero_fan_speeds()
Definition: temperature.h:506
Definition: temperature.cpp:2325
#define MSG_PID_AUTOTUNE_FINISHED
Definition: language.h:278
uint16_t acc
Definition: temperature.h:159
heater_ind_t
Definition: temperature.h:49
#define MSG_T_HEATING_FAILED
Definition: language.h:293
#define HEATER_CHAMBER_RAW_HI_TEMP
Definition: thermistors.h:317
#define ENABLED(V...)
Definition: macros.h:177
Planner planner
Definition: planner.cpp:111
#define HOTEND_INDEX
Definition: temperature.h:41
#define SOFT_PWM_SCALE
Definition: Configuration_A3ides_2209_MINI.h:1986
#define TEMP_AD595(RAW)
Definition: temperature.cpp:1186
Definition: private_spi.h:28