Академический Документы
Профессиональный Документы
Культура Документы
An Introductory Workshop
Version 4.2
www.mentor.com/systemvision
SystemVision
An Introductory Workshop
Version 4.2
www.mentor.com/systemvision
SystemVision Overview
Workbook Overview/References
SystemVision Basic Features
Presentation
Hands-on Exercise
SystemVision Parametric Analyses
Presentation
Hands-on Exercise
SystemVision Symbols and Models
Presentation
Hands-on Exercise
Application Examples
Unmanned Aerial Vehicle (UAV) Presentation
Hands-on Exercise: UAV Mixed-Signal (Case Study 1)
Hands-on Exercise: UAV Mixed-Technology (Case Study 2)
Hands-on Exercise: UAV Power Converter (Case Study 3)
Hands-on Exercise: UAV Communications (Case Study 4)
Hands-on Exercise: UAV System (Case Study 5)
Table of Contents
Workshop Objectives.................................................................................................. 5
Workshop Objectives 5
Prerequisites 5
Introduction to SystemVision..................................................................................... 9
Copyright
Copyright Mentor Graphics Corporation 2005. All rights reserved. The contents of this
training material may not be duplicated without prior written approval from Mentor
Graphics Corporation.
Workshop Objectives
The purpose of this workshop is to familiarize students with the SystemVision System
Modeling Solution. This and other related material is available at the Mentor Graphics web
site: http//www.mentor.com/systemvision/.
Workshop Objectives
As a minimum, students should come away from this training class with:
A basic ability to create and simulate designs using SystemVision
Simulation fundamentals
An understanding of the types of systems that can be developed and analyzed using
SystemVision
Prerequisites
General knowledge of electrical engineering is required
Simulation experience is not required
Additionally, a self-running demo of the Getting Started tutorial is available from the
SystemVision Welcome screen.
The Waveform Viewer's Tutorial presents an example-driven tour of the basic features
available with Waveform Viewer. It is accessed from within the Waveform Viewer:
Help > Tutorial > Open Tutorial.
Introduction to SystemVision
The SystemVision
System Modeling Solution
Instructor Notes/Comments
SystemVision is a general purpose analog, digital, mixed-signal, mixed-
technology simulation environment. This presentation is meant to be an
introduction to the SystemVision System Modeling Solution.
Requirements Specification s +b
Cascade G2 ( s ) = k
Compensation s + a
Plant
+
S1 S2 S4
Architectural
S3 +
G2(s)
System Partitioning Feedback Compensation
H(s)
GAP ????
? ? ? ? ? R1
CFB
RFB
Component R2
OpAmp
Detailed Design Motor
Load
GAP Enc.
Instructor Notes/Comments
Designing complex systems often requires designers to represent the system at various levels
at different stages of the design. These levels can be represented by a pyramid. The tip of
the pyramid represents the Conceptual or Requirements Specification level, where abstract
ideas are tested, as well as some interface ideas.
The next level in the pyramid is the Architectural or System Partitioning level, where the
designer begins to compartmentalize design ideas, using state machines and transfer
functions
Eventually, the designer makes it to the Component level, where the detailed design is
actually implemented with real parts. In many of todays systems, these parts can consist of a
mix of analog and digital electrical components, as well as mechanical, electro-mechanical,
magnetic, electro-magnetic, and other mixed-technology components.
Additionally, designers are adding more and more software into such systems, sometimes at
all levels of the design!
Of course, designers need simulation tools to accomplish these system designs.
Unfortunately, there are GAPs between what the designers need, and what the tools
typically have to offer.
There are tools for the higher levels, and tools for the component level, but not from the
high level to the component level.
Requirements Specification s +b
Cascade G2 ( s ) = k
Compensation s + a
Plant
+
S1 S2 S4
Architectural
S3 +
G2(s)
System Partitioning Feedback Compensation
H(s)
Architectural Component
Combine All +
G(s) PWM
M J
Levels
CCW CW
? ? ? ? ? H(s)
R1
CFB
RFB
Component R2
OpAmp
Detailed Design Motor
Load
GAP Enc.
Instructor Notes/Comments
SystemVision was specifically designed to fill the gap:
- Across technology-type boundaries
- Across all levels of abstraction, including the all-important Functional level.
- And across the software/hardware boundary
What is SystemVision?
CFB
R
RFB
R1
R2
OpAmp
Motor Motor C
Load
System Component
Model Models
Enc.
VHDL- Mixed-
AMS Signal
Component Models
Simulator
Core
SPICE Multi- Modeling Formats
& Domain
C
VHDL-AMS : E == m*c**2;
Results
SPICE :
m
E
c x2 c2
C Language : E = m*pow(c,2);
Instructor Notes/Comments
At the core of SV lies an extremely powerful and versatile simulation engine,
which accepts mixed-signal, mixed-domain (mixed-technology) as well as multi-
language formats.
Lower-Right: SV is supported by three language pillars: VHDL-AMS, the C
programming language, and SPICE formats. This allows for convenient use of
existing models, as well as ease of development of new models in standardized
formats.
Upper-Right: Models for any of these formats can be attached to graphical
symbols, which are often stored in symbol libraries.
Upper-Left: These symbols are used to graphically construct designs. These
graphical designs are read into the SV core, and simulated per the user's
specifications.
Lower-Left: SV simulates the given design, and produces user-friendly
waveforms which can be measured and analyzed.
Graphical Design
What is SystemVision?
CFB Model Libraries
R
RFB
R1
R2
OpAmp
Motor Motor C
Load
System Component
Model Models
Enc.
VHDL- Mixed-
AMS Signal
Component Models
Simulator
Data Analysis & Viewing Core
SPICE Multi- Modeling
Model Creation Formats
& Domain
C
VHDL-AMS : E == m*c**2;
Results
SPICE :
m
E
c x2 c2
C Language : E = m*pow(c,2);
SPICE
dq->abc +
P-I c ic Te
Profile Cmd
Angle Encoder/
Command Tachometer T load
k
s
Slip + + Scale wr
Calc Factor
Encoder
Time-Division Multiplexer
Parity Generator
Multi-Technology Architectural
Multi-Language System Partitioning
Mixed-Signal
Functional
Combine All Levels
Component
Detailed Design
In this section, we will focus on some of the basic features of SystemVision. These features
include DC (Operating Point) analysis, as well as transient (time-domain) and AC
(frequency-domain) analyses.
The Waveform Viewer will also be introduced, and basic instructions for viewing various
waveforms will be given. Additionally, the Measurement Tool and the Waveform Calculator
will be briefly introduced.
SystemVision
Introduction and Basic Features
Simulation Analyses
DC (Operating Point)
Transient (Time-domain)
AC (Frequency-domain)
Viewing/Post-Processing Results
Waveform Viewer
Basic Measurements
Welcome Page
Getting
Started Additional
.pdf file Help
Examples
Access with
Welcome Tab
Main Interface
Project tab Schematic SystemVision
Contains Toolbar Toolbar
Schematics
Main Window:
Schematics
Model files
Symbols
Simulation Tab
Contains
input/output
Files
Use Tabs to
Select window
Output
Transcript
Window
Creating a Design
Symbol Library
Selected Symbol
Symbol List
VHDL-AMS
Symbol Libraries Symbol Preview
SPICE
Symbol Libraries
Place symbol
Model Parameters
(VHDL-AMS Generics)
Running a Simulation
Simulation Controls
Simulations Tab
Simulations Tab
3 main analysis sections
Frequency (AC)
Analysis
Simulation Controls
Results Tab
Results Tab
Load/Append/Replace waveforms
Results
Database
Name
Enable
Annotation
To Schematic
Expand
Hierarchy
Select desired
waveforms
Select individual
signals
Viewing/Post-Processing
Results
DC Back Annotation
Click Show/Hide
Back Annotation
to toggle on/off
DC values appear
on schematic
Graph window
Waveform List
(Waveform Display pane)
Signal pane
Tree/List tabs
Drag and
Drop
To plot
Signal
Type
Plot analog
Indicators
or digital
Signals
Domain
Units
Preserved
Auto-loads
Current
Database
Access
Additional
Workspaces
Add Multiple
Cursors
Annotate
Measurement
Results
Cursors Display
X and Y Values
Waveform Measurements
Example: Risetime
Select thresholds
(optional)
Annotate to graph
or create new
waveform
Select X range
(optional)
Click Apply to
Perform Measure
Waveform Calculator
Equation Stack
Input Waveform
Advanced Functions
(more in View menu)
Standard
Functions Plot to Active Graph
Open-source
User can read and/or edit
Educational
Includes examples from all natures
Pre-compiled
To speed up simulation
Includes symbols
Continually growing
vpulse1 C1
When you install SystemVision, the installation program creates two ways with which
it may be invoked:
Windows Start Menu.
Start > All Programs > Mentor Graphics SystemVision > SystemVision Professional 4.2
b) Click the [+] next to TestBenches. The testbench listing is expanded and the
contents of the testbench are displayed.
c) Under TestBenches, click [+] next to ex_rlc [ACTIVE].
The listing of files associated with this testbench are shown in Figure 1.
R L
vinput vmid vload
vpulse C
b) (Optional) Click the zoom icons in the View Toolbar to adjust the size of the
display.
Time-domain Analysis
1. Specify the simulation settings.
a) Choose Simulation > Simulate from the menu bar. This displays the Simulation
Control dialog box shown in Figure 3. This dialog box provides four tabs:
Simulations, Results, Multi-Run, and Advanced. When you click on a different
tab, the dialog box changes to provide different simulation settings.
b) The Results tab specifies that the simulation waveforms will be stored in a
database called ex_rlc, and that All Waveforms for the Time-domain analysis will
be stored in this database (individual waveforms can be selected as well).
3. Run the simulation for operating point and time domain analyses.
a) Click OK. This begins the following simulation analyses on the active testbench
(ex_rlc) shown in the Project Navigator:
Operating point analysis
Time domain analysis
b) When the simulation is complete, SystemVision launches the Waveform Viewer
in a separate window, shown in Figure 5. Note the Waveform List, which shows
a hierarchical list of signals for each design element in the testbench.
Note that in the figure the background color has been set to white to allow
waveforms to be easily viewed when printed.
To zoom in on an area, click and hold the left mouse button to create a
rectangular bounding box. You can stretch this box to surround the portion of
the display you want to zoom.
To display a popup menu for zooming and placing waveform cursors, move the
mouse cursor away from any portion of the waveform and then click the right
mouse button.
You can use this menu to practice zooming the display and using waveform
cursors. Note that the F5 key also creates waveform cursors. To move a
waveform cursor, click on it and drag it to a desired location. To delete a
waveform cursor, click on it and press F5.
To display a popup menu for waveform properties, move the mouse cursor over
any portion of the waveform and click the right mouse button.
To delete a waveform from the display, click on its name in the waveform Signal
pane and click the Delete icon in the toolbar.
5. Perform Overshoot Measurement.
a) Select Tools > Measurement Tool from the menu.
b) Select Overshoot from the drop-down menu located to the far right of the
Measurement: label (the field next to the Measurement: label should specify All
Types, which allows all measurements to be viewed).
c) Verify that the vload waveform name appears in the Source Waveform(s) field. If
it does not appear, select it using the drop-down menu for that field. The
Measurement Tool should appear as shown in Figure 7.
d) Leave all other fields unchanged, and click Apply. An overshoot measurement
should be performed on the vload waveform.
e) Click the Close button on the Measurement Tool. The Measurement Tool will be
used again in later labs.
6. Save the simulation results as a waveform database.
a) In the Waveform List, click the folder icon next to ex_rlc.1, which selects the
results of this simulation as a database.
b) Right-click to display the popup menu and click Save As... to display the Save As
dialog box.
c) Click Save to save the current database of simulation results in the specified
location. Now these simulation results can be loaded at any time without having
to run another simulation.
7. Close the database.
a) In the Waveform List, click the folder icon next to ex_rlc.1.
b) Right-click to display a popup menu.
c) Click Close then Yes in the confirmation dialog box to close the display of
ex_rlc.1.
Frequency-domain Analysis
The frequency domain analysis is a small-signal AC analysis that uses the following
parameters for voltage source V_PULSE1:
ac_mag = 1.0
ac_phase = 0.0
1. Run the simulation for frequency domain analysis.
a) Return to the SystemVision window and choose the following to display the
Simulation Control dialog box: Simulation > Simulate.
b) In the Simulations tab, click the appropriate boxes to do the following:
Disable: Operating Point Analysis, Time-Domain Analysis
Enable: Frequency Analysis
c) Under Frequency Analysis, type the following values:
Freq Start: 10
Freq Stop: 100k
Number of Points: 10 (in the Setup tab)
e) Leave all other fields unchanged, and click Apply. A lowpass bandwidth
measurement should be performed on the db(vload) waveform.
f) Click the Close button in the Measurement Tool.
4. Choose File > Exit to quit the Waveform Viewer.
a) If necessary, click Yes to the Confirm Exit dialog box.
b) Click No to the Unsaved Changes dialog box.
5. You have finished this exercise. Before exiting, select File > Close All to close all open
schematics.
Create and Simulate a New Design
In this lab exercise you will create a simple electrical design from analog models provided in
the SystemVision library, simulate, and view the results.
These exercises show you how to do the following tasks:
Create a new project
Create a new schematic using symbols and models from the Educational Library
supplied with SystemVision.
Place and wire symbols
Run a simulation and view results
A new project is created as shown in the ProjectNavigator Tree (you may need to
scroll right to see the project name).
Create a New Schematic
In this section of the exercise, you will create the schematic shown in Figure 10.
1. To create a new schematic for the circuit in Figure 10, choose: File > New...
a) In the New dialog box, click the File tab.
b) From the Types pane on the right, select Schematic.
c) In the Name field, type in a name for this schematic (such as rc_filter).
d) Click OK.
For future symbols, this procedure will be summarized using notation similar to:
Electrical > v_pulse.1 > Place
2. Select and place the remaining symbols. As you did for the voltage source in the
previous step, select component symbols from the Add Component dialog box and
place them in the schematic window.
a) In the Add Component dialog box, select a resistor for placement.
Electrical > resistor > Place
b) Move the cursor into the schematic and click to place a resistor symbol (R1).
c) Move the cursor back to the Add Component dialog box and click Place.
d) Move the cursor into the schematic and click to place another resistor symbol
(R2).
e) In the Add Component dialog box, select a capacitor for placement.
Electrical > capacitor > Place
f) Move the cursor into the schematic and click. This places a capacitor symbol (C1)
in the schematic.
g) In the Add Component dialog box, select an electrical ground for placement.
Electrical > electrical_ref > Place
Figure 11 shows what the display looks like with the added components (again,
the colors have been altered in SystemVision so that the schematics will be easily
viewable in printed form).
2. To get out of the Add Net mode, click the Select icon
from the Object Toolbar.
3. Save the design. Choose File > Save.
Set Properties for Components
Now that the components have been placed and connected together to form the desired
circuit, the parameter values for each component should be specified.
1. Set the properties (parameter values) for voltage source V_PULSE1.
a) In the schematic work area, right-click on the voltage source (V_PULSE1). This
displays a popup menu.
b) Choose Edit Model Properties, which displays the Model Properties dialog box.
c) Click the Parameters tab. Note that the parameter names for this voltage source
are listed in the left-hand column under Name.
d) In the Value column, type the following values for each indicated parameter:
Name Type Default Value
WIDTH TIME 1 ms
PERIOD TIME 2 ms
PULSE VOLTAGE 5.0
a) Right-click on R1. Choose Edit Model Properties, which displays the Model
Properties dialog box.
b) In the Model Properties dialog box, click the Parameters tab.
c) Find the RES parameter in the Name column, move your cursor under the Value
column, and click in the blank space.
d) Type 5000 (or 5e3), which specifies 5 k as the resistance for R1.
Name Type Default Value
RES RESISTANCE 5000
e) Click OK.
f) Right-click on R2. Choose Edit Model Properties, which displays the Model
Properties dialog box.
g) In the Model Properties dialog box, click the Parameters tab.
h) Find the RES parameter in the Name column, move your cursor under the Value
column, and click in the blank space.
i) Type 50, which specifies 50 as the resistance for R2.
Name Type Default Value
RES RESISTANCE 50
j) Click OK.
3. Set properties (parameter values) for capacitor C1.
a) Right-click on C1. Choose Edit Model Properties, which displays the Model
Properties dialog box.
b) In the Model Properties dialog box, click the Parameters tab.
c) Find the CAP parameter in the Name column, move your cursor under the Value
column, and click in the blank space.
d) Type 1e-6, which specifies 1.0F as the capacitance for C1.
Name Type Default Value
CAP CAPACITANCE 1e-6
e) Click OK.
Set Properties for Nets
Now the components have been connected together and parameterized. The last step before
simulating is giving the nets meaningful names so they can be easily identified in the
Waveform Viewer.
1. Double-click on the net (wire) between V_PULSE1 and R1.
a) In the Properties dialog box, click the Name tab.
b) In the Label field, type vin (this will be automatically capitalized as you type it in).
c) Click OK.
The design will be netlisted, and the design models will be compiled (if necessary).
Then the Simulation Control dialog box should appear.
4. In the Simulations tab, make the following selections:
a) Enable: Operating Point Analysis and Time-Domain Analysis
b) Under Time-Domain Analysis, enter the following value:
End Time: 0.5
5. In the Results tab, select All Waveforms from the drop-down menu next to the
Time-domain Waveforms field.
6. To simulate, click OK in the Simulation Control dialog box.
This runs a simulation on the design. When the simulation completes, SystemVision
launches the waveform viewer.
View Results
1. In the Waveform List window, click on the [+] indicators next to c1, r1, and r2 to
expand the list of waveform names for each component.
2. Display the following waveforms by double-clicking (or by drag-and-drop into the
waveform display pane):
Under c1: i, v
Under r1: v
Under r2: v
Note that the horizontal display for each waveform is quite compressedto better view
each waveform, you need to change the range of the X axis.
You can change the range of the X axis either by clicking and dragging the mouse cursor
across the time values or by changing X axis properties, as described in the next step.
3. Change X Axis Properties. Move the mouse cursor over the word Time(s) along the
X axis and right-click.
a) In the popup menu, choose Properties. This displays the X Axis Properties
dialog box.
b) Under Axis Range, disable (uncheck) Auto Range. Set Max to 0.005.
c) Click OK.
4. Figure 13 shows the four waveforms that should appear in the workspace.
Lab Summary
This lab focused on some of the basic features of SystemVision. These features included DC
(Operating Point) analysis, as well as transient (time-domain) and AC (frequency-domain)
analyses.
The Waveform Viewer was also introduced, and basic instructions for viewing various
waveforms were given. Additionally, the Measurement Tool and the Waveform Calculator
were briefly introduced.
Lab Review
Project Tab
Schematics
Symbol Libraries
Additional Files
Simulation Tab
VHDL Files:
Local Files
Library files
Generated Files
Simulation Results
Use mouse cursor to view path info
Local compiled
(work) library
Additional
Pre-compiled VHDL Testbenches
model libraries
Glossary of Terms
The following terms apply to the way SystemVision handles design management.
Project a working collection of designs, schematics, test benches, experiments,
libraries, and associated files that SystemVision uses to manage data and user input.
You must use a project to operate on your design and save the results. Projects are
saved with the file extension .dproj.
Testbench a unique, operational design unit (schematic or HDL code) that consists
of a netlist of model instances and settings for simulation. Every simulation is
performed on a testbench. The design unit may or may not contain its own driving
stimulus and loads for simulation. (As an HDL term, testbench is the stimulus that
is affixed to the design for simulation purposes).
Experiment a unique collection of settings that you specify for a given simulation
and its results on a given design.
Design a user-defined network of models (usually represented by a schematic or
structural HDL code) that SystemVision can simulate.
Root (Design Root) a symbolic design associated with a specific testbench. Usually a
schematic, the root is the top design entity in a hierarchical design that is under test.
The root may or may not contain a driving stimulus that can produce results.
Typically, a testbench is attached to the design root.
File the basic element of data storage, which you can open, read, and write in
SystemVision but only if you have a project open. Although you cannot open a
project as a file, you can open files contained within a project.
Block a design that can be used as part of a larger design.
Functional block (fub) the ViewDraw term for a user-defined symbol. If you create
a fub, you must also associate it with a model and assign it to a library, if desired.
Database SystemVision uses the ViewDraw database structure to store project
information such as connectivity, symbol data, instance data. Simulation results are
stored as waveform database files (with extension .wdb), which is the format used by
the waveform viewer.
Schematic (page, sheet) the graphical display of symbols and connections that
represent a design. SystemVision saves a schematic as a file as part of a project.
Sheet the extension of a schematic (also referred to as a page). If you have large
schematic that does not fit into the document display area of SystemVision, you can
partition it into multiple sheets. Sheets do not necessarily create hierarchy for the
design (although you can create hierarchy on different sheets).
Library (database) a well-defined collection of files that contain symbol definitions
or model definitions (such as files containing VHDL-AMS models). A library is
maintained in a specific directory location defined by SystemVision.
Symbol the graphical representation of a model that gets displayed on a schematic.
In this section, we will focus on the parametric analyses features of SystemVision. These
include deterministic-based Parameter Sweep and Sensitivity analyses, and statistical-based
Monte Carlo analysis. Also emphasized are the post-processing features of the Waveform
Viewer used to manage the large amounts of data that can result from such analyses.
SystemVision
Parametric Analyses
Parameter Sweeps
DC Sweeps
Time/Frequency-domain Sweeps
Sensitivity Analysis
Monte Carlo Analysis
Parameter distribution setup
Running Monte Carlo
Post-Processing Results
Parameter Sweeps
Time-domain results
as parameter is swept
DC Sweep Example
Testbench circuit Ic vs Vc
Edit
Parameters
Select
Sweep
Simulator Commands
Generated DC Sweep enable
(optional)
Select parameters
Sensitivity Analysis
Select Analysis
Which parameters
To vary
0.483
0.238
0.225
3.1023 (nominal)
2.9523 (R+10%)
Statistical analysis
Performed by random selection of model
parameters
Nominal value, Tolerance and Distribution
assigned for each parameter
VHDL-AMS or SPICE parameters
Powerful post-processing in Waveform
Viewer
Transforms data into information
Nominal Value
(from Model
Properties)
Select Distribution
Assign Tolerance
Value (%)
Select
Monte Carlo Input # of Runs
Optional Seed
(default = 1)
Selects only
Extreme values
during simulation
Right Click
To access
Parameter
Parameter Table
Values Saved
in WDB
Plot as a
Plot Group of
Individual Signals
Runs
Icons indicate
Compound
Waveforms
Select
Measurement
Input
Compound
Waveform
Create new
waveform
Measured Measurement
Value Creates
Scatterplot
Y-axis
Indicates
Measurement Run
Number
Waveform Calculator
Equation Stack
Input Waveform
Advanced Functions
(more in View menu)
Standard
Functions Plot to Active Graph
Enter to Stack
Winding Motor
Resistance Inductance
Plot MC
Parameter
Values
Transform to
Histogram Transform to
Result: Normal Histogram
Distribution Result: Uniform
Distribution
Risetime
Histogram
Motor Position
(original MC data)
Risetime vs r_wind
(high correlation)
Risetime vs inductance
(low correlation)
Lab Exercise
VHDL Digital
Command SPICE circuit
Inputs
VHDL-AMS Motor
with Mechanical
Load Dynamics
In this lab we will use Parameter Sweeps, Sensitivity and Monte Carlo analyses in
SystemVision to analyze the performance of a simple H-Bridge Motor Controller. This
example combines SPICE models for the electronics with VHDL-AMS models for the
motor and loads. The ability to simulate these together is made possible by SystemVisions
support for multiple industry standard languages. Combining this with Parametric Analyses
makes SystemVision a powerful tool for robust mixed-technology system design.
The SystemVision project is named Beyond_SPICE. Contained in the project are several test
benches that illustrate how SystemVision uses VHDL-AMS to extend SPICE beyond its
inherent limitations for modeling mixed-technology systems.
H-bridge Motor Controller
The design tb_hbridge_spice_ams, shown in Figure 1, is an H-bridge circuit combining SPICE
level transistors with digital (VHDL) stimulus and a VHDL-AMS DC motor model with
loads attached. Using SystemVision, the power of VHDL-AMS can be seamlessly integrated
with existing SPICE models or subcircuits, to provide a multi-language, mixed-technology
system simulation.
DC Motor
Rotational
Stop
Digital Command
Inputs
Moment of
Inertia
Design Selection/Exploration
3. Plot the signal position. This is the position of the motor shaft over time. Notice that
the motor does not return to its original position due to the short length of the
reverse command signal.
4. Verify that the waveforms match those shown in Figure 2.
5. Close the graph window, or bring up a new one by selecting File > New.
Parameter Sweeps
Parameter Sweeps are useful for automatically varying specific circuit parameters and
running simulations.
Setup Sweeps
We next examine the effects of the component parameters on the motor position. We will
do this by sweeping a parameter (motor winding resistance) over a specified range.
1. Return to the tb_hbridge_spice_ams schematic and from the menu, select Simulation >
Simulate to invoke the Simulation Control window
10. When the simulation runs are complete, plot the digital command signals (fcmd and
rcmd) along with the motor position as shown in Figure 5 below:
6. Click the Add Cursor button twice to place two cursors (C1 and C2) at locations
similar to those shown in Figure 6.
7. Click the Measurement Tool icon and fill in the dialog as shown in Figure 7 to
annotate the Risetime measurement results to the graph.
The measurement can be moved from one waveform to another by clicking on the
handle at either the top of bottom of the result markers, and holding and dragging
to another waveform. All measurement results can be viewed by right-clicking with
the cursor over the measurement and selecting Measurement Results.
9. In the Measurement Tool, select the Plot New Waveform option and re-apply to
create a plot of Risetime vs. motor winding resistance.
10. Bring back up the graph window with the waveforms shown in Figure 6.
11. Reposition the cursors so that they enclose the falling edges of the swept waveforms.
12. In the Measurement Tool, select Falltime as the Measurement.
13. Re-apply to create a plot of Falltime vs. motor winding resistance.
14. The results are shown in Figure 8.
The waveforms were super-imposed by copying and pasting (or dragging) a
waveform from one graph window to another graph window.
The individual measurement points can be displayed by selecting the waveform
name (in the signal pane) and selecting RMB > Data Point > Symbols.
Figure 8 clearly shows the effect the value the motor winding resistance has on the shaft
position when used with the H-bridge driver circuit. This is a simple example of how
SystemVision can be used to turn simulation data into engineering information that can be
used to help improve a system design.
15. Exit out of the Waveform Viewer. Do not save the waveforms.
Sensitivity Analysis
Sensitivity analysis is used to automatically vary each component parameter (or selected
parameters) in a design to a user-specified percentage of nominal value. This occurs one
parameter at a time, so that the sensitivity of a design performance measure to the various
parameters can be determined.
Run Sensitivity Analysis
Like Parameter Sweeps, Sensitivity analysis is run in combination with one of the main
analysis types (Time or Freq domain) and the controls are built into the Multi-Run tab of the
Simulation Control dialog.
1. From the menu, select Simulation > Simulate to invoke the Simulation Control window.
2. Select the Multi-Run tab as shown in Figure 9.
8. Click on the Simulations tab to verify that Time-Domain Analysis is selected with
settings as shown in Figure 10.
The position waveforms show how sensitive the motor angle position is to variations
in each component parameter included in the analysis. More meaningful would be to
perform a measurement on these waveforms, and plot the relative sensitivity of this
performance measure to each parameter that was varied.
These waveforms illustrate that the maximum value of the position angle is most
sensitive to the damping coefficient of the motor. The next most sensitive parameter
is the winding resistance of the motor.
6. Close the Waveform Viewer. Do not save the changes.
4. Select the Parameters tab and click on the browse button to first R_WIND, and
then L to enter in the following tolerance and distribution information:
R_WIND:
Nominal Value = 100.0
Distribution = Normal
Tolerance = 20
L:
Nominal = 1.0e-3
Distribution = Uniform
Tolerance = 20
5. Click OK to close the Model Properties dialog.
Running Monte Carlo
Once the parameters have been assigned, the next step is to run the analysis. Like Parameter
Sweeps and Sensitivity analysis, the Monte Carlo analysis is run in combination with one of
the main analysis types (Time or Freq domain) and the controls are built into the Multi-Run
tab of the Simulation Control dialog.
1. From the menu, select Simulation > Simulate to invoke the Simulation Control window.
2. Select the Multi-Run tab as shown in Figure 14.
6. Click OK to run the simulation. This will take a few minutes. You can monitor the
progress by observing the lower left-hand corner of the SystemVision interface
shown in Figure 16.
2. Notice that the motor position and current both exhibit some variation and are
displayed as compound waveforms. Each member of the family of curves represents
one of the Monte Carlo simulation runs. Next we quantify these variations by post-
processing the simulation data using the Measurement Tool and Waveform
Calculator.
3. Select Tools > Measurement Tool to begin performing measurements.
4. Select the position waveform using the dropdown menu from the Source
Waveform(s) field.
5. Select Maximum as the Measurement type.
6. In the Measurement Results field, select Annotate Waveform(s) with Result Markers.
7. Select Apply Measurement to: Entire Waveform.
8. Click Apply to annotate to the waveform as shown in Figure 18.
11. Click Apply to create new waveform as shown in Figure 20. Scatter plots are useful
in spotting trends and can be also used to create correlation plots (we will do this a
bit later).
12. Close the Measurement Tool.
6. In the waveform viewer, select File > New to create a new graph window then click
Plot in the calculator to plot the histogram as in Figure 24.
Since there are only 10 runs, this histogram is not particularly meaningful, but as the number
of runs increases, this can be a very useful way of viewing the statistical data.
Creating Correlation Plots
Here we will combine the power of the Measurement Tool and Waveform Calculator to determine
correlation between system performance and device parameters using the data generated
from Monte Carlo analysis.
1. Plot the signals Maximum.position, L and r_wind into a new graph as shown in Figure 25.
L and r_wind are parameters, and are available in the MonteCarlo Parameters > ydcmotor1
folder.
2. From the Calculator menu select View > Additional Functions > Transforms.
3. Click on the YvsX button and enter r_wind into the wfX field and Maximum.position into
the wfY field as shown in Figure 26.
Hint: Use the down arrow field or select the waveform label and click the button to enter waveforms.
4. Click OK.
5. In the Calculator click Enter to put this calculation into the stack and then click Plot
to plot it into a new graph as shown in Figure 27. (Open a new graph window if
necessary).
These findings are consistent with those from the Sensitivity analysis: maximum
motor angle depends strongly on motor winding resistance, but not much on motor
winding inductance.
The advantage of Monte Carlo analysis over Sensitivity analysis is that Monte Carlo
analysis varies all of the component values (randomly within their tolerances) for
each simulation run. Sensitivity analysis only varies one component at a time. This
means that tolerance stack-up issues can be detected using Monte Carlo analysis, but
not by Sensitivity analysis.
Further Design Exploration (Optional)
If time permits, create additional correlation plots for the following:
1. Risetime(position) vs. r_wind.
2. Risetime(position) vs. L..
3. Maximum motor speed vs. r_wind.
In this section, we will highlight the models that are available with SystemVision. We will
also focus on some of the basic methods for creating symbols for models, as well as creating
models themselves.
SystemVision
Symbols and Models
VHDL-AMS Models
SPICE Models
Combining VHDL-AMS and SPICE Models
Symbol Generation
Modeling Tools
VHDL-AMS Models
Accessing
Viewing/Editing
Importing
Open from
Simulation
Tab
or Push
into Symbol
Keyword
Sensitive
Text Editor
RMB on
VHDL Files
Folder
SPICE Models
Accessing
Viewing/Editing
Importing
SPICE Models
Primitive
Semiconductor
Macromodel
Open from
Simulation
Tab or Push
into Symbol
Standard
SPICE
Syntax
SPICE
Model
Name
SPICE Double-click
Symbol On Symbol to
Libraries Place on Access
Schematic Properties
Model Property
Automatically
Populated
Double-Click
to view
model
Click to
Enable
DxDatabook
Filter Auto-Populates
Select
Database Component
Library
Properties
Select
Component
Drag Symbol
To Place on
Schematic
RMB or
Drag and Drop
to add .lib files
Expand to view
Individual
models
SPICE
Components
Symbols
VHDL-AMS
Symbols
Loads
VHDL-AMS
VHDL
Digital
Symbols
Inputs
Standard
SPICE Netlist
Entries
Go to active
Testbench
Expand to View
Top-Level
Netlist file
Y Elements
Call VHDL-AMS
Models
Symbol Generation
Symbol Generation
Drag-n-Drop
VHDL-AMS/SPICE (text-based)
Symbol Wizard
VHDL-AMS/SPICE (Schematic-based)
VHDL-AMS/SPICE (text-based)
Symbol Wizard
Select Model:
- Schematic
- VHDL-AMS
- SPICE
For Schematics,
Select Pins from
Available Net
Names
Instantiate New
Model in Design
Modeling Tools
Modeling Tools
PSPICE Conversion
Select under Select PSpice Lib,
Tools Menu Generate SV
Spice Lib
Original Data
Composed of
Linear Segments
Cubic-Spline
Curve Fit
Lab Exercise
SystemVision provides useful tools and capabilities for symbol and model creation. This
section of the workshop introduces many of these features. As you use this information, feel
free to experiment with product features and functions not explicitly covered.
This portion of the lab covers the following tasks:
Drag and Drop a VHDL-AMS model to automatically create a new symbol
Use the Symbol Wizard to create a new symbol from a schematic
Simulate and compare results of both VHDL-AMS and schematic-based models
Generate PWM Symbols for UAV Propeller System
This exercise illustrates two approaches for creating symbols for existing models.
Open the UAV_Prop Design
1. Select one of the following methods and invoke SystemVision.
When you install SystemVision, the installation program creates two ways with which
it may be invoked:
Windows Start Menu.
Start > All Programs > Mentor Graphics SystemVision > SystemVision Professional 4.2
b) (Optional) Click the zoom icons in the View Toolbar to adjust the size of the
display.
System Operation
The purpose of the airplane_prop system is to control the power delivered to a propeller used
by a UAV (Unmanned Aerial Vehicle). The system works as follows:
Power from a 42V battery pack (modeled as a DC voltage source) is delivered to a DC
motor through a digitally-controlled switch. The switch is controlled by a PWM (pulse-width
modulator) running at 2.5 KHz. When the switch is on, current flows from the 42V supply
into the motor winding. When the switch is off, the free wheeling diode (D1) allows for the
continuous flow of current as required by the motor winding inductance.
For further information about this system, please refer to UAV Case Study #5 (RC Airplane
System), available on the SystemVision web site.
Add PWM Model File to Project
The design given in Figure 1 does not include the actual PWM component required to drive
the switch. The following steps show how to add a new PWM component model to the
airplane_prop system.
1. You will first need to locate the PWM model so it can be added to the project. In the
Simulation tab, expand the airplane_prop folder.
2. Expand the Files folder. This will reveal several simulation file categories.
3. Expand the VHDL Files folder. This will show all of the VHDL-AMS models that
are already included for use in this design.
4. Right-click on the VHDL Files folder, and select Add VHDL File
5. Navigate to the hdl directory where the required file, pwm_vhdl.vhd, has been placed.
6. Select the file and click Open (or double-click on the file). The new model file should
now appear under the VHDL Files folder.
Generate and Add VHDL-AMS PWM Symbol to Schematic
The following steps show how to take an existing VHDL-AMS model (with no symbol), and
automatically create a symbol that can be instantiated in the airplane_prop schematic.
1. To automatically create a symbol for the new PWM model, expand the pwm_vhdl.vhd
hierarchy.
2. Select and drag, the model's entity, pwm_vhdl, onto the schematic canvas (the model's
entity is typically given the same name as the model file).
3. As the entity is dragged onto the canvas, it is transformed into a symbol. Place the
symbol on the schematic, between the two open nets at the top of the design. The
schematic should look like that shown in Figure 2.
4. Double-click on the newly-added symbol, and type in a label for it, such as PWM1.
This will allow you to easily identify the PWM waveforms in the Waveform Viewer.
5. RMB > Push Language > VHDL on the new symbol to view the pwm_vhdl model listing.
6. When you finish reviewing the model, select File > Close from the menu to close the
listing.
Simulate with Time-domain Analysis and View Results
1. Specify the simulation settings.
a) Choose Simulation > Simulate from the menu bar. This displays the Simulation
Control dialog box. This dialog box provides four tabs: Simulations, Results,
Multi-Run, and Advanced. When you click on a different tab, the dialog box
changes to provide different simulation settings.
Note that in the figure the background color has been set to white to allow
waveforms to be easily viewed when printed.
The input waveform (prop_amp_in) is designed to slowly ramp up the propeller speed, hold it
briefly at maximum speed, and then ramp it back down.
Notice that the actual speed waveform (prop) starts off at nearly 1387 rad/s! In fact, it only
increases from 1387 to about 1395 rad/s. This is because the motor is not yet loaded by a
propeller. We will look at load alternatives later in this lab.
5. Plot the pwm_out waveform as well. If you zoom in on this waveform, you can see
how the output width of the PWM tracks the amplitude of its input (prop_amp_in).
The schematic-based PWM design is implemented in two stages. The first stage is a
summing op amp that adds the input waveform (prop_amp_in) to a local sawtooth wave
generator. The sawtooth waveform oscillates at a frequency much greater than the input
waveform, and can be thought of as "riding on top of" the input waveform once they are
summed together.
The second stage of the design is a comparator that accepts the summed input/sawtooth
waveform, and generates a logic '1' if the amplitude of this waveform is greater than some
threshold value (the threshold is 0 in this design).
4. To generate a symbol for this schematic, click on the Symbol Wizard button, .
5. The Symbol Generation Dialog comes up. Verify that the Generate symbol from:
dropdown is set to Schematic, and that the Schematic name is set to pwm_sch.
The Symbol Wizard can also be used to generate symbols from VHDL-AMS
(compiled or source) and SPICE models.
6. Click OK.
7. Select the following nets to be used for pins on the symbol.
INM
INP
DIG_OUT
8. Click OK. The Symbol Editor automatically comes up, with a default symbol shape,
along with the pins that were specified.
9. Reposition the INM and INP pins so that they are spaced a little farther apart (select
and drag each pin to do this).
10. Select File > Save and then File > Close from the menu to close out the Symbol Editor.
11. Select Add > Component with the airplane_prop design in view (select the airplane_prop tab
at the bottom of the schematic window to quickly navigate between views).
12. Place the newly-created pwm_sch symbol onto the schematic. Connect it as shown in
Figure 5.
13. Double-click on the newly-added symbol, and type in a label for it, (again, something
like PWM1 is fine). This will allow you to easily identify the PWM waveforms in the
Waveform Viewer.
14. RMB > Push Schematic on the new symbol to view the pwm_sch schematic.
15. With the pwm_sch model listing showing in the Main Window, select File > Close from
the menu to close the schematic.
Simulate with Time-domain Analysis and View Results
Now that the schematic-based PWM model has been instantiated, the airplane_prop design
can once again be simulated.
1. Simulate the design with the same settings as before. Again, it should take a minute
or so for the simulation to complete.
2. View results of the time domain analysis.
a) In the Waveform List, drag-and-drop the prop signal onto into the same graph
region where the waveforms from the previous analysis are displayed.
The VHDL Model Generation Tool window will be displayed. This is the window
from which you will develop a VHDL-AMS model. The window is divided into two
main regions. The region on the left lists the high-level labels for various portions of
a VHDL-AMS model, such as Generics, Ports, Architectures, etc. Clicking on any of
these labels activates the appropriate form in the right region of the window. The
actual model will be constructed from entries made in the form. The default form,
Model Parameters, allows you to change the name and location of the model to be
generated.
5. Click on the Code Preview button near the bottom of the window. This will allow
you to view the actual VHDL-AMS model as it is being constructed.
The Code Preview window already shows the outline for a model called prop_lin,
along with a default architecture.
Note that the Code Preview window is read-only, and is intended for viewing code models can not
be edited from this window.
6. Arrange the VHDL Model Generation Tool window and the Code Preview window
on your computer display so you can view both windows simultaneously.
7. Add Generic
VHDL-AMS generics are constant parameters whose values can be changed from
the schematic in which the model is instantiated. A generic for the value of the
scaling factor (gain) will be added to the model.
a) Click on the Generics label in the left region of the window. This brings up the
Generics form.
b) Click the Add button in the form.
c) In the New Generic dialog, type the name: gain, and click OK.
d) In the Type dropdown menu, select real as the type of this generic.
e) Since we know that this application will require a gain of 400.0e-6, type that value
as the Default Value for the gain generic.
8. Add Port
The prop_lin model will require only one port to connect to the shaft of the DC
motor that drives it. The motor shaft is mechanical in nature.
a) Click on the Ports label to bring up the Ports form.
b) Click on the Add button in the form.
c) Type in the following name for the propeller port: shaft, and click OK. This port
represents the shaft of the propeller.
This nature is required for the propeller shaft to correctly match the nature of
the motor shaft.
9. Create Architecture
The entity portion of the model has now been defined, which describes how the
model interfaces with other models in the system. A VHDL-AMS model architecture
is used to describe the functionality of a model.
a) Click on the [+] next to the Architectures label.
b) Click on the [+] next to the "default" architecture label.
c) Click on the Branches label, and click the Add button in the form.
A terminal port has two aspects of information associated with it: an across aspect
(like voltage or velocity), and a through aspect (like current or torque). In order to
access these aspects individually, the VHDL-AMS language supports "branch"
quantities. You will assign names to the across and through aspects of the model
using branch quantities.
d) Type vel (or some other name representing velocity) in the ACROSS field.
e) Type torq (or some other name representing torque) in the THROUGH field.
f) Select the port name (shaft) from the FROM dropdown menu.
g) Select ROTATIONAL_VELOCITY_REF from the TO dropdown menu.
The FROM/TO fields specify which port(s) a branch quantity represents. In the
case of a one port model, the branch exists from the port to an understood
reference point (i.e. ground). For a port with nature ROTATIONAL_VELOCITY, the
corresponding reference point ROTATIONAL_VELOCITY_REF is used.
10. Add Simultaneous Equation
The final step in the models' creation is to specify its actual functionality. For this
model, the branch quantities (vel and torq) and generic (gain) will be used to describe
this functionality.
a) Click on the Simultaneous Equations label, and click the Add button in the form.
b) Select unconditional as the Class of the equation, and click the OK button.
c) In the white space below the Set of simple simultaneous equations heading, type the
following equation:
torq == gain*vel;
This equation specifies that the torque (torq) consumed by the propeller model is
proportional to the velocity (vel) of the propeller times the gain value (gain).
11. Generate the Model
You have now completed the specification for the propeller load model.
The generated model will come up in the SystemVision text editor. Take a
moment to look over the model.
Not only was the model itself generated, but a symbol for the model was
automatically created as well.
c) Click on the prop_lin tab near the bottom of the window to view the generated
symbol.
d) Save and close both the symbol and model.
12. Add Model to airplane_prop system
The next step is to hook up and test the model you just created.
a) With the airplane_prop tab selected, Select Add Component from the menu.
b) Place/connect the prop_lin model as illustrated in Figure 6.
a) In the Waveform List, drag-and-drop the prop_amp_in and prop signals onto the
same graph region.
Note that the motor/propeller velocity now takes a little time to get up to speed.
b) Also plot the prop1/torq waveform in the same graph region (this is the torque
branch quantity you specified in the model).
c) Place a cursor on the graph, and position it so that the velocity reads about 1k
rad/s.
Note that the torq value reads about 0.4 N-m for a velocity of 1000 rad/s, as
predicted during the model development. The results should appear similar to
those given in Figure 7.
5. Add Port
As with the prop_lin model, the prop_tlu model will require one port to connect to the
shaft of the DC motor that drives it.
a) Click on the Ports label to bring up the Ports form.
b) Click on the Add button in the form.
c) Type in the following name for the propeller port: shaft, and click OK.
6. Create Architecture
You have now defined the entity portion of the model, which is identical to the
entity used in the prop_lin model, with the exception of the generic gain. You will next
describe the functionality of the model.
a) Click on the [+] next to the Architectures label.
b) Click on the [+] next to the "default" architecture label.
c) Click on the Branches label, and click the Add button in the form.
d) Type vel (or some other name representing velocity) in the ACROSS field.
e) Type torq (or some other name representing torque) in the THROUGH field.
f) Select the port name (shaft) from the FROM dropdown menu.
g) Select ROTATIONAL_VELOCITY_REF from the TO dropdown menu.
7. Add Lookup Function
This version of the propeller model includes velocity/torque data pairs from a
datasheet. This data will be accessed using a VHDL-AMS function.
a) Click on the Subprograms label and then click the Add button on the
Subprograms form.
b) Type in prop_lookup as the subprogram name and click OK.
c) Select Function from the Class dropdown menu.
d) Click the Implement from Table Data checkbox. The Return Type is automatically set
to real.
e) Click on the Table Lookup button. The Load table data from file form appears.
f) Select the prop_pwl.txt file (in the /hdl directory), and click the Open button.
The Fit Table LookUp Data form appears. This form lists the values from the
data file. The data in this table can also be typed in manually.
8. Curve Fit with Linear Interpolation and View Results
a) To view the transfer function of the data, click the New Curve Fit button.
b) The New Curve Fit dialog appears. Accept the default settings to create a
waveform called curve0.
The curves will now be displayed in the Waveform Viewer. They should look
similar to those shown in Figure 8.
h) Zoom in on various portions of the curves to view the effects the chosen
interpolation method.
An example for a region near the upper-end of the waveforms is shown in Figure
9.
This curve is selected so the original data is used for the model without the
smoothing effects of the Cubic Spline Interpolation.
k) Click OK to generate the model statements required to implement the lookup
function.
10. Add Simultaneous Equation
The final step in the model creation is to specify the actual functionality of the
model. For this model, the branch quantities and lookup function will be used to
describe this functionality.
a) Click on the Simultaneous Equations label, and click the Add button in the form.
b) Select unconditional as the Class of the equation, and click the OK button.
c) In the white space below the Set of simple simultaneous equations heading, type the
following equation:
torq == prop_lookup(vel);
This equation specifies that the torque (torq) consumed by the propeller model is
You have now completed the specification for the data-based propeller load model.
a) To generate the actual VHDL-AMS model click on the Generate button.
b) Click Yes in response to the "Do you want to generate model and close this
tool?" dialog.
The generated model will come up in the SystemVision text editor. Take a
moment to look over the model. It appears a bit more involved than the
previous model.
Click on the prop_tlu tab near the bottom of the window to view the generated
symbol.
c) Save and close both the symbol and model.
12. Add Model to airplane_prop System
The next step is to hook up and test the model you just created.
a) With the airplane_prop tab selected, delete the existing propeller symbol from the
schematic.
b) Select Add Component from the menu.
c) Place/connect the prop_tlu model as previously illustrated in Figure 6.
d) Double-click on the newly-placed symbol and give it a label, such as PROP1.
Simulate with Time-domain Analysis and View Results
Now that the new load has been added to the design, the airplane_prop design will be
simulated to determine its performance.
1. Simulate the design with the same settings as before. It should take a few minutes for
the simulation to complete.
2. View results of the time domain analysis.
a) In the Waveform List, drag-and-drop the prop signal onto the same graph region
used in the previous simulation (close out any curve-fitting windows, if desired).
b) Also plot the prop1/torq waveform in the same graph region.
If you place a cursor on the vel waveform, the corresponding torq value should
match that given in the data file (which you can view by opening the prop_pwl.txt
file in the Auxiliary Files folder).
c) Compare the waveforms generated by the two models. The new simulation
results are more accurate because the propeller is modeled from actual datasheet
data.
Lab Summary
This lab focused on two SystemVision features: symbol creation and model creation. Basic
symbols for both VHDL-AMS and SPICE models are created automatically by simply
dragging the model into the schematic canvas. Schematic-based model symbols are also
generated automatically using the Symbol Wizard.
Two VHDL-AMS models were created using the Model Wizard. The Model Wizard helped
to guide the process of creating a model, and automatically generated most of the syntax for
the models. The table lookup feature of the Model Wizard was also discussed, which
automatically generates functions for piece-wise linear model development. Various curve-
fitting options were considered during this process as well.
SystemVision
SystemVision System Modeling Solution 2
Mixed-technology
Multi-language
Hierarchical levels
SystemVision
SystemVision System Modeling Solution 3
Two channels:
throttle and rudder
SystemVision
SystemVision System Modeling Solution 4
Serial Bitstream
Analog inputs are
digitized
serialized
and time-domain
multiplexed into a
bitstream
SystemVision
SystemVision System Modeling Solution 5
RF Tx and Rx
RF Tx and Rx uses
BFSK (Binary
Frequency Shift
Keying)
Recovered data is
reformatted into serial
bitstream format
SystemVision
SystemVision System Modeling Solution 6
Pulsewidth Encoding
Bitstream data
converted into variable
pulsewidths
Standard approach to
promote servo
interchangeability
SystemVision
SystemVision System Modeling Solution 7
SystemVision
SystemVision System Modeling Solution 8
Propeller Speed/Torque
Throttle commands
result in propeller
speed and torque
Propeller is open
loop and relies on air
drag to slow it down
SystemVision
SystemVision System Modeling Solution 9
DC/DC Converter
Propeller needs 42V
from battery pack
Rudder electronics
needs 4.8V for on-board
electronics
DC/DC converter
provides 4.8V from 42V
SystemVision
SystemVision System Modeling Solution 10
Rudder Position
Rudder position is
what is ultimately
controlled
Rudder is closed-
loop so its profile
should match
commanded profile
SystemVision
SystemVision System Modeling Solution 11
System Design:
Defining Subsystems
SystemVision
SystemVision System Modeling Solution 12
Command/Control
(C&C) Subsystem
C&C Communications
C&C
Communications
Subsystem
Throttle
Subsystem Throttle
Power
Power
Subsystem
Rudder
Subsystem
Rudder
SystemVision
SystemVision System Modeling Solution 13
UAV Technologies
UAV color-coded to
highlight technology
types
Multiple colors/block
implies mixed-
technology
SystemVision
SystemVision System Modeling Solution 14
Instructor Notes/Comments
UAV components are color-coded to labels on bottom. This is a bit of a
generalization to keep discussion simple (most of the digital/firmware sections
may actually be implemented as software).
Figure illustrates various boundary conditions as they might exist for this type
of system. It is necessary to be able to simulate everything together
C&C Subsystem
C&C subsystem provides
overall control for UAV
Performs both digital and
analog functions
Will likely require both
digital and firmware
design
SystemVision
SystemVision System Modeling Solution 15
Encoder Block
Encoder block converts analog input commands into digital words, which are
then serialized and used to create a bitstream suitable for wireless
communications.
Analog/Controls Digital/Firmware
SystemVision
SystemVision System Modeling Solution 16
Since SystemVision
supports VHDL-AMS,
multiple front-end tools
can generate the state
machine code.
Digital/Firmware
SystemVision
SystemVision System Modeling Solution 17
Communications Subsystem
Comm subsystem
accepts digital inputs
and produces digital
outputs
Internally, signals are
analog
SystemVision
SystemVision System Modeling Solution 18
Communications System
Communications block accepts serial bitstream as an input, and performs a
binary frequency shift keying (BFSK) conversion on the bitstream. The BFSK
representation of the bitstream can then be transmitted/received over an RF
link.
BFSK_OUT
INPUT F_OUT
LPF
BFSK PLL
Prog LF_OUT gain A/D Bitstream Out
Source D_IN A_OUT INPUT
VCO_OUT Frequency
Pseudo
Bitstream
VCO_OUT
INPUT F_OUT
Analog/Controls Digital/Firmware
SystemVision
SystemVision System Modeling Solution 19
BFSK Freq
PLL Out
LPF Out
Bitstream Out
SystemVision
SystemVision System Modeling Solution 20
Throttle Subsystem
Motor sizing dependent
on load presented by
propeller
Propeller torque as a
function of speed
available from propeller
manufacturer
This data is
implemented in
VHDL-AMS using
PWL lookup function
SystemVision
SystemVision System Modeling Solution 21
576 0.347
628.3 0.4138
SystemVision
SystemVision System Modeling Solution 22
Power Subsystem
Converter requirements
derived from UAV
system specs, primarily,
rudder servo error
SystemVision
SystemVision System Modeling Solution 23
Buck Converter
Buck converter developed with combination of analog components and
S-domain control blocks. Both averaged and switching version
implemented. This subsystem will be integrated with Rudder Subsystem.
Analog/Controls
SystemVision
SystemVision System Modeling Solution 24
Rudder Subsystem
Rudder subsystem developed
using multiple approaches
Control block (S-
domain)
Mixed S-domain,
electrical, mechanical
domains (VHDL-AMS)
Mixed electrical
(SPICE), mechanical
domains (VHDL-AMS)
Mixed electrical ,
mechanical (VHDL-
AMS), software
domains (C)
SystemVision
SystemVision System Modeling Solution 25
Load
Constant Gain
Compen-
Summer Gain sator Limiter Lag Gain Lag Gain Integrator Limiter
Input Output
Gain
Gain
Analog/Controls
SystemVision
SystemVision System Modeling Solution 26
Control Control
Horn Horn
Mechanical Stop
Potentiometer
SystemVision
SystemVision System Modeling Solution 27
Servo Controller
We may still leverage S-domain blocks where they are useful. This may
be the case when the analog specialist wants to test the subsystem
before actual software algorithms are developed.
Lead-Lag Limiter
Summer Gain
Input Output
Gain
Feedback
Analog/Controls
SystemVision
SystemVision System Modeling Solution 28
***************POLE
***************POLE STAGE************
STAGE************
**
*Fp=13.3
*Fp=13.3 MHz
MHz
G3
G3 98
98 15
15 99 49
49 1E-3
1E-3
R12
R12 98
98 15
15 1K
1K
C5
C5 98
98 15
15 11.967P
11.967P
**
************POLE/ZERO
************POLE/ZERO STAGE**********
STAGE**********
**
*Fp=600
*Fp=600 KHz,
KHz, Fz=
Fz= 1.4MHz
1.4MHz
G5
G5 98
98 18
18 15
15 49
49 1E-3
1E-3
R14
R14 98
98 18
18 1K
1K
R15
R15 98
98 19
19 750
750
C6
C6 19
19 18
18 151.58P
151.58P
**
SystemVision
SystemVision System Modeling Solution 29
begin -- proc
if clk'event and (clk='1' or clk='H') then
v_input(0) := vin;
v_input(1) := A;
computing1 : VHDL_Compute1(v_input, v_output);
SystemVision
SystemVision System Modeling Solution 30
System Integration
Once we have developed and tested the individual
subsystems, we can get our greatest benefit from this
environment: analyzing complex systemic interactions
between subsystems.
SystemVision
SystemVision System Modeling Solution 31
C&C Rudder
SystemVision
SystemVision System Modeling Solution 32
C&C Rudder
SystemVision
SystemVision System Modeling Solution 33
SystemVision
SystemVision System Modeling Solution 34
Servo/
Amplifier DC Motor Gearbox Translational Rudder
Linkage
Power
Amplifier
Control
Horn Control
Horn
Mechanical
Potentiometer
Stop
SystemVision
SystemVision System Modeling Solution 35
Motor
MOTOR
SystemVision
SystemVision System Modeling Solution 36
SystemVision
SystemVision System Modeling Solution 37
SystemVision
SystemVision System Modeling Solution 38
SystemVision
SystemVision System Modeling Solution 39
Human Controller
Human controller is modeled using S-domain blocks. This is useful
to study human-in-the-loop but will not be required in the system
deliverable. Our common development environment allows this
functionality to be easily integrated into the full system.
1
+
input + 4
s+ 4
0.1 +
s
fb
Analog/Controls
SystemVision
SystemVision System Modeling Solution 40
SystemVision
SystemVision System Modeling Solution 41
SystemVision
SystemVision System Modeling Solution 42
www.mentor.com/systemvision
SystemVision
SystemVision System Modeling Solution 43
UAV Labs
The following lab exercises allow students to use
SystemVision on a relatively large system. The
following UAV Help files are included:
SystemVision
SystemVision System Modeling Solution 44
SystemVision
SystemVision System Modeling Solution 45
Case Study 1:
The Airplane Controller System
Motor/Propeller
Throttle Amp
Bitstream to Pulse-Width Pulse-Width to Analog
Amp
s+a
s+b
+ Buck Converter
Battery DC Motor/Rudder
(42 V) DC Assembly
Case Study 1:
The Airplane Controller System
This help file discusses how to use SystemVision to simulate a mixed-signal Airplane
Controller System (also referred to as the Command and Control System). The Airplane
Controller System is part of a remote controlled (RC) electric airplane system (also referred
to as a UAV system), which is detailed through five case studies in the book The System
Designers Guide to VHDL-AMS.
The RC Airplane System is illustrated in Figure 1. The Airplane Controller System is
indicated by the shaded boxes. For more detailed information on the Airplane Controller
System, please refer to the accompanying file: vhdl-ams-book-chapter-8.pdf. This file comprises
the book chapter which corresponds to the Airplane Controller System design.
Control Stick Analog to Bitstream RF Transmit/Receive
Motor/Propeller
Throttle Amp
Bitstream to Pulse-Width Pulse-Width to Analog
Amp
s+a
s+b
+ Buck Converter
Battery DC Motor/Rudder
(42 V) DC Assembly
The purpose of the Airplane Controller System is to send digitized versions of the
input analog commands (which issue from a hand-held joystick controller), through
an RF transmitter/receiver pair, and properly decode the signals in order to control
the rudder position and propeller speed of the airplane.
Control Stick
Throttle Digitize/Encode Decode/PW PW/Analog
PW (12 ms)
Bitstream
Control Stick
Rudder PW/Analog
PW (12 ms)
The VHDL-AMS files will be compiled as necessary, and the Simulation Control
window will appear. This window contains four tabs:
The Simulations tab is for the basic settings and to enable/disable the desired
analyses. Enable the Time-Domain Analysis and set End Time to 1 sec.
The Results tab allows users to select signals for viewing. The default selection is
TopLevel Waveforms which will save all signals at the highest level of hierarchy.
Users can also choose Selected Waveforms and click on the browse button ()
to select individual signals, or All Signals, which makes every available signal in
the design available for viewing.
The Multi-Run tab is for performing parametric variations.
The Advanced tab is used for advanced simulation settings (normally not
required).
2. Click the OK button to run the simulation.
Viewing Results
The simulation results will automatically be loaded into the Waveform Viewer upon
completion of a successful simulation (if not, look in the Output Window for any error
messages).
Individual waveforms can be viewed by double-clicking the left-mouse button (LMB) or by
using the drag-and-drop feature. Waveforms can also be displayed from the schematic by
selecting the desired signal and using RMB > Plot Waveform.
1. Use one of these methods to plot the rudder_cmd and rudder_out waveforms. It will be
easier to compare the waveforms if they are placed into the same graph region.
2. Repeat this step for the throttle_cmd and throttle_out waveforms. These waveforms
should appear as shown in Figure 3.
Figure 3 - Throttle and rudder input commands and their digitized equivalents.
Note that the output signals are time-discrete replicas of the input signals. These signals are
then fed into the Rudder System, which is described in the CS2_Mixed_Technology case study.
Explore Other Signals
1. Using the same approach as above, explore some other simulation waveforms in this
design. Some interesting signals to look at are suggested below:
rudder_servo_in (varying pulse width voltage which drives the airplane rudder
servo)
throttle_servo_in (varying pulse width voltage which drives the airplane throttle
servo)
tdm_bitstream (bitstream data from Encoder to Decoder)
The rudder_servo_in (throttle_servo_in) voltages vary in pulse width from 1ms to 2ms
in response to the operator commands. These signals are sent to the servo units
on the airplane.
The tdm_bitstream signal contains all the encoded information which is trans-
mitted from the ground operator to the airplane. Examination of any data frame
will show the actual bit values that are sent. Each frame occurs at 20ms intervals.
2. Users should also take some time to explore the various blocks in the design. Most
of them are hierarchical, and contain schematics that detail the system operation.
3. After exploring the various blocks, add signals of interest to the Signal List in the
Results tab of the Simulation Control window, and re-simulate the design to view the
new signals.
4. Again, for more detailed information on the Airplane Controller System, please refer
to the accompanying file: vhdl-ams-book-chapter-8.pdf.
Case Study 2:
The Rudder System
Motor/Propeller
Throttle Amp
Bitstream to Pulse-Width Pulse-Width to Analog
Amp
s+a
s+b
+ Buck Converter
Battery DC Motor/Rudder
(42 V) DC Assembly
Case Study 2:
The Rudder System
This help file discusses how to use SystemVision to simulate various Rudder System design
implementations. The Rudder System is part of a remote controlled (RC) electric airplane
system (also referred to as a UAV system), which is detailed through five case studies in the
book The System Designers Guide to VHDL-AMS.
The RC Airplane System is illustrated in Figure 1. The Rudder System is indicated by the
shaded box. For more detailed information on the Rudder System, please refer to the
accompanying file: vhdl-ams-book-chapter-14.pdf. This file comprises the book chapter which
corresponds to the Rudder System design.
Control Stick Analog to Bitstream RF Transmit/Receive
Motor/Propeller
Throttle Amp
Bitstream to Pulse-Width Pulse-Width to Analog
Amp
s+a
s+b
+ Buck Converter
Battery DC Motor/Rudder
(42 V) DC Assembly
Rudder System configurations not discussed in the book are also presented in this Help file.
In particular, a SPICE version of the servo subsystem is demonstrated, as well as an
extended example illustrating software in the loop capabilities.
Control Block Rudder System
The Rudder Control Block implementation is shown in Figure 2. This is a full, closed-loop
control block implementation of the Rudder System. The models used in this design do not
intrinsically obey energy conservation laws. This is an abstract topology, which is used
primarily to test system error and stability specifications.
Design Selection/Viewing/Editing
1. Make sure the CS2_Mixed_Technology project is loaded into SystemVision.
2. From the Simulation tab (in the ProjectNavigator Tree), click on TestBenches >
rudder_control_block to open the schematic.
Compen-
Summer Gain sator Limiter Lag Gain Lag Gain Integrator Limiter
Input + s+a + k k 1 Output
k s+b s+a
k + s+a
k s
+
Servo Rudder
Gain
k
Gain Motor
k
The VHDL-AMS files will be compiled as necessary, and the Simulation Control
window will appear. This window contains four tabs:
The Simulations tab is for the basic settings and to enable/disable the desired
analyses. If necessary, enable the Time-Domain Analysis and set End Time to 1
sec.
The Results tab allows users to select signals for viewing. The default selection is
TopLevel Waveforms which will save all signals at the highest level of hierarchy.
Since this is a small design, All Signals was selected for convenience. Users can
also choose Selected Waveforms and click on the browse button () to select
individual signals.
The Multi-Run tab is for performing parametric variations.
The Advanced tab is used for advanced simulation settings (normally not
required).
2. Click the OK button to run the simulation.
Viewing Results
The simulation results will automatically be loaded into the Waveform Viewer upon
completion of a successful simulation (if not, look in the Output Window for any error
messages).
Individual waveforms can be viewed by double-clicking the left-mouse button (LMB) or by
using the drag-and-drop feature. Waveforms can also be displayed from the schematic by
selecting the desired signal and using RMB > Plot Waveform.
1. Use one of these methods to plot the src_in and rudder_out waveforms. These
waveforms should appear as shown in Figure 3.
Note that the (electrical) input signal, src_in is scaled from 0 to 4.7 V, and the (rotational)
output signal, rudder_out is scaled from 0 to ~1 rad. Since we are using abstract models, both
input and output have the same units (volts).
Users are also encouraged to further explore this implementation by running a Frequency
Domain analysis.
Mechanical
Potentiometer Stop
The servo design for this system is shown in Figure 5. As shown, this design uses control
blocks like those used for the entire design in Figure 4. However, in this case, these control
blocks are fluently integrated with the true conservation-based electro-mechanical
components/effects that comprise the rest of the system.
Summer Gain Lead-Lag Limiter
Input + s+a Output
k
s+b
Gain
Feedback
k
The simulation results will automatically be loaded into the Waveform Viewer upon
completion of a successful simulation (if not, look in the Output Window for any error
messages).
Individual waveforms can be viewed by double-clicking the left-mouse button (LMB) or by
using the drag-and-drop feature. Waveforms can also be displayed from the schematic by
selecting the desired signal and using RMB > Plot Waveform.
1. Use one of these methods to plot the rudder_out waveform. It will be easier to
compare the waveform to the previous simulation waveforms if they are placed into
the same graph region. These waveforms should appear as shown in Figure 6.
Note that the rudder_out_control waveform has been moved to its own axis to allow it
to easily be compared to the rudder_out_mech waveform. This was done by right-
clicking on the rudder_out_control waveform, and selecting Move to New Y Axis.
Also note that some waveform names may have been renamed in the Waveform
Viewer. This is useful when adding waveforms from multiple simulation runs with
the same name onto the same graph region. This is accomplished by double-clicking
on a waveform name in the signal pane, and changing the name in the Waveform
Properties window. Other aspects of waveform appearance are also controlled
through this window.
Design Selection/Viewing/Editing
1. Make sure the CS2_Rudder_System project is loaded into SystemVision.
2. From the Simulation tab, click on TestBenches > rudder_spice_ams to open the
schematic. An implementation similar to that illustrated in Figure 7 will appear.
ROT
The servo design for this system is illustrated in Figure 8. As shown, this design consists of
electrical components. The op amps in this design are SPICE-based, and the rest of the
components are VHDL-AMS-based. Alternatively, the entire servo design illustrated in the
figure is modeled as a single SPICE sub-circuit. Users select which servo implementation to
simulate from the schematic. This illustrates the ease with which multi-language as well as
multi-domain design is supported by SystemVision.
3. To configure the design to run with the mixed-VHDL-AMS/SPICE schematic
configuration, perform the following steps:
a) on the SERVO_SPICE_AMS block. If necessary, in the
RMB > Edit Model Properties
General tab, set the Simulation Model Type to Schematic.
b) on the same block. This shows the combined VHDL-
RMB > Push Schematic
AMS/SPICE schematic.
By selecting RMB > Push Language on various components, you can see that the op amps are
modeled in SPICE, whereas the remaining components are modeled in VHDL-AMS.
C2
C5
R2
Servo_in R5
R1
R3
R4
X1 Servo_Out
Summer C4 X2
Lead-Lag
C6
R6
V1
R7 Pos_FB
X3
Potentiometer_FB V2
Under close inspection, it appears that there is some irregularity near the first peak of
the waveform. After investigating this, it was found that one of the op amps in the
SPICE servo is taking a little time to recover after saturating as the motor is initially
driven. It then tracks smoothly. This could be a potential design issue and may
require further investigation.
1. To configure the design to run with the stand-alone SPICE sub-circuit configuration,
perform the following steps:
a) on the SERVO_SPICE_AMS block, and in the General
RMB > Edit Model Properties
tab, set the Simulation Model Type to Spice.
b) Click OK, and then save the schematic.
2. RMB > Push Language > SPICE to view the SPICE sub-circuit model.
3. Close the SPICE sub-circuit model window.
4. Re-simulate the design using the same settings as before, and verify that the
simulation results match those seen in previous design implementations.
Rudder System with Z-Domain Servo
The Z-domain Rudder System implementation is shown in Figure 10. For this im-
plementation, there are four configurations: the servo lead-lag compensator block is
implemented using the VHDL-AMS attribute, ztf (which can be simulated in the frequency
domain); and alternatively as discrete difference equations (which cannot be simulated in
the frequency domain). For these two configurations, the remainder of the servo is
composed of continuous-time control blocks.
In addition, the entire servo is implemented as difference equations in both VHDL-AMS, as
well as the C programming language. Each of these four configurations can be chosen at the
schematic level to illustrate how SystemVision can be used to develop and test systems with
software in the loop.
Design Selection/Viewing/Editing
1. Make sure the CS2_Mixed_Technology project is loaded into SystemVision.
2. From the Simulation tab, click on TestBenches > rudder_z_domain to open the
schematic.
ROT
3. Select diff from the Architecture dropdown menu in the Model Properties window.
4. Click OK to close the Model Properties window.
5. You can select RMB > Push Language > VHDL on the ZTF/DIFF Lead Lag symbol to
view the two VHDL-AMS architectures that you are choosing between.
6. Save and close the schematic, and re-run the simulation.
7. Verify that the results are similar to those given for previous simulations.
Test Full Servo VHDL-AMS and C Difference Equations
1. Next, select a software model implementation for the entire servo: From the top-
level schematic, place the cursor over the Servo_Z_Diff block, and select RMB > Edit
Model Properties.
2. Select VHDL as the Simulation Model Type in the Model Properties window.
3. In the General tab, select Diff from the Architecture dropdown menu in the Model
Properties window. The simulator will now use the Diff (all sequential VHDL-AMS
code) architecture for the next simulation.
4. Click OK to close the Model Properties window.
While on the Servo_Z_Diff block, selecting Push Language > VHDL will display the
VHDL-AMS model in which the complete servo is implemented strictly as a
sequential software algorithms. This model has two architectures, Diff and Diff_C.
5. Save the schematic, and re-run the simulation, and again compare results to previous
simulations.
6. Next, place the cursor over the Servo_Z_Diff block, and select RMB > Edit Model
Properties.
7. Select Diff_C from the Architecture dropdown menu in the Model Properties
window. The simulator will now use the Diff_C architecture for the next simulation.
The Diff_C architecture acts as a gateway between SystemVision and the actual C code
(servo_c.c).
8. Save the schematic, and re-run the simulation, and again compare results to previous
simulations. All of these implementations should yield similar results.
The actual C code source file can be found as follows from the Simulation tab in the
ProjectNavigator Tree: rudder_z_domain > Files > Auxiliary Files > servo_c.c. Select RMB >
Open on servo_c.c to view the C file contents.
The Rudder System lab exercises have illustrated multiple implementations of a servo
subsystem that yield the same simulation results. The implementations included:
All control (s-domain)
All VHDL-AMS with conserved/non-conserved models
VHDL-AMS/SPICE servo model
SPICE only servo model
Z-domain lead-lag model using VHDL-AMS ztf (for AC analysis)
Z-domain lead-lag model using difference equations
Z-domain servo model using difference equations (VHDL-AMS)
Z-domain servo model using difference equations (C)
Once again, for more detailed information on the Rudder System, please refer to the
accompanying file: vhdl-ams-book-chapter-14.pdf.
Case Study 3:
The Power Converter System
Case Study 3:
The Power Converter System
This help file discusses how to use SystemVision to simulate a DC-DC Switching Power
Converter. The Power Converter is part of a remote-controlled (RC) electric airplane system
(also referred to as a UAV system), which is detailed through five Case Studies in the book
The System Designers Guide to VHDL-AMS.
The RC Airplane System is illustrated in Figure 1, with the power converter highlighted by
the shaded boxes. For more detailed information on the Power Converter design, please
refer to the accompanying file: vhdl-ams-book-chapter-18.pdf. This file comprises the book
chapter which corresponds to the Power Converter system design.
Design Selection/Viewing/Editing
Make sure the CS3_Power_Converter project is loaded into SystemVision.
From the Project tab, click on Design Roots > tb_buckconverter to open the schematic.
Simulating the circuit
1. From the menu, select Simulation > Simulate to invoke the Simulation Control window
(there is also a simulation icon available on the icon bar). If asked to make this design
the active testbench, click Yes. The VHDL-AMS files will be compiled as necessary.
2. Click the OK button to run the simulation.
Viewing Results
1. The simulation results will automatically be loaded into the waveform viewer upon
completion of a successful simulation (if not, look in the Output Window for any
error messages).
2. Individual signals can be viewed by double-clicking with the LMB or by using the
drag-and-drop feature. You can also plot a signal from the schematic by selecting the
desired signal and using RMB > Plot Waveform. Use one of these methods to plot the
signals vin and vout which should appear as shown in Figure 3.
As you can see, the input is 42VDC and the output is regulating to about 4.8V. Zooming in
on the output waveform will reveal the switching behavior.
tb_buckconverter_hier testbench
The design tb_BuckConverter_hier, shown in Figure 4, is a modified version of the original
tb_BuckConverter that puts the switch and diode beneath a hierarchical block (buck_sw) along
with some simple PWM control circuitry to control the frequency and duty cycle of the
switch control signal. There is also an averaged model (buck_avg) which we will use for
frequency analysis and to aid in the compensator design.
Design Selection/Viewing/Editing
1. Make sure the CS3_Power_Converter project is loaded into SystemVision.
2. From the Project tab, click on Design Roots > tb_buckconverter_hier to open the
schematic.
Simulating with the switching model
1. Return to the top level schematic and from the menu, select Simulation > Simulate to
invoke the Simulation Control window (there is also a simulation icon available on
the icon bar). If asked to make this design the active testbench, click Yes. The
VHDL-AMS files will be compiled as necessary.
2. Click the OK button to run the simulation.
Viewing Results
1. The simulation results will automatically be loaded into the Waveform Viewer upon
completion of a successful simulation (if not, look in the Output Window for any error
messages). Individual signals can be viewed by double-clicking with the LMB or by
using the drag-and-drop feature. You can also plot a signal from the schematic by
selecting the desired signal and using RMB > Plot Waveform. Use one of these methods
to plot the signals vin and vout which should be identical to the previous results in
Figure 3.
2. Open a new graph window (File > New), then go back to the schematic.
3. On the schematic, select the buck_sw symbol and RMB > Push schematic to open the
underlying schematic as shown in Figure 5 below:
4. Place the cursor over the design net (wire), and select RMB > Plot Waveform to plot the
signals VSAW, CTRL, COMP_OUT, and SW_CTRL on the new graph window. Zoom as
necessary to better view the waveforms shown in Figure 6.
Notice the analog sawtooth waveform (VSAW) is compared with a fixed analog reference
signal (CTRL). The comparator output is a digital signal (COMP_OUT). This signal is then
inverted to become the PWM control signal for the switch (SW_CTRL). Increasing the
reference signal will increase the duty cycle of the switch control.
5. Feel free to look at any other signals of interest. Additional waveform viewing
features are summarized below:
Multiple graph windows and workspaces can be easily created using the menus
or drag-and-drop.
Signals can be deleted using the Delete key on your keyboard, or by using the
RMB > Delete command on the signal name.
Viewing Results
1. The simulation results will automatically be loaded into the Waveform Viewer upon
completion of a successful simulation (if not, look in the Output Window for error
messages).
2. Individual signals can be viewed by double-clicking with the LMB or by using the
drag-and-drop feature. You can also plot a signal from the schematic by selecting the
desired signal and using RMB > Plot Waveform. Use one of these methods to plot the
signal vout into the previous graph containing the switching waveform (you can select
this graph window using the tabs that appear near the bottom of the Waveform
Viewer).
3. Zoom in on the graph containing vout from both runs and compare results as shown
in Figure 7.
Both the switching and average model should regulate to about 4.8V, but you should have
noticed a significant increase in simulation speed when using the averaged model. This
makes the averaged model useful for parametric sweeps and compensation design.
tb_compensator testbench
The design tb_compensator is a testbench for a behavioral compensator model (comp_2p2z).
This filter contains two poles and two zeros placed at locations determined by the control-
to-output transfer curve generated using the CS3_BuckConverter design (see the document
vhdl-ams-book-chapter-18.pdf for more information).
Design selection/viewing/editing:
1. Make sure the CS3_Power_Converter project is loaded into SystemVision.
2. From the Project tab, click on Design Roots > tb_compensator to open the schematic.
The locations of the poles and zeros have been placed to compensate for corresponding
poles and zeros measured from the control-to-output frequency response of the buck
converter simulated below.
The waveforms can be placed in the same graph region by selecting and dragging a
waveform name from the signal pane to the desired graph region.
CS3_buckconverter testbench
The design CS3_BuckConverter, shown in Figure 9, is a more complete buck converter
example that includes compensation in the feedback loop. Some additional models have
been added to allow the feedback loop to be broken (sw_LoopCtrl) and to enable/disable the
load (pwl_load). With this circuit, the control-to-output frequency response transfer curve can
be generated to assist in designing the compensator, along with time-domain simulation
results to test the line and load regulation of the closed-loop system. All simulations will be
done using the averaged model (buck_avg), and a behavioral model of the compensator
(comp_2p2z).
the compensation design. To generate this plot, we need to break the loop and disable the
load prior to running the simulation.
Design selection/viewing/editing:
1. Make sure the CS3_Power_Converter project is loaded into SystemVision.
2. From the Project tab, click on Design Roots > CS3_BuckConverter to open the
schematic.
Break the loop:
1. Select the two-pole switch (sw2) and select RMB > Edit Model Properties.
2. From the Parameters tab, set the sw_state property to 2, if necessary. This will break
the loop and insert the DC voltage source connected to p2.
Disable the Load:
1. Select the Load symbol and select RMB > Edit Model Properties.
2. From the Parameters tab, set the load_enable property to no, if necessary. This will
remove the load from the circuit.
Simulate the Design:
1. From the menu select Simulation > Simulate to invoke the Simulation Control window
(there is also a Simulation icon available on the icon bar). If asked to make this
design the active testbench, click Yes. VHDL-AMS files will be compiled as
necessary.
The Simulation tab is for the basic settings and to enable/disable the desired
analyses.
If necessary, uncheck the Time-Domain Analysis Enable checkbox.
If necessary, enable the Frequency Analysis and use these settings:
Freq Start: 1
Freq Stop: 100meg
The Results tab allows you to select the signals for viewing. The default selection
is TopLevel Waveforms which will save all signals at the highest level of
hierarchy. Use the down arrow button for other choices.
The Multi-Run tab is for performing parametric variations.
The Advanced tab is for advanced simulation settings.
2. Click OK button to run the simulation.
Viewing Results:
1. The simulation results will automatically be loaded into the waveform viewer upon
completion of a successful simulation (if not, look in the Output Window for error
messages).
2. Individual signals can be viewed by double-clicking with the LMB or by using the
drag-and-drop feature. You can also plot a signal from the schematic by selecting the
desired signal and using RMB > Plot Waveform. Use one of these methods to plot the
signal vout to view the magnitude and phase of the control-to-output response as
shown in Figure 10.
3. From the menu, select Cursor > Add to add a cursor to the graph.
4. Verify the location of the double-pole caused by the LC filter.
( fp( LC ) = 1 /(2 LC ) = 806 Hz )
Part 2: Closed-loop Time-Domain Simulation with Load/Line Regulation
The control-to-output curve contains useful information for designing the compensator.
Here we will close the loop and use a high-level model for the compensation loop filter (see
the tb_compensator design above to verify its operation). The load will be re-enabled and a
Time-Domain analysis will be run to verify it the closed-loop operation. The pwl_load model
can be used to change the load resistance to a different value at a certain instant in time. This
will allow us to see how the closed-loop system responds to sudden changes in load
conditions.
Close the loop:
1. Select the two-pole switch (sw2) and select RMB > Edit Model Properties.
2. From the Parameters tab, set the sw_state property to 1. This will close the loop and
connect the output of the compensator block to the ctrl input of the buck_avg model.
Enable the Load:
1. Select the Load symbol and select RMB > Edit Model Properties.
2. From the Parameters tab, set the load_enable property to yes. This will enable the
load in the circuit.
Simulate the Design:
1. From the menu select Simulation > Simulate to invoke the Simulation Control window
(there is also a Simulation icon available on the icon bar). If asked to make this
design the active testbench, click Yes. VHDL-AMS files will be compiled as
necessary.
The Simulation tab is for the basic settings and to enable/disable the desired
analyses.
Enable the Time-domain Analysis and set End Time to 70ms.
Disable the Frequency-domain Analysis.
The Results tab allows you to select the signals for viewing. The default selection
is TopLevel Waveforms which will save all signals at the highest level of
hierarchy. Use the down arrow button for other choices.
The Multi-Run tab is for performing parametric variations.
The Advanced tab is for advanced simulation settings.
2. Click the OK button to run the simulation.
Viewing Results:
1. The simulation results will automatically be loaded into the Waveform Viewer upon
completion of a successful simulation (if not, look in the Output Window for error
messages).
2. Individual signals can be viewed by double-clicking with the LMB or by using the
drag-and-drop feature. You can also plot a signal from the schematic by selecting the
desired signal and using RMB > Plot Waveform.
3. Use one of these methods to plot the signal vout (from the Time-Domain Analysis)
and verify that the voltage output regulates to 4.8V after a sudden change in load
conditions at 5ms and 30ms. Also, verify the output regulates to 4.8V after a sudden
drop in the input voltage from 42V to 30V at 50ms. The result is shown in Figure
11.
Case Study 4:
The Communications System
Case Study 4:
The Communication System
This help file discusses how to use SystemVision to simulate a simple Communications
System. The Communications System is part of a remote-controlled (RC) electric airplane
system (also referred to as a UAV system), which is detailed through five Case Studies in the
book The System Designers Guide to VHDL-AMS.
The RC Airplane System is illustrated in Figure 1, with the Communications System
highlighted by the shaded boxes. For more detailed information on the Communications
System design, please refer to the accompanying file: vhdl-ams-book-chapter-23.pdf. This file
comprises the book chapter which corresponds to the Communications System design.
Design Selection/Viewing/Editing
1. Make sure the CS4_Communications_System project is loaded into SystemVision.
2. From the Project tab, click on Design Roots > tb_bfsk to open the schematic.
Simulation
1. From the menu, select Simulation > Simulate to invoke the Simulation Control window
(there is also a simulation icon available on the icon bar). If asked to make this design
the active testbench, click Yes. The VHDL-AMS files will be compiled as necessary.
The Simulations tab is for the basic settings and to enable/disable the desired
analyses. If necessary, enable the Time-Domain Analysis and set End Time to
800us.
The Results tab allows you to select the signals for viewing. The default selection
is TopLevel Waveforms which will save all signals at the highest level of
hierarchy. Since this is a small design, All Signals was selected for convenience.
You can also choose Selected Waveforms and click on the browse button () to
select individual signals.
The Multi-Run tab is for performing parametric variations.
The Advanced tab is used for advanced simulation settings (normally not
required).
2. Click the OK button to run the simulation.
Viewing Results
1. The simulation results will automatically be loaded into the waveform viewer upon
completion of a successful simulation (if not, look in the Output Window for any
error messages).
2. Individual signals can be viewed by double-clicking with the LMB or by using the
drag-and-drop feature. You can also plot a signal from the schematic by selecting the
desired signal and using RMB > Plot Waveform. Use one of these methods to plot the
signals bitstream, bfsk_out and f_bfsk_out which should appear as shown in Figure 3.
Note that the f_bfsk_out waveform will need to be zoomed in the y-axis to keep from getting
swamped out be the DC offset.
The graph markers on the measured output frequency signal show that the binary frequency
shifting operation is toggling the frequency between 455kHz and 460kHz as desired.
3. Look at any other signals of interest. Additional Waveform Viewer features are given
below:
Multiple graph windows and workspaces can be easily created using the menus
or drag-and-drop.
Markers can be placed to view the X-Y coordinates of any point in the
waveform.
Signals can be deleted using the Delete key on your keyboard, or by using the
RMB > Delete command on the signal name.
The Measurement tool can be used to extract information from the waveforms.
tb_CommSys_Det
The design tb_CommSys_det, shown in Figure 4, is a non-coherent detector topology
commonly used to detect (demodulate) BFSK signals and recover the original unmodulated
baseband data.
Design Selection/Viewing/Editing
Make sure the CS4_Communications_System project is loaded into SystemVision.
From the Project tab, click on Design Roots > tb_Commsys_det to open the schematic.
Simulate the Design
1. Return to the top level schematic and from the menu, select Simulation > Simulate to
invoke the Simulation Control window (there is also a simulation icon available on
the icon bar). If asked to make this design the active testbench, click Yes. The
VHDL-AMS files will be compiled as necessary.
The Simulations tab is for the basic settings and to enable/disable the desired
analyses. If necessary, enable the Time-Domain Analysis and set End Time to
800us.
The Results tab allows you to select the signals for viewing. The default selection
is TopLevel Waveforms which will save all signals at the highest level of
hierarchy. Since this is a small design, All Signals was selected for convenience.
You can also choose Selected Waveforms and click on the browse button () to
select individual signals.
The Multi-Run tab is for performing parametric variations.
The Advanced tab is used for advanced simulation settings (normally not
required).
2. Click the OK button to run the simulation (the Output Window will display the
simulation progress and any error messages that may be issued).
Viewing Results
1. The simulation results will automatically be loaded into the waveform viewer upon
completion of a successful simulation (if not, look in the Output Window for any
error messages).
2. Individual signals can be viewed by double-clicking with the LMB or by using the
drag-and-drop feature. You can also plot a signal from the schematic by selecting the
desired signal and using RMB > Plot Waveform. Use one of these methods to plot the
input (bitstream), lowpass filter output (lpf_out) and recovered digital baseband signal
(baseband) as shown in Figure 5.
Note the original input bitstream is successfully recovered with about 14us of delay.
3. Look at any other signals of interest. Additional Waveform Viewer features are given
below:
Multiple graph windows and workspaces can be easily created using the menus
or drag-and-drop.
Markers can be placed to view the X-Y coordinates of any point on the
waveform.
Signals can be deleted using the Delete key on your keyboard, or by using the
RMB > Delete command on the signal name.
The Measurement Tool can be used to extract information from the waveforms.
tb_CommSys_PLL
The design tb_CommSys_PLL, shown in Figure 6 is an alternate detector topology that utilizes
a Phase Locked Loop circuit used to detect (demodulate) BFSK signals to recover the
original unmodulated baseband data.
Design selection/viewing/editing:
1. Make sure the CS4_Communications_System project is loaded into SystemVision.
2. From the Project tab, click on Design Roots > tb_CommSys_PLL to open the schematic.
Simulate the Design
1. Return to the top level schematic and from the menu, select Simulation > Simulate to
invoke the Simulation Control window (there is also a simulation icon available on
the icon bar). If asked to make this design the active testbench, click Yes. The
VHDL-AMS files will be compiled as necessary.
The Simulations tab is for the basic settings and to enable/disable the desired
analyses. If necessary, enable the Time-Domain Analysis and set End Time to
800us.
The Results tab allows you to select the signals for viewing. The default selection
is TopLevel Waveforms which will save all signals at the highest level of
hierarchy. Since this is a small design, All Signals was selected for convenience.
You can also choose Selected Waveforms and click on the browse button () to
select individual signals.
The Multi-Run tab is for performing parametric variations.
The Advanced tab is used for advanced simulation settings (normally not
required).
2. Click the OK button to run the simulation.
Viewing Results
1. The simulation results will automatically be loaded into the waveform viewer upon
completion of a successful simulation (if not, look in the Output Window for error
messages).
2. Individual signals can be viewed by double-clicking with the LMB or by using the
drag-and-drop feature. You can also plot a signal from the schematic by selecting the
desired signal and using RMB > Plot Waveform. Use one of these methods to plot the
input (bitstream), lowpass filter output (lpf_out) and recovered digital baseband signal
(baseband) as shown in Figure 7.
Note the original input bitstream is successfully recovered with about 8us of delay.
3. Look at any other signals of interest. Additional Waveform Viewer features are given
below:
Multiple graph windows and workspaces can be easily created using the menus
or drag-and-drop.
Markers can be placed to view the X-Y coordinates of any point an the
waveform.
Signals can be deleted using the Delete key on your keyboard, or by using the
RMB > Delete command on the signal name.
The Measurement tool can be used to extract information from the waveforms.
Case Study 5:
The RC Airplane System
Motor/Propeller
Throttle Amp
Bitstream to Pulse-Width Pulse-Width to Analog
Amp
s+a
s+b
+ Buck Converter
Battery DC Motor/Rudder
(42 V) DC Assembly
Case Study 5:
The RC Airplane System
This help file discusses how to use SystemVision to simulate various remote controlled (RC)
electric airplane system designs. The individual subsystems for the RC Airplane System (also
referred to as a UAV system) are detailed through five Case Studies in the book The System
Designers Guide to VHDL-AMS.
The RC Airplane System is shown in Figure 1. For more detailed information on the RC
Airplane System, please refer to the accompanying file: vhdl-ams-book-chapter-26.pdf. This file
comprises the book chapter which corresponds to the complete RC Airplane System design.
Control Stick Analog to Bitstream RF Transmit/Receive
Motor/Propeller
Throttle Amp
Bitstream to Pulse-Width Pulse-Width to Analog
Amp
s+a
s+b
+ Buck Converter
Battery DC Motor/Rudder
(42 V) DC Assembly
There are three implementations of the RC Airplane System discussed in this help file:
Airplane_CC_Rudder; Airplane_Prop; and Airplane_HCL. These are summarized below.
Design Selection/Viewing/Editing
1. Make sure the CS5_RC_Airplane_System project is loaded into SystemVision.
2. From the Simulation tab (in the ProjectNavigator Tree), click on TestBenches >
airplane_cc_rudder to open the schematic. A schematic similar to that illustrated in
Figure 2 should appear.
The purpose of the Airplane CC Rudder System is to send digitized versions of the
input analog commands (which issue from a hand-held joystick controller), through
an RF transmitter/receiver pair, and properly decode the signals and apply them to
the complete Rudder System. In this way, the entire link from analog command to
physical rudder movement can be analyzed.
throttle_cmdDigitize/Encode RF Tx and Rx Decode/PW PW/Analog To
Prop
Amp PLL
rudder_cmd PW/Analog To
Rudder
f1 f2
rudder_ana
Mechanical
Potentiometer Stop
An illustrated, the rudder_cmd waveform is analog, and is issued from the joystick; the
rudder_ana waveform is the reconstructed rudder command after being received digitally on
the airplane and re-converted into analog form; the rudder_out waveform represents the actual
rotational rudder displacement.
2. Explore other waveforms of interest.
Airplane Propeller System
Design Selection/Viewing/Editing
1. Make sure the CS5_RC_Airplane_System project is loaded into SystemVision.
2. From the Simulation tab (in the ProjectNavigator Tree), click on TestBenches >
airplane_prop to open the schematic. The schematic illustrated in Figure 4 should
appear.
The purpose of the Airplane Propeller System is to verify that the propeller speed and
torque specifications for the system are satisfied. This system consists of an ideal sine wave
stimulus, which feeds into a pulse-width modulator (PWM), which in turn controls the
amount of energy delivered from the 42V power supply to the propeller motor.
PWM
Switch
Motor Propeller
As illustrated, the propeller output follows the command somewhat, but not completely.
This is because the propeller drive circuit is uni-directional, and relies on the propeller drag
to slow it down when so commanded. This is deemed acceptable in this system since
standard airplane usage would not require the propeller to be shut down instantly.
Users are also encouraged look at the propeller torque and PWM output waveforms as well.
Note that when looking at high frequency switching signals, it is best to reduce the viewable
time range in the waveform viewer (either by double-clicking on the time axis and typing in
values manually, or by zooming in on a reduced range).
Airplane with Human in the Loop
Design Selection/Viewing/Editing
1. Make sure the CS5_RC_Airplane_System project is loaded into SystemVision.
2. From the Simulation tab (in the ProjectNavigator Tree), click on TestBenches >
airplane_HCL to open the schematic. A schematic similar to that illustrated in Figure 6
should appear.
This new system includes the Airplane Controller (C&C) and Rudder System
designs, along with the human operator in the loop. This system models the
interaction between the RC Airplane itself, and the person controlling it. Wind
perturbations are also applied from within the plane model, in order to see how well
the system will respond when the RC operator attempts to adjust for them.
Amp PLL
PW/Analog
f1 f2
To Rudder
To Prop
DC Motor Propellor
Low-Pass
pwr_in
w 1 w2
k speed_cmd sw_out
(s + w1)(s + w2)
Buck Converter +
DC
DC
Battery
4.8 V DC 42 V
Mechanical
Potentiometer Stop Rot2V
Human
Controller k
Visual Feedback
Figure 6 - Command and Controller with Rudder System and Human Control Loop.
The simulation results will automatically be loaded into the waveform viewer upon
completion of a successful simulation (if not, look in the Output Window for any error
messages).
Individual waveforms can be viewed by double-clicking the left-mouse button (LMB) or by
using the drag-and-drop feature. Waveforms can also be displayed from the schematic by
selecting the desired signal and using RMB > Plot Waveform.
1. Use one of these methods to plot the plane1\wind_neg and rudder_out waveforms. It
will be easier to compare the waveforms if they are placed into the same graph
region.
2. Plot the plane1\flight_deviation waveform on a separate graph region. These waveforms
should appear as shown in Figure 7.
As shown in the figure, the wind_neg waveform represents a crosswind profile, and the
rudder_out waveform represents how well the RC operator responds to the resulting
unwanted heading change. The flight_deviation waveform represents the actual deviation from
the original heading (0 rudder angle), which results from the crosswind.
3. Look at any other signals of interest.
4. Again, for more detailed information on the RC Airplane System, please refer to the
accompanying file: vhdl-ams-book-chapter-26.pdf.