Skip to content
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

Add PT100 on MCU's with 3.3v excitation temptable #16731

Merged
merged 4 commits into from
Jan 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@
* 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
* 15 : 100k thermistor calibration for JGAurora A5 hotend
* 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
* 20 : Pt100 with circuit in the Ultimainboard V2.x
* 20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR)
* 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....)
* 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
* 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
* 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/lcd/thermistornames.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
#elif THERMISTOR_ID == 18
#define THERMISTOR_NAME "ATC Semitec 204GT-2"
#elif THERMISTOR_ID == 20
#define THERMISTOR_NAME "Pt100 UltiMB"
#define THERMISTOR_NAME "Pt100 UltiMB 5v"
#elif THERMISTOR_ID == 21
#define THERMISTOR_NAME "Pt100 UltiMB 3.3v"
#elif THERMISTOR_ID == 201
#define THERMISTOR_NAME "Pt100 OverLord"
#elif THERMISTOR_ID == 60
Expand Down
77 changes: 77 additions & 0 deletions Marlin/src/module/thermistor/thermistor_21.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

#define REVERSE_TEMP_SENSOR_RANGE

#undef OV_SCALE
#define OV_SCALE(N) (float((N) * 5) / 3.3f)

// Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics"
const short temptable_21[][2] PROGMEM = {
{ OV( 0), 0 },
{ OV(227), 1 },
{ OV(236), 10 },
{ OV(245), 20 },
{ OV(253), 30 },
{ OV(262), 40 },
{ OV(270), 50 },
{ OV(279), 60 },
{ OV(287), 70 },
{ OV(295), 80 },
{ OV(304), 90 },
{ OV(312), 100 },
{ OV(320), 110 },
{ OV(329), 120 },
{ OV(337), 130 },
{ OV(345), 140 },
{ OV(353), 150 },
{ OV(361), 160 },
{ OV(369), 170 },
{ OV(377), 180 },
{ OV(385), 190 },
{ OV(393), 200 },
{ OV(401), 210 },
{ OV(409), 220 },
{ OV(417), 230 },
{ OV(424), 240 },
{ OV(432), 250 },
{ OV(440), 260 },
{ OV(447), 270 },
{ OV(455), 280 },
{ OV(463), 290 },
{ OV(470), 300 },
{ OV(478), 310 },
{ OV(485), 320 },
{ OV(493), 330 },
{ OV(500), 340 },
{ OV(507), 350 },
{ OV(515), 360 },
{ OV(522), 370 },
{ OV(529), 380 },
{ OV(537), 390 },
{ OV(544), 400 },
{ OV(614), 500 }
};

#undef OV_SCALE
#define OV_SCALE(N) (N)
6 changes: 5 additions & 1 deletion Marlin/src/module/thermistor/thermistors.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
#error "MAX_RAW_THERMISTOR_VALUE is too large for int16_t. Reduce OVERSAMPLENR or HAL_ADC_RESOLUTION."
#endif

#define OV(N) int16_t((N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE))
#define OV_SCALE(N) (N)
#define OV(N) int16_t(OV_SCALE(N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE))

#define ANY_THERMISTOR_IS(n) (THERMISTOR_HEATER_0 == n || THERMISTOR_HEATER_1 == n || THERMISTOR_HEATER_2 == n || THERMISTOR_HEATER_3 == n || THERMISTOR_HEATER_4 == n || THERMISTOR_HEATER_5 == n || THERMISTOR_HEATER_6 == n || THERMISTOR_HEATER_7 == n || THERMISTORBED == n || THERMISTORCHAMBER == n || THERMISTORPROBE == n)

Expand Down Expand Up @@ -105,6 +106,9 @@
#if ANY_THERMISTOR_IS(20) // Pt100 with INA826 amp on Ultimaker v2.0 electronics
#include "thermistor_20.h"
#endif
#if ANY_THERMISTOR_IS(21) // Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics"
#include "thermistor_21.h"
#endif
#if ANY_THERMISTOR_IS(51) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "EPCOS"
#include "thermistor_51.h"
#endif
Expand Down