Content
- Description
- Usage
- Naming convention
- Principles of operation
- Authors
Description
SimulationChain allows simulation of complex discrite dynamic systems. Key features implemented comprises of ARX object model, PID and GPC controllers and identification algorithm. Application has been created as a programming assignment for Control Systems Programming laboratory (abr. PSS).
Many of its functions are covered in WymaganiaProgr2014.pdf document available for all students enrolled on PSS course. A brief description of its main technical features:
- uses flexible XML files to serialize objects properties,
- provides clean, flexible GUI,
- features visualisation of control, response and excitation signals,
- enables modification of objects properties,
- uses composite tree; allows to simulate complicated parallel and serial simulation chains,
- very flexible, modular design using MVC model and multiple design patterns enabling easy expansion.
Usage
There is a main window shown in the picture below.
Features:
- Tree view of the simulation chain object with SimulationRoot as a root node.
- Property view. Features changing parameters of the object selected in the simulation chain view. Regulator is displayed with all its generators as children.
- Visualization of the input (red) and output signal (blue) of the simulation chain.
- Regulator output signal plotted with respect to the time of the plot above.
- Properties and output of the identification algorithm.
- Simulation properties and controls.
- Menu allowing to save and load simulation data.
Naming convention
There is unified naming convention used throught the project. The main rules are:
- member variables are beginning with m_ prefix,
- member variables of basic types (int, double, char etc.) has their type stated right after prefix in the lower case, example: m_nNumberOfObjects, m_dGain,
- member variables begin with a capital letter and use another capital letter for following words (does not include prefixes),
- non-member variables can begin with type letter, if not, they begin with lower case letter,
- methods begin with upper case letter and has the same naming convention as member variables (excluding prefixes),
- classes begin with a capital letter indicating their type:
- I - interface,
- S - singleton,
- C - standard class,
- apart of prefixes, class naming convention is the same as for member variables.
- Note
- Naming convention is disregarded in GUI class (classes) which is generated by external tool (QTCreator).
Principles of operation
The project is divided into three main parts:
- Model - classes which store and process data, in particular:
- View - GUI class: MainWindow,
- Controller: SLogic.
Adding a new generator will require deriving from abstract base class CRegulator and adding its type to the GenType enum and registering in the corresponding factory. Similar procedure is used in case of simulation chain classes which has to derive from CSimNode or any of the inherited classes.
All simulation chain and generator objects are using SUniqueNameController to register unique names which come in handy when searching through the simualation tree.
- Warning
- It is vital to ensure that all new singletons are multithreaded safe since the SLogic class and GUI uses multiple threads to function.
SLogic will be initialized from contructor. When using standard console output the program will be run from the SLogic::Run method. When using GUI it will have to connected to required functions.
- Note
Program uses following, external libraries:
- QT GUI and multithreading libraries,
- Eigen-Eigen matrix and vector manipulation library,
- Boost library.
To compile, it is necessary to use a compiler which will handle C++11 features. Recommended compilers for Windows OS are:
- MinGW v0.6.2 beta,
- Visual Studio 2013 compiler.
Both have been tested and proved to deliver sufficient support for the C++11 standard.
Authors
The application was created by Aleksander Bulski and Jacek Turula (identification algorithm), students of Automatic Control and Robotics at the Silesian University of Technology, faculty of Automatic Control, Electronics and Computer Science, spring semester 2013/2014.