How to Implement PID Control on STM32F4 to Maintain 1500 RPM for an ECU?

Hey guys, working on a project in which I have used STM32F4 to control an old ECU (which intended to be maintained at 1500 RPM) I'm planning to use PID control to maintain the fuel actuator so that it will maintain 1500 RPM, can anyone guide me in this?? @MCU, MPU & Firmware
Solution:
Yes I have, in a few context as well. You are likely controlling your actuator with something like a pwm and you have some sort of sensor telling you how many RPM you are doing maybe some encoder setup. Once you habe those you can implment your PID control loop in your main loop or the thread that's doing this.
Jump to solution
9 Replies
ZacckOsiemo
ZacckOsiemo•6mo ago
this should be fun you basically need to implement a control system with some feedback. In it
Mr_UJ 🔋
Mr_UJ 🔋•6mo ago
Yes, have you done something similar to this??
Solution
ZacckOsiemo
ZacckOsiemo•6mo ago
Yes I have, in a few context as well. You are likely controlling your actuator with something like a pwm and you have some sort of sensor telling you how many RPM you are doing maybe some encoder setup. Once you habe those you can implment your PID control loop in your main loop or the thread that's doing this.
ZacckOsiemo
ZacckOsiemo•6mo ago
Do you need more of a hand in this?
techielew
techielew•6mo ago
@Mr_UJ 🔋 FYI your thread continues here
Mr_UJ 🔋
Mr_UJ 🔋•6mo ago
Thanks Yes, what i have done till now: 1- interfaced Hall effect RPM sensor to measure rpm. 2- interfaced actuator position potentiometer I want to know is this approach to use PID to control engine RPM is feasible or any other technique can be more useful in this The main issue with PID is to tune the gains as the engine model is unknown
ZacckOsiemo
ZacckOsiemo•6mo ago
If you have the measured_rpm then you can now build out your PID algorithm. Have you implmented that before?
Mr_UJ 🔋
Mr_UJ 🔋•6mo ago
Yes, but only with simulation on Matlab How the tuning part is done on actual system? that will make system fairly stable in presence of disturbance.
ZacckOsiemo
ZacckOsiemo•6mo ago
By software, meaning by you You would just need to implement the PID control loop and run it at an interval that works for you?
Want results from more Discord servers?
Add your server