Message Boards Message Boards

1
|
10814 Views
|
7 Replies
|
4 Total Likes
View groups...
Share
Share this post:

WL / SystemModeller: PID, Fuzzy, NN predictive & MPC, etc. controllers?

Posted 8 years ago

Hi everyone,

I am new to Wolfram Mathematica and system modeler. I have few doubts relating to both of them My purpose of simulation tool is to design closed loop control circuits. I have referred in wolfram homepage but i could find complete answers to my questions. So i have few doubts which i will write in points as follows.

1) What kind of closed loop controllers can be implemented with mathematica (like PID, Fuzzy controller..). Some of the Controllers that i want to implement: PID, Fuzzy,PID like Fuzzy controller , NN predictive controller,Model predictive contoller (MPC) etc.. Still there are some other controllers for controlling a plant. If you know any info please let me know.

2) What kind of closed loop controllers can be implemented with System Modeller (like PID, Fuzzy ). Point 2 almost refer the same as point 1 but what i would like to know is the list of controllers that are provided for graphical modelling. For example: In system modeler we can drag and drop a PID controller and then can change the gain values as per our requirement. So is this possible with other controllers like Fuzzy, MPC.....

3) Is it possible to get the data of the model built in the environment into a human readable format ( i.e to an external file like .txt, XML or to a notepad).

4) Is it possible to estimate simulation time in both Mathamatica and system modeler. In system modeler i know that in simulation log i can find the simulation time. Is there a possibility to check this in mathamatica too?

Can you please also send me some supporting links to your answers? Please help me in this regard. Awaiting your reply.....

Regards, Pradeep

7 Replies

Hello,

Modelica libraries usually contain example models inside the downloads that show use-cases for the libraries so that you can explore the libraries for yourself hands on. Some libraries are also part of academic papers and if so, you'll often find references to those papers on the GitHub pages. If you are interested about using SystemModeler, you could contact me directly and I'll help you get started (email is in bio).

POSTED BY: Patrik Ekenberg

Hi Pradeep!

As you've noticed, the Modelica Standard Library contains PID-controllers and Linear Quadratic regulators. You also have the possibility to construct boolean logical controllers using the blocks available in the Modelica.Blocks.Logical library.

For other types of control you can use third party libraries. The Modelica Association list some free libraries here. For your application, it seems that the IndustrialControlsSystems, NCLib (simulation of networks and controllers), and LinearMPC libraries might be of interest to you. I have not used any of these personally so I can't speak for their functionality, though they are free to download. As Jan mentioned there is also a library for FuzzyControl but it has not been updated for three years so it might need some tuning to adhere to the newest Modelica standards.

When implementing more advanced forms of controllers we usually use SystemModeler in conjunction with Mathematica. The blog post Jan linked to is an example of this, showing the development of a Nonlinear Model Predictive Controller. There, we build a model of the system utilizing the graphical modeling of SystemModeler and processing and discretizing the resulting equations in Mathematica which results in a cost function and conditions that can be deployed together with a solver. The deployed controller could then be called in SystemModeler as Modelica has the ability to interface simulations with external libraries.

We are working on developing a workflow for developing deployable nonlinear model predictive controllers from SystemModeler but it is an ongoing project.

It might help if you explained more about what you are looking to do. Am I correct in understanding that you want to compare different controllers with each other? What kind of scenario are you looking to control?

POSTED BY: Patrik Ekenberg

Hi Patrick,

Thank you for your answers to my questions. I am not comparing different controllers. But my task was to research on different simulation tools where i can implement digital control systems and then compare the simulation tools. For this purpose i have few initial criterias for selection of simulation tools. So for this i have to know what are the controllers that can be implmented to control my system. So i want to know the information of different controllers as i mentioned in the previous post. May i know how to use this third party libraries in the system modeler.

Hi Patrik,

If it is possible can you suggest me a link where a can find the implemented controllers using both system modeler and mathematica. Because i am very new to this environment.

This blog, http://blog.wolfram.com/2015/08/26/releasing-the-opcclassic-library/, talks a little bit about MPC, but it's not downloadable. I will see if I can find something though. Same for Fuzzy controllers. Stay tuned. :)

POSTED BY: Jan Brugard

Hi Jan Brugard,

Thank you for your reply Jan. For your answer to the second point you said that it is possible to model all the controllers in System Modeller. But in the documentation i am always able to find only related to PID controller which is in modelica library called (LimPID). IF possible can you provide some supporting documnets or web adress where i can find the info for implementing Fuzzy, PID like Fuzzy controller, NN predictive controller, Model predictive controller. Please help me in this regard.

I let someone else answer on 1)

2) You can model all of those in SystemModeler. There's no built-in library with Fuzzy controllers, but you can make your own components for graphical use of course. There is a free Modelica library for Fuzzy control available, but unfortunately it's updated. I would guess that you can draw inspiration from it though.

I believe you might find this downloadable example of a model inversion control interesting:

http://www.wolfram.com/system-modeler/industry-examples/more/heavy-equipment/model-inversion-control-of-a-hoist-crab

3) Yes, results are always stored in mat-file,

http://reference.wolfram.com/system-modeler/UserGuide/SimulationCenterSimulationResultFiles.html

and experiment settings in an xml file

http://reference.wolfram.com/system-modeler/UserGuide/SimulationCenterSimulationSettingsFiles.html

4) You can use AbsoluteTiming in Mathematica to get the simulation time.

POSTED BY: Jan Brugard
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract