From d8f7d660b8081c70d2b38f74710559017b9324c4 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Mon, 23 Dec 2019 13:33:17 +1100 Subject: [PATCH] Rough ts80 tuning --- workspace/TS100/Core/Src/TipThermoModel.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/workspace/TS100/Core/Src/TipThermoModel.cpp b/workspace/TS100/Core/Src/TipThermoModel.cpp index 4db3c24d..a56bcf66 100644 --- a/workspace/TS100/Core/Src/TipThermoModel.cpp +++ b/workspace/TS100/Core/Src/TipThermoModel.cpp @@ -26,13 +26,15 @@ * This was bought to my attention by */ +// TIP_GAIN = TIP_GAIN/1000 == uV per deg C constant of the tip #ifdef MODEL_TS100 #define OP_AMP_Rf 750*1000 /*750 Kilo-ohms -> From schematic, R1*/ #define OP_AMP_Rin 2370 /*2.37 Kilo-ohms -> From schematic, R2*/ - +#define TIP_GAIN 405 #else #define OP_AMP_Rf 180*1000 /*180 Kilo-ohms -> From schematic, R6*/ #define OP_AMP_Rin 2000 /*2.0 Kilo-ohms -> From schematic, R3*/ +#define TIP_GAIN 115 #endif @@ -314,7 +316,7 @@ int32_t LinearInterpolate(int32_t x1, int32_t y1, int32_t x2, int32_t y2, uint32_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { //based on new measurements, tip is quite linear at 24.9uV per deg C = 2.49 per 0.1C // - tipuVDelta *= 405; + tipuVDelta *= TIP_GAIN; tipuVDelta /= 10000; return tipuVDelta; @@ -339,7 +341,7 @@ uint32_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { } uint32_t TipThermoModel::convertuVToDegF(uint32_t tipuVDelta) { - tipuVDelta *= 405; + tipuVDelta *= TIP_GAIN; tipuVDelta /= 1000; return ((tipuVDelta * 9) / 50) + 32; //(Y °C × 9/5) + 32 =Y°F