Using simulink as fitness function for GA

8 ビュー (過去 30 日間)
Hala
Hala 2012 年 6 月 16 日
コメント済み: Sakshi Bhonsle 2019 年 5 月 2 日
Hello, I built a PI fuzzy control system using simulink with 3 gains that need to be tuned. I want to tune these gains automatically using genetic algorithm based on minimizing the mean square error. I have a m-file that runs the GA and calls a fitness function in another m-file. The fitness function m-file receives the gains as suggetsed population from GA and it is supposed to run the simulink block after sending the gains to it. The problem is that how to send the population (gains) during the run of GA to simulink and run the simulink block every generation???
FYI I used the sim command to run simulink and to workspace block to get the system output to the m-file. I tried using set_param,assignin commands and it didn't work (I knew because the output gains I got are not optimal for the controller)...
Please help me it's for my master thesis and I need this to finish...
  2 件のコメント
ashish
ashish 2012 年 11 月 7 日
dear hala richard crozier i hv same problem if u read it kindly me also ashish19802005@gmail.com
Sakshi Bhonsle
Sakshi Bhonsle 2019 年 5 月 2 日
Kindly mail me if your solution for the above mentioned solution was found : b.sakshi93@gmail.com

サインインしてコメントする。

回答 (4 件)

Richard Crozier
Richard Crozier 2012 年 6 月 16 日

Muruganandham Subramanian
Muruganandham Subramanian 2012 年 11 月 7 日
編集済み: Walter Roberson 2012 年 11 月 8 日
Hi,
FYI,Genetic algorithm is a population based method, probably the gains for PID controller(i.e, Proportional gain, Integral gain, Derivative gain) are to be splitted into range b/w mininum to maximum (for e.g If you know the PID gains range approximately).For this you can use 'unifrnd' command.then by looping method, for every data of PID gains(i.e depends on population), give as i/p to .mdl, then by GA algorithm, you can choose best results

Sangeetha  Elumalai
Sangeetha Elumalai 2016 年 2 月 10 日
I also want to tune PID controller in simulink by using GA... if anyone knows, pls help me
  2 件のコメント
Hassan Yousef
Hassan Yousef 2018 年 1 月 4 日
me also
Zhengyan Mao
Zhengyan Mao 2018 年 1 月 26 日
Anyone of you figures this out?

サインインしてコメントする。


Stephan Kurzawe
Stephan Kurzawe 2018 年 5 月 11 日
Hej, I ran into the same issue today. On a matlab example for lsq-nonlin I found the solution:
You just have to add 'SrcWorkspace','Current' into your sim command. So that it looks:
sim('model.slx','SrcWorkspace','Current');
Hope it helps. Stephan

カテゴリ

Help Center および File ExchangePID Controller Tuning についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by