-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Support for bed MAX31865 on esp32 #27610
Comments
This is just config options that are not in standard config files. and I added a sanity check diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 6d5ae49de8..f7ae53b1fd 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -599,6 +599,10 @@
#define MAX31865_SENSOR_OHMS_2 100
#define MAX31865_CALIBRATION_OHMS_2 430
#endif
+#if TEMP_SENSOR_IS_MAX_TC(BED)
+ #define MAX31865_SENSOR_OHMS_BED 100
+ #define MAX31865_CALIBRATION_OHMS_BED 430
+#endif
#if HAS_E_TEMP_SENSOR
#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 806bafa2d0..99437183d2 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -174,9 +174,10 @@
* Thermocouple Options — for MAX6675 (-2), MAX31855 (-3), and MAX31865 (-5).
*/
//#define TEMP_SENSOR_FORCE_HW_SPI // Ignore SCK/MOSI/MISO pins; use CS and the default SPI bus.
-//#define MAX31865_SENSOR_WIRES_0 2 // (2-4) Number of wires for the probe connected to a MAX31865 board.
-//#define MAX31865_SENSOR_WIRES_1 2
-//#define MAX31865_SENSOR_WIRES_2 2
+//#define MAX31865_SENSOR_WIRES_0 2 // (2-4) Number of wires for the probe connected to a MAX31865 board.
+//#define MAX31865_SENSOR_WIRES_1 2
+//#define MAX31865_SENSOR_WIRES_2 2
+//#define MAX31865_SENSOR_WIRES_BED 2
//#define MAX31865_50HZ_FILTER // Use a 50Hz filter instead of the default 60Hz.
//#define MAX31865_USE_READ_ERROR_DETECTION // Treat value spikes (20°C delta in under 1s) as read errors.
@@ -188,6 +189,7 @@
//#define MAX31865_WIRE_OHMS_0 0.95f // For 2-wire, set the wire resistances for more accurate readings.
//#define MAX31865_WIRE_OHMS_1 0.0f
//#define MAX31865_WIRE_OHMS_2 0.0f
+//#define MAX31865_WIRE_OHMS_BED 0.0f
/**
* Hephestos 2 24V heated bed upgrade kit.
diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h
index 9c21c4fd29..b7edc34ade 100644
--- a/Marlin/src/inc/SanityCheck.h
+++ b/Marlin/src/inc/SanityCheck.h
@@ -2121,6 +2121,13 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#error "MAX31865_SENSOR_OHMS_2 and MAX31865_CALIBRATION_OHMS_2 must be set if TEMP_SENSOR_2/TEMP_SENSOR_REDUNDANT is MAX31865."
#endif
#endif
+#if TEMP_SENSOR_BED_IS_MAX31865
+ #if !defined(MAX31865_SENSOR_WIRES_BED) || !WITHIN(MAX31865_SENSOR_WIRES_BED, 2, 4)
+ #error "MAX31865_SENSOR_WIRES_BED must be defined as an integer between 2 and 4."
+ #elif !defined(MAX31865_SENSOR_OHMS_BED) || !defined(MAX31865_CALIBRATION_OHMS_BED)
+ #error "MAX31865_SENSOR_OHMS_BED and MAX31865_CALIBRATION_OHMS_BED must be set if TEMP_SENSOR_BED is MAX31865."
+ #endif
+#endif
/**
* Redundant temperature sensor config |
related PR #27511 |
PR created to add this to marlin. |
Thank you, but for my motherboard (MKS tinybee, an esp32-based board), even after adding everything according to your instructions, I get the following error:
but while that compiles, the printer does not respond to commands if the bed temp sensor is defined as the max31865. |
Is a esp32 specific issue diff --git a/Marlin/src/HAL/shared/Delay.h b/Marlin/src/HAL/shared/Delay.h
index a6795a78ea..4751d7a5e2 100644
--- a/Marlin/src/HAL/shared/Delay.h
+++ b/Marlin/src/HAL/shared/Delay.h
@@ -174,6 +174,9 @@ void calibrate_delay_loop();
// Delay in microseconds
#define DELAY_US(x) DELAY_CYCLES((x) * ((F_CPU) / 1000000UL))
+
+ #define DELAY_CYCLES_VAR DELAY_CYCLES
+
#else
#error "Unsupported MCU architecture"
The PR has been updated as for not working... that is beyond me. (I don't have access to MAX31865 module) |
please attach your config files. and any other edited files |
add #define DEBUG_MAX31865 to Configuration.h |
Please test the |
Apologies for late response, ran into some issues. The bugfix-2.1.x branch results in same behaviour: printer connects but does not communicate. Here are my configuration files and changed source from the 2.1.2.5 branch. I'm not sure I got everything but hope I did: the code with AlexB in the comments was code that I changed. The changes not related to the bed max31865 include an additional of serial3 to allow the TFT screen to communicate with the printer, and I also inverted the behaviour of a fan pin to accommodate the CPAP fan. Please let me know if any other details are needed. One (possible) issue I see with the code is that I'm currently using the pins on the exp2 connection of the mainboard. The max31865 version I have is a stepstick variant on a breadboard. I tried using it directly in the slot for the unused E1 stepstick but got the same results. The MKS tinybee does not seem to support SPI mode for the steppers due to I think low pin count, so I thought maybe using the unused exp2 connection could be an alternative. |
Please let me know if anything else is needed. |
Is your feature request related to a problem? Please describe.
The Marlin documentation claims support for a bed max31865 module. Such support does not exist however, and I was hoping to see it happen.
Are you looking for hardware support?
Fully custom cartesian printer, MKS Tinybee motherboard, max31865 module for bed support.
Describe the feature you want
Support for max31865 for the bed.
Additional context
Although the comments in Marlin code claim support exists, it does not seem to. Setting #define TEMP_SENSOR_BED -5 leads to errors, upon fixing which I get more errors. Hoping to see actual support added.
The text was updated successfully, but these errors were encountered: