This article describes the requirements for creating a circuit model to simulate with the eHS Solver.
- Consider using an existing circuit model from the Examples section as a starting point.
- Open MathWorks Simulink to use the Simscape Electrical Specialized Power Systems Simulink Blockset. See Supported Circuit Editors for more information.
- Add a powergui block to the Simulink model.
Optional: Double click the powergui block and navigate to the Solver tab. Configure the parameters as shown below:
Simulation type Discrete Solver type Backward Euler Sample time (s) 1e-6
- Optional: Navigate to Simulation >> Configuration Parameters >> Solver, and set the Solver Type to Fixed-Step. Under Additional Parameters, set the Fixed Step Size to 1e-6 (this value must match the one in the powergui block).
Note: The parameters configured in steps 4 and 5 do not affect the eHS solver; they are used only if the model is executed directly in Simulink (offline mode). Offline simulation is typically done for model validation purposes, and to generate benchmark data to compare against the results from the eHS Solver. The Discrete Backward Euler solver generates offline results most similar to those of the eHS solver.
- Build the circuit using only supported components.
- Add Current and Voltage Measurement blocks at locations of interest. The eHS solver will output these measurements during the simulation.
- Configure the parameters of each individual component and provide descriptive names. It is recommended, but not required, to start Source component names with the index UXX, Switch component names with SWXX, and Measurement component names with YXX.
- Add a Ground block to the circuit. This is required.
- Optional: Add Scope blocks and signal generators to the source components to allow the model to generate results offline. Note that these and any other components not supported by the eHS solver will be ignored during the FPGA simulation. They are for offline execution only.
- Save the model and press Run to confirm that there are no errors. A model that does not run successfully cannot be loaded into eHS.
Figure 1. A Half-Wave Rectifier and Voltage Divider circuit model. In this model, the Sine Wave block (grey), Scope block (yellow), and Goto Tags exist for offline simulation purposes only, and will be ignored by the eHS Solver when the circuit is simulated on the FPGA.