Skip to content

Commit

Permalink
High wattage means tip temp is low, compensate
Browse files Browse the repository at this point in the history
  • Loading branch information
dhiltonp committed Dec 5, 2020
1 parent 6f3a7c1 commit 1749c9a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions workspace/TS100/Core/Drivers/TipThermoModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "TipThermoModel.h"
#include "Settings.h"
#include "BSP.h"
#include "power.hpp"
#include "../../configuration.h"

/*
Expand Down Expand Up @@ -102,6 +103,10 @@ uint32_t TipThermoModel::convertFtoC(uint32_t degF) {
uint32_t TipThermoModel::getTipInC(bool sampleNow) {
int32_t currentTipTempInC = TipThermoModel::convertTipRawADCToDegC(getTipRawTemp(sampleNow));
currentTipTempInC += getHandleTemperature() / 10; //Add handle offset
// Power usage indicates that our tip temp is lower than our thermocouple temp.
// I found a number that doesn't unbalance the existing PID, causing overshoot.
// This could be tuned in concert with PID parameters...
currentTipTempInC -= x10WattHistory.average() / 25;
if (currentTipTempInC < 0)
return 0;
return currentTipTempInC;
Expand All @@ -111,6 +116,7 @@ uint32_t TipThermoModel::getTipInF(bool sampleNow) {
uint32_t currentTipTempInF = TipThermoModel::convertTipRawADCToDegF(
getTipRawTemp(sampleNow));
currentTipTempInF += convertCtoF(getHandleTemperature() / 10); //Add handle offset
currentTipTempInF += x10WattHistory.average() / 45; // 25 * 9 / 5, see getTipInC
return currentTipTempInF;
}
#endif
Expand Down

0 comments on commit 1749c9a

Please sign in to comment.