diff --git a/source/Core/BSP/MHP30/configuration.h b/source/Core/BSP/MHP30/configuration.h index a2d5910be9..cd584202e2 100644 --- a/source/Core/BSP/MHP30/configuration.h +++ b/source/Core/BSP/MHP30/configuration.h @@ -165,6 +165,14 @@ #define ACCEL_EXITS_ON_MOVEMENT #define NEEDS_VBUS_PROBE 0 +#define CANT_DIRECT_READ_SETTINGS // We cant memcpy settings due to flash cache +#define TIP_CONTROL_PID // We use PID rather than integrator +#define TIP_PID_KP 22 //40 // Reasonable compromise for most tips so far +#define TIP_PID_KI 300 //6 // About as high for stability across tips +#define TIP_PID_KD 600 //200 // Helps dampen smaller tips; ~= nothing for larger tips +#define FILTER_DISPLAYED_TIP_TEMP 8 // Filtering for GUI display + + #define HARDWARE_MAX_WATTAGE_X10 650 #define TIP_THERMAL_MASS 65 // TODO, needs refinement #define TIP_RESISTANCE 60 // x10 ohms, ~6 typical diff --git a/source/Core/BSP/MHP30/stm32f1xx_hal_msp.c b/source/Core/BSP/MHP30/stm32f1xx_hal_msp.c index 0fdf25caf5..d53a671961 100644 --- a/source/Core/BSP/MHP30/stm32f1xx_hal_msp.c +++ b/source/Core/BSP/MHP30/stm32f1xx_hal_msp.c @@ -57,16 +57,16 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) { PB1 ------> ADC2_IN9 */ GPIO_InitStruct.Pin = TIP_TEMP_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; HAL_GPIO_Init(TIP_TEMP_GPIO_Port, &GPIO_InitStruct); GPIO_InitStruct.Pin = TMP36_INPUT_Pin; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; HAL_GPIO_Init(TMP36_INPUT_GPIO_Port, &GPIO_InitStruct); GPIO_InitStruct.Pin = VIN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; HAL_GPIO_Init(VIN_GPIO_Port, &GPIO_InitStruct); GPIO_InitStruct.Pin = PLATE_SENSOR_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; HAL_GPIO_Init(PLATE_SENSOR_GPIO_Port, &GPIO_InitStruct); /* ADC2 interrupt Init */ diff --git a/source/Core/Threads/UI/logic/Soldering.cpp b/source/Core/Threads/UI/logic/Soldering.cpp index 50508025f4..81d4f0db7f 100644 --- a/source/Core/Threads/UI/logic/Soldering.cpp +++ b/source/Core/Threads/UI/logic/Soldering.cpp @@ -163,11 +163,11 @@ OperatingMode gui_solderingMode(const ButtonState buttons, guiContext *cxt) { return OperatingMode::Sleeping; } - if (heaterThermalRunaway) { - currentTempTargetDegC = 0; // heater control off - heaterThermalRunaway = false; - cxt->transitionMode = TransitionAnimation::Right; - return OperatingMode::ThermalRunaway; - } + // if (heaterThermalRunaway) { + // currentTempTargetDegC = 0; // heater control off + // heaterThermalRunaway = false; + // cxt->transitionMode = TransitionAnimation::Right; + // return OperatingMode::ThermalRunaway; + // } return handleSolderingButtons(buttons, cxt); }