How to speed up simulation time for fuzzy controllers in simulink

I have implemented fuzzy controller in simulink as uploaded at http://tinypic.com/view.php?pic=5l9t07&s=6. Fuzzy controller has two inputs with three membership functions and 9 rules.The issue is that; that the simulink is taking too long time to run it. What could be the issue. Any guidance.

1 Comment

You can approximate a nonlinear fuzzy PID controller using a lookup table. By replacing a Fuzzy Logic Controller block with Lookup Table blocks in Simulink, you can deploy a fuzzy controller with simplified generated code and improved execution speed.

Sign in to comment.

 Accepted Answer

You can try running in accelerator or rapid accelerator mode, change to a stiff ode solver or breaking what appears to be an algebraic loop in the feedback with a transfer function or unit delay.

6 Comments

I have tried the accelator and rapid accelator mode but got compiler issues. As I am very new to fuzzy controller and simulink so can you explicitly explain about stiff ode solver;that how it would help me. Secondly as I have mentioned that I have used 9 rules for fuzzy controller; are these 9 rules large enough to make the overall system slow. Any guidance would be highly appreciated.
Did you try my last suggestion? You can add a 1/z block to the feedback loop. Try that and let me know how that works.
For compiler, you need to download a supported compiler and use the mex -setup command to tell MATLAB to use it.
Sir the issue of execution time has been resolved but output is not correct after adding this delay;its a straight line. How to tackle it?
Well the delay represents a sensor. Realistically a feedback control such as this will have some kind of delay in the feedback path. What is the sample time of the delay? Try setting it faster.
Sir previously sample time was set to -1(inhereted) so when I increased it; the straight line became little curved.The problem is still there..how to solve this problem.Secondly sir can you kindly explain how delay block acts as a sensor and why it is necessary in the model.

Sign in to comment.

More Answers (0)

Categories

Products

Tags

Community Treasure Hunt

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

Start Hunting!