The code now includes generic PID controller functions that can be used for different purposes such as velocity and position tracking.
And to use all these PID controllers, I added a PID autotuner based on the Nelder Mead algorithm that searches over a R3 space for the optimum coefficients to obtain the lowest rise time. These functions are included in the gen_algo.c file and should be applicable to other projects as well.
I decided to reorganise the code this way so that it is portable to other projects. I was also got rather annoyed with having to write the same code over and over again in another project so this quickly became a priority. This reduces the code I have to rewrite and test and should result in increased productivity in the future since the code has already been written.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.