mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
fix negative rawC
This commit is contained in:
@@ -926,7 +926,7 @@ void startPIDTask(void const *argument __unused) {
|
|||||||
#ifdef MODEL_TS80
|
#ifdef MODEL_TS80
|
||||||
idealQCVoltage = calculateMaxVoltage(systemSettings.cutoutSetting);
|
idealQCVoltage = calculateMaxVoltage(systemSettings.cutoutSetting);
|
||||||
#endif
|
#endif
|
||||||
int32_t rawC = ctoTipMeasurement(100) - ctoTipMeasurement(101); // 1*C change in raw.
|
uint8_t rawC = ctoTipMeasurement(101) - ctoTipMeasurement(100); // 1*C change in raw.
|
||||||
currentlyActiveTemperatureTarget = 0; // Force start with no output (off). If in sleep / soldering this will
|
currentlyActiveTemperatureTarget = 0; // Force start with no output (off). If in sleep / soldering this will
|
||||||
// be over-ridden rapidly
|
// be over-ridden rapidly
|
||||||
|
|
||||||
@@ -956,8 +956,10 @@ void startPIDTask(void const *argument __unused) {
|
|||||||
// P term - total power needed to hit target temp next cycle.
|
// P term - total power needed to hit target temp next cycle.
|
||||||
// thermal mass = 1690 milliJ/*C for my tip.
|
// thermal mass = 1690 milliJ/*C for my tip.
|
||||||
// = Watts*Seconds to raise Temp from room temp to +100*C, divided by 100*C.
|
// = Watts*Seconds to raise Temp from room temp to +100*C, divided by 100*C.
|
||||||
// divided by 8 to let I term dominate near set point.
|
// divided by 20 to let I term dominate near set point.
|
||||||
const uint16_t mass = 1690 / 8;
|
// I should retune this, but don't want to do it until
|
||||||
|
// the feed-forward temp adjustment is in place.
|
||||||
|
const uint16_t mass = 1690 / 20;
|
||||||
int32_t milliWattsNeeded = tempToMilliWatts(tempError.average(), mass, rawC);
|
int32_t milliWattsNeeded = tempToMilliWatts(tempError.average(), mass, rawC);
|
||||||
milliWattsOut += milliWattsNeeded;
|
milliWattsOut += milliWattsNeeded;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user