1
0
forked from me/IronOS

WiP Power limit

This commit is contained in:
Ben V. Brown
2019-06-18 19:32:45 +10:00
parent 884f22c8af
commit b570ebae54
4 changed files with 13 additions and 6 deletions

View File

@@ -48,6 +48,9 @@ typedef struct {
uint8_t customTipGain; // Tip gain value if custom tuned, or 0 if using a uint8_t customTipGain; // Tip gain value if custom tuned, or 0 if using a
// tipType param // tipType param
uint8_t tipType; 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 uint32_t padding; // This is here for in case we are not an even divisor so
// that nothing gets cut off // that nothing gets cut off
} systemSettingsType; } systemSettingsType;

View File

@@ -114,7 +114,7 @@ void resetSettings() {
systemSettings.tipType = TS_B2; // Default to the B2 Tip systemSettings.tipType = TS_B2; // Default to the B2 Tip
#endif #endif
#ifdef MODEL_TS80 #ifdef MODEL_TS80
systemSettings.pidPowerLimit=24; // Sets the max pwm power limit
systemSettings.tipType = TS_B02; // Default to the B2 Tip systemSettings.tipType = TS_B02; // Default to the B2 Tip
#endif #endif
saveSettings(); // Save defaults saveSettings(); // Save defaults

View File

@@ -318,15 +318,17 @@ static void settings_setInputPRange(void) {
static void settings_displayInputPRange(void) { static void settings_displayInputPRange(void) {
printShortDescription(0, 5); 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) { switch (systemSettings.cutoutSetting) {
case 0: case 0:
OLED::printNumber(18, 2); OLED::printNumber(9, 2);
OLED::print(SymbolWatts); OLED::print(SymbolVolts);
break; break;
case 1: case 1:
OLED::printNumber(24, 2); OLED::printNumber(12, 2);
OLED::print(SymbolWatts); OLED::print(SymbolVolts);
break; break;
default: default:
break; break;

View File

@@ -28,6 +28,8 @@ int32_t tempToMilliWatts(int32_t rawTemp, uint16_t mass, uint8_t rawC) {
} }
void setTipMilliWatts(int32_t mw) { void setTipMilliWatts(int32_t mw) {
//Enforce Max Watts Limiter # TODO
int32_t output = milliWattsToPWM(mw, systemSettings.voltageDiv / 10,1); int32_t output = milliWattsToPWM(mw, systemSettings.voltageDiv / 10,1);
setTipPWM(output); setTipPWM(output);
uint16_t actualMilliWatts = PWMToMilliWatts(output, uint16_t actualMilliWatts = PWMToMilliWatts(output,