Project Simulator

All project simulations presented on this site use a custom simulator designed for high speed and accuracy.

This simulator was never intended to provide user flexibility and as such would not be considered as user friendly.

Below, I present some operating instructions as to it use followed up with some examples of the actual project simulation presented on this site.

It must be pointed out that a full explanation of the simulator and its components is not plausible. However, one can poke around and discover some of the operating details if motivated to do so. Components can also be stripped out and used to build other simulation environments.

This package contains numerous public domain code snippets found over the years to aid in its design. I attempt where possible to acknowledge the authors of this code, but some acknowledgements may be lacking.

This simulator is provided as a zipped archive that can be install in any Linux distribution (bare metal or virtual) that has sufficient RAM memory (at least 8G Byte).

The archive can be downloaded here.

To start off let me list some of the system files and their function within the simulator.

In directory Development/Simulator

Simulation.ccThe top-level file for the simulator. Launches a particular simulator project build and provides the console command line interface.
Simulation.hppThis is the simulator execution environment. It is an include file attached to the selected project to simulate.
Application.ccThis file selects the project to be built.

For instance, M2LC Operating in Resonance Mode project (which is one of the complicated simulations I have developed) is selected by defining SIMU_MultiLevelDCTest in this file.
gnuplot_i.cc and gnuplot_i.hppThese files provide the qnuplot connections to the simulator.

Note that most of the other files listed in Development/Simulator are left-over from legacy builds and should be for the most part ignored (except App_Observer described below).

As mentioned above Simulation.hpp contains the balk of the simulation executable. The individual modules (labeled as objects) used in the executable are summarized below.

SimuObjectThe top-level object
OdeObjItemODE solver. Can be configured to use Runge Kutta third order, forth order and Fehlberg modules. A simple fixed time model can also be assigned.
CtrlObjItemControls simulation code that would be considered to be valid on some predefined update time (eg., servo and feedforward control loops)
SrcObjItemA time continuous object that runs at the update quantum of the simulator (fixed or dynamic time)
SpiceObjItem, CoefObjItem and SwitchObjItemObjects used to embed SPICE models into the simulator (the M2LC Operating in Resonance Mode project described above is heavily dependent on this object)

It should be noted that the OdeObjItem Runge Kutta modes are not effective if the simulation contains any discontinuous functions (eg., PWM signal generators), for which in the most part is used in most of the simulation project examples supplied.

Here is list of the stable projects supplied in this ZIP ‘ed archive. Some of them listed below can be referenced to documents that I have posted on this site.

Project (see Application.cc)Top-Level FileComment
App_Observer./Simulation/App_Observer.hppSee Brushless AC Motor Control
(Brushless AC Motor Controller)
App_Observer_Disturbance_Rejection./App_Observer_Disturbance_Rejection/
App_Observer_Disturbance_Rejection.
hpp
See Brushless AC Motor Control
(Disturbance Compensation based on Numerical Modeling)
App_SpaceVectorDeadtimeTest./SpaceVectorDeadtimeTest/
App_SpaceVectorDeadtimeTest.hpp
See Brushless AC Motor Control
(Dead-time elimination in SVPWM Mode)
App_InductionMotor./InductionMotor/
App_InductionMotor.hpp
See Induction Motor Control
(Simulation of an Induction Motor in the Rotating and Synchronous D/Q Planes)
App_InductionMotor_DTC_SVM./InductionMotor_DTC_SVM/
App_InductionMotor_DTC_SVM.hpp
See TI C2000 Simulation Test for an Induction Motor
(Simulated Induction Motor Controller using a TI C2000 SOC)
App_MultiLevelDCTest./MultiLevelDCTest/
App_MultiLevelDCTest.hpp
See M2LC Software
(M2LC Operating in Resonance Mode)
App_MultiLevelDCTest_3Phase./MultiLevelDCTest_3Phase/
App_MultiLevelDCTest_3Phase.hpp
See M2LC Software
(HighPerformanceM2LCResonanceMode_BusAnalysis)

(One example on how to use ….. and done!)