Skip to content

Commit fdd2a52

Browse files
✨ TEMP_SENSOR_SOC (#25642)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
1 parent a2c0cc0 commit fdd2a52

22 files changed

+589
-103
lines changed

Marlin/Configuration.h

+77-68
Original file line numberDiff line numberDiff line change
@@ -432,78 +432,67 @@
432432
// @section temperature
433433

434434
/**
435-
* --NORMAL IS 4.7kΩ PULLUP!-- 1kΩ pullup can be used on hotend sensor, using correct resistor and table
435+
* Temperature Sensors:
436436
*
437-
* Temperature sensors available:
438-
*
439-
* SPI RTD/Thermocouple Boards - IMPORTANT: Read the NOTE below!
440-
* -------
441-
* -5 : MAX31865 with Pt100/Pt1000, 2, 3, or 4-wire (only for sensors 0-1)
442-
* NOTE: You must uncomment/set the MAX31865_*_OHMS_n defines below.
443-
* -3 : MAX31855 with Thermocouple, -200°C to +700°C (only for sensors 0-1)
444-
* -2 : MAX6675 with Thermocouple, 0°C to +700°C (only for sensors 0-1)
445-
*
446-
* NOTE: Ensure TEMP_n_CS_PIN is set in your pins file for each TEMP_SENSOR_n using an SPI Thermocouple. By default,
447-
* Hardware SPI on the default serial bus is used. If you have also set TEMP_n_SCK_PIN and TEMP_n_MISO_PIN,
448-
* Software SPI will be used on those ports instead. You can force Hardware SPI on the default bus in the
449-
* Configuration_adv.h file. At this time, separate Hardware SPI buses for sensors are not supported.
450-
*
451-
* Analog Themocouple Boards
452-
* -------
453-
* -4 : AD8495 with Thermocouple
454-
* -1 : AD595 with Thermocouple
437+
* NORMAL IS 4.7kΩ PULLUP! Hotend sensors can use 1kΩ pullup with correct resistor and table.
455438
*
439+
* ================================================================
456440
* Analog Thermistors - 4.7kΩ pullup - Normal
457-
* -------
458-
* 1 : 100kΩ EPCOS - Best choice for EPCOS thermistors
459-
* 331 : 100kΩ Same as #1, but 3.3V scaled for MEGA
460-
* 332 : 100kΩ Same as #1, but 3.3V scaled for DUE
461-
* 2 : 200kΩ ATC Semitec 204GT-2
462-
* 202 : 200kΩ Copymaster 3D
463-
* 3 : ???Ω Mendel-parts thermistor
464-
* 4 : 10kΩ Generic Thermistor !! DO NOT use for a hotend - it gives bad resolution at high temp. !!
465-
* 5 : 100kΩ ATC Semitec 104GT-2/104NT-4-R025H42G - Used in ParCan, J-Head, and E3D, SliceEngineering 300°C
466-
* 501 : 100kΩ Zonestar - Tronxy X3A
467-
* 502 : 100kΩ Zonestar - used by hot bed in Zonestar Průša P802M
468-
* 503 : 100kΩ Zonestar (Z8XM2) Heated Bed thermistor
469-
* 504 : 100kΩ Zonestar P802QR2 (Part# QWG-104F-B3950) Hotend Thermistor
470-
* 505 : 100kΩ Zonestar P802QR2 (Part# QWG-104F-3950) Bed Thermistor
471-
* 512 : 100kΩ RPW-Ultra hotend
472-
* 6 : 100kΩ EPCOS - Not as accurate as table #1 (created using a fluke thermocouple)
473-
* 7 : 100kΩ Honeywell 135-104LAG-J01
474-
* 71 : 100kΩ Honeywell 135-104LAF-J01
475-
* 8 : 100kΩ Vishay 0603 SMD NTCS0603E3104FXT
476-
* 9 : 100kΩ GE Sensing AL03006-58.2K-97-G1
477-
* 10 : 100kΩ RS PRO 198-961
478-
* 11 : 100kΩ Keenovo AC silicone mats, most Wanhao i3 machines - beta 3950, 1%
479-
* 12 : 100kΩ Vishay 0603 SMD NTCS0603E3104FXT (#8) - calibrated for Makibox hot bed
480-
* 13 : 100kΩ Hisens up to 300°C - for "Simple ONE" & "All In ONE" hotend - beta 3950, 1%
481-
* 15 : 100kΩ Calibrated for JGAurora A5 hotend
482-
* 18 : 200kΩ ATC Semitec 204GT-2 Dagoma.Fr - MKS_Base_DKU001327
483-
* 22 : 100kΩ GTM32 Pro vB - hotend - 4.7kΩ pullup to 3.3V and 220Ω to analog input
484-
* 23 : 100kΩ GTM32 Pro vB - bed - 4.7kΩ pullup to 3.3v and 220Ω to analog input
485-
* 30 : 100kΩ Kis3d Silicone heating mat 200W/300W with 6mm precision cast plate (EN AW 5083) NTC100K - beta 3950
486-
* 60 : 100kΩ Maker's Tool Works Kapton Bed Thermistor - beta 3950
487-
* 61 : 100kΩ Formbot/Vivedino 350°C Thermistor - beta 3950
488-
* 66 : 4.7MΩ Dyze Design / Trianglelab T-D500 500°C High Temperature Thermistor
489-
* 67 : 500kΩ SliceEngineering 450°C Thermistor
490-
* 68 : PT100 amplifier board from Dyze Design
491-
* 70 : 100kΩ bq Hephestos 2
492-
* 75 : 100kΩ Generic Silicon Heat Pad with NTC100K MGB18-104F39050L32
493-
* 2000 : 100kΩ Ultimachine Rambo TDK NTCG104LH104KT1 NTC100K motherboard Thermistor
494-
*
495-
* Analog Thermistors - 1kΩ pullup - Atypical, and requires changing out the 4.7kΩ pullup for 1kΩ.
496-
* ------- (but gives greater accuracy and more stable PID)
497-
* 51 : 100kΩ EPCOS (1kΩ pullup)
498-
* 52 : 200kΩ ATC Semitec 204GT-2 (1kΩ pullup)
499-
* 55 : 100kΩ ATC Semitec 104GT-2 - Used in ParCan & J-Head (1kΩ pullup)
500-
*
441+
* ================================================================
442+
* 1 : 100kΩ EPCOS - Best choice for EPCOS thermistors
443+
* 331 : 100kΩ Same as #1, but 3.3V scaled for MEGA
444+
* 332 : 100kΩ Same as #1, but 3.3V scaled for DUE
445+
* 2 : 200kΩ ATC Semitec 204GT-2
446+
* 202 : 200kΩ Copymaster 3D
447+
* 3 : ???Ω Mendel-parts thermistor
448+
* 4 : 10kΩ Generic Thermistor !! DO NOT use for a hotend - it gives bad resolution at high temp. !!
449+
* 5 : 100kΩ ATC Semitec 104GT-2/104NT-4-R025H42G - Used in ParCan, J-Head, and E3D, SliceEngineering 300°C
450+
* 501 : 100kΩ Zonestar - Tronxy X3A
451+
* 502 : 100kΩ Zonestar - used by hot bed in Zonestar Průša P802M
452+
* 503 : 100kΩ Zonestar (Z8XM2) Heated Bed thermistor
453+
* 504 : 100kΩ Zonestar P802QR2 (Part# QWG-104F-B3950) Hotend Thermistor
454+
* 505 : 100kΩ Zonestar P802QR2 (Part# QWG-104F-3950) Bed Thermistor
455+
* 512 : 100kΩ RPW-Ultra hotend
456+
* 6 : 100kΩ EPCOS - Not as accurate as table #1 (created using a fluke thermocouple)
457+
* 7 : 100kΩ Honeywell 135-104LAG-J01
458+
* 71 : 100kΩ Honeywell 135-104LAF-J01
459+
* 8 : 100kΩ Vishay 0603 SMD NTCS0603E3104FXT
460+
* 9 : 100kΩ GE Sensing AL03006-58.2K-97-G1
461+
* 10 : 100kΩ RS PRO 198-961
462+
* 11 : 100kΩ Keenovo AC silicone mats, most Wanhao i3 machines - beta 3950, 1%
463+
* 12 : 100kΩ Vishay 0603 SMD NTCS0603E3104FXT (#8) - calibrated for Makibox hot bed
464+
* 13 : 100kΩ Hisens up to 300°C - for "Simple ONE" & "All In ONE" hotend - beta 3950, 1%
465+
* 15 : 100kΩ Calibrated for JGAurora A5 hotend
466+
* 18 : 200kΩ ATC Semitec 204GT-2 Dagoma.Fr - MKS_Base_DKU001327
467+
* 22 : 100kΩ GTM32 Pro vB - hotend - 4.7kΩ pullup to 3.3V and 220Ω to analog input
468+
* 23 : 100kΩ GTM32 Pro vB - bed - 4.7kΩ pullup to 3.3v and 220Ω to analog input
469+
* 30 : 100kΩ Kis3d Silicone heating mat 200W/300W with 6mm precision cast plate (EN AW 5083) NTC100K - beta 3950
470+
* 60 : 100kΩ Maker's Tool Works Kapton Bed Thermistor - beta 3950
471+
* 61 : 100kΩ Formbot/Vivedino 350°C Thermistor - beta 3950
472+
* 66 : 4.7MΩ Dyze Design / Trianglelab T-D500 500°C High Temperature Thermistor
473+
* 67 : 500kΩ SliceEngineering 450°C Thermistor
474+
* 68 : PT100 Smplifier board from Dyze Design
475+
* 70 : 100kΩ bq Hephestos 2
476+
* 75 : 100kΩ Generic Silicon Heat Pad with NTC100K MGB18-104F39050L32
477+
* 2000 : 100kΩ Ultimachine Rambo TDK NTCG104LH104KT1 NTC100K motherboard Thermistor
478+
*
479+
* ================================================================
480+
* Analog Thermistors - 1kΩ pullup
481+
* Atypical, and requires changing out the 4.7kΩ pullup for 1kΩ.
482+
* (but gives greater accuracy and more stable PID)
483+
* ================================================================
484+
* 51 : 100kΩ EPCOS (1kΩ pullup)
485+
* 52 : 200kΩ ATC Semitec 204GT-2 (1kΩ pullup)
486+
* 55 : 100kΩ ATC Semitec 104GT-2 - Used in ParCan & J-Head (1kΩ pullup)
487+
*
488+
* ================================================================
501489
* Analog Thermistors - 10kΩ pullup - Atypical
502-
* -------
503-
* 99 : 100kΩ Found on some Wanhao i3 machines with a 10kΩ pull-up resistor
490+
* ================================================================
491+
* 99 : 100kΩ Found on some Wanhao i3 machines with a 10kΩ pull-up resistor
504492
*
493+
* ================================================================
505494
* Analog RTDs (Pt100/Pt1000)
506-
* -------
495+
* ================================================================
507496
* 110 : Pt100 with 1kΩ pullup (atypical)
508497
* 147 : Pt100 with 4.7kΩ pullup
509498
* 1010 : Pt1000 with 1kΩ pullup (atypical)
@@ -515,15 +504,34 @@
515504
* NOTE: ADC pins are not 5V tolerant. Not recommended because it's possible to damage the CPU by going over 500°C.
516505
* 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
517506
*
507+
* ================================================================
508+
* SPI RTD/Thermocouple Boards
509+
* ================================================================
510+
* -5 : MAX31865 with Pt100/Pt1000, 2, 3, or 4-wire (only for sensors 0-1)
511+
* NOTE: You must uncomment/set the MAX31865_*_OHMS_n defines below.
512+
* -3 : MAX31855 with Thermocouple, -200°C to +700°C (only for sensors 0-1)
513+
* -2 : MAX6675 with Thermocouple, 0°C to +700°C (only for sensors 0-1)
514+
*
515+
* NOTE: Ensure TEMP_n_CS_PIN is set in your pins file for each TEMP_SENSOR_n using an SPI Thermocouple. By default,
516+
* Hardware SPI on the default serial bus is used. If you have also set TEMP_n_SCK_PIN and TEMP_n_MISO_PIN,
517+
* Software SPI will be used on those ports instead. You can force Hardware SPI on the default bus in the
518+
* Configuration_adv.h file. At this time, separate Hardware SPI buses for sensors are not supported.
519+
*
520+
* ================================================================
521+
* Analog Thermocouple Boards
522+
* ================================================================
523+
* -4 : AD8495 with Thermocouple
524+
* -1 : AD595 with Thermocouple
525+
*
526+
* ================================================================
518527
* Custom/Dummy/Other Thermal Sensors
519-
* ------
528+
* ================================================================
520529
* 0 : not used
521530
* 1000 : Custom - Specify parameters in Configuration_adv.h
522531
*
523532
* !!! Use these for Testing or Development purposes. NEVER for production machine. !!!
524533
* 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below.
525534
* 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below.
526-
*
527535
*/
528536
#define TEMP_SENSOR_0 1
529537
#define TEMP_SENSOR_1 0
@@ -538,6 +546,7 @@
538546
#define TEMP_SENSOR_CHAMBER 0
539547
#define TEMP_SENSOR_COOLER 0
540548
#define TEMP_SENSOR_BOARD 0
549+
#define TEMP_SENSOR_SOC 0
541550
#define TEMP_SENSOR_REDUNDANT 0
542551

543552
// Dummy thermistor constant temperature readings, for use with 998 and 999

Marlin/Configuration_adv.h

+12-3
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,15 @@
276276
#define THERMAL_PROTECTION_BOARD // Halt the printer if the board sensor leaves the temp range below.
277277
#define BOARD_MINTEMP 8 // (°C)
278278
#define BOARD_MAXTEMP 70 // (°C)
279-
#ifndef TEMP_BOARD_PIN
280-
//#define TEMP_BOARD_PIN -1 // Board temp sensor pin, if not set in pins file.
281-
#endif
279+
//#define TEMP_BOARD_PIN -1 // Board temp sensor pin override.
280+
#endif
281+
282+
//
283+
// SoC Sensor options
284+
//
285+
#if TEMP_SENSOR_SOC
286+
#define THERMAL_PROTECTION_SOC // Halt the printer if the SoC sensor leaves the temp range below.
287+
#define SOC_MAXTEMP 85 // (°C)
282288
#endif
283289

284290
/**
@@ -579,6 +585,9 @@
579585
// Use TEMP_SENSOR_BOARD as a trigger for enabling the controller fan
580586
//#define CONTROLLER_FAN_MIN_BOARD_TEMP 40 // (°C) Turn on the fan if the board reaches this temperature
581587

588+
// Use TEMP_SENSOR_SOC as a trigger for enabling the controller fan
589+
//#define CONTROLLER_FAN_MIN_SOC_TEMP 40 // (°C) Turn on the fan if the SoC reaches this temperature
590+
582591
//#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings
583592
#if ENABLED(CONTROLLER_FAN_EDITABLE)
584593
#define CONTROLLER_FAN_MENU // Enable the Controller Fan submenu

Marlin/src/HAL/STM32/HAL.h

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "../shared/Marduino.h"
2929
#include "../shared/math_32bit.h"
3030
#include "../shared/HAL_SPI.h"
31+
#include "temp_soc.h"
3132
#include "fastio.h"
3233
#include "Servo.h"
3334
#include "MarlinSerial.h"

Marlin/src/HAL/STM32/inc/SanityCheck.h

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
#error "TFT_COLOR_UI, TFT_LVGL_UI and TFT_CLASSIC_UI are currently only supported on STM32H7, STM32F4 and STM32F1 hardware."
5252
#endif
5353

54+
#if TEMP_SENSOR_SOC && defined(ATEMP) && TEMP_SOC_PIN != ATEMP
55+
#error "TEMP_SENSOR_SOC requires 'TEMP_SOC_PIN ATEMP' on STM32."
56+
#endif
57+
5458
/**
5559
* Check for common serial pin conflicts
5660
*/

0 commit comments

Comments
 (0)