1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 13:56:24 +00:00

Add TEMP_SENSOR_BOARD (#22279)

This commit is contained in:
Katelyn Schiesser 2021-07-11 18:41:33 -07:00 committed by GitHub
parent 4b63578a10
commit 2f6c8e1176
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 372 additions and 151 deletions

View File

@ -474,7 +474,7 @@
* NOTE: ADC pins are not 5V tolerant. Not recommended because it's possible to damage the CPU by going over 500°C. * NOTE: ADC pins are not 5V tolerant. Not recommended because it's possible to damage the CPU by going over 500°C.
* 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
* *
* Custom/Dummy/Other Thermos * Custom/Dummy/Other Thermal Sensors
* ------ * ------
* 0 : not used * 0 : not used
* 1000 : Custom - Specify parameters in Configuration_adv.h * 1000 : Custom - Specify parameters in Configuration_adv.h
@ -496,6 +496,7 @@
#define TEMP_SENSOR_PROBE 0 #define TEMP_SENSOR_PROBE 0
#define TEMP_SENSOR_CHAMBER 0 #define TEMP_SENSOR_CHAMBER 0
#define TEMP_SENSOR_COOLER 0 #define TEMP_SENSOR_COOLER 0
#define TEMP_SENSOR_BOARD 0
#define TEMP_SENSOR_REDUNDANT 0 #define TEMP_SENSOR_REDUNDANT 0
// Dummy thermistor constant temperature readings, for use with 998 and 999 // Dummy thermistor constant temperature readings, for use with 998 and 999
@ -528,17 +529,11 @@
* the print will be aborted. Whichever sensor is selected will have its normal functions disabled; i.e. selecting * the print will be aborted. Whichever sensor is selected will have its normal functions disabled; i.e. selecting
* the Bed sensor (-1) will disable bed heating/monitoring. * the Bed sensor (-1) will disable bed heating/monitoring.
* *
* Use the following to select temp sensors: * For selecting source/target use: COOLER, PROBE, BOARD, CHAMBER, BED, E0, E1, E2, E3, E4, E5, E6, E7
* -5 : Cooler
* -4 : Probe
* -3 : not used
* -2 : Chamber
* -1 : Bed
* 0-7 : E0 through E7
*/ */
#if TEMP_SENSOR_REDUNDANT #if TEMP_SENSOR_REDUNDANT
#define TEMP_SENSOR_REDUNDANT_SOURCE 1 // The sensor that will provide the redundant reading. #define TEMP_SENSOR_REDUNDANT_SOURCE E1 // The sensor that will provide the redundant reading.
#define TEMP_SENSOR_REDUNDANT_TARGET 0 // The sensor that we are providing a redundant reading for. #define TEMP_SENSOR_REDUNDANT_TARGET E0 // The sensor that we are providing a redundant reading for.
#define TEMP_SENSOR_REDUNDANT_MAX_DIFF 10 // (°C) Temperature difference that will trigger a print abort. #define TEMP_SENSOR_REDUNDANT_MAX_DIFF 10 // (°C) Temperature difference that will trigger a print abort.
#endif #endif

View File

@ -125,6 +125,12 @@
#define PROBE_BETA 3950 // Beta value #define PROBE_BETA 3950 // Beta value
#endif #endif
#if TEMP_SENSOR_BOARD == 1000
#define BOARD_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define BOARD_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#define BOARD_BETA 3950 // Beta value
#endif
#if TEMP_SENSOR_REDUNDANT == 1000 #if TEMP_SENSOR_REDUNDANT == 1000
#define REDUNDANT_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor #define REDUNDANT_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define REDUNDANT_RESISTANCE_25C_OHMS 100000 // Resistance at 25C #define REDUNDANT_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
@ -224,6 +230,18 @@
#endif #endif
#endif #endif
//
// Motherboard Sensor options
//
#if TEMP_SENSOR_BOARD
#define THERMAL_PROTECTION_BOARD // Halt the printer if the board sensor leaves the temp range below.
#define BOARD_MINTEMP 8 // (°C)
#define BOARD_MAXTEMP 70 // (°C)
#ifndef TEMP_BOARD_PIN
//#define TEMP_BOARD_PIN -1 // Board temp sensor pin, if not set in pins file.
#endif
#endif
// //
// Laser Coolant Flow Meter // Laser Coolant Flow Meter
// //
@ -487,6 +505,10 @@
#define CONTROLLERFAN_SPEED_ACTIVE 255 // (0-255) Active speed, used when any motor is enabled #define CONTROLLERFAN_SPEED_ACTIVE 255 // (0-255) Active speed, used when any motor is enabled
#define CONTROLLERFAN_SPEED_IDLE 0 // (0-255) Idle speed, used when motors are disabled #define CONTROLLERFAN_SPEED_IDLE 0 // (0-255) Idle speed, used when motors are disabled
#define CONTROLLERFAN_IDLE_TIME 60 // (seconds) Extra time to keep the fan running after disabling motors #define CONTROLLERFAN_IDLE_TIME 60 // (seconds) Extra time to keep the fan running after disabling motors
// Use TEMP_SENSOR_BOARD as a trigger for enabling the controller fan
//#define CONTROLLER_FAN_MIN_BOARD_TEMP 40 // (°C) Turn on the fan if the board reaches this temperature
//#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings //#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings
#if ENABLED(CONTROLLER_FAN_EDITABLE) #if ENABLED(CONTROLLER_FAN_EDITABLE)
#define CONTROLLER_FAN_MENU // Enable the Controller Fan submenu #define CONTROLLER_FAN_MENU // Enable the Controller Fan submenu

View File

@ -1168,10 +1168,10 @@ void setup() {
SETUP_RUN(HAL_init()); SETUP_RUN(HAL_init());
// Init and disable SPI thermocouples; this is still needed // Init and disable SPI thermocouples; this is still needed
#if TEMP_SENSOR_0_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && TEMP_SENSOR_REDUNDANT_SOURCE == 0) #if TEMP_SENSOR_0_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E0))
OUT_WRITE(TEMP_0_CS_PIN, HIGH); // Disable OUT_WRITE(TEMP_0_CS_PIN, HIGH); // Disable
#endif #endif
#if TEMP_SENSOR_1_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && TEMP_SENSOR_REDUNDANT_SOURCE == 1) #if TEMP_SENSOR_1_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E1))
OUT_WRITE(TEMP_1_CS_PIN, HIGH); OUT_WRITE(TEMP_1_CS_PIN, HIGH);
#endif #endif

View File

@ -231,6 +231,9 @@
#define STR_HEATER_BED "bed" #define STR_HEATER_BED "bed"
#define STR_HEATER_CHAMBER "chamber" #define STR_HEATER_CHAMBER "chamber"
#define STR_COOLER "cooler" #define STR_COOLER "cooler"
#define STR_MOTHERBOARD "motherboard"
#define STR_PROBE "probe"
#define STR_REDUNDANT "redundant "
#define STR_LASER_TEMP "laser temperature" #define STR_LASER_TEMP "laser temperature"
#define STR_STOPPED_HEATER ", system stopped! Heater_ID: " #define STR_STOPPED_HEATER ", system stopped! Heater_ID: "

View File

@ -76,9 +76,14 @@ void ControllerFan::update() {
) )
); );
// If any of the drivers or the heated bed are enabled... // If any triggers for the controller fan are true...
if (motor_on || TERN0(HAS_HEATED_BED, thermalManager.temp_bed.soft_pwm_amount > 0)) // - At least one stepper driver is enabled
lastMotorOn = ms; //... set time to NOW so the fan will turn on // - The heated bed is enabled
// - TEMP_SENSOR_BOARD is reporting >= CONTROLLER_FAN_MIN_BOARD_TEMP
if ( motor_on
|| TERN0(HAS_HEATED_BED, thermalManager.temp_bed.soft_pwm_amount > 0)
|| TERN0(HAS_CONTROLLER_FAN_MIN_BOARD_TEMP, thermalManager.wholeDegBoard() >= CONTROLLER_FAN_MIN_BOARD_TEMP)
) lastMotorOn = ms; //... set time to NOW so the fan will turn on
// Fan Settings. Set fan > 0: // Fan Settings. Set fan > 0:
// - If AutoMode is on and steppers have been enabled for CONTROLLERFAN_IDLE_TIME seconds. // - If AutoMode is on and steppers have been enabled for CONTROLLERFAN_IDLE_TIME seconds.

View File

@ -125,6 +125,29 @@
#undef THERMAL_PROTECTION_COOLER #undef THERMAL_PROTECTION_COOLER
#endif #endif
// Usurp a sensor to do redundant readings
#if TEMP_SENSOR_REDUNDANT
#define REDUNDANT_TEMP_MATCH(M,N) (TEMP_SENSOR_REDUNDANT_##M == HID_##N)
#else
#define REDUNDANT_TEMP_MATCH(...) 0
#endif
// Temperature sensor IDs
#define HID_REDUNDANT -6
#define HID_COOLER -5
#define HID_PROBE -4
#define HID_BOARD -3
#define HID_CHAMBER -2
#define HID_BED -1
#define HID_E0 0
#define HID_E1 1
#define HID_E2 2
#define HID_E3 3
#define HID_E4 4
#define HID_E5 5
#define HID_E6 6
#define HID_E7 7
#if ENABLED(MIXING_EXTRUDER) && (ENABLED(RETRACT_SYNC_MIXING) || BOTH(FILAMENT_LOAD_UNLOAD_GCODES, FILAMENT_UNLOAD_ALL_EXTRUDERS)) #if ENABLED(MIXING_EXTRUDER) && (ENABLED(RETRACT_SYNC_MIXING) || BOTH(FILAMENT_LOAD_UNLOAD_GCODES, FILAMENT_UNLOAD_ALL_EXTRUDERS))
#define HAS_MIXER_SYNC_CHANNEL 1 #define HAS_MIXER_SYNC_CHANNEL 1
#endif #endif

View File

@ -532,84 +532,84 @@
// Usurp a sensor to do redundant readings // Usurp a sensor to do redundant readings
#if TEMP_SENSOR_REDUNDANT #if TEMP_SENSOR_REDUNDANT
#ifndef TEMP_SENSOR_REDUNDANT_SOURCE #ifndef TEMP_SENSOR_REDUNDANT_SOURCE
#define TEMP_SENSOR_REDUNDANT_SOURCE 1 #define TEMP_SENSOR_REDUNDANT_SOURCE E1
#endif #endif
#ifndef TEMP_SENSOR_REDUNDANT_TARGET #ifndef TEMP_SENSOR_REDUNDANT_TARGET
#define TEMP_SENSOR_REDUNDANT_TARGET 0 #define TEMP_SENSOR_REDUNDANT_TARGET E0
#endif #endif
#if !PIN_EXISTS(TEMP_REDUNDANT) #if !PIN_EXISTS(TEMP_REDUNDANT)
#ifndef TEMP_SENSOR_REDUNDANT_MAX_DIFF #ifndef TEMP_SENSOR_REDUNDANT_MAX_DIFF
#define TEMP_SENSOR_REDUNDANT_MAX_DIFF 10 #define TEMP_SENSOR_REDUNDANT_MAX_DIFF 10
#endif #endif
#if TEMP_SENSOR_REDUNDANT_SOURCE == -5 #if REDUNDANT_TEMP_MATCH(SOURCE, COOLER)
#if !PIN_EXISTS(TEMP_COOLER) #if !PIN_EXISTS(TEMP_COOLER)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to COOLER requires TEMP_COOLER_PIN." #error "TEMP_SENSOR_REDUNDANT_SOURCE set to COOLER requires TEMP_COOLER_PIN."
#else #else
#define TEMP_REDUNDANT_PIN TEMP_COOLER_PIN #define TEMP_REDUNDANT_PIN TEMP_COOLER_PIN
#endif #endif
#elif TEMP_SENSOR_REDUNDANT_SOURCE == -4 #elif REDUNDANT_TEMP_MATCH(SOURCE, PROBE)
#if !PIN_EXISTS(TEMP_PROBE) #if !PIN_EXISTS(TEMP_PROBE)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to PROBE requires TEMP_PROBE_PIN." #error "TEMP_SENSOR_REDUNDANT_SOURCE set to PROBE requires TEMP_PROBE_PIN."
#else #else
#define TEMP_REDUNDANT_PIN TEMP_PROBE_PIN #define TEMP_REDUNDANT_PIN TEMP_PROBE_PIN
#endif #endif
#elif TEMP_SENSOR_REDUNDANT_SOURCE == -2 #elif REDUNDANT_TEMP_MATCH(SOURCE, CHAMBER)
#if !PIN_EXISTS(TEMP_CHAMBER) #if !PIN_EXISTS(TEMP_CHAMBER)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to CHAMBER requires TEMP_CHAMBER_PIN." #error "TEMP_SENSOR_REDUNDANT_SOURCE set to CHAMBER requires TEMP_CHAMBER_PIN."
#else #else
#define TEMP_REDUNDANT_PIN TEMP_CHAMBER_PIN #define TEMP_REDUNDANT_PIN TEMP_CHAMBER_PIN
#endif #endif
#elif TEMP_SENSOR_REDUNDANT_SOURCE == -1 #elif REDUNDANT_TEMP_MATCH(SOURCE, BED)
#if !PIN_EXISTS(TEMP_BED) #if !PIN_EXISTS(TEMP_BED)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to BED requires TEMP_BED_PIN." #error "TEMP_SENSOR_REDUNDANT_SOURCE set to BED requires TEMP_BED_PIN."
#else #else
#define TEMP_REDUNDANT_PIN TEMP_BED_PIN #define TEMP_REDUNDANT_PIN TEMP_BED_PIN
#endif #endif
#elif TEMP_SENSOR_REDUNDANT_SOURCE == 0 #elif REDUNDANT_TEMP_MATCH(SOURCE, E0)
#if !PIN_EXISTS(TEMP_0) #if !PIN_EXISTS(TEMP_0)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to 0 requires TEMP_0_PIN." #error "TEMP_SENSOR_REDUNDANT_SOURCE set to E0 requires TEMP_0_PIN."
#else #else
#define TEMP_REDUNDANT_PIN TEMP_0_PIN #define TEMP_REDUNDANT_PIN TEMP_0_PIN
#endif #endif
#elif TEMP_SENSOR_REDUNDANT_SOURCE == 1 #elif REDUNDANT_TEMP_MATCH(SOURCE, E1)
#if !PIN_EXISTS(TEMP_1) #if !PIN_EXISTS(TEMP_1)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to 1 requires TEMP_1_PIN." #error "TEMP_SENSOR_REDUNDANT_SOURCE set to E1 requires TEMP_1_PIN."
#else #else
#define TEMP_REDUNDANT_PIN TEMP_1_PIN #define TEMP_REDUNDANT_PIN TEMP_1_PIN
#endif #endif
#elif TEMP_SENSOR_REDUNDANT_SOURCE == 2 #elif REDUNDANT_TEMP_MATCH(SOURCE, E2)
#if !PIN_EXISTS(TEMP_2) #if !PIN_EXISTS(TEMP_2)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to 2 requires TEMP_2_PIN." #error "TEMP_SENSOR_REDUNDANT_SOURCE set to E2 requires TEMP_2_PIN."
#else #else
#define TEMP_REDUNDANT_PIN TEMP_2_PIN #define TEMP_REDUNDANT_PIN TEMP_2_PIN
#endif #endif
#elif TEMP_SENSOR_REDUNDANT_SOURCE == 3 #elif REDUNDANT_TEMP_MATCH(SOURCE, E3)
#if !PIN_EXISTS(TEMP_3) #if !PIN_EXISTS(TEMP_3)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to 3 requires TEMP_3_PIN." #error "TEMP_SENSOR_REDUNDANT_SOURCE set to E3 requires TEMP_3_PIN."
#else #else
#define TEMP_REDUNDANT_PIN TEMP_3_PIN #define TEMP_REDUNDANT_PIN TEMP_3_PIN
#endif #endif
#elif TEMP_SENSOR_REDUNDANT_SOURCE == 4 #elif REDUNDANT_TEMP_MATCH(SOURCE, E4)
#if !PIN_EXISTS(TEMP_4) #if !PIN_EXISTS(TEMP_4)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to 4 requires TEMP_4_PIN." #error "TEMP_SENSOR_REDUNDANT_SOURCE set to E4 requires TEMP_4_PIN."
#else #else
#define TEMP_REDUNDANT_PIN TEMP_4_PIN #define TEMP_REDUNDANT_PIN TEMP_4_PIN
#endif #endif
#elif TEMP_SENSOR_REDUNDANT_SOURCE == 5 #elif REDUNDANT_TEMP_MATCH(SOURCE, E5)
#if !PIN_EXISTS(TEMP_5) #if !PIN_EXISTS(TEMP_5)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to 5 requires TEMP_5_PIN." #error "TEMP_SENSOR_REDUNDANT_SOURCE set to E5 requires TEMP_5_PIN."
#else #else
#define TEMP_REDUNDANT_PIN TEMP_5_PIN #define TEMP_REDUNDANT_PIN TEMP_5_PIN
#endif #endif
#elif TEMP_SENSOR_REDUNDANT_SOURCE == 6 #elif REDUNDANT_TEMP_MATCH(SOURCE, E6)
#if !PIN_EXISTS(TEMP_6) #if !PIN_EXISTS(TEMP_6)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to 6 requires TEMP_6_PIN." #error "TEMP_SENSOR_REDUNDANT_SOURCE set to E6 requires TEMP_6_PIN."
#else #else
#define TEMP_REDUNDANT_PIN TEMP_6_PIN #define TEMP_REDUNDANT_PIN TEMP_6_PIN
#endif #endif
#elif TEMP_SENSOR_REDUNDANT_SOURCE == 7 #elif REDUNDANT_TEMP_MATCH(SOURCE, E7)
#if !PIN_EXISTS(TEMP_7) #if !PIN_EXISTS(TEMP_7)
#error "TEMP_SENSOR_REDUNDANT_SOURCE set to 7 requires TEMP_7_PIN." #error "TEMP_SENSOR_REDUNDANT_SOURCE set to E7 requires TEMP_7_PIN."
#else #else
#define TEMP_REDUNDANT_PIN TEMP_7_PIN #define TEMP_REDUNDANT_PIN TEMP_7_PIN
#endif #endif
@ -699,7 +699,7 @@
#define TEMP_SENSOR_REDUNDANT_IS_MAX_TC 1 #define TEMP_SENSOR_REDUNDANT_IS_MAX_TC 1
#if TEMP_SENSOR_REDUNDANT == -5 #if TEMP_SENSOR_REDUNDANT == -5
#if TEMP_SENSOR_REDUNDANT_SOURCE != 0 && TEMP_SENSOR_REDUNDANT_SOURCE != 1 #if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
#error "MAX31865 Thermocouples (-5) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1 (0/1)." #error "MAX31865 Thermocouples (-5) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1 (0/1)."
#endif #endif
@ -707,7 +707,7 @@
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN 0 #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN 0
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1024 #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1024
#elif TEMP_SENSOR_REDUNDANT == -3 #elif TEMP_SENSOR_REDUNDANT == -3
#if TEMP_SENSOR_REDUNDANT_SOURCE != 0 && TEMP_SENSOR_REDUNDANT_SOURCE != 1 #if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1 (0/1)." #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1 (0/1)."
#endif #endif
@ -715,7 +715,7 @@
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN -270 #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN -270
#define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1800 #define TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX 1800
#elif TEMP_SENSOR_REDUNDANT == -2 #elif TEMP_SENSOR_REDUNDANT == -2
#if TEMP_SENSOR_REDUNDANT_SOURCE != 0 && TEMP_SENSOR_REDUNDANT_SOURCE != 1 #if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1 (0/1)." #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_REDUNDANT_SOURCE other than TEMP_SENSOR_0/TEMP_SENSOR_1 (0/1)."
#endif #endif
@ -725,13 +725,13 @@
#endif #endif
// mimic setting up the source TEMP_SENSOR // mimic setting up the source TEMP_SENSOR
#if TEMP_SENSOR_REDUNDANT_SOURCE == 0 #if REDUNDANT_TEMP_MATCH(SOURCE, E0)
#define TEMP_SENSOR_0_MAX_TC_TMIN TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN #define TEMP_SENSOR_0_MAX_TC_TMIN TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN
#define TEMP_SENSOR_0_MAX_TC_TMAX TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX #define TEMP_SENSOR_0_MAX_TC_TMAX TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX
#ifndef MAX31865_SENSOR_WIRES_0 #ifndef MAX31865_SENSOR_WIRES_0
#define MAX31865_SENSOR_WIRES_0 2 #define MAX31865_SENSOR_WIRES_0 2
#endif #endif
#elif TEMP_SENSOR_REDUNDANT_SOURCE == 1 #elif REDUNDANT_TEMP_MATCH(SOURCE, E1)
#define TEMP_SENSOR_1_MAX_TC_TMIN TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN #define TEMP_SENSOR_1_MAX_TC_TMIN TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN
#define TEMP_SENSOR_1_MAX_TC_TMAX TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX #define TEMP_SENSOR_1_MAX_TC_TMAX TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX
#ifndef MAX31865_SENSOR_WIRES_1 #ifndef MAX31865_SENSOR_WIRES_1
@ -780,7 +780,7 @@
#if HAS_MAX_TC #if HAS_MAX_TC
// Translate old _SS, _CS, _SCK, _DO, _DI, _MISO, and _MOSI PIN defines. // Translate old _SS, _CS, _SCK, _DO, _DI, _MISO, and _MOSI PIN defines.
#if TEMP_SENSOR_0_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && TEMP_SENSOR_REDUNDANT_SOURCE == 1) #if TEMP_SENSOR_0_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E1))
#if !PIN_EXISTS(TEMP_0_CS) // SS, CS #if !PIN_EXISTS(TEMP_0_CS) // SS, CS
#if PIN_EXISTS(MAX6675_SS) #if PIN_EXISTS(MAX6675_SS)
@ -849,7 +849,7 @@
#endif // TEMP_SENSOR_0_IS_MAX_TC #endif // TEMP_SENSOR_0_IS_MAX_TC
#if TEMP_SENSOR_1_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && TEMP_SENSOR_REDUNDANT_SOURCE == 1) #if TEMP_SENSOR_1_IS_MAX_TC || (TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E1))
#if !PIN_EXISTS(TEMP_1_CS) // SS2, CS2 #if !PIN_EXISTS(TEMP_1_CS) // SS2, CS2
#if PIN_EXISTS(MAX6675_SS2) #if PIN_EXISTS(MAX6675_SS2)
@ -2584,6 +2584,9 @@
#if HAS_ADC_TEST(COOLER) #if HAS_ADC_TEST(COOLER)
#define HAS_TEMP_ADC_COOLER 1 #define HAS_TEMP_ADC_COOLER 1
#endif #endif
#if HAS_ADC_TEST(BOARD)
#define HAS_TEMP_ADC_BOARD 1
#endif
#if HAS_ADC_TEST(REDUNDANT) #if HAS_ADC_TEST(REDUNDANT)
#define HAS_TEMP_ADC_REDUNDANT 1 #define HAS_TEMP_ADC_REDUNDANT 1
#endif #endif
@ -2604,6 +2607,9 @@
#if HAS_TEMP(COOLER) #if HAS_TEMP(COOLER)
#define HAS_TEMP_COOLER 1 #define HAS_TEMP_COOLER 1
#endif #endif
#if HAS_TEMP(BOARD)
#define HAS_TEMP_BOARD 1
#endif
#if HAS_TEMP(REDUNDANT) #if HAS_TEMP(REDUNDANT)
#define HAS_TEMP_REDUNDANT 1 #define HAS_TEMP_REDUNDANT 1
#endif #endif
@ -2675,7 +2681,8 @@
#if HAS_HEATED_BED || HAS_TEMP_CHAMBER #if HAS_HEATED_BED || HAS_TEMP_CHAMBER
#define BED_OR_CHAMBER 1 #define BED_OR_CHAMBER 1
#endif #endif
#if HAS_TEMP_HOTEND || BED_OR_CHAMBER || HAS_TEMP_PROBE || HAS_TEMP_COOLER
#if HAS_TEMP_HOTEND || BED_OR_CHAMBER || HAS_TEMP_PROBE || HAS_TEMP_COOLER || HAS_TEMP_BOARD
#define HAS_TEMP_SENSOR 1 #define HAS_TEMP_SENSOR 1
#endif #endif
@ -2813,9 +2820,6 @@
#endif #endif
#undef _NOT_E_AUTO #undef _NOT_E_AUTO
#undef _HAS_FAN #undef _HAS_FAN
#if PIN_EXISTS(CONTROLLER_FAN)
#define HAS_CONTROLLER_FAN 1
#endif
#if BED_OR_CHAMBER || HAS_FAN0 #if BED_OR_CHAMBER || HAS_FAN0
#define BED_OR_CHAMBER_OR_FAN 1 #define BED_OR_CHAMBER_OR_FAN 1
@ -2892,6 +2896,27 @@
#define FAST_PWM_FAN_FREQUENCY ((F_CPU) / (2 * 255 * 1)) // Fan frequency default #define FAST_PWM_FAN_FREQUENCY ((F_CPU) / (2 * 255 * 1)) // Fan frequency default
#endif #endif
/**
* Controller Fan Settings
*/
#if PIN_EXISTS(CONTROLLER_FAN)
#define HAS_CONTROLLER_FAN 1
#if CONTROLLER_FAN_MIN_BOARD_TEMP
#define HAS_CONTROLLER_FAN_MIN_BOARD_TEMP 1
#endif
#endif
#if HAS_CONTROLLER_FAN
#if ENABLED(CONTROLLER_FAN_USE_BOARD_TEMP)
#define HAS_CONTROLLER_FAN_BOARD_TEMP_TRIGGER 1
#ifndef CONTROLLER_FAN_TRIGGER_TEMP
#define CONTROLLER_FAN_TRIGGER_TEMP 30
#endif
#else
#undef CONTROLLER_FAN_TRIGGER_TEMP
#endif
#endif
// Servos // Servos
#if PIN_EXISTS(SERVO0) && NUM_SERVOS > 0 #if PIN_EXISTS(SERVO0) && NUM_SERVOS > 0
#define HAS_SERVO_0 1 #define HAS_SERVO_0 1

View File

@ -583,6 +583,10 @@
#error "TEMP_SENSOR_1_AS_REDUNDANT is now TEMP_SENSOR_REDUNDANT, with associated TEMP_SENSOR_REDUNDANT_* config." #error "TEMP_SENSOR_1_AS_REDUNDANT is now TEMP_SENSOR_REDUNDANT, with associated TEMP_SENSOR_REDUNDANT_* config."
#elif defined(MAX_REDUNDANT_TEMP_SENSOR_DIFF) #elif defined(MAX_REDUNDANT_TEMP_SENSOR_DIFF)
#error "MAX_REDUNDANT_TEMP_SENSOR_DIFF is now TEMP_SENSOR_REDUNDANT_MAX_DIFF" #error "MAX_REDUNDANT_TEMP_SENSOR_DIFF is now TEMP_SENSOR_REDUNDANT_MAX_DIFF"
#elif MOTHERBOARD == BOARD_DUE3DOM_MINI && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD)
#warning "Onboard temperature sensor for BOARD_DUE3DOM_MINI has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)."
#elif MOTHERBOARD == BOARD_BTT_SKR_E3_TURBO && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD)
#warning "Onboard temperature sensor for BOARD_BTT_SKR_E3_TURBO has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)."
#endif #endif
constexpr float arm[] = AXIS_RELATIVE_MODES; constexpr float arm[] = AXIS_RELATIVE_MODES;
@ -1959,6 +1963,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h." #error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_PROBE_IS_CUSTOM && !(defined(PROBE_PULLUP_RESISTOR_OHMS) && defined(PROBE_RESISTANCE_25C_OHMS) && defined(PROBE_BETA)) #elif TEMP_SENSOR_PROBE_IS_CUSTOM && !(defined(PROBE_PULLUP_RESISTOR_OHMS) && defined(PROBE_RESISTANCE_25C_OHMS) && defined(PROBE_BETA))
#error "TEMP_SENSOR_PROBE 1000 requires PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS and PROBE_BETA in Configuration_adv.h." #error "TEMP_SENSOR_PROBE 1000 requires PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS and PROBE_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_BOARD_IS_CUSTOM && !(defined(BOARD_PULLUP_RESISTOR_OHMS) && defined(BOARD_RESISTANCE_25C_OHMS) && defined(BOARD_BETA))
#error "TEMP_SENSOR_BOARD 1000 requires BOARD_PULLUP_RESISTOR_OHMS, BOARD_RESISTANCE_25C_OHMS and BOARD_BETA in Configuration_adv.h."
#elif TEMP_SENSOR_REDUNDANT_IS_CUSTOM && !(defined(REDUNDANT_PULLUP_RESISTOR_OHMS) && defined(REDUNDANT_RESISTANCE_25C_OHMS) && defined(REDUNDANT_BETA)) #elif TEMP_SENSOR_REDUNDANT_IS_CUSTOM && !(defined(REDUNDANT_PULLUP_RESISTOR_OHMS) && defined(REDUNDANT_RESISTANCE_25C_OHMS) && defined(REDUNDANT_BETA))
#error "TEMP_SENSOR_REDUNDANT 1000 requires REDUNDANT_PULLUP_RESISTOR_OHMS, REDUNDANT_RESISTANCE_25C_OHMS and REDUNDANT_BETA in Configuration_adv.h." #error "TEMP_SENSOR_REDUNDANT 1000 requires REDUNDANT_PULLUP_RESISTOR_OHMS, REDUNDANT_RESISTANCE_25C_OHMS and REDUNDANT_BETA in Configuration_adv.h."
#endif #endif
@ -1966,14 +1972,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/** /**
* Required MAX31865 settings * Required MAX31865 settings
*/ */
#if TEMP_SENSOR_0_IS_MAX31865 || (TEMP_SENSOR_REDUNDANT_IS_MAX31865 && TEMP_SENSOR_REDUNDANT_SOURCE == 0) #if TEMP_SENSOR_0_IS_MAX31865 || (TEMP_SENSOR_REDUNDANT_IS_MAX31865 && REDUNDANT_TEMP_MATCH(SOURCE, E0))
#if !defined(MAX31865_SENSOR_WIRES_0) || !WITHIN(MAX31865_SENSOR_WIRES_0, 2, 4) #if !defined(MAX31865_SENSOR_WIRES_0) || !WITHIN(MAX31865_SENSOR_WIRES_0, 2, 4)
#error "MAX31865_SENSOR_WIRES_0 must be defined as an integer between 2 and 4." #error "MAX31865_SENSOR_WIRES_0 must be defined as an integer between 2 and 4."
#elif !defined(MAX31865_SENSOR_OHMS_0) || !defined(MAX31865_CALIBRATION_OHMS_0) #elif !defined(MAX31865_SENSOR_OHMS_0) || !defined(MAX31865_CALIBRATION_OHMS_0)
#error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set if TEMP_SENSOR_0/TEMP_SENSOR_REDUNDANT is MAX31865." #error "MAX31865_SENSOR_OHMS_0 and MAX31865_CALIBRATION_OHMS_0 must be set if TEMP_SENSOR_0/TEMP_SENSOR_REDUNDANT is MAX31865."
#endif #endif
#endif #endif
#if TEMP_SENSOR_1_IS_MAX31865 || (TEMP_SENSOR_REDUNDANT_IS_MAX31865 && TEMP_SENSOR_REDUNDANT_SOURCE == 1) #if TEMP_SENSOR_1_IS_MAX31865 || (TEMP_SENSOR_REDUNDANT_IS_MAX31865 && REDUNDANT_TEMP_MATCH(SOURCE, E1))
#if !defined(MAX31865_SENSOR_WIRES_1) || !WITHIN(MAX31865_SENSOR_WIRES_1, 2, 4) #if !defined(MAX31865_SENSOR_WIRES_1) || !WITHIN(MAX31865_SENSOR_WIRES_1, 2, 4)
#error "MAX31865_SENSOR_WIRES_1 must be defined as an integer between 2 and 4." #error "MAX31865_SENSOR_WIRES_1 must be defined as an integer between 2 and 4."
#elif !defined(MAX31865_SENSOR_OHMS_1) || !defined(MAX31865_CALIBRATION_OHMS_1) #elif !defined(MAX31865_SENSOR_OHMS_1) || !defined(MAX31865_CALIBRATION_OHMS_1)
@ -1989,62 +1995,58 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "TEMP_SENSOR_REDUNDANT requires TEMP_SENSOR_REDUNDANT_SOURCE." #error "TEMP_SENSOR_REDUNDANT requires TEMP_SENSOR_REDUNDANT_SOURCE."
#elif !defined(TEMP_SENSOR_REDUNDANT_TARGET) #elif !defined(TEMP_SENSOR_REDUNDANT_TARGET)
#error "TEMP_SENSOR_REDUNDANT requires TEMP_SENSOR_REDUNDANT_TARGET." #error "TEMP_SENSOR_REDUNDANT requires TEMP_SENSOR_REDUNDANT_TARGET."
#elif TEMP_SENSOR_REDUNDANT_SOURCE == TEMP_SENSOR_REDUNDANT_TARGET #elif REDUNDANT_TEMP_MATCH(SOURCE, TEMP_SENSOR_REDUNDANT_TARGET)
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be the same as TEMP_SENSOR_REDUNDANT_TARGET." #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be the same as TEMP_SENSOR_REDUNDANT_TARGET."
#elif TEMP_SENSOR_REDUNDANT_SOURCE < -5 || TEMP_SENSOR_REDUNDANT_SOURCE > 7
#error "TEMP_SENSOR_REDUNDANT_SOURCE must be between -5 and 7."
#elif TEMP_SENSOR_REDUNDANT_TARGET < -5 || TEMP_SENSOR_REDUNDANT_TARGET > 7
#error "TEMP_SENSOR_REDUNDANT_TARGET must be between -5 and 7."
#elif TEMP_SENSOR_REDUNDANT_SOURCE == -3
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be -3 (not used)."
#elif TEMP_SENSOR_REDUNDANT_TARGET == -3
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be -3 (not used)."
#elif HAS_MULTI_HOTEND && TEMP_SENSOR_REDUNDANT_SOURCE < HOTENDS #elif HAS_MULTI_HOTEND && TEMP_SENSOR_REDUNDANT_SOURCE < HOTENDS
#error "TEMP_SENSOR_REDUNDANT_SOURCE must be after the last TEMP_SENSOR used with a hotend; you can't use a sensor in the middle of two hotends." #error "TEMP_SENSOR_REDUNDANT_SOURCE must be after the last used hotend TEMP_SENSOR."
#endif #endif
#if TEMP_SENSOR_REDUNDANT_SOURCE == 0 && HAS_HOTEND #if REDUNDANT_TEMP_MATCH(SOURCE, E0) && HAS_HOTEND
#error "TEMP_SENSOR_REDUNDANT_SOURCE can not be 0 if a hotend is used. E0 always uses TEMP_SENSOR_0." #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be 0 if a hotend is used. E0 always uses TEMP_SENSOR_0."
#elif TEMP_SENSOR_REDUNDANT_SOURCE == -5 && HAS_TEMP_COOLER #elif REDUNDANT_TEMP_MATCH(SOURCE, COOLER) && HAS_TEMP_COOLER
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be Cooler (-5): TEMP_SENSOR_COOLER has already defined the sensor." #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be COOLER. TEMP_SENSOR_COOLER is in use."
#elif TEMP_SENSOR_REDUNDANT_SOURCE == -4 && HAS_TEMP_PROBE #elif REDUNDANT_TEMP_MATCH(SOURCE, PROBE) && HAS_TEMP_PROBE
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be Probe (-4): TEMP_SENSOR_PROBE has already defined the sensor." #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be PROBE. TEMP_SENSOR_PROBE is in use."
#elif TEMP_SENSOR_REDUNDANT_SOURCE == -2 && HAS_TEMP_CHAMBER #elif REDUNDANT_TEMP_MATCH(SOURCE, BOARD) && HAS_TEMP_BOARD
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be Chamber (-2): TEMP_SENSOR_CHAMBER has already defined the sensor." #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be BOARD. TEMP_SENSOR_BOARD is in use."
#elif TEMP_SENSOR_REDUNDANT_SOURCE == -1 && HAS_TEMP_BED #elif REDUNDANT_TEMP_MATCH(SOURCE, CHAMBER) && HAS_TEMP_CHAMBER
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be Bed (-1): TEMP_SENSOR_BED has already defined the sensor." #error "TEMP_SENSOR_REDUNDANT_SOURCE can't be CHAMBER. TEMP_SENSOR_CHAMBER is in use."
#elif REDUNDANT_TEMP_MATCH(SOURCE, BED) && HAS_TEMP_BED
#error "TEMP_SENSOR_REDUNDANT_SOURCE can't be BED. TEMP_SENSOR_BED is in use."
#endif #endif
#if TEMP_SENSOR_REDUNDANT_TARGET == 0 && !PIN_EXISTS(TEMP_0) #if REDUNDANT_TEMP_MATCH(TARGET, E0) && !PIN_EXISTS(TEMP_0)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E0 (0): requires TEMP_0_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E0 without TEMP_0_PIN defined."
#elif TEMP_SENSOR_REDUNDANT_TARGET == 1 && !PIN_EXISTS(TEMP_1) #elif REDUNDANT_TEMP_MATCH(TARGET, E1) && !PIN_EXISTS(TEMP_1)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E1 (1): requires TEMP_1_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E1 without TEMP_1_PIN defined."
#elif TEMP_SENSOR_REDUNDANT_TARGET == 2 && !PIN_EXISTS(TEMP_2) #elif REDUNDANT_TEMP_MATCH(TARGET, E2) && !PIN_EXISTS(TEMP_2)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E2 (2): requires TEMP_2_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E2 without TEMP_2_PIN defined."
#elif TEMP_SENSOR_REDUNDANT_TARGET == 3 && !PIN_EXISTS(TEMP_3) #elif REDUNDANT_TEMP_MATCH(TARGET, E3) && !PIN_EXISTS(TEMP_3)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E3 (3): requires TEMP_3_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E3 without TEMP_3_PIN defined."
#elif TEMP_SENSOR_REDUNDANT_TARGET == 4 && !PIN_EXISTS(TEMP_4) #elif REDUNDANT_TEMP_MATCH(TARGET, E4) && !PIN_EXISTS(TEMP_4)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E4 (4): requires TEMP_4_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E4 without TEMP_4_PIN defined."
#elif TEMP_SENSOR_REDUNDANT_TARGET == 5 && !PIN_EXISTS(TEMP_5) #elif REDUNDANT_TEMP_MATCH(TARGET, E5) && !PIN_EXISTS(TEMP_5)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E5 (5): requires TEMP_5_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E5 without TEMP_5_PIN defined."
#elif TEMP_SENSOR_REDUNDANT_TARGET == 6 && !PIN_EXISTS(TEMP_6) #elif REDUNDANT_TEMP_MATCH(TARGET, E6) && !PIN_EXISTS(TEMP_6)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E6 (6): requires TEMP_6_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E6 without TEMP_6_PIN defined."
#elif TEMP_SENSOR_REDUNDANT_TARGET == 7 && !PIN_EXISTS(TEMP_7) #elif REDUNDANT_TEMP_MATCH(TARGET, E7) && !PIN_EXISTS(TEMP_7)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be E7 (7): requires TEMP_7_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be E7 without TEMP_7_PIN defined."
#elif TEMP_SENSOR_REDUNDANT_TARGET == -1 && !PIN_EXISTS(TEMP_BED) #elif REDUNDANT_TEMP_MATCH(TARGET, BED) && !PIN_EXISTS(TEMP_BED)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be Bed (-1): requires TEMP_BED_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be BED without TEMP_BED_PIN defined."
#elif TEMP_SENSOR_REDUNDANT_TARGET == -2 && !PIN_EXISTS(TEMP_CHAMBER) #elif REDUNDANT_TEMP_MATCH(TARGET, CHAMBER) && !PIN_EXISTS(TEMP_CHAMBER)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be Chamber (-2): requires TEMP_CHAMBER_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be CHAMBER without TEMP_CHAMBER_PIN defined."
#elif TEMP_SENSOR_REDUNDANT_TARGET == -4 && !PIN_EXISTS(TEMP_PROBE) #elif REDUNDANT_TEMP_MATCH(TARGET, BOARD) && !PIN_EXISTS(TEMP_BOARD)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be Probe (-4): requires TEMP_PROBE_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be BOARD without TEMP_BOARD_PIN defined."
#elif TEMP_SENSOR_REDUNDANT_TARGET == -5 && !PIN_EXISTS(TEMP_COOLER) #elif REDUNDANT_TEMP_MATCH(TARGET, PROBE) && !PIN_EXISTS(TEMP_PROBE)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be Cooler (-5): requires TEMP_COOLER_PIN" #error "TEMP_SENSOR_REDUNDANT_TARGET can't be PROBE without TEMP_PROBE_PIN defined."
#elif REDUNDANT_TEMP_MATCH(TARGET, COOLER) && !PIN_EXISTS(TEMP_COOLER)
#error "TEMP_SENSOR_REDUNDANT_TARGET can't be COOLER without TEMP_COOLER_PIN defined."
#endif #endif
#if TEMP_SENSOR_REDUNDANT_IS_MAX_TC && TEMP_SENSOR_REDUNDANT_SOURCE == 0 && !PIN_EXISTS(TEMP_0_CS) #if TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E0) && !PIN_EXISTS(TEMP_0_CS)
#error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE 0 requires TEMP_0_CS_PIN." #error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE E0 requires TEMP_0_CS_PIN."
#elif TEMP_SENSOR_REDUNDANT_IS_MAX_TC && TEMP_SENSOR_REDUNDANT_SOURCE == 1 && !PIN_EXISTS(TEMP_1_CS) #elif TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E1) && !PIN_EXISTS(TEMP_1_CS)
#error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE 1 requires TEMP_1_CS_PIN." #error "TEMP_SENSOR_REDUNDANT MAX Thermocouple with TEMP_SENSOR_REDUNDANT_SOURCE E1 requires TEMP_1_CS_PIN."
#endif #endif
#endif #endif
@ -2209,6 +2211,28 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#endif #endif
#endif #endif
#if TEMP_SENSOR_PROBE
#if !PIN_EXISTS(TEMP_PROBE)
#error "TEMP_SENSOR_PROBE requires TEMP_PROBE_PIN."
#elif !HAS_TEMP_ADC_PROBE
#error "TEMP_PROBE_PIN must be an ADC pin."
#elif DISABLED(FIX_MOUNTED_PROBE)
#error "TEMP_SENSOR_PROBE shouldn't be set without FIX_MOUNTED_PROBE."
#endif
#endif
#if TEMP_SENSOR_BOARD
#if !PIN_EXISTS(TEMP_BOARD)
#error "TEMP_SENSOR_BOARD requires TEMP_BOARD_PIN."
#elif !HAS_TEMP_ADC_BOARD
#error "TEMP_BOARD_PIN must be an ADC pin."
#elif ENABLED(THERMAL_PROTECTION_BOARD) && (!defined(BOARD_MINTEMP) || !defined(BOARD_MAXTEMP))
#error "THERMAL_PROTECTION_BOARD requires BOARD_MINTEMP and BOARD_MAXTEMP."
#endif
#elif CONTROLLER_FAN_MIN_BOARD_TEMP
#error "CONTROLLER_FAN_MIN_BOARD_TEMP requires TEMP_SENSOR_BOARD."
#endif
#if ENABLED(LASER_COOLANT_FLOW_METER) && !(PIN_EXISTS(FLOWMETER) && ENABLED(LASER_FEATURE)) #if ENABLED(LASER_COOLANT_FLOW_METER) && !(PIN_EXISTS(FLOWMETER) && ENABLED(LASER_FEATURE))
#error "LASER_COOLANT_FLOW_METER requires FLOWMETER_PIN and LASER_FEATURE." #error "LASER_COOLANT_FLOW_METER requires FLOWMETER_PIN and LASER_FEATURE."
#endif #endif

View File

@ -58,8 +58,8 @@
#endif #endif
// MAX TC related macros // MAX TC related macros
#define TEMP_SENSOR_IS_MAX(n, M) (ENABLED(TEMP_SENSOR_##n##_IS_MAX##M) || (ENABLED(TEMP_SENSOR_REDUNDANT_IS_MAX##M) && TEMP_SENSOR_REDUNDANT_SOURCE == (n))) #define TEMP_SENSOR_IS_MAX(n, M) (ENABLED(TEMP_SENSOR_##n##_IS_MAX##M) || (ENABLED(TEMP_SENSOR_REDUNDANT_IS_MAX##M) && REDUNDANT_TEMP_MATCH(SOURCE, E##n)))
#define TEMP_SENSOR_IS_ANY_MAX_TC(n) (ENABLED(TEMP_SENSOR_##n##_IS_MAX_TC) || (ENABLED(TEMP_SENSOR_REDUNDANT_IS_MAX_TC) && TEMP_SENSOR_REDUNDANT_SOURCE == n)) #define TEMP_SENSOR_IS_ANY_MAX_TC(n) (ENABLED(TEMP_SENSOR_##n##_IS_MAX_TC) || (ENABLED(TEMP_SENSOR_REDUNDANT_IS_MAX_TC) && REDUNDANT_TEMP_MATCH(SOURCE, E##n)))
// LIB_MAX6675 can be added to the build_flags in platformio.ini to use a user-defined library // LIB_MAX6675 can be added to the build_flags in platformio.ini to use a user-defined library
// If LIB_MAX6675 is not on the build_flags then raw SPI reads will be used. // If LIB_MAX6675 is not on the build_flags then raw SPI reads will be used.
@ -262,7 +262,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
#endif #endif
#if HAS_TEMP_REDUNDANT #if HAS_TEMP_REDUNDANT
redundant_temp_info_t Temperature::temp_redundant; redundant_info_t Temperature::temp_redundant;
#endif #endif
#if ENABLED(AUTO_POWER_E_FANS) #if ENABLED(AUTO_POWER_E_FANS)
@ -436,6 +436,14 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
probe_info_t Temperature::temp_probe; // = { 0 } probe_info_t Temperature::temp_probe; // = { 0 }
#endif #endif
#if HAS_TEMP_BOARD
board_info_t Temperature::temp_board; // = { 0 }
#if ENABLED(THERMAL_PROTECTION_BOARD)
int16_t Temperature::mintemp_raw_BOARD = TEMP_SENSOR_BOARD_RAW_LO_TEMP,
Temperature::maxtemp_raw_BOARD = TEMP_SENSOR_COOLER_RAW_HI_TEMP;
#endif
#endif
#if ENABLED(PREVENT_COLD_EXTRUSION) #if ENABLED(PREVENT_COLD_EXTRUSION)
bool Temperature::allow_cold_extrude = false; bool Temperature::allow_cold_extrude = false;
celsius_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP; celsius_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP;
@ -937,14 +945,26 @@ void Temperature::_temp_error(const heater_id_t heater_id, PGM_P const serial_ms
SERIAL_ERROR_START(); SERIAL_ERROR_START();
SERIAL_ECHOPGM_P(serial_msg); SERIAL_ECHOPGM_P(serial_msg);
SERIAL_ECHOPGM(STR_STOPPED_HEATER); SERIAL_ECHOPGM(STR_STOPPED_HEATER);
if (heater_id >= 0)
SERIAL_ECHO(heater_id); heater_id_t real_heater_id = heater_id;
else if (TERN0(HAS_HEATED_CHAMBER, heater_id == H_CHAMBER))
SERIAL_ECHOPGM(STR_HEATER_CHAMBER); #if HAS_TEMP_REDUNDANT
else if (TERN0(HAS_COOLER, heater_id == H_COOLER)) if (heater_id == H_REDUNDANT) {
SERIAL_ECHOPGM(STR_COOLER); SERIAL_ECHOPGM(STR_REDUNDANT); // print redundant and cascade to print target, too.
else real_heater_id = (heater_id_t)TEMP_SENSOR_REDUNDANT_TARGET;
SERIAL_ECHOPGM(STR_HEATER_BED); }
#endif
switch (real_heater_id) {
OPTCODE(HAS_TEMP_COOLER, case H_COOLER: SERIAL_ECHOPGM(STR_COOLER); break)
OPTCODE(HAS_TEMP_PROBE, case H_PROBE: SERIAL_ECHOPGM(STR_PROBE); break)
OPTCODE(HAS_TEMP_BOARD, case H_BOARD: SERIAL_ECHOPGM(STR_MOTHERBOARD); break)
OPTCODE(HAS_TEMP_CHAMBER, case H_CHAMBER: SERIAL_ECHOPGM(STR_HEATER_CHAMBER); break)
OPTCODE(HAS_TEMP_BED, case H_BED: SERIAL_ECHOPGM(STR_HEATER_BED); break)
default:
if (real_heater_id >= 0)
SERIAL_ECHOLNPAIR("E", real_heater_id);
}
SERIAL_EOL(); SERIAL_EOL();
} }
@ -1663,6 +1683,9 @@ void Temperature::manage_heater() {
#if TEMP_SENSOR_PROBE_IS_CUSTOM #if TEMP_SENSOR_PROBE_IS_CUSTOM
{ true, 0, 0, PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS, 0, 0, PROBE_BETA, 0 }, { true, 0, 0, PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS, 0, 0, PROBE_BETA, 0 },
#endif #endif
#if TEMP_SENSOR_BOARD_IS_CUSTOM
{ true, 0, 0, BOARD_PULLUP_RESISTOR_OHMS, BOARD_RESISTANCE_25C_OHMS, 0, 0, BOARD_BETA, 0 },
#endif
#if TEMP_SENSOR_REDUNDANT_IS_CUSTOM #if TEMP_SENSOR_REDUNDANT_IS_CUSTOM
{ true, 0, 0, REDUNDANT_PULLUP_RESISTOR_OHMS, REDUNDANT_RESISTANCE_25C_OHMS, 0, 0, REDUNDANT_BETA, 0 }, { true, 0, 0, REDUNDANT_PULLUP_RESISTOR_OHMS, REDUNDANT_RESISTANCE_25C_OHMS, 0, 0, REDUNDANT_BETA, 0 },
#endif #endif
@ -1698,6 +1721,7 @@ void Temperature::manage_heater() {
TERN_(TEMP_SENSOR_CHAMBER_IS_CUSTOM, t_index == CTI_CHAMBER ? PSTR("CHAMBER") :) TERN_(TEMP_SENSOR_CHAMBER_IS_CUSTOM, t_index == CTI_CHAMBER ? PSTR("CHAMBER") :)
TERN_(TEMP_SENSOR_COOLER_IS_CUSTOM, t_index == CTI_COOLER ? PSTR("COOLER") :) TERN_(TEMP_SENSOR_COOLER_IS_CUSTOM, t_index == CTI_COOLER ? PSTR("COOLER") :)
TERN_(TEMP_SENSOR_PROBE_IS_CUSTOM, t_index == CTI_PROBE ? PSTR("PROBE") :) TERN_(TEMP_SENSOR_PROBE_IS_CUSTOM, t_index == CTI_PROBE ? PSTR("PROBE") :)
TERN_(TEMP_SENSOR_BOARD_IS_CUSTOM, t_index == CTI_BOARD ? PSTR("BOARD") :)
TERN_(TEMP_SENSOR_REDUNDANT_IS_CUSTOM, t_index == CTI_REDUNDANT ? PSTR("REDUNDANT") :) TERN_(TEMP_SENSOR_REDUNDANT_IS_CUSTOM, t_index == CTI_REDUNDANT ? PSTR("REDUNDANT") :)
nullptr nullptr
); );
@ -1933,14 +1957,32 @@ void Temperature::manage_heater() {
} }
#endif // HAS_TEMP_PROBE #endif // HAS_TEMP_PROBE
#if HAS_TEMP_BOARD
// For motherboard temperature measurement.
celsius_float_t Temperature::analog_to_celsius_board(const int16_t raw) {
#if TEMP_SENSOR_BOARD_IS_CUSTOM
return user_thermistor_to_deg_c(CTI_BOARD, raw);
#elif TEMP_SENSOR_BOARD_IS_THERMISTOR
SCAN_THERMISTOR_TABLE(TEMPTABLE_BOARD, TEMPTABLE_BOARD_LEN);
#elif TEMP_SENSOR_BOARD_IS_AD595
return TEMP_AD595(raw);
#elif TEMP_SENSOR_BOARD_IS_AD8495
return TEMP_AD8495(raw);
#else
UNUSED(raw);
return 0;
#endif
}
#endif // HAS_TEMP_BOARD
#if HAS_TEMP_REDUNDANT #if HAS_TEMP_REDUNDANT
// For redundant temperature measurement. // For redundant temperature measurement.
celsius_float_t Temperature::analog_to_celsius_redundant(const int16_t raw) { celsius_float_t Temperature::analog_to_celsius_redundant(const int16_t raw) {
#if TEMP_SENSOR_REDUNDANT_IS_CUSTOM #if TEMP_SENSOR_REDUNDANT_IS_CUSTOM
return user_thermistor_to_deg_c(CTI_REDUNDANT, raw); return user_thermistor_to_deg_c(CTI_REDUNDANT, raw);
#elif TEMP_SENSOR_REDUNDANT_IS_MAX_TC && TEMP_SENSOR_REDUNDANT_SOURCE == 0 #elif TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E0)
return TERN(TEMP_SENSOR_REDUNDANT_IS_MAX31865, max31865_0.temperature((uint16_t)raw), raw * 0.25); return TERN(TEMP_SENSOR_REDUNDANT_IS_MAX31865, max31865_0.temperature((uint16_t)raw), raw * 0.25);
#elif TEMP_SENSOR_REDUNDANT_IS_MAX_TC && TEMP_SENSOR_REDUNDANT_SOURCE == 1 #elif TEMP_SENSOR_REDUNDANT_IS_MAX_TC && REDUNDANT_TEMP_MATCH(SOURCE, E1)
return TERN(TEMP_SENSOR_REDUNDANT_IS_MAX31865, max31865_1.temperature((uint16_t)raw), raw * 0.25); return TERN(TEMP_SENSOR_REDUNDANT_IS_MAX31865, max31865_1.temperature((uint16_t)raw), raw * 0.25);
#elif TEMP_SENSOR_REDUNDANT_IS_THERMISTOR #elif TEMP_SENSOR_REDUNDANT_IS_THERMISTOR
SCAN_THERMISTOR_TABLE(TEMPTABLE_REDUNDANT, TEMPTABLE_REDUNDANT_LEN); SCAN_THERMISTOR_TABLE(TEMPTABLE_REDUNDANT, TEMPTABLE_REDUNDANT_LEN);
@ -1983,6 +2025,7 @@ void Temperature::updateTemperaturesFromRawValues() {
TERN_(HAS_TEMP_CHAMBER, temp_chamber.celsius = analog_to_celsius_chamber(temp_chamber.raw)); TERN_(HAS_TEMP_CHAMBER, temp_chamber.celsius = analog_to_celsius_chamber(temp_chamber.raw));
TERN_(HAS_TEMP_COOLER, temp_cooler.celsius = analog_to_celsius_cooler(temp_cooler.raw)); TERN_(HAS_TEMP_COOLER, temp_cooler.celsius = analog_to_celsius_cooler(temp_cooler.raw));
TERN_(HAS_TEMP_PROBE, temp_probe.celsius = analog_to_celsius_probe(temp_probe.raw)); TERN_(HAS_TEMP_PROBE, temp_probe.celsius = analog_to_celsius_probe(temp_probe.raw));
TERN_(HAS_TEMP_BOARD, temp_board.celsius = analog_to_celsius_board(temp_board.raw));
TERN_(HAS_TEMP_REDUNDANT, temp_redundant.celsius = analog_to_celsius_redundant(temp_redundant.raw)); TERN_(HAS_TEMP_REDUNDANT, temp_redundant.celsius = analog_to_celsius_redundant(temp_redundant.raw));
TERN_(FILAMENT_WIDTH_SENSOR, filwidth.update_measured_mm()); TERN_(FILAMENT_WIDTH_SENSOR, filwidth.update_measured_mm());
@ -2030,23 +2073,28 @@ void Temperature::updateTemperaturesFromRawValues() {
#endif // HAS_HOTEND #endif // HAS_HOTEND
#define TP_CMP(S,A,B) (TEMPDIR(S) < 0 ? ((A)<(B)) : ((A)>(B)))
#if ENABLED(THERMAL_PROTECTION_BED) #if ENABLED(THERMAL_PROTECTION_BED)
#define BEDCMP(A,B) (TEMPDIR(BED) < 0 ? ((A)<(B)) : ((A)>(B))) if (TP_CMP(BED, temp_bed.raw, maxtemp_raw_BED)) max_temp_error(H_BED);
if (BEDCMP(temp_bed.raw, maxtemp_raw_BED)) max_temp_error(H_BED); if (temp_bed.target > 0 && TP_CMP(BED, mintemp_raw_BED, temp_bed.raw)) min_temp_error(H_BED);
if (temp_bed.target > 0 && BEDCMP(mintemp_raw_BED, temp_bed.raw)) min_temp_error(H_BED);
#endif #endif
#if BOTH(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER) #if BOTH(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER)
#define CHAMBERCMP(A,B) (TEMPDIR(CHAMBER) < 0 ? ((A)<(B)) : ((A)>(B))) if (TP_CMP(CHAMBER, temp_chamber.raw, maxtemp_raw_CHAMBER)) max_temp_error(H_CHAMBER);
if (CHAMBERCMP(temp_chamber.raw, maxtemp_raw_CHAMBER)) max_temp_error(H_CHAMBER); if (temp_chamber.target > 0 && TP_CMP(CHAMBER, mintemp_raw_CHAMBER, temp_chamber.raw)) min_temp_error(H_CHAMBER);
if (temp_chamber.target > 0 && CHAMBERCMP(mintemp_raw_CHAMBER, temp_chamber.raw)) min_temp_error(H_CHAMBER);
#endif #endif
#if BOTH(HAS_COOLER, THERMAL_PROTECTION_COOLER) #if BOTH(HAS_COOLER, THERMAL_PROTECTION_COOLER)
#define COOLERCMP(A,B) (TEMPDIR(COOLER) < 0 ? ((A)<(B)) : ((A)>(B))) if (cutter.unitPower > 0 && TP_CMP(COOLER, temp_cooler.raw, maxtemp_raw_COOLER)) max_temp_error(H_COOLER);
if (cutter.unitPower > 0 && COOLERCMP(temp_cooler.raw, maxtemp_raw_COOLER)) max_temp_error(H_COOLER); if (TP_CMP(COOLER, mintemp_raw_COOLER, temp_cooler.raw)) min_temp_error(H_COOLER);
if (COOLERCMP(mintemp_raw_COOLER, temp_cooler.raw)) min_temp_error(H_COOLER);
#endif #endif
#if BOTH(HAS_TEMP_BOARD, THERMAL_PROTECTION_BOARD)
if (TP_CMP(BOARD, temp_board.raw, maxtemp_raw_BOARD)) max_temp_error(H_BOARD);
if (TP_CMP(BOARD, mintemp_raw_BOARD, temp_board.raw)) min_temp_error(H_BOARD);
#endif
#undef TP_CMP
} // Temperature::updateTemperaturesFromRawValues } // Temperature::updateTemperaturesFromRawValues
/** /**
@ -2275,6 +2323,9 @@ void Temperature::init() {
#if HAS_TEMP_ADC_PROBE #if HAS_TEMP_ADC_PROBE
HAL_ANALOG_SELECT(TEMP_PROBE_PIN); HAL_ANALOG_SELECT(TEMP_PROBE_PIN);
#endif #endif
#if HAS_TEMP_ADC_BOARD
HAL_ANALOG_SELECT(TEMP_BOARD_PIN);
#endif
#if HAS_TEMP_ADC_REDUNDANT #if HAS_TEMP_ADC_REDUNDANT
HAL_ANALOG_SELECT(TEMP_REDUNDANT_PIN); HAL_ANALOG_SELECT(TEMP_REDUNDANT_PIN);
#endif #endif
@ -2388,6 +2439,7 @@ void Temperature::init() {
#endif #endif
#endif // HAS_HOTEND #endif // HAS_HOTEND
// TODO: combine these into the macros above
#if HAS_HEATED_BED #if HAS_HEATED_BED
while (analog_to_celsius_bed(mintemp_raw_BED) < BED_MINTEMP) mintemp_raw_BED += TEMPDIR(BED) * (OVERSAMPLENR); while (analog_to_celsius_bed(mintemp_raw_BED) < BED_MINTEMP) mintemp_raw_BED += TEMPDIR(BED) * (OVERSAMPLENR);
while (analog_to_celsius_bed(maxtemp_raw_BED) > BED_MAXTEMP) maxtemp_raw_BED -= TEMPDIR(BED) * (OVERSAMPLENR); while (analog_to_celsius_bed(maxtemp_raw_BED) > BED_MAXTEMP) maxtemp_raw_BED -= TEMPDIR(BED) * (OVERSAMPLENR);
@ -2403,15 +2455,22 @@ void Temperature::init() {
while (analog_to_celsius_cooler(maxtemp_raw_COOLER) < COOLER_MAXTEMP) maxtemp_raw_COOLER -= TEMPDIR(COOLER) * (OVERSAMPLENR); while (analog_to_celsius_cooler(maxtemp_raw_COOLER) < COOLER_MAXTEMP) maxtemp_raw_COOLER -= TEMPDIR(COOLER) * (OVERSAMPLENR);
#endif #endif
#if HAS_TEMP_BOARD
while (analog_to_celsius_board(mintemp_raw_BOARD) > BOARD_MINTEMP) mintemp_raw_BOARD += TEMPDIR(BOARD) * (OVERSAMPLENR);
while (analog_to_celsius_board(maxtemp_raw_BOARD) < BOARD_MAXTEMP) maxtemp_raw_BOARD -= TEMPDIR(BOARD) * (OVERSAMPLENR);
#endif
#if HAS_TEMP_REDUNDANT #if HAS_TEMP_REDUNDANT
temp_redundant.target = &( temp_redundant.target = &(
#if TEMP_SENSOR_REDUNDANT_TARGET == -5 && HAS_TEMP_COOLER #if REDUNDANT_TEMP_MATCH(TARGET, COOLER) && HAS_TEMP_COOLER
temp_cooler temp_cooler
#elif TEMP_SENSOR_REDUNDANT_TARGET == -4 && HAS_TEMP_PROBE #elif REDUNDANT_TEMP_MATCH(TARGET, PROBE) && HAS_TEMP_PROBE
temp_probe temp_probe
#elif TEMP_SENSOR_REDUNDANT_TARGET == -2 && HAS_TEMP_CHAMBER #elif REDUNDANT_TEMP_MATCH(TARGET, BOARD) && HAS_TEMP_BOARD
temp_board
#elif REDUNDANT_TEMP_MATCH(TARGET, CHAMBER) && HAS_TEMP_CHAMBER
temp_chamber temp_chamber
#elif TEMP_SENSOR_REDUNDANT_TARGET == -1 && HAS_TEMP_BED #elif REDUNDANT_TEMP_MATCH(TARGET, BED) && HAS_TEMP_BED
temp_bed temp_bed
#else #else
temp_hotend[TEMP_SENSOR_REDUNDANT_TARGET] temp_hotend[TEMP_SENSOR_REDUNDANT_TARGET]
@ -2787,6 +2846,7 @@ void Temperature::disable_all_heaters() {
*/ */
void Temperature::update_raw_temperatures() { void Temperature::update_raw_temperatures() {
// TODO: can this be collapsed into a HOTEND_LOOP()?
#if HAS_TEMP_ADC_0 && !TEMP_SENSOR_0_IS_MAX_TC #if HAS_TEMP_ADC_0 && !TEMP_SENSOR_0_IS_MAX_TC
temp_hotend[0].update(); temp_hotend[0].update();
#endif #endif
@ -2808,6 +2868,7 @@ void Temperature::update_raw_temperatures() {
TERN_(HAS_TEMP_ADC_BED, temp_bed.update()); TERN_(HAS_TEMP_ADC_BED, temp_bed.update());
TERN_(HAS_TEMP_ADC_CHAMBER, temp_chamber.update()); TERN_(HAS_TEMP_ADC_CHAMBER, temp_chamber.update());
TERN_(HAS_TEMP_ADC_PROBE, temp_probe.update()); TERN_(HAS_TEMP_ADC_PROBE, temp_probe.update());
TERN_(HAS_TEMP_ADC_BOARD, temp_board.update());
TERN_(HAS_TEMP_ADC_COOLER, temp_cooler.update()); TERN_(HAS_TEMP_ADC_COOLER, temp_cooler.update());
TERN_(HAS_JOY_ADC_X, joystick.x.update()); TERN_(HAS_JOY_ADC_X, joystick.x.update());
@ -2838,6 +2899,7 @@ void Temperature::readings_ready() {
TERN_(HAS_TEMP_CHAMBER, temp_chamber.reset()); TERN_(HAS_TEMP_CHAMBER, temp_chamber.reset());
TERN_(HAS_TEMP_PROBE, temp_probe.reset()); TERN_(HAS_TEMP_PROBE, temp_probe.reset());
TERN_(HAS_TEMP_COOLER, temp_cooler.reset()); TERN_(HAS_TEMP_COOLER, temp_cooler.reset());
TERN_(HAS_TEMP_BOARD, temp_board.reset());
TERN_(HAS_TEMP_REDUNDANT, temp_redundant.reset()); TERN_(HAS_TEMP_REDUNDANT, temp_redundant.reset());
TERN_(HAS_JOY_ADC_X, joystick.x.reset()); TERN_(HAS_JOY_ADC_X, joystick.x.reset());
@ -3264,6 +3326,11 @@ void Temperature::isr() {
case MeasureTemp_PROBE: ACCUMULATE_ADC(temp_probe); break; case MeasureTemp_PROBE: ACCUMULATE_ADC(temp_probe); break;
#endif #endif
#if HAS_TEMP_ADC_BOARD
case PrepareTemp_BOARD: HAL_START_ADC(TEMP_BOARD_PIN); break;
case MeasureTemp_BOARD: ACCUMULATE_ADC(temp_board); break;
#endif
#if HAS_TEMP_ADC_REDUNDANT #if HAS_TEMP_ADC_REDUNDANT
case PrepareTemp_REDUNDANT: HAL_START_ADC(TEMP_REDUNDANT_PIN); break; case PrepareTemp_REDUNDANT: HAL_START_ADC(TEMP_REDUNDANT_PIN); break;
case MeasureTemp_REDUNDANT: ACCUMULATE_ADC(temp_redundant); break; case MeasureTemp_REDUNDANT: ACCUMULATE_ADC(temp_redundant); break;
@ -3430,6 +3497,9 @@ void Temperature::isr() {
#if HAS_TEMP_COOLER #if HAS_TEMP_COOLER
case H_COOLER: k = 'L'; break; case H_COOLER: k = 'L'; break;
#endif #endif
#if HAS_TEMP_BOARD
case H_BOARD: k = 'M'; break;
#endif
#if HAS_TEMP_REDUNDANT #if HAS_TEMP_REDUNDANT
case H_REDUNDANT: k = 'R'; break; case H_REDUNDANT: k = 'R'; break;
#endif #endif
@ -3459,7 +3529,7 @@ void Temperature::isr() {
OPTARG(HAS_TEMP_REDUNDANT, const bool include_r/*=false*/) OPTARG(HAS_TEMP_REDUNDANT, const bool include_r/*=false*/)
) { ) {
#if HAS_TEMP_HOTEND #if HAS_TEMP_HOTEND
print_heater_state(H_NONE, degHotend(target_extruder), degTargetHotend(target_extruder) OPTARG(SHOW_TEMP_ADC_VALUES, rawHotendTemp(target_extruder))); print_heater_state(H_E0, degHotend(target_extruder), degTargetHotend(target_extruder) OPTARG(SHOW_TEMP_ADC_VALUES, rawHotendTemp(target_extruder)));
#endif #endif
#if HAS_HEATED_BED #if HAS_HEATED_BED
print_heater_state(H_BED, degBed(), degTargetBed() OPTARG(SHOW_TEMP_ADC_VALUES, rawBedTemp())); print_heater_state(H_BED, degBed(), degTargetBed() OPTARG(SHOW_TEMP_ADC_VALUES, rawBedTemp()));
@ -3471,7 +3541,10 @@ void Temperature::isr() {
print_heater_state(H_COOLER, degCooler(), TERN0(HAS_COOLER, degTargetCooler()) OPTARG(SHOW_TEMP_ADC_VALUES, rawCoolerTemp())); print_heater_state(H_COOLER, degCooler(), TERN0(HAS_COOLER, degTargetCooler()) OPTARG(SHOW_TEMP_ADC_VALUES, rawCoolerTemp()));
#endif #endif
#if HAS_TEMP_PROBE #if HAS_TEMP_PROBE
print_heater_state(H_PROBE, degProbe(), 0 OPTARG(SHOW_TEMP_ADC_VALUES, rawProbeTemp()) ); print_heater_state(H_PROBE, degProbe(), 0 OPTARG(SHOW_TEMP_ADC_VALUES, rawProbeTemp()));
#endif
#if HAS_TEMP_BOARD
print_heater_state(H_BOARD, degBoard(), 0 OPTARG(SHOW_TEMP_ADC_VALUES, rawBoardTemp()));
#endif #endif
#if HAS_TEMP_REDUNDANT #if HAS_TEMP_REDUNDANT
if (include_r) print_heater_state(H_REDUNDANT, degRedundant(), degRedundantTarget() OPTARG(SHOW_TEMP_ADC_VALUES, rawRedundantTemp())); if (include_r) print_heater_state(H_REDUNDANT, degRedundant(), degRedundantTarget() OPTARG(SHOW_TEMP_ADC_VALUES, rawRedundantTemp()));

View File

@ -46,9 +46,13 @@
// Element identifiers. Positive values are hotends. Negative values are other heaters or coolers. // Element identifiers. Positive values are hotends. Negative values are other heaters or coolers.
typedef enum : int8_t { typedef enum : int8_t {
H_NONE = -6, H_REDUNDANT = HID_REDUNDANT,
H_COOLER, H_PROBE, H_REDUNDANT, H_CHAMBER, H_BED, H_COOLER = HID_COOLER,
H_E0, H_E1, H_E2, H_E3, H_E4, H_E5, H_E6, H_E7 H_PROBE = HID_PROBE,
H_BOARD = HID_BOARD,
H_CHAMBER = HID_CHAMBER,
H_BED = HID_BED,
H_E0 = HID_E0, H_E1, H_E2, H_E3, H_E4, H_E5, H_E6, H_E7
} heater_id_t; } heater_id_t;
// PID storage // PID storage
@ -105,6 +109,9 @@ enum ADCSensorState : char {
#if HAS_TEMP_ADC_PROBE #if HAS_TEMP_ADC_PROBE
PrepareTemp_PROBE, MeasureTemp_PROBE, PrepareTemp_PROBE, MeasureTemp_PROBE,
#endif #endif
#if HAS_TEMP_ADC_BOARD
PrepareTemp_BOARD, MeasureTemp_BOARD,
#endif
#if HAS_TEMP_ADC_REDUNDANT #if HAS_TEMP_ADC_REDUNDANT
PrepareTemp_REDUNDANT, MeasureTemp_REDUNDANT, PrepareTemp_REDUNDANT, MeasureTemp_REDUNDANT,
#endif #endif
@ -192,7 +199,7 @@ typedef struct TempInfo {
// A redundant temperature sensor // A redundant temperature sensor
typedef struct RedundantTempInfo : public TempInfo { typedef struct RedundantTempInfo : public TempInfo {
temp_info_t* target; temp_info_t* target;
} redundant_temp_info_t; } redundant_info_t;
#endif #endif
// A PWM heater with temperature sensor // A PWM heater with temperature sensor
@ -231,6 +238,9 @@ struct PIDHeaterInfo : public HeaterInfo {
#elif HAS_TEMP_CHAMBER #elif HAS_TEMP_CHAMBER
typedef temp_info_t chamber_info_t; typedef temp_info_t chamber_info_t;
#endif #endif
#if HAS_TEMP_BOARD
typedef temp_info_t board_info_t;
#endif
#if EITHER(HAS_COOLER, HAS_TEMP_COOLER) #if EITHER(HAS_COOLER, HAS_TEMP_COOLER)
typedef heater_info_t cooler_info_t; typedef heater_info_t cooler_info_t;
#endif #endif
@ -312,6 +322,9 @@ typedef struct { int16_t raw_min, raw_max; celsius_t mintemp, maxtemp; } temp_ra
#if TEMP_SENSOR_COOLER_IS_CUSTOM #if TEMP_SENSOR_COOLER_IS_CUSTOM
CTI_COOLER, CTI_COOLER,
#endif #endif
#if TEMP_SENSOR_BOARD_IS_CUSTOM
CTI_BOARD,
#endif
#if TEMP_SENSOR_REDUNDANT_IS_CUSTOM #if TEMP_SENSOR_REDUNDANT_IS_CUSTOM
CTI_REDUNDANT, CTI_REDUNDANT,
#endif #endif
@ -352,8 +365,11 @@ class Temperature {
#if HAS_TEMP_COOLER #if HAS_TEMP_COOLER
static cooler_info_t temp_cooler; static cooler_info_t temp_cooler;
#endif #endif
#if HAS_TEMP_BOARD
static board_info_t temp_board;
#endif
#if HAS_TEMP_REDUNDANT #if HAS_TEMP_REDUNDANT
static redundant_temp_info_t temp_redundant; static redundant_info_t temp_redundant;
#endif #endif
#if ENABLED(AUTO_POWER_E_FANS) #if ENABLED(AUTO_POWER_E_FANS)
@ -478,6 +494,10 @@ class Temperature {
static int16_t mintemp_raw_COOLER, maxtemp_raw_COOLER; static int16_t mintemp_raw_COOLER, maxtemp_raw_COOLER;
#endif #endif
#if HAS_TEMP_BOARD && ENABLED(THERMAL_PROTECTION_BOARD)
static int16_t mintemp_raw_BOARD, maxtemp_raw_BOARD;
#endif
#if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED > 1 #if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED > 1
static uint8_t consecutive_low_temperature_error[HOTENDS]; static uint8_t consecutive_low_temperature_error[HOTENDS];
#endif #endif
@ -551,6 +571,9 @@ class Temperature {
#if HAS_TEMP_COOLER #if HAS_TEMP_COOLER
static celsius_float_t analog_to_celsius_cooler(const int16_t raw); static celsius_float_t analog_to_celsius_cooler(const int16_t raw);
#endif #endif
#if HAS_TEMP_BOARD
static celsius_float_t analog_to_celsius_board(const int16_t raw);
#endif
#if HAS_TEMP_REDUNDANT #if HAS_TEMP_REDUNDANT
static celsius_float_t analog_to_celsius_redundant(const int16_t raw); static celsius_float_t analog_to_celsius_redundant(const int16_t raw);
#endif #endif
@ -787,6 +810,14 @@ class Temperature {
#endif #endif
#endif #endif
#if HAS_TEMP_BOARD
#if ENABLED(SHOW_TEMP_ADC_VALUES)
static inline int16_t rawBoardTemp() { return temp_board.raw; }
#endif
static inline celsius_float_t degBoard() { return temp_board.celsius; }
static inline celsius_t wholeDegBoard() { return static_cast<celsius_t>(degBoard() + 0.5f); }
#endif
#if HAS_TEMP_REDUNDANT #if HAS_TEMP_REDUNDANT
#if ENABLED(SHOW_TEMP_ADC_VALUES) #if ENABLED(SHOW_TEMP_ADC_VALUES)
static inline int16_t rawRedundantTemp() { return temp_redundant.raw; } static inline int16_t rawRedundantTemp() { return temp_redundant.raw; }

View File

@ -51,6 +51,7 @@
|| TEMP_SENSOR_IS(n, CHAMBER) \ || TEMP_SENSOR_IS(n, CHAMBER) \
|| TEMP_SENSOR_IS(n, COOLER) \ || TEMP_SENSOR_IS(n, COOLER) \
|| TEMP_SENSOR_IS(n, PROBE) \ || TEMP_SENSOR_IS(n, PROBE) \
|| TEMP_SENSOR_IS(n, BOARD) \
|| TEMP_SENSOR_IS(n, REDUNDANT) ) || TEMP_SENSOR_IS(n, REDUNDANT) )
typedef struct { int16_t value; celsius_t celsius; } temp_entry_t; typedef struct { int16_t value; celsius_t celsius; } temp_entry_t;
@ -305,6 +306,13 @@ typedef struct { int16_t value; celsius_t celsius; } temp_entry_t;
#define TEMPTABLE_PROBE_LEN 0 #define TEMPTABLE_PROBE_LEN 0
#endif #endif
#if TEMP_SENSOR_BOARD > 0
#define TEMPTABLE_BOARD TT_NAME(TEMP_SENSOR_BOARD)
#define TEMPTABLE_BOARD_LEN COUNT(TEMPTABLE_BOARD)
#else
#define TEMPTABLE_BOARD_LEN 0
#endif
#if TEMP_SENSOR_REDUNDANT > 0 #if TEMP_SENSOR_REDUNDANT > 0
#define TEMPTABLE_REDUNDANT TT_NAME(TEMP_SENSOR_REDUNDANT) #define TEMPTABLE_REDUNDANT TT_NAME(TEMP_SENSOR_REDUNDANT)
#define TEMPTABLE_REDUNDANT_LEN COUNT(TEMPTABLE_REDUNDANT) #define TEMPTABLE_REDUNDANT_LEN COUNT(TEMPTABLE_REDUNDANT)
@ -319,6 +327,7 @@ static_assert(255 > TEMPTABLE_0_LEN || 255 > TEMPTABLE_1_LEN || 255 > TEMPTABLE_
|| 255 > TEMPTABLE_CHAMBER_LEN || 255 > TEMPTABLE_CHAMBER_LEN
|| 255 > TEMPTABLE_COOLER_LEN || 255 > TEMPTABLE_COOLER_LEN
|| 255 > TEMPTABLE_PROBE_LEN || 255 > TEMPTABLE_PROBE_LEN
|| 255 > TEMPTABLE_BOARD_LEN
|| 255 > TEMPTABLE_REDUNDANT_LEN || 255 > TEMPTABLE_REDUNDANT_LEN
, "Temperature conversion tables over 255 entries need special consideration." , "Temperature conversion tables over 255 entries need special consideration."
); );
@ -513,6 +522,15 @@ static_assert(255 > TEMPTABLE_0_LEN || 255 > TEMPTABLE_1_LEN || 255 > TEMPTABLE_
#define TEMP_SENSOR_PROBE_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE #define TEMP_SENSOR_PROBE_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
#endif #endif
#endif #endif
#ifndef TEMP_SENSOR_BOARD_RAW_HI_TEMP
#if TT_REVRAW(BOARD)
#define TEMP_SENSOR_BOARD_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE
#define TEMP_SENSOR_BOARD_RAW_LO_TEMP 0
#else
#define TEMP_SENSOR_BOARD_RAW_HI_TEMP 0
#define TEMP_SENSOR_BOARD_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE
#endif
#endif
#ifndef TEMP_SENSOR_REDUNDANT_RAW_HI_TEMP #ifndef TEMP_SENSOR_REDUNDANT_RAW_HI_TEMP
#if TT_REVRAW(REDUNDANT) #if TT_REVRAW(REDUNDANT)
#define TEMP_SENSOR_REDUNDANT_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE #define TEMP_SENSOR_REDUNDANT_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE

View File

@ -65,7 +65,7 @@
#define TEMP_BED_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_BED_PIN #define TEMP_BED_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_BED_PIN
#endif #endif
#if HOTENDS == 1 && TEMP_SENSOR_REDUNDANT_SOURCE != 1 #if HOTENDS == 1 && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
#if TEMP_SENSOR_PROBE #if TEMP_SENSOR_PROBE
#define TEMP_PROBE_PIN TEMP_1_PIN #define TEMP_PROBE_PIN TEMP_1_PIN
#elif TEMP_SENSOR_CHAMBER #elif TEMP_SENSOR_CHAMBER

View File

@ -165,8 +165,8 @@
// //
#define TEMP_0_PIN P0_24 #define TEMP_0_PIN P0_24
#define TEMP_1_PIN P0_23 #define TEMP_1_PIN P0_23
//#define TEMP_2_PIN P1_30 // Onboard thermistor
#define TEMP_BED_PIN P0_25 #define TEMP_BED_PIN P0_25
#define TEMP_BOARD_PIN P1_30 // Onboard thermistor, NTC100K
// //
// Heaters / Fans // Heaters / Fans

View File

@ -114,10 +114,11 @@
// //
// Temperature Sensors // Temperature Sensors
// //
#define TEMP_0_PIN 0 // Analog Input #define TEMP_0_PIN 0 // Analog Input, Header J2
#define TEMP_1_PIN 1 // Analog Input #define TEMP_1_PIN 1 // Analog Input, Header J3
#define TEMP_BED_PIN 2 // Analog Input #define TEMP_BOARD_PIN TEMP_1_PIN // Analog Input, Header J3
#define TEMP_PROBE_PIN 3 // Analog Input #define TEMP_BED_PIN 2 // Analog Input, Header J6
#define TEMP_PROBE_PIN 3 // Analog Input, Header J15
// //
// Heaters / Fans // Heaters / Fans

View File

@ -68,8 +68,8 @@
// //
#define TEMP_0_PIN 0 // Analog Input (HOTEND0 thermistor) #define TEMP_0_PIN 0 // Analog Input (HOTEND0 thermistor)
#define TEMP_1_PIN 2 // Analog Input (unused) #define TEMP_1_PIN 2 // Analog Input (unused)
#define TEMP_2_PIN 5 // Analog Input (OnBoard thermistor beta 3950)
#define TEMP_BED_PIN 1 // Analog Input (BED thermistor) #define TEMP_BED_PIN 1 // Analog Input (BED thermistor)
#define TEMP_BOARD_PIN 5 // Analog Input (OnBoard thermistor beta 3950)
// SPI for MAX Thermocouple // SPI for MAX Thermocouple
#if DISABLED(SDSUPPORT) #if DISABLED(SDSUPPORT)

View File

@ -161,6 +161,7 @@
// //
#define TEMP_0_PIN PA2 // T0 <-> E0 #define TEMP_0_PIN PA2 // T0 <-> E0
#define TEMP_1_PIN PA0 // T1 <-> E1 #define TEMP_1_PIN PA0 // T1 <-> E1
#define TEMP_BOARD_PIN TEMP_1_PIN // Onboard sensor shared with T1
#define TEMP_BED_PIN PA1 // T2 <-> Bed #define TEMP_BED_PIN PA1 // T2 <-> Bed
#define TEMP_PROBE_PIN PC3 // Shares J4 connector with PD1 #define TEMP_PROBE_PIN PC3 // Shares J4 connector with PD1