From b531e4cde315cb045841c9a82a51b95f8c991b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Thu, 10 Dec 2020 18:19:36 +0100 Subject: [PATCH] application: add tube temperature --- application.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/application.c b/application.c index c5f8dc1..6270d6b 100644 --- a/application.c +++ b/application.c @@ -389,18 +389,16 @@ static float bed_bothalf_temperature(void) /** read bed tube temperature * @return temperature in °C */ -/* static float bed_tube_temperature(void) { const uint16_t measurement = sensor_max1247_read(3); // read measured value from corresponding thermistor // convert to °C - // calibrated using a DS18B20 (accuracy = +- 0.5°C), with 12-bit precision - // 19.312 °C = 564 + // calibrated using a TP101 with 0.1 °C precision (unknown accuracy but is on par with DS18B20) + // 557 = 19.5 °C, 3221 = 100.9 °C - return measurement * 0.0270798 + 4.38946; + return measurement * 0.0305556 + 2.48056; } -*/ /** read heat sink temperature * @return temperature in °C @@ -1209,8 +1207,9 @@ void main(void) const float heatsink_temp = bed_heatsink_temperature(); const float top_temp = bed_tophalf_temperature(); const float bot_temp = bed_bothalf_temperature(); + const float tube_temp = bed_tube_temperature(); // read bed temperatures - printf("bed: top=%u %.2f, bottom=%u %.02f, sink=%u %.02f, tube=%u; 393-A=%u; 339-3=%u\n",sensor_max1247_read(0), top_temp, sensor_max1247_read(1), bot_temp, sensor_max1247_read(2), heatsink_temp, sensor_max1247_read(3), gpio_get(GPIO_PORT(BED_PIN_393A), GPIO_PIN(BED_PIN_393A)) ? 1 : 0, gpio_get(GPIO_PORT(BED_PIN_3393), GPIO_PIN(BED_PIN_3393)) ? 1 : 0); + printf("bed: top=%u %.2f, bottom=%u %.02f, sink=%u %.02f, tube=%u %.02f; 393-A=%u; 339-3=%u\n",sensor_max1247_read(0), top_temp, sensor_max1247_read(1), bot_temp, sensor_max1247_read(2), heatsink_temp, sensor_max1247_read(3), tube_temp, gpio_get(GPIO_PORT(BED_PIN_393A), GPIO_PIN(BED_PIN_393A)) ? 1 : 0, gpio_get(GPIO_PORT(BED_PIN_3393), GPIO_PIN(BED_PIN_3393)) ? 1 : 0); printf("lid: %.04f °C\n", lid_temp); if (ds18b20_present) { const float temp = sensor_ds18b20_temperature(0); // get temperature