saber tutorial

14
Introductory Exercise Using the Saber Simulator R.E. Betz School of Electrical Engineering and Computer Engineering The University of Newcastle, Australia Created: July 21, 2000 Last modified: March 19, 2002 Generated: March 19, 2002 1 Introduction Saber 1 is a software simulation program. Its main attribute is that it allows the simulation of mixed mode systems – i.e. one can have continuous time analogue circuitry, digital circuits, continuous and discrete time transfer func- tions, magnetic systems (such as electrical machines and magnetic actuators), mechanical systems, and hydraulic systems all in the same simulation. This is unusual since most simulation packages cannot readily handle this mix of sys- tems. They tend to be more specialised – i.e. only for electronic circuits, only for power systems, digital simulation packages etc. Simulation packages are very useful for the simulation of electronic systems, since the models of electronic components behave nearly the same as the actual component. In some circumstances simulation is almost mandatory, since a poor design can result in immediate catastrophic failure of the real circuit. An example where this is often true is in the area of power electronics. The Saber simulator consists of four major components: SaberSketch: This provides a means to graphically enter a schematic to be simulated. SaberGuide: To some degree this component is hidden, since it provides the connection between SaberSketch and the Saber Simulator. Simulator: This module is the actual simulation engine. It is activated via SaberGuide. SaberScope: This is the back end postprocessing section of the Saber system. SaberScope allows the user to process the files produce by the Saber simulator and produce new files of results, but more importantly it allows the user to generate graphs of the results. In this introductory exercise we shall be using the Saber simulator for circuit simulation. The circuit to be simulated is a very simple one, but it is able to demonstrate many of the features of the software. In order to minimise the 1 Saber is a registered trademark for Avant! 1

Upload: ujjwal-karki

Post on 12-Nov-2014

179 views

Category:

Documents


3 download

DESCRIPTION

Saber Tutorial

TRANSCRIPT

Page 1: Saber Tutorial

Introductory Exercise Using the Saber Simulator

R.E. BetzSchool of Electrical Engineering and Computer Engineering

The University of Newcastle, Australia

Created: July 21, 2000Last modified: March 19, 2002

Generated: March 19, 2002

1 Introduction

Saber�1 is a software simulation program. Its main attribute is that it allowsthe simulation of mixed mode systems – i.e. one can have continuous timeanalogue circuitry, digital circuits, continuous and discrete time transfer func-tions, magnetic systems (such as electrical machines and magnetic actuators),mechanical systems, and hydraulic systems all in the same simulation. This isunusual since most simulation packages cannot readily handle this mix of sys-tems. They tend to be more specialised – i.e. only for electronic circuits, onlyfor power systems, digital simulation packages etc.

Simulation packages are very useful for the simulation of electronic systems,since the models of electronic components behave nearly the same as the actualcomponent. In some circumstances simulation is almost mandatory, since apoor design can result in immediate catastrophic failure of the real circuit. Anexample where this is often true is in the area of power electronics.

The Saber simulator consists of four major components:

• SaberSketch: This provides a means to graphically enter a schematic tobe simulated.

• SaberGuide: To some degree this component is hidden, since it providesthe connection between SaberSketch and the Saber Simulator.

• Simulator: This module is the actual simulation engine. It is activatedvia SaberGuide.

• SaberScope: This is the back end postprocessing section of the Sabersystem. SaberScope allows the user to process the files produce by theSaber simulator and produce new files of results, but more importantly itallows the user to generate graphs of the results.

In this introductory exercise we shall be using the Saber simulator for circuitsimulation. The circuit to be simulated is a very simple one, but it is able todemonstrate many of the features of the software. In order to minimise the

1Saber is a registered trademark for Avant!

1

Page 2: Saber Tutorial

vS

vd

vL

vR

L

R

i

Saber groundnode

Figure 1: Simple single phase, half wave rectifier, with an LR load.

simulation times we shall be using idealised components from the Saber partslibrary. If one wanted to work out the power dissipation in semiconductorcomponents then the more realistic real component libraries would have to beused, but use of these makes the simulation times considerably longer.

The circuit to be simulated is shown in Figure 1. It is a simple single phasehalf wave rectifier circuit. The only complication is that it has a load thatincludes inductance.

2 Circuit Schematic Capture

The first step in the circuit simulation process is to capture the circuit schematic.This is achieved by using the SaberSketch section of the Saber suite. Figure 2shows the initial screen that appears when SaberSketch is invoked (via the Startmenu).2

The sequence of steps to follow to set-up a design are as follows.

Create the design: This is achieved by selecting the File→New→Design pull-down menu. If we wanted to open an existing design then one would useOpen→Design, and then navigate to the desired file. Often if SaberSketchstarts it will load the last design file automatically.

2The drawing area is shown in white in this figure. This has been done to prevent tonerwastage when this document is printed.

2

ujjwal
Highlight
Page 3: Saber Tutorial

Partsmenu

{

Zoomingcontrols

Gridcontrol

Select todraw a line

Invoke SaberGuide

Figure 2: Initial screen upon invoking SaberSketch.

Place parts on the schematic: The next step is to place the desired com-ponents on the blank schematic. The is achieved using the Parts Gallerybutton. When clicked-on this opens up another window which allows oneto select the parts folder to be used. The folder that you will use for thisexercise is the Analogy Parts Library. If one double-left-clicks on this thenthe contents of the Available Categories window will change to a selectionof component categories. One can select a category, eventually ending upwith a listing of individual parts in the Available Parts list scroll window.An example of this window is shown in Figure 3, which shows the contentof the Inductors & Coupling component category.

To place a component in the schematic one selects a particular componentfrom the Available Parts window and then click-on Place. The componentwill then appear in the middle of the schematic window. An alternativeis to left-click-on the part and then go the to schematic window and clickthe middle mouse button (if there is one).3

One can also access the Parts Gallery via using the right mouse buttonselecting Get Parts→Parts Gallery, or from the Schematics main menu.

As a specific example, if we want to place a diode on the schematicthen one navigates to the Analogy Parts Library→Electronic→SemiconductorDevices→Diodes category. From the Available Parts window select the

3Only works if a mouse driver that recognises the middle mouse button is installed.

3

Page 4: Saber Tutorial

Figure 3: An example of a parts gallery screen.

Diode, Ideal (PWL) component and then press Place. If you look at theschematic you will find a green diode in the middle of it. The green colourindicates that the component is selected. If a component is selected thenit can be dragged around the schematic to position it where one likes bymoving the cursor pointer over it (the component then changes to red),pressing the left mouse button, and then dragging to the desired location.

Set a parts properties: Once a part is on the schematic then its propertiescan be set. This is carried out by double-left-clicking on the part (one canalso get the properties of the part by right clicking and then selecting theSymbol Properties on the drop-down menu). One can also obtain help ona part by selecting the Help drop-down menu from the properties screen.The Help explains the meaning and range of values for all the propertieslisted for the part.

The properties window contains three columns – Property Name, PropertyValue and a set of round buttons on the right that denote the visibility ofthe property on the schematic. The latter two of these can be altered bythe user. The Property Value fields can contain undef, or *req*. The undeffield usually means means that the value is undefined, but the part willexecute correctly with some underlying default value. However, in manycases this does not make sense. For example the resistor component hasundef for its value, and clearly one would wish to set the value of a resistorin a particular circuit. If an undef value has to be defined the simulatorwill let you know when you try to run the simulation. The *req* fieldmeans that there are no default values defined, and it is mandatory todefine a value. The values of the components can be entered in two main

4

Page 5: Saber Tutorial

number formats. Saber uses a set of multiplier factors which are shown inTable 1. One can of course use whole numbers, and also scientific notationif desired – e.g. 25e-4 for 0.0025.

It should be noted that the ref property name contains a unique name forthe part on the schematic. Sometimes if a part is copied on the schematicthis name is not changed appropriately (this appears to be a bug in thesoftware). Therefore one gets duplicate part references, and consequentlythe simulation fails. One has to manually change the ref name if thisoccurs.4

The visibility field allows one to nominate whether the property value (thevisibility button is half on), or the property name and property value (thevisibility full on), are to be displayed on the schematic. If the button is“off” then nothing about that property is displayed on the schematic.

In a manner similar to the placement of the diode all the other componentsare placed on the schematic. The wires that join the components are drawnby moving the cursor over one of the component node points. The cursorwill change to a cross-hair and pressing and holding the left mouse buttonwill allow a wire to be drawn. There is a grid that wires and componentslie on, which makes drawing the lines very simple. If for some reason thecursor does not change (for examples one is drawing a line not connectedto a component, then the wire drawing tool can be selected (see Figure 2).A wire which does not terminate on a component node can be terminatedby double-left-clicking at the point where one wishes to stop the wire.

Place a Saber ground node: A schematic must contain a ground referencedesignator for the simulator to be able to function. This symbol is calledGround (Saber Node 0) in the parts library. This ground symbol can belocated in a number of places in the parts library tree. The ground isconnected to the point in the schematic from which all the voltages in thedesign will be measured.

Wires: We have already mentioned how to draw wires on the schematic. Onecan also select a wire and delete it by pressing delete on the keyboard, orright clicking and selecting Delete Wire on the drop-down menu. One canalso alter the properties of a wire by right-clicking on the selected wireand selecting Attributes... on the drop-down menu (see Figure 4 for anexample of the Attributes... window). For example, one can change thename of a wire in the Name field in the window, and then select whetherthis name should be displayed on the schematic (which is often very handyfor documentation reasons).

Repeat the above steps until the complete circuit shown in Figure 1 hasbeen drawn. At this point we are now ready to start the simulation phase ofthe exercise.

4A part can be copied by selecting the component and then moving the cursor to theplace where one wishes to have the duplicate component, and then clicking the middle mousebutton.

5

Page 6: Saber Tutorial

Name Scientific Notation Saber shortcutfemto 10−15 fpico 10−12 pnano 10−9 nmicro 10−6 umilli 10−3 mkilo 103 kmega 106 meg

Table 1: Number magnitude specifiers in Saber

3 Executing the Transient Analysis

In order to carry out the simulation of a design one now has to invoke thesimulator. This is achieved by pressing the SaberGuide button (see Figure 2).One then gets the screen shown in Figure 5. Note the new toolbar at the topof the screen. This toolbar allows one to control the Saber simulator from theSaberSketch window.

The main tool used in SaberGuide is the DC/Transient button shown inFigure 5. If one clicks on this button then the window shown in Figure 6appears. The parameters circled should be filled out so that the end time andtime step of the simulation are set-up, and the simulator will automatically openSaberScope upon the completion of the simulation. One can see that there area number of other tabs on the window. In more sophisticated simulations someof these may have to be used. The only other one that we shall look at in thissimulation is the Input Output tab, which is shown in Figure 7. The circledquantities have been altered from the default values. These alterations cause tosimulator to save all the signals in the design, and all types of variables (acrossvariables (i.e. voltages) and through variables (i.e. currents)).

Remark 1 One can also select specific signals for the simulator to save. This isessential in large simulations otherwise the output files produced by the simulatorare huge. The signals can be selected using the Browse Design... selection fromthe Input Output→Signal List→Select sub-menu. Note that the simulator hasto be running to carry out this function, therefore it is necessary to start asimulation and stop it (using the Stop button), and then reenter this menu tocarry out this function.

Once all this information has been filled out then one simply clicks OK at thebottom of the window and the simulation will begin. It firstly netlists the design,and if this is successfully completed it will work out the dc starting condition,and then finally start the transient analysis. A rotating icon in the top rightcorner of the Saber window indicates that the simulator is running. When itfinishes, which is very fast in the case of this simulation, the simulator willautomatically open up SaberScope to allow the results of the simulation to bepost-processed.

6

Page 7: Saber Tutorial

Figure 4: The wire attributes window.

4 Plotting and Processing Results

If SaberScope has not been set to automatically open then it can be openedmanually via the Results→View Plotfiles in Scope... menu item.

If SaberScope opens automatically it loads the plot file just generated by thesimulator (because of the setting made in the DC/Transient screen), and thendisplays the plot file opened in the Signal Manager window, and the signals inthis plot file in a second window named after the plot file. The SaberScopeopening window is shown in Figure 8.

Notice in the Diode LR cct.tr signal window that some of the signals havea “+” next to them. This means that if one double-left-clicks on them thenanother more detailed signal list will expand from this root. One can thenselect one of these signals to plot, and then left-click the Plot button. Figure 9shows the inductor component expanded, and the i(m) signal plotted.

Remark 2 From Figure 9 one can see the advantage of naming signals withmeaningful names, as opposed to the default names given to the signals by Saber.The default names in the signal list window do not make much sense. Whenone is scanning through the signal list for complex designs, it is much easier tofind the signals/components of interest if the names make sense.

If one wishes to plot a number of variables, then left-click the desired sig-nals holding down the Ctrl key on the keyboard, and then left-click Plot. Theselected signals will all be plotted on separate axes. One can also superimposeseveral plots on the one set of axes. This can be achieved in two different ways,

7

ujjwal
Highlight
Page 8: Saber Tutorial

DC and transientanalysis button

Figure 5: An example of SaberSketch with the Saber guide toolbar activated.

dependent on whether one has already plotted the signals on separate axes. Ifone wishes to plot two signals on the same axis then select one of the signalsand plot it, and then select the other, and go the the plot window and press thecentre mouse button over the graph upon which one wishes the second signalto be plotted.

The other way of plotting two or more signals on the same axis, is to firstlyplot the signals on separate axes, and then use the Stack Region feature. Thisis activate by selecting one of the signals to be “stacked” on the same axis (thisis achieved by placing the mouse cursor over the signal name to the right ofthe plot – the plot will go red, and then left-click), and then right-click and gothe drop-down sub-menu Stack Region. At the bottom of this flyout one cansee a number of Analog signals listed (the number dependent on the numberof signals plotted on the graph window), with Analog 0 being the one at thebottom of the graph window. Select the analog signal number that correspondsto the axis that one wishes to plot onto.

If one plots a signal and wants to delete it, then select the signal in the graphwindow, and then right click to get the drop-down menu and select the DeleteSignal option.

4.1 Manipulating Results

One of the very powerful features of the SaberScope system is its ability toperform calculations on the results of the simulation, and also to take accurate

8

Page 9: Saber Tutorial

Changed fields

Figure 6: An example dc/transient simulation set-up window.

measurements on the waveforms produced.Let us firstly consider the calculation capability. The waveform calculator

allows one to subtract, add, multiply, divide, and perform a number of othermanipulations on signals. The calculator is activated by pushing the “Calcula-tor” button at the bottom of the screen. The signals that one wishes to carryout the calculations on are selected by left-clicking them in the signal window,and then middle clicking in the area just below the toolbar in the calculator.The signal name should appear in this window and the scrolling window imme-diately below it. The calculator works using reverse polish notation (like a HPcalculator), therefore before selecting an operation we need to select the twosignals to operate on.

In the example shown in Figure 10, we have selected the inductor voltage(vl) and current (i), and then selected the multiply function of the calculator (*)

9

Page 10: Saber Tutorial

Changedvariables

Figure 7: The input-output table of the dc/transient analysis window.

– i.e. we are working out the instantaneous power flow into the inductor. Theresult then appears in the top window of the calculator. We can then plot thisresult by left clicking the small graph icon at the extreme left of the calculatortoolbar.

In order to look at a waveform in more detail one can expand the horizontalor vertical axis by simply selecting the axis by left-clicking, and then holdingdown the button to extend a yellow bar along the region of the axis that onewishes to expand. One can do this more precisely by right-clicking on the axisof interest and then using the drop-down menu to carry out a more precisenumerical expansion of the axis (or alternatively go back to the original axisscaling).

In addition to expanding the axes using the mouse cursor, one can alsozoom in on the waveforms by simply clicking the mouse over the section of the

10

Page 11: Saber Tutorial

Figure 8: The initial SaberScope window.

waveform of interest, and then dragging out a square marque over the area.This area will then be zoomed on the plot.

All plotted curves have properties that can be altered. This is achieved byselecting the plot of interest, and then right-clicking and selecting Attributes....The contents of the resultant window are self explanatory.

The other major facility that is of use for processing plots is the measurementtool. This is activate by left clicking the “Caliper” button at the bottom of theSaberScope screen. This tool allows one to measure the precise absolute values ofthe quantities on the screen, rise time of steps etc. There are too many featuresto document here, so it is suggested that you have a look at the features, andtry them to see what happens.

4.2 Fourier Analysis

The Fourier Analysis facility allows one to get frequency response plots for dataproduced by the simulator. A Fourier Analysis can only be performed after thesimulator has run, and therefore falls into the post-processing category.

In order to perform a Fourier Analysis one must firstly return to the Saber-Guide window (don’t close the SaberScope window, simply iconise it to keepit out of the way). The following steps are carried out to perform a FourierAnalysis on a periodic waveform.

1. Select the Analyses→Fourier→Fourier... menu.

2. The left window in Figure 11 will show up. I have filled in some valuesfor this window. The Fundamental Frequency of the output waveforms isknown as it was set by the frequency of the sine wave source in the circuit.The 80 millisecond time next to the Period End dialogue indicates that we

11

Page 12: Saber Tutorial

Figure 9: A signal plotted in SaberScope.

are to analyse the period of the output ending at 80 milliseconds. Finallythe Number of Harmonics stipulates the maximum number of harmonicsthat that analysis will calculate.

3. Another tab in the Fourier window is the Input Output tab. Its contentsappear as the right window in Figure 11. In this case I have set the SignalList to be /... which means all signals, and the Include Signal Types is setto all, meaning that through and across variables are to be included.

4. Finally we left click OK or Apply and the Fourier analysis is carried outon the signals selected.

Remark 3 If one is analysing a non-periodic waveform or a pulse then the FastFourier Transform option should be used.

In order to plot the results of the Fourier analysis go back to SaberScopeand via the Signal Manager window open a file dialogue. One should see a newfile with a fou.ai pl extension. Click on this file and click on Open. Anothersignal list box should open with the signals listed for which frequency data isavailable. These signals can then be plotted in a fashion similar to the timedomain signals.

5 A Practice Exercise

In order to test your understanding of the above concepts it is suggested thatyou carry out the following on the circuit of Figure 1. I suggest that you don’tblindly carry out the simulation, but try and understand what you are seeing in

12

Page 13: Saber Tutorial

Figure 10: An example of a waveform calculation in SaberScope.

the results. For a simple circuit, it has surprising results, and you might learnsomething!

1. Execute the simulation and plot graphs of vs, vR, vL and i.

2. Measure the average and rms load current from the plots.

3. Measure the average voltage across the inductor, and try and explain theresult.

4. Measure the voltage across the diode. What is the maximum reversevoltage it is subject to?

5. Plot graphs of the power dissipated in the load and the energy stored inthe inductor. Measure the average power dissipation.

6. Measure the ac source power, and compare this value with the value dis-sipated in the load resistor. Why is there a discrepancy?

7. Perform a frequency analysis of the rectifier output voltage and current.Why is the spectrum of the current different from that of the voltage?

8. Replace the load resistor with a 300 volt dc source. Plot vS , i and vL. Notethat current only flows for part of the half cycle of the voltage supply. Notewhere the peak current occurs.

9. Measure the average and rms values of the load current and voltage. Alsomeasure the average power transferred to the load. Note that the averageload power is now the product of the average current and average loadvoltage.

13

Page 14: Saber Tutorial

Figure 11: Fourier analysis dialogues in Saber.

10. Perform a frequency analysis of the load current and voltage, and comparethe results with the resistive load case.

If the above exercise is carried out successfully then you should have a goodpreliminary working knowledge of the operation of the Saber simulation system.There are many other aspects of the system that we have not considered – youwill need to know these for more sophisticated simulations.

Acknowledgment

This tutorial is partially based on a Saber tutorial written by Dr. B.J. Cook ofthe Department of Electrical and Computer Engineering, University of Newcas-tle, Australia.

14