how can i implement a pid controller with firefly algorithm to optimize pid parameters ?
Mostrar comentarios más antiguos
i use firefly algorithm to find the optimal values of PID parameters Kp,Kd,Ki i built code for PID controller with my system but how can i implement the firefly algorithm with my code to find optimal value for PID parameters
Respuestas (2)
noor diyana
el 11 de Mayo de 2017
0 votos
Hi Sandy jeak . You can try out this code from my senior project. I think its working successful. For objective function and MaxIt ,runtime also you can change as system that you want. All the best! Now, I've to use social spider optimization(SSO)to optimize PID Controller.Hopefully someone can help me also.
6 comentarios
ednilson szeskoski
el 2 de Sept. de 2017
Editada: ednilson szeskoski
el 2 de Sept. de 2017
Hello, how can I implement this transfer function in code? Thank you very much already:
% 0.004 s^4 + 0.454 s^3 + 5.55 s^2 + 15.1 s + 10 % -------------------------------------------------------------------------------------------
% 1.6e-05 s^7 + 0.002032 s^6 + 0.04732 s^5 + 0.4286 s^4 + 2.133 s^3 + 8.76 s^2 + 18.01 s + 11
Walter Roberson
el 2 de Sept. de 2017
tf([0.004, 0.454, 5.55, 15.1, 10], [1.6e-05, 0.002032, 0.04732, 0.4286, 2.133, 8.76, 18.01, 11])
... Or did you mean something different by "implement this transfer function in code" ?
ednilson szeskoski
el 3 de Sept. de 2017
Editada: ednilson szeskoski
el 3 de Sept. de 2017

The way to write the function is quiet, the question is how do I add the constants kp ki and kd. The system I would like to implement is in the attached image. Thank you for your help.
ednilson szeskoski
el 6 de Sept. de 2017
Editada: Walter Roberson
el 6 de Sept. de 2017
I solved using feedback in the mesh, calculating mathematically was not efficient.
The problem is that I am now having errors in the code, in some of the runtime it occurs errors like:
runtime=1
Best Values:32.2255 at Iteration =20
runtime=2
Best Values:26.8245 at Iteration =20
runtime=3
Error using -
Matrix dimensions must agree.
Error in main (line 77)
rij=norm(pop(i).Position-pop(j).Position)/dmax;
Walter Roberson
el 6 de Sept. de 2017
Please post (or link to) the code you are using.
Varun Rai
el 14 de Feb. de 2020
suppose we have multiple pid controllers in simulink model then how can we write the firefly algorithm foe that. for eg. multiararea load frequency control . reply pls
ednilson szeskoski
el 12 de Sept. de 2017
0 votos
The way to write the transfer function was correct. What was generating the error was the VarMax = 10 where when decreasing the variable obtained success in the simulation. Thank you.
Categorías
Más información sobre PID Controller Tuning en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!