Implementing Digital control with STM32

Thread Starter

Exjay

Joined Nov 19, 2015
186
Hello all,
Please, I am interested in how to implement control into algorithms with STM32 control. Resources, links and suggestions are welcome.
 

MrChips

Joined Oct 2, 2009
34,714
Hello all,
Please, I am interested in how to implement control into algorithms with STM32 control. Resources, links and suggestions are welcome.
You have to be more specific. Give us an example of exactly what you are trying to do. The solution likely has nothing to do with STM32.
 

Thread Starter

Exjay

Joined Nov 19, 2015
186
You have to be more specific. Give us an example of exactly what you are trying to do. The solution likely has nothing to do with STM32.
Thanks for your response.
I'm trying to learn control engineering but not limited to theory. I believe one can generate C codes that implementable in embedded systems from transfer functions.
 

MrChips

Joined Oct 2, 2009
34,714
Thanks for your response.
I'm trying to learn control engineering but not limited to theory. I believe one can generate C codes that implementable in embedded systems from transfer functions.
What is ”control engineering”?
Why does it require “C codes”?
Give us an example of “transfer function”.
 

Justin Spencer

Joined Jul 22, 2017
10
Thanks for your response.
I'm trying to learn control engineering but not limited to theory. I believe one can generate C codes that implementable in embedded systems from transfer functions.
Hello, that sounds great!
I think you want to learn embedded systems.

Control engineering is big.
Control engineering is general field.
Do not focus on control engineering.

I use embeddedrelated.com to learn.
Please check it.

I hope this helps somehow.
Thank you and happy learning!
 

lichurbagan

Joined Jul 4, 2025
121
Hello all,
Please, I am interested in how to implement control into algorithms with STM32 control. Resources, links and suggestions are welcome.
STM32 MCUs are popular for embedded control applications. Choose the right STM32 series with FPU for faster calculations.
Define your control problem before designing the algorithm. Common control types are PID, state-space, and MPC.
Use STM32CubeIDE or CubeMX to configure peripherals. Timers trigger ADC reads and control loop execution.
Compute control output and update PWM or DAC signals. Simulate your controller first in MATLAB or Python.
Test, tune gains, and add safety protections in firmware.
For more STM32 details, visit https://www.theengineeringprojects.com/2021/10/introduction-to-stm32-family.html
 
Hello all,
Please, I am interested in how to implement control into algorithms with STM32 control. Resources, links and suggestions are welcome.
I glanced at the ST Micro website to get an overview of what the STM32 series of controllers can do. They are pushing their 'eDesign Suite' which are pre-programmed groups of software for specific algorithms, like a PWM for a 3-phase AC-DC where the user just has to enter a few variables, then it writes the code for you. The way I look at it, those pre-written algorithms are for hobby level projects, not for a new product that a degreed engineer is designing where he needs to implement his own unique algorithms into an embedded system. (They are useful for a breadboard though, where one might want to use a canned program to produce generic PWM signals so that he can debug his magnetics and gate drives and such)
Since you mentioned that you need your own transfer functions for control, these "canned programs" are not the way to go. Good C programming skills are required to write the actual control transfer functions. ST Micro does have tools that help you get the basic configuration of pins and setting up peripherals and such.
 

Futurist

Joined Apr 8, 2025
734
Thanks for your response.
I'm trying to learn control engineering but not limited to theory. I believe one can generate C codes that implementable in embedded systems from transfer functions.
Do you know what an STM32 is? why have you chosen that kind of device?

Have you written software before, what languages have you used?

Do you have a PC?

Do you have a multimeter? oscilloscope? do you have a place to work on this stuff, like a workshop?
 
Top