-
Notifications
You must be signed in to change notification settings - Fork 0
Basic workings
embedSim has models for various hw components like PV modules, buck converters, boost converters etc. implemented in python. Control algorithms for various examples are connected implemented in c++/c in /src folder. The basic idea is to provide an environment and method to enable simulation and testing of application layer control code with models for the hardware. The aim is to provide effective and open source simulations for real world engineering problems.
In order to pass information from one model to another or from a controller to a model a 'node' is used a node is nothing but a pointer that stores the value of a variable. This variable can be a voltage current, duty cycle , motor speed or anything that needs to be passed on. Different components (and controllers) are either completely implemented in or wrapped by a python class.
When a simulation is being run all the components are stored in list (in the python environment) and all the nodes are stored in an array (in the c++ src). The values stored in each node can be accessed from python using the getNodeVal function (values are also be assgined using putNodeVal function). During execution all components are executed one by one. Depending on its function each component will read data from the nodes and then assign output value to output nodes (nodes by themselves are not input or output, but a component should know where to read from and where to put data). the figure bellow demonstrates this execution :
