1
0
forked from me/IronOS

Update PD to support awareness of having inductor for DCDC op

+ fix voltage divider to be more on point
+ Create adjustment for thermal mass causes overshoot
This commit is contained in:
Ben V. Brown
2021-05-03 22:36:25 +10:00
parent dd5daf51e3
commit ee12c99d9e
7 changed files with 54 additions and 25 deletions

View File

@@ -72,10 +72,12 @@ 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...
#ifndef NO_THERMAL_MASS_COMP
// 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...
#ifdef THERMAL_MASS_OVERSHOOTS
currentTipTempInC += x10WattHistory.average() / 25;
#else
currentTipTempInC -= x10WattHistory.average() / 25;
#endif
if (currentTipTempInC < 0)