cancel
Showing results for 
Search instead for 
Did you mean: 

How can I change values in real time while code is running on STM32CubeIDE

umairgist
Associate II

Hello, I am using STM32F407G MCU and STM32CubeIDE Software.

 

I'm trying to tune a PI controller for my device and controller is embedded in the STM32 microcontroller. After writing the code and setting the parameters, I've been uploading it to the device. However, it's a lengthy process to stop the code, change Kp, Ki values, rebuild, and debug each time.

Is there a faster way to modify the Kp and Ki gains without constantly stopping and restarting the code? I've tried using Live Expressions, but it doesn't seem to work in STM32CubeIDE.

1 REPLY 1
Muhammed Güler
Senior III

If you make the PID parameters variable, you can use the communication you want and change the parameters. You can transfer the KP, KD and KI values ​​to the MCU with the protocol you will create and ensure that the PID algorithm starts over with the new values. It requires some programming work.