aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBen V. Brown <[email protected]>2019-06-18 19:32:45 +1000
committerBen V. Brown <[email protected]>2019-06-18 19:32:45 +1000
commitb570ebae54fcf59940b66986f8a53cde6308b55a (patch)
tree3cc31d129951b93ee9381037dc376c519b320eef
parent884f22c8af46a43a2caab7eab8defefef08f3e78 (diff)
downloadIronOS-b570ebae54fcf59940b66986f8a53cde6308b55a.tar.gz
IronOS-b570ebae54fcf59940b66986f8a53cde6308b55a.zip
WiP Power limit
-rw-r--r--workspace/TS100/inc/Settings.h3
-rw-r--r--workspace/TS100/src/Settings.cpp2
-rw-r--r--workspace/TS100/src/gui.cpp12
-rw-r--r--workspace/TS100/src/power.cpp2
4 files changed, 13 insertions, 6 deletions
diff --git a/workspace/TS100/inc/Settings.h b/workspace/TS100/inc/Settings.h
index 0d99698f..5e883651 100644
--- a/workspace/TS100/inc/Settings.h
+++ b/workspace/TS100/inc/Settings.h
@@ -48,6 +48,9 @@ typedef struct {
uint8_t customTipGain; // Tip gain value if custom tuned, or 0 if using a
// tipType param
uint8_t tipType;
+#ifdef MODEL_TS80
+ uint8_t pidPowerLimit;
+#endif
uint32_t padding; // This is here for in case we are not an even divisor so
// that nothing gets cut off
} systemSettingsType;
diff --git a/workspace/TS100/src/Settings.cpp b/workspace/TS100/src/Settings.cpp
index f3ab233f..bd355b47 100644
--- a/workspace/TS100/src/Settings.cpp
+++ b/workspace/TS100/src/Settings.cpp
@@ -114,7 +114,7 @@ void resetSettings() {
systemSettings.tipType = TS_B2; // Default to the B2 Tip
#endif
#ifdef MODEL_TS80
-
+ systemSettings.pidPowerLimit=24; // Sets the max pwm power limit
systemSettings.tipType = TS_B02; // Default to the B2 Tip
#endif
saveSettings(); // Save defaults
diff --git a/workspace/TS100/src/gui.cpp b/workspace/TS100/src/gui.cpp
index 20c0c37f..abb0dadd 100644
--- a/workspace/TS100/src/gui.cpp
+++ b/workspace/TS100/src/gui.cpp
@@ -318,15 +318,17 @@ static void settings_setInputPRange(void) {
static void settings_displayInputPRange(void) {
printShortDescription(0, 5);
-//0 = 18W, 1=24W
+ //0 = 9V, 1=12V (Fixed Voltages, these imply 1.5A limits)
+ //2 = 18W, 2=24W (Auto Adjusting V, estimated from the tip resistance???) # TODO
+ // Need to come back and look at these ^ as there were issues with voltage hunting
switch (systemSettings.cutoutSetting) {
case 0:
- OLED::printNumber(18, 2);
- OLED::print(SymbolWatts);
+ OLED::printNumber(9, 2);
+ OLED::print(SymbolVolts);
break;
case 1:
- OLED::printNumber(24, 2);
- OLED::print(SymbolWatts);
+ OLED::printNumber(12, 2);
+ OLED::print(SymbolVolts);
break;
default:
break;
diff --git a/workspace/TS100/src/power.cpp b/workspace/TS100/src/power.cpp
index b2d315a8..d8bd0118 100644
--- a/workspace/TS100/src/power.cpp
+++ b/workspace/TS100/src/power.cpp
@@ -28,6 +28,8 @@ int32_t tempToMilliWatts(int32_t rawTemp, uint16_t mass, uint8_t rawC) {
}
void setTipMilliWatts(int32_t mw) {
+ //Enforce Max Watts Limiter # TODO
+
int32_t output = milliWattsToPWM(mw, systemSettings.voltageDiv / 10,1);
setTipPWM(output);
uint16_t actualMilliWatts = PWMToMilliWatts(output,