Add limiter for setpoint > ADC range
This commit is contained in:
@@ -119,3 +119,10 @@ uint32_t TipThermoModel::getTipInF(bool sampleNow) {
|
|||||||
currentTipTempInF += convertCtoF(getHandleTemperature() / 10); //Add handle offset
|
currentTipTempInF += convertCtoF(getHandleTemperature() / 10); //Add handle offset
|
||||||
return currentTipTempInF;
|
return currentTipTempInF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t TipThermoModel::getTipMaxInC() {
|
||||||
|
uint32_t maximumTipTemp = TipThermoModel::convertTipRawADCToDegC(
|
||||||
|
0x7FFF - 10);
|
||||||
|
maximumTipTemp += getHandleTemperature() / 10; //Add handle offset
|
||||||
|
return maximumTipTemp;
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ public:
|
|||||||
static uint32_t getTipInC(bool sampleNow = false);
|
static uint32_t getTipInC(bool sampleNow = false);
|
||||||
static uint32_t getTipInF(bool sampleNow = false);
|
static uint32_t getTipInF(bool sampleNow = false);
|
||||||
|
|
||||||
|
//Calculates the maximum temperature can can be read by the ADC range
|
||||||
|
static uint32_t getTipMaxInC();
|
||||||
|
|
||||||
static uint32_t convertTipRawADCToDegC(uint16_t rawADC);
|
static uint32_t convertTipRawADCToDegC(uint16_t rawADC);
|
||||||
static uint32_t convertTipRawADCToDegF(uint16_t rawADC);
|
static uint32_t convertTipRawADCToDegF(uint16_t rawADC);
|
||||||
|
|||||||
@@ -138,6 +138,9 @@ void startPIDTask(void const *argument __unused) {
|
|||||||
//Maximum allowed output
|
//Maximum allowed output
|
||||||
currentTempTargetDegC = (450);
|
currentTempTargetDegC = (450);
|
||||||
}
|
}
|
||||||
|
if (currentTempTargetDegC > TipThermoModel::getTipMaxInC()) {
|
||||||
|
currentTempTargetDegC = TipThermoModel::getTipMaxInC();
|
||||||
|
}
|
||||||
// Convert the current tip to degree's C
|
// Convert the current tip to degree's C
|
||||||
|
|
||||||
// As we get close to our target, temp noise causes the system
|
// As we get close to our target, temp noise causes the system
|
||||||
@@ -190,7 +193,8 @@ void startPIDTask(void const *argument __unused) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (systemSettings.powerLimitEnable && x10WattsOut > (systemSettings.powerLimit * 10))
|
if (systemSettings.powerLimitEnable
|
||||||
|
&& x10WattsOut > (systemSettings.powerLimit * 10))
|
||||||
setTipX10Watts(systemSettings.powerLimit * 10);
|
setTipX10Watts(systemSettings.powerLimit * 10);
|
||||||
else
|
else
|
||||||
setTipX10Watts(x10WattsOut);
|
setTipX10Watts(x10WattsOut);
|
||||||
|
|||||||
Reference in New Issue
Block a user