Hi,
Most of us are familiar with performing power electronics circuits simulation using Matlab, PSpice, PSim etc., In this article we will see how to perform the same power electronics simulation using NI Multisim and how to perform the co-simulation using NI LabVIEW.
Two major features of performing simulation using Multisim and LabVIEW are:
1. Dynamically varying simulation parameters during run time.
2. A graphical interface development for simulation.
We will take the example of a simple H bridge inverter producing two level output.
You need to have the following softwares.
1. NI LabVIEW 2014
2. NI Multisim 2014
3. Control and Simulation package 2014.
The good thing with National Instruments is that you can get a free 6 month student version to work on with the software!
Go to the "Place" menu and click on the "Component" to start adding components to the simulation. Alternatively, the short cut key is "Ctrl+W". The default window opens up as shown in the screenshot.
Start searching the components required for the simulation. The list of components needs are:
1. DC_Power
2. Transistor_Diode
3. Digital_Clock
4. Non_Ideal_Resistor
5. Ground
Make sure that you type the exact name as shown above.
We need to change the frequency to 50 Hz as we are considering to operate the inverter at 50 Hz. Set the
frequency to 50 Hz for all the Digital_Clock. The delay will be 0 for U1 Digital_Clock and U2 Digital_Clock.
Since the total time period is 1/50 Hz = 0.02 Sec, for a two level inverter the switches in a leg are phase
shifted by 0.01 sec.
The most important part of our simulation:-) Save it!.
To run the simulation, go to the "Simulate" menu and click on "Run" icon. Alternatively you can also use the shortcut key F5.
The simulation is running and we can see the output in the oscilloscope.
Please find the attachment containing the inverter file.
The simulation performed in Multisim does not provide the option to vary the circuit parameters like input voltage while it is running. This is where co-simulation is useful.
Co-simulation is nothing but linking the Multisim and LabVIEW environment to make the whole simulation dynamic. The concept of co-simulation is that all the circuit components like diodes, MOSFET, resistors are provided by the Multisim software while the control algorithm such as PI controller, closed loop controller are performed by the LabVIEW. I hope you got the point!
The existing multisim inverter file needs to be modified to perform the co-simulation which will follow now.
The block that performs the exchange of data between Multisim and LabVIEW is the "Hierarchical Connector". Go to "Place", then "Connectors" and "Hierarchical Connector". You can use the short cut "Ctrl+I" also.
Since we are using input voltage source and output voltage across resistor as parameters for co-simulation, we need multiple Hierarchical connectors. See the pictures for connections. We use three hierarchical connectors, one at the input and two across the resistors. Complete the connections as shown in the picture.
As the connections are over now, we move on to setup the connectors. We need to rename it suitably. The direction of the hierarchical connector needs to be defined as input or output. The Voltage_Controlled_Voltage_Source is input type while the other two connectors are output type. Please refer to the pictures.
We need to specify that the VNeg hierarchical connector is the negative terminal of the VPos connector. Go to "View", then "LabVIEW Co-Simulation Terminals". A Window will open. In the Output section in the window we need to mention that VNeg terminal is the negative connection of VPos. You need to select the VNeg in the Negative connection column of VPos row. After setting up you can save and close the file. Make sure you remember the path of the file saved. I prefer to save it on desktop.
Before performing the task it is a good idea to split the Front Panel and Block Diagram into two halves on the screen. Go to "Window" menu and click on "Tile Left and Right". This will split the Front Panel and Block Diagram into two halves. Now move your cursor to Block Diagram and right click to get the list of pallets. Go to "Control and Simulation", then "Simulation" and click on the "Control and Simulation Loop". Drag it to a larger size while placing on the Block Diagram.
We need to import the Multisim design file into the Control and Simulation Loop. Again go to the pallets in the Block Diagram via the path "Control and Simulation", then "Simulation", then "External Models" and "Multisim Design". It will then ask for the file path. Hope you remember the path. Choose the path and click Ok. You will notice the Hierarchical Connectors names shown in the Multisim design imported.
The input is over and now we need to add a graph at output and a Halt simulation feature. Open the pallets in Block Diagram. Go to "Control and Simulation", then "Simulation", then "Graph Utilities" and select "SimTime Waveform". Again follow the same path till "Simulation" and go to "Utilities" and select "Halt Simulation". Make sure that you place all the blocks inside the loop and complete the connections as shown in the pictures.
We need to mention the simulation parameters now. Double left click on the small box on top left of the control and simulation loop to open the simulation parameters settings. You need to change the "Final Time" to "inf", "Initial Step Size" to "1E-5", "Minimum Step Size" to "1E-9" and "Maximum Step Size" to "1E-5". Refer to the pictures.
This step is optional, however I strongly recommend to perform. When going for much more blocks and connections in the Block Diagram, it looks messed up. To rearrange the blocks, click on the "Clean Up Diagram" icon in the top side list of icons, one with a broomstick symbol. Things will look better now.