Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MHP30: Re-tuning PID #1961

Draft
wants to merge 11 commits into
base: dev
Choose a base branch
from
8 changes: 8 additions & 0 deletions source/Core/BSP/MHP30/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions source/Core/BSP/MHP30/stm32f1xx_hal_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
12 changes: 6 additions & 6 deletions source/Core/Threads/UI/logic/Soldering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}