Export to Spice introduction.
There is no doubt that Spice is an industry standard for circuit simulation. Therefore there exist a possibility to create simple coupling between Spice and Caspoc. Since Spice simulations tend to be slow and plagued with convergence problems it is not advised create a co simulation between Caspoc and Spice. However Spice can be valuable when one wants to simulate one switching stack in a power converter and thereby using existing spice models for the semiconductors.
There are two methods that are advised:
Partial co-simulation
The first method is partial co-simulation: Perform a system simulation in Caspoc for a long time period, followed by a spice simulation for only one switching interval.
- Perform a system simulation of the power converter with load and control and thereby using ideal switch models for the semiconductors.
- Run the simulation until the steady state is achieved. Reset "Tscreen" to one or two switching intervals and continue the simulation for this short period.
- Store the waveform for the control signals, supply voltages and load current. This is done by displaying each of these waveforms in a scope, and than saving them in ASCII text files by selecting "File / Save" in each Scope.
- Build a Spice model using the detailed semiconductor models and model the control signal, supply voltage and load current by controlled voltage sources, with the value FILE="caspoc_data_file" instead of a numerical value. Specify the name of the saved text file from the Caspoc-scope instead of caspoc_data_file.
- Run the simulation in Spice to obtain the waveforms during the switching of the semiconductors.
The Spice simulator of choice can be selected in the Optiosn, see the section Options below.
Netlist export
The second method is exporting a spice file or spice library file from the Caspoc model and use that model into spice. This methods finds applications where a basic electric circuit or a control has to be coupled to a FEM simulation, where the FEM software can include a circuit model.
Menu
The netlist export and export of the initial conditions for the Spice simulation is started from the Spice section in the menu item Tools
From the menu Spice you can select exporting and vieing of the netlist. Since the netlist is written into the temporary folder of Windows, the easiest is usingthe view commands from the menu for discplaying the netlist.
After running the simulation, the results are displayed in the scopes. This shows that the model contains all components and is configured in the correct way. To export the spice netlist, you have to select from the menu Tools/Spice/Export and than select the preferred file type. Below we are exporting as a spice *.cir file.
The spice netlist file is written in the temporary folder of Windows. To see the results, you have to select the menu item Tools/Spice/View/View (exported) input files and than select the preferred file type
Circuit components can be selected arbitrarily from the circuit section, although it is saver to selct them from the Circuit/Spice section.
Since only a limited number of blocks can be exported into the spice netlist, there is a special blockset that can be selected for creating spice netlist exports. Thes can be found in the systems and blocks section under Spice
Selecting the spice simulator
From the menu select Options/Options, to specify the preferred spice simulators. Not all simulators can run a *.cir file directly. Topspice is a tested spice simulator that has proven to give good results in running the netlists from Caspoc.