We will use step response to test the system behavior, as the heating process identified as first order system. At this moment I not sure how much lag or delay involve with the process.

STM32 Firmware

In this code, we used Arduino IDE to program using stm32 core.

Blackpill will wait for “start” string command from serial port then it will turn on the mosfet module untill the reading resistant reachine 150 Ohms then it will turn-off for 120 seconds and repeat for 10 cycles while printing the value via serial for Python script to gather data.

see : https://github.com/Menginventor/DIY_Hakko/tree/main/hakko_model_iden_firmware

Python script

Pythonscript will send “start” command start the process and save .csv and .npy file for later analysis.

see: https://github.com/Menginventor/DIY_Hakko/blob/main/data_gatherer.py

Step response

single_step.png

step_response.png

Parameters Estimation

Using FOPDT model, we can use optimization to fit the model

the delay (theta) can not be optimized and ambient temp is off from ideally around 50 Ω to 80.99 Ω.

It take very long time to wait until it reach ambient temperature so we will use it as is.

Using a First-Order Plus Dead Time (FOPDT) model, we apply optimization to fit the system response and obtain the following parameters:

T_inf_opt = 80.99 Ω K_opt = 265.33 tau_opt = 36.56 s theta_opt = 0.00 s

The delay theta could not be effectively optimized and appears negligible in this case. Additionally, the estimated ambient resistance T_inf deviates from the expected value of approximately 50 Ω, converging instead to 80.99  Ω.

Since allowing the system to cool down to the actual ambient temperature takes a long time, we proceed with the model as-is.

Next: Part 3: PI-Controller design