2012-10-30 01:46 AM
Hi,
I see in the DSP section of the Firmware for the F4, at the following location \STM32F4xx_DSP_StdPeriph_Lib_V1.0.1\Libraries\CMSIS\DSP_Lib\Source\ControllerFunctions that there is reference to hardware and software based PID, in code supplied by arm, which suggests that software PID is possible on F1, F2, and in DSP hardware on F4. However, I can't see any examples to help me get started on this. Can you provide demo code or a description of how use this in a PID application, both for software pid (f1,f2) and the PID Hardware (f4) please? Thanks #pid2012-10-30 02:15 AM
For examples, there is obviously none in the
../CMSIS/DSP_Lib/Examples
subfolder, but it should not be a problem to find a generic example using google/<your fafourite search machine>.that there is reference to hardware and software based PID,
I guess you are referring to the q15 and q31 integer implementations and the f32 floating point implementation of the DSP routines. Check the lengthy comments in arm_math.h. It describes the macros you need to define for building it for a M0, M3 or M4 target. There is no specific ''hardware'' implementation - just configure your project to use the FPU, and select the proper library if you want to use the precompiled DSP lib. For a real ''Hardware PID'', you need to build one with discrete components - there is no PID periphery in any ARM Cortex controller I know of. It is all realized in software.
2012-10-31 04:07 AM
Hey, can anybody recommend an STM32 based example that they have come across on the web, that is very simple and that I can use as a starting point to build a practical project?
Thanks2012-10-31 07:52 AM
Hi,
I am looking for the exact same thing. Although I see lots on PID controllers and how to build your own, I would like to see an example using the PID instance given in the DSP library. There seem to be examples in the DSP library for everything BUT the PID controllers. I am still searching for an example. No luck so far.2012-10-31 08:14 AM
For a useful example, one needs an output and a related (sensor) input to get a closed-loop control system. Either no one at ST had any idea, or they found it less interesting.
For code examples, they mostly target their evaluation boards.2012-11-20 04:44 AM
Yes, it's true, to demonstrate a working PID controller would be difficult as the controller is meant to work on and control feedback from some system. However, even a table of inputs as a driver with a related table of expected output given a specific input - nothing fancy - would've been good.
I ended up just coding my own. Cheers, Lisa