1
0
forked from me/IronOS

Startup behaviour fixes (#1306)

* Reduce PPS max to 20V to avoid instability

Some PSU's cant actually run at 21V

* Creating a rough draft of a "pre start check" concept

* Newer alpine

* Cleaning up MHP detection

* Cleanup comments

* PID: Run prestart based on ADC IRQ rather than times

* MHP30: Far better startup for detecting tip gain

* Newer alpine for github CI
This commit is contained in:
Ben V. Brown
2022-06-16 20:21:46 +10:00
committed by GitHub
parent f5cb42c9d7
commit 3bb1b7bc32
9 changed files with 98 additions and 73 deletions

View File

@@ -172,7 +172,7 @@ static void gui_drawBatteryIcon() {
}
static void gui_solderingTempAdjust() {
uint32_t lastChange = xTaskGetTickCount();
currentTempTargetDegC = 0;
currentTempTargetDegC = 0; // Turn off header while adjusting temp
uint32_t autoRepeatTimer = 0;
uint8_t autoRepeatAcceleration = 0;
bool waitForRelease = false;
@@ -511,12 +511,8 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
boostModeOn = false;
break;
case BUTTON_BOTH:
// exit
return;
break;
case BUTTON_B_LONG:
return; // exit on back long hold
break;
case BUTTON_F_LONG:
// if boost mode is enabled turn it on
if (getSettingValue(SettingsOptions::BoostTemp))
@@ -665,8 +661,6 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
// If we have tripped thermal runaway, turn off heater and show warning
if (heaterThermalRunaway) {
currentTempTargetDegC = 0; // heater control off
// TODO WARNING
warnUser(translatedString(Tr->WarningThermalRunaway), 10 * TICKS_SECOND);
heaterThermalRunaway = false;
return;

View File

@@ -39,21 +39,26 @@ void startPIDTask(void const *argument __unused) {
pidTaskNotification = xTaskGetCurrentTaskHandle();
uint32_t PIDTempTarget = 0;
// Pre-seed the adc filters
for (int i = 0; i < 128; i++) {
osDelay(5);
for (int i = 0; i < 32; i++) {
ulTaskNotifyTake(pdTRUE, 5);
TipThermoModel::getTipInC(true);
getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 1);
}
while (preStartChecks() != 0) {
ulTaskNotifyTake(pdTRUE, 2000);
}
int32_t x10WattsOut = 0;
for (;;) {
x10WattsOut = 0;
// This is a call to block this thread until the ADC does its samples
if (ulTaskNotifyTake(pdTRUE, 2000)) {
if (ulTaskNotifyTake(pdTRUE, TICKS_SECOND * 2)) {
// Do the reading here to keep the temp calculations churning along
uint32_t currentTipTempInC = TipThermoModel::getTipInC(true);
PIDTempTarget = currentTempTargetDegC;
if (PIDTempTarget) {
if (PIDTempTarget > 0) {
// Cap the max set point to 450C
if (PIDTempTarget > (450)) {
// Maximum allowed output