how can i implement a pid controller with firefly algorithm to optimize pid parameters ?

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

답변 (2개)

noor diyana
noor diyana 2017년 5월 11일
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

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
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" ?
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.
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;
Please post (or link to) the code you are using.
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

댓글을 달려면 로그인하십시오.

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.

카테고리

질문:

2017년 4월 10일

댓글:

2020년 2월 14일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by