WiP Power limit
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user