You are on page 1of 102

Introduction To The VHDL-AMD

Modeling Language
Scott Cooper
Mentor Graphics

Presented 13 November 2007


Westminster, Colorado

Denver Chapter, IEEE Power Electronics Society


www.denverpels.org
Special Note
This document contains an expanded version of the
presentation that Scott Cooper presented at the
Chapter meeting and a paper written by Scott that is
an introduction to modeling languages.
The Chapter thanks Scott Cooper for his
contributions.

Denver Chapter, IEEE PELS 2


Introduction to VHDL-AMS
Presented by Scott Cooper

Introduction to System Modeling Using VHDL-AMS 1


Presentation Agenda
D VHDL-AMS Overview
Here we will briefly define what VHDL-AMS is, and some concepts associated
with it.
D Electrical Analog Modeling
In this portion of the presentation, we concentrate on analog, or continuous-time,
modeling concepts with VHDL-AMS.
D Mixed-Signal Modeling
In this section, we discuss mixed-signal modeling techniques.
D Power Converter Design Example
The last part of the presentation will focus on a power converter design developed
with VHDL-AMS models.

Introduction to System Modeling Using VHDL-AMS 2


What is VHDL-AMS?
D A mixed-signal modeling language based on VHDL
(IEEE 1076-1993)
D A strict superset of VHDL (IEEE 1076.1-1999)
 AMS => Analog / Mixed Signal Extensions
D Represents complex models directly
 Non-linear Ordinary Differential-Algebraic Equations (DAEs)
 Mixed Analog/Digital
D Can also model non-electrical physical phenomena

Introduction to System Modeling Using VHDL-AMS 3


VHDL-AMS Concepts
D VHDL-AMS models are organized as entities and
architectures
D It has a concept of time, concurrent processes
D It has a well-defined simulation cycle
D It can model continuous and discontinuous behavior
D Equations are solved using conservation laws
(e.g. KCL, Newton’s Laws)
D It handles initial conditions, piecewise-defined
behavior, and so forth

Introduction to System Modeling Using VHDL-AMS 4


Electrical Analog Modeling

Introduction to System Modeling Using VHDL-AMS 5


VHDL-AMS Model Structure
VHDL-AMS models are typically comprised of two
sections: an entity and an architecture.

D Entity - Describes the model interface to the outside


world
D Architecture - Describes the function or behavior of
the model

Introduction to System Modeling Using VHDL-AMS 6


Entity - model interface

D Pins “p1” and “p2” provide the interface between this


model and the outside world.
D The nature of these pins is defined in the model’s
“Entity declaration.”

Introduction to System Modeling Using VHDL-AMS 7


Resistor Model (Entity Declaration)

Pin Definitions:
p1, p2 - electrical pins

entity resistor is
port (
terminal p1, p2 : electrical);
end entity resistor;

Introduction to System Modeling Using VHDL-AMS 8


Resistor Model (Entity Explanation)

Entity/model name Port names


Entity declaration
Port Nature:
Electrical?
Mechanical?
entity resistor is Thermal?
…?
Device port (pin) port (
terminal p1, p2 :electrical);
Port type: end entity resistor;
Analog?
Digital?
Conserved?

Entity/model name

Introduction to System Modeling Using VHDL-AMS 9


Architecture - model behavior

D The architecture describes the behavior of the model.

D In this case, the model behavior is governed by Ohm’s


law, which relates current and voltage as:

i = v / res

Introduction to System Modeling Using VHDL-AMS 10


Resistor Model (Architecture)

Characteristic Equation:
i = v / res

architecture ideal of resistor is


constant res : real := 10.0e3;
quantity v across i through p1 to p2;
begin -- architecture ideal
i == v / res;
end architecture ideal;

Introduction to System Modeling Using VHDL-AMS 11


Resistor Model (Architecture Explanation)
Architecture name Entity name

architecture ideal of resistor is


Internal object constant res : real := 10.0e3;
declarations quantity v across i through p1 to p2;
begin -- architecture ideal
Model behavior i == v / res;
end architecture ideal;

Architecture name

Now that we’ve seen the overall structure of a VHDL-AMS


model, let’s explore some elements of the model.

Introduction to System Modeling Using VHDL-AMS 12


VHDL-AMS Object Types
D There are six classes of “objects” in VHDL-AMS:
 Constants
 Terminals
 Quantities
 Variables
 Signals
 Files
D For analog modeling, constants, terminals, and
quantities are routinely used

Introduction to System Modeling Using VHDL-AMS 13


Constants
D Data storage object for use in a model
 constant res : real := 50.0;
Declares constant, res, of type real, and initializes it to 50.0. Since this
constant is of type real, it must be assigned only real values, which
must include a decimal point.
 constant count : integer := 3;
Declares constant count, of type integer, and initializes it to 3. Since
count is of type integer, it must be assigned only whole values, which
must not include a decimal point.
 constant td : time := 1 ns;
Declares constant td, of type time, and initializes it to 1 ns (1.0e-9
seconds).
Time is a special kind of constant, described next.

Introduction to System Modeling Using VHDL-AMS 14


Predefined Physical Types
D The constant time is a predefined physical type, so named because
it represents a real world physical property. It can be either real or
integer.
D As a physical type, time values are specified with a value followed
by a multiplier (separated with a space). Predefined time
multipliers consist of the following:
- fs (femto-seconds)
- ps (pico-seconds)
- ns (nano-seconds)
- us (micro-seconds)
- ms (milli-seconds)
- sec (seconds)
- min (minutes)
- hr (hours)
D Since td is of type time, it may only be assigned time values.

Introduction to System Modeling Using VHDL-AMS 15


Constants (cont.)
D Constants make models easier to understand and
modify (as opposed to using literal values)
 i == v/50.0; -- Poor modeling style
 i == v/res; -- Good modeling style
D Constant values cannot be changed during simulation

Introduction to System Modeling Using VHDL-AMS 16


Terminals
D Terminals represent continuous, conservative ports
in VHDL-AMS
D Terminals have across (potential) and through (flow)
aspects
D Terminal types are referred to as “natures”
D Example terminal natures (predefined):
 electrical - voltage across, current through
 translational – position across, force through
 thermal – temperature across, power (or heat-flow) through
 fluidic – pressure across, flow-rate through
D Users can define custom terminal natures

Introduction to System Modeling Using VHDL-AMS 17


Quantities: 3 Types

D Free quantity - non-conservative analog object:


 quantity pwr : real;

D Branch quantity - analog object used for conservative


energy systems:
 quantity v across i through p1 to p2;

D Source quantity - for frequency domain:


 quantity spectral_src real spectrum mag, phase;

Source quantities will not be discussed in this course

Introduction to System Modeling Using VHDL-AMS 18


Free Quantities
Free quantities can be used to represent non-conserved
analog values.
They are often used to clarify model descriptions, and provide the
ability to view internal model waveforms. Free quantities are also
used to describe signal-flow (block diagram) type models.
 quantity internal_variable : real := 5.0;
– In this case, the quantity internal_variable is of type real, and is initialized
to 5.0.
 quantity power : real;
– In this case, the quantity power is declared as type real, and is initialized to
the default (left-most) value for that type. The default value for type real is
guaranteed to be no larger than -1.0e+38. Depending on how they are used,
it is sometimes important to initialize quantities and avoid their default
values.

Introduction to System Modeling Using VHDL-AMS 19


Branch Quantities
D Branch quantity
Branch quantities are analog objects used for conservative energy
systems. For electrical systems, these quantities are used to access
either the voltage or current, or both, of a terminal port.

To illustrate branch quantities, consider the entity declaration for


the resistor model discussed previously:

D terminal p1, p2 : electrical;

An example of the branch quantity declaration syntax for these


terminals is next:

Introduction to System Modeling Using VHDL-AMS 20


Branch Quantities
Quantity “i” refers to
the through aspect of
terminal ports p1 and p2

quantity v across i through p1 to p2 ;

Quantity “v” refers to “v” and “i” are defined with respect
the across aspect of to terminal ports p1 and p2
terminal ports p1 and p2

D Recall the resistor entity declaration for ports p1 and p2 :


terminal p1, p2 : electrical;
D Since p1 and p2 are declared as electrical ports, v will represent voltage,
and i will represent current
D Any name can be used for the quantities (not restricted to v and i)

Introduction to System Modeling Using VHDL-AMS 21


Source Quantities
Source quantity
Source quantities are used for frequency and noise modeling.
These are used only in sources when frequency domain analysis is
to be performed, and other models do not require them to perform
in this domain. A syntax example is given as:

quantity spectral_src real spectrum mag, phase ;

Introduction to System Modeling Using VHDL-AMS 22


Generic Constants (“Generics”)
D Allow models to be externally parameterized
D Static objects can be defined as generics in the entity
of a model, rather than as constants in the architecture
of a model
D Allows the model to be used more “generically,”
without having to modify the model itself. The model
user just passes in a value to the model.

Introduction to System Modeling Using VHDL-AMS 23


Resistor Model (Entity with Generic)

Generic type
Optional initializer
entity resistor is
generic (
Generic name res : real := 10.0e3);
port (
terminal p1, p2 : electrical);
end entity resistor;

Value of generic can be initialized in the entity


declaration. This value will be over-written if
specified when the component is instantiated.

Introduction to System Modeling Using VHDL-AMS 24


Resistor Model
(Architecture with Generic)

architecture ideal of resistor is


constant res : real := 10.0e3;
quantity v across i through p1 to p2;
begin -- architecture ideal
i == v / res;
end architecture ideal;

Constant res no longer defined in architecture

Introduction to System Modeling Using VHDL-AMS 25


Implicit Quantity Attributes (analog)
Useful predefined quantity attributes
D Q’dot
Time derivative of quantity Q
v == L*i’dot; -- v = L*di/dt
D Q’integ
Time integral of quantity Q
v == (1/C)*i’integ + init; -- v = (1/C) ∫i dt + k
D Q’delayed(T)
Quantity Q delayed by time T
v_out == v_in’delayed(td);
D … many more

Introduction to System Modeling Using VHDL-AMS 26


Analog Modeling Examples

Introduction to System Modeling Using VHDL-AMS 27


Inductor Model (Entity)

+ v- Pin Definitions/Argument:
p1
i
p2 p1, p2 : electrical pins
ind : user supplied argument

use ieee.electrical_systems.all;
entity inductor is
generic (
ind : real); -- inductance value
port (
terminal p1, p2 : electrical);
end entity inductor;

Introduction to System Modeling Using VHDL-AMS 28


Inductor Model (Architecture)

+ v- Fundamental Equation:
p1 p2 di
i
v = ind
dt

architecture ideal of inductor is


quantity v across i through p1 to p2;
begin -- ideal architecture
v == ind * i’dot;
end architecture ideal;

Introduction to System Modeling Using VHDL-AMS 29


Diode Model (Entity)

Pin Definitions/Argument:
p, n : electrical pins
Isat : user supplied argument

entity diode is
generic (
-- saturation current
Isat : current := 1.0e-14;
port (
terminal p, n : electrical);
end entity diode;

Introduction to System Modeling Using VHDL-AMS 30


Diode Model (Architecture)

Fundamental Equation:
v
i = Isat * (exp vt
− 1 .0 )

architecture ideal of diode is


constant TempC : real := 27.0;
constant TempK : real := 273.0 + TempC;
constant vt : real := PHYS_K*TempK/PHYS_Q;
quantity v across i through p to n;
begin
i == Isat*(exp(v/vt)-1.0);
end architecture ideal;

Introduction to System Modeling Using VHDL-AMS 31


Op Amp Model (Entity)

in_pos Pin Definitions/Argument:


output
in_neg in_pos, in_neg, output : electrical pins
a_ol, f_0dB : user supplied arguments

entity opamp_3p is
generic (
a_ol: real := 100.0e3;
f_0dB: real := 1.0e6
);
port (
terminal in_pos: electrical;
terminal in_neg: electrical;
terminal output: electrical
);
end entity opamp_3p;

Introduction to System Modeling Using VHDL-AMS 32


Op Amp Model (Architecture)
in_pos
output Fundamental Equation:
v_in v_out
a ol
in_neg vout = vin
s
1+
architecture default of opamp_3p is
3 dB ω
constant f_3dB: real := f_0dB/a_ol;
constant w_3dB: real := math_2_pi*f_3dB;
constant num: real_vector := (0 => a_ol);
constant den: real_vector := (1.0, 1.0/w_3dB);
quantity v_in across in_pos to in_neg;
quantity v_out across i_out through output to ELECTRICAL_REF;
begin
v_out == v_in'ltf(num, den);
end architecture default;

Introduction to System Modeling Using VHDL-AMS 33


Incandescent Lamp
An incandescent lamp converts electrical energy into thermal energy.
D From an electrical standpoint, the lamp filament acts as a temperature-dependent
resistance.
D From a thermal standpoint, current flows through this resistance, power is developed
and thermally dissipated as a combination of thermal conductance, thermal
capacitance, and radiation.

v T
i hflow
R v*i = power => heat flow rth cth

(Powerelectrical = Powerthermal)

Electrical model governing power Thermal model governing power (heat flow)

Introduction to System Modeling Using VHDL-AMS 34


Lamp Equations
We begin with the electrical model of the preceding figure, which consists of a
temperature-dependent electrical resistance. The power dissipated by this
resistance is determined as follows:
power = v*i
where the power is simply the product of the voltage (v) across the electrical
resistance and the current (i) through it. The voltage across the electrical
resistance can be determined using Ohm’s law as follows:
v = i*R
where R represents the electrical resistance at the given temperature. This
resistance, in turn, can be calculated with the following formula:
R = RC*(1.0 + alpha*(T - TC))
where RC is the electrical resistance when the lamp is “cold,” TC is the
unheated “cold” temperature of the filament, T is the actual filament
temperature, and alpha is the resistive temperature coefficient of the filament.

Introduction to System Modeling Using VHDL-AMS 35


Lamp Equations
We now have the necessary information to calculate the temperature-
dependent electrical power as a function of filament temperature. The next
task is to develop equations which describe how this power is thermally
dissipated.

For the thermal capacitance component (cth), the governing equation is:
hflowcap = cth*dT/dt
where the heat flow is the product of the time derivative of the filament
temperature (T) and the thermal capacitance (cth). The thermal conductance
(rth) component is formulated as follows:
hflowres = (T - TA)/rth
where the heat flow is the ratio of the delta temperature (actual temperature
(T) minus ambient temperature (TA)), and the thermal resistance. The lamp
will also dissipate heat in the form of electromagnetic radiation.

Introduction to System Modeling Using VHDL-AMS 36


Lamp Equations
The radiated heat flow increases as the fourth power of the object’s
temperature, and may be described as follows:
hflowradiated = Ke*(T4 - TA4)
where Ke is the radiated energy coefficient. We now have all the equations
necessary to implement the incandescent lamp model.
To summarize our approach, we are attempting to equate electrical power to
thermal power (heat flow), as follows:
Electrical: power = v*i
and
Thermal: hflow = hflowcap + hflowres + hflowradiated
these two equations may be equated by the following relationship:
Electrical/thermal: power = hflow

Introduction to System Modeling Using VHDL-AMS 37


Developing the Lamp Model
Although it is quite easy to develop simple models in an
unstructured manner, more complex models benefit from a
structured modeling approach. A recommended approach for
analog modeling is:
1. Determine the model’s characteristic relationships for internal
and external variables
2. Implement these relationships as simultaneous statements in
VHDL-AMS
3. Declare appropriate objects to support the simultaneous
statements

Introduction to System Modeling Using VHDL-AMS 38


Incandescent Lamp (Architecture)
architecture dyn_therm of Lamp is …then declare appropriate
constant temp_amb_K : real := temp_amb + 273.18; objects to support the
constant temp_cold_K : real := temp_cold + 273.18; simultaneous equations.
quantity v across i through p1 to p2;
quantity r_temp : resistance; -- Resistance at temp_fil [ohms]
quantity temp_fil : temperature; -- Filament temperature [K]
quantity hflow : heat_flow; -- Heat flow from filament [watts]

begin First, express core


r_temp == r_cold*(1.0 + alpha*(temp_fil - temp_cold_K)); relationships as VHDL-AMS
v == i*r_temp;
simultaneous equations…
hflow == v*i; -- Electrical power = heat flow
hflow == cth*temp_fil'dot + ke*SIGN(temp_fil - temp_amb_K)*(temp_fil**4
- temp_amb_K**4) + (temp_fil - temp_amb_K)/rth;
-- Note: For alpha, cth and rth, temperatures specified in C or K will work since each represents a ratio,
-- for which only the change in temperature is significant, not its absolute offset.
end architecture dyn_therm;

Introduction to System Modeling Using VHDL-AMS 39


Incandescent Lamp (Entity)
Finally, define the model’s interface to the outside world.

entity Lamp is
generic (
r_cold : resistance := 0.2; -- Filament resistance at temp_cold
temp_cold : temperature := 27.0; -- Calibration temperature [deg C]
alpha : real := 0.0045; -- Resistive temp coefficient [ohms/deg C]
ke : real := 0.85e-12; -- Radiation coefficient [watts/K^4]
rth : real := 400.0; -- Thermal conduction [deg C/watt]
cth : real := 0.25e-3; -- Thermal heat capacitance [joules/C]
temp_amb : temperature := 27.0); -- Ambient temperature [deg C]
port (terminal p1, p2 : electrical);
end entity Lamp;

Introduction to System Modeling Using VHDL-AMS 40


Model Solvability
Analog models are solved by the simulator as
simultaneous equations. When solving simultaneous
equations, the number of equations must equal the
number of unknowns to be solved.

To ensure the same number of equations and unknowns


in a behavioral model, the following formula may be
applied:
# equations = # free quantities
+ # through quantities
+ # quantity ports of mode out

Introduction to System Modeling Using VHDL-AMS 41


Mixed-Signal Modeling

Introduction to System Modeling Using VHDL-AMS 42


Mixed-Signal Introduction
In this section, we combine the analog and digital
modeling capabilities of VHDL-AMS.

An overview of A/D and D/A conversion techniques


will be given next, followed by specific model
examples.

Introduction to System Modeling Using VHDL-AMS 43


Analog to Digital
The ‘above attribute is used to convert an analog (continuous) quantity
into a digital (discontinuous) signal, by detecting an analog threshold
crossing. The syntax is as follows:

Q’above(threshold);

Where Q is the analog quantity to be converted, and threshold is the


analog threshold level.

This statement returns a boolean ‘true’ if quantity Q passes from


below to above the threshold level; it returns a boolean ‘false’ if
quantity Q passes from above to below the threshold level.

Introduction to System Modeling Using VHDL-AMS 44


Digital to Analog
There are two primary methods for converting from digital signals to analog
quantities. The first method involves using the ‘ramp attribute, as follows:
Q == S’ramp(tr,tf);
Where Q is an analog quantity, S is a digital signal, and tr and tf are the rise
and fall-times of Q at transition points.

When signal S changes value, quantity Q tracks this change, but transitions to
it over a linear interval of tr or tf, depending on the direction of the change.

The ‘ramp attribute also performs the function of restarting the analog solver at
the discontinuous points when signal S is updated. This is a very important
consideration for analog simulation so that the simulator does not get “lost”
when encountering a discontinuity.

Introduction to System Modeling Using VHDL-AMS 45


Digital to Analog
The second method for D/A conversion can be used any time a
quantity is updated as a function of a signal, as in:
Q == f(S);
break on S;
Where Q is an analog quantity, and f(S) is some function which returns
a digital signal.

In this case, if the ‘ramp attribute is not included in the statement, a


break statement should be included to synchronize the analog quantity
to the digital signal during state transitions. The break statement is
used explicitly to accomplish what the ‘ramp attribute does implicitly,
which is to guide a simulator through discontinuities.

Introduction to System Modeling Using VHDL-AMS 46


Mixed Signal Model Examples

Introduction to System Modeling Using VHDL-AMS 47


Analog to Digital Interface (Entity)

entity a2d is
generic (vthreshold : real := 2.0);
port (d_output : out std_logic;
terminal a_input : electrical);
end entity a2d;

Entity declaration can include both analog and digital ports.

Introduction to System Modeling Using VHDL-AMS 48


Analog to Digital Interface (Architecture)
architecture behavioral of a2d is
quantity vin across a_input to electrical_ref;
begin
process (vin’above(vthreshold)) is
begin
if vin’above(vthreshold) then
d_output <= ‘1’;
else
d_output <= ‘0’;
end if;
end process;
end architecture behavioral;
-- Note that no simultaneous equations are required --

Introduction to System Modeling Using VHDL-AMS 49


The ‘above Attribute
D “Why use ‘above instead of > or < ?”
 ‘above() generates an event exactly when the crossing occurs.
– It is the only way to generate a signal to use in a break statement.
 < or > do a comparison at each time-step, which may not fall on
the exact crossing.
D Must use “ not ‘above() ” to represent “ ‘below() ”, as
‘below() is not part of the VHDL-AMS language.

Introduction to System Modeling Using VHDL-AMS 50


Simple Switch and Entity

The purpose of this switch is to allow or prevent current flow between pins p1
and p2, depending on the value of sw_state. Ports p1 and p2 are electrical
analog, and port sw_state is std_logic digital.

entity switch_dig_nogen is
port ( sw_state : in std_logic;
terminal p1, p2 : electrical );
end entity switch_dig_nogen;

Introduction to System Modeling Using VHDL-AMS 51


Simple Switch Architecture
architecture ideal of switch_dig_nogen is
constant r_open : real := 10.0e3;
constant r_closed : real := 15.0e-3;
constant trans_time : real := 10.0e-6;
signal r_sig : resistance := r_open;
quantity v across i through p1 to p2;
quantity r : resistance;
begin
DetectState: process (sw_state)
begin
if (sw_state = ‘0’) then
r_sig <= r_open;
elsif (sw_state = ‘1’) then
r_sig <= r_closed;
end if;
end process DetectState;
r == r_sig’ramp(trans_time, trans_time);
v == r*i;
end architecture ideal;

Introduction to System Modeling Using VHDL-AMS 52


Key Switch Attributes
D ‘event
The mechanism by which digital events are detected in
VHDL-AMS. The switch uses this to detect when a new
digital control signal is given.
D ‘ramp
Ensures that when switching from one value of r_sig to
another, a reasonable amount of “switching time” is
used.
The syntax used in the switch example is:
q == S’ramp(tr, tf);
where q is a quantity (r), S is a signal (r_sig), and tr and tf are real values,
representing the rise time and fall time respectively.

Introduction to System Modeling Using VHDL-AMS 53


Ideal Limiter Model (Entity)
A limiter model entity is shown below. Its function is to restrict the range of
voltage levels which pass from input to output. In order to implement this
behavior, the model selects between one of three simultaneous equations,
depending on the level of the input voltage.

entity limiter_ideal is
generic (
limit_high : real := 10.0; -- upper limit
limit_low : real := -10.0); -- lower limit
port (
terminal input: electrical;
terminal output: electrical);
end entity limiter_ideal ;

Introduction to System Modeling Using VHDL-AMS 54


Ideal Limiter Model (Architecture)
architecture simple of limiter_ideal is
quantity vin across input to electrical_ref;
quantity vout across iout through output to electrical_ref;
begin
if vin’above(limit_high) use -- above upper limit, so limit output
vout == limit_high;
elsif not vin’above(limit_low) use -- below lower limit, so limit output
vout == limit_low;
else -- no limit exceeded, so pass input signal to output
vout == vin;
end use;
break on vin'above(limit_high), vin'above(limit_low);
end architecture simple;

Introduction to System Modeling Using VHDL-AMS 55


Power Converter Example

Introduction to System Modeling Using VHDL-AMS 56


Phase 1 – Averaged Model
Phase 1 allows both frequency and time domain exploration
of the design. It simulates very quickly, and allows the
overall control loop to be stabilized.

Introduction to System Modeling Using VHDL-AMS 57


Averaged Model Stimulus and Results
Output voltage

Dynamic load perturbations

Input perturbations

Introduction to System Modeling Using VHDL-AMS 58


Phase 2 – Ideal Switch/Diode Models
Phase 2 allows switching effects to be analyzed with
relatively ideal switch and diode models. Drive voltages
and currents can now be evaluated.

Introduction to System Modeling Using VHDL-AMS 59


Averaged and Switched Results
Superimposed output voltages for
averaged and switched designs

Introduction to System Modeling Using VHDL-AMS 60


Phase 3 – MOSFET, IRR Diode and Stress
Checks
Phase 3 includes a MOSFET switch, a diode model that
includes IRR effects, as well as stress monitoring for the
MOSFET and diode.

Introduction to System Modeling Using VHDL-AMS 61


Averaged, Ideal Switch, MOSFET Tests
Superimposed output voltages for
averaged, ideal switched and MOSFET
switch-based designs

Introduction to System Modeling Using VHDL-AMS 62


Stress Indicators in Waveform Viewer
Boolean indicators in the Waveform Viewer that show if
any stress measures have been violated.

Introduction to System Modeling Using VHDL-AMS 63


Analyzing Causes of Stress (IRR Violated)

If MOSFET switches too


fast (RGATE = 1k), IRR
specification is violated.

Introduction to System Modeling Using VHDL-AMS 64


Analyzing Causes of Stress (MOSFET Power)

If MOSFET switches too


slow (RGATE = 3k), its power
rating is violated.

Introduction to System Modeling Using VHDL-AMS 65


Test IRR Diode
Test circuit for the diode with
reverse-recovery effects
modeled.

Introduction to System Modeling Using VHDL-AMS 66


IRR Diode Test Results

Test results for the diode


with reverse-recovery
effects modeled.

Introduction to System Modeling Using VHDL-AMS 67


VHDL-AMS Reference Material
D How to Model Mechatronic Systems Using VHDL-AMS is the first booklet in the
SystemVision Technology Series. This booklet serves as the foundation for this
modeling course. It is available from the SystemVision Welcome Screen, and from
Mentor Graphics at the SystemVision website.

D The System Designer's Guide to VHDL-AMS (P. J. Ashenden, G. D. Peterson, D.


A. Teegarden - ISBN 1-55860-749-8, published by Morgan-Kaufman Publishers,
2002) is a comprehensive textbook for the VHDL-AMS modeling language.

D The Designer’s Guide to Analog & Mixed-Signal Modeling (R. S. Cooper - ISBN
0-9705953-0-1, published by Avant!, 2001) includes numerous model examples in
both the VHDL-AMS and MAST modeling languages.

D The VHDL-AMS Quick Reference Guide offers a summary of many VHDL-AMS


language features and syntax. It is accessed from within SystemVision: Help >
Manuals > VHDL-AMS Quick Reference.

Introduction to System Modeling Using VHDL-AMS 68


Thank You!

Introduction to System Modeling Using VHDL-AMS 69


System Modeling White Paper

System Modeling: An Introduction

Scott Cooper
Mentor Graphics

www.mentor.com/systemvision
INTRODUCTION environment in which a system can be tuned,
This paper introduces a systematic process for optimized, and critical insights can be gained –
developing and analyzing system models for the before any hardware is built. During the
purpose of computer simulation. This process is verification phase of the design, simulation
demonstrated using the Digitally-Controlled technologies can again be employed to verify
Positioning System (referred to as “Position intended system operation.
Controller”) shown in Figure 1. It is a common mistake to completely design a
system and then attempt to use simulation to
WHAT IS COMPUTER SIMULATION? verify whether or not it will work correctly.
The general concept of “computer simulation” Simulation should be considered an integral part
(referred to simply as “simulation” in this paper) of the entire design phase, and continue well into
is to use a computer to predict the behavior of a the manufacturing phase.
system that is to be developed. To achieve this, a
“system model” of the real system is created. This SYSTEM OVERVIEW
system model is then used to predict actual system The Position Controller is composed of two
performance and to help make design decisions. sections, as indicated by the dotted line dividing
Simulation typically involves using the system shown in Figure 1. These sections are
specialized computer algorithms to analyze, or referred to as the Digital Command and Servo
“solve”, the system model over some period of subsystems. These subsystems will be developed
time (time-domain simulation) or over some range individually, and then combined to form the
of frequencies (frequency-domain simulation). overall Position Controller system.
The Position Controller works as follows: A
WHY SIMULATE? Digital Command subsystem is used to generate a
Simulation is useful for many reasons. Perhaps series of user-programmable “position profile”
the most obvious use of simulation is to reduce commands, which the motor/load are expected to
the risk of unintended system behaviors, or even precisely track. The digitally-generated command
outright failures. This risk is reduced through drives a digital-to-analog (D/A) converter which
“virtual testing” using simulation technologies. produces an analog representation of the digital
Virtual testing is typically used in conjunction command.
with physical testing (on a physical prototype). The D/A output is then filtered, and used to
The problem with relying solely on physical command an analog servo loop, the purpose of
testing is that it is often too expensive, too time- which is to precisely control the position of an
consuming, and occurs too late in the design inertial load connected to the shaft of a motor.
process to allow for optimal design changes to be Each of these blocks will be explored in detail in
implemented. this paper.
Virtual testing, on the other hand, allows a
Digital Servo
system to be tested as it is being designed, before Command
actual hardware is built. It also allows access to
the innermost workings of a system, which can be Digital Servo/
D
difficult or even impossible to observe with Command 2 Motor/
physical prototypes. Additionally, virtual testing A Load
allows the impact of component tolerances on
overall system performance to be analyzed, which
is impractical to do with physical prototypes. Figure 1 – Position Controller
When employed during the beginning of the This type of servo positioning system is
design process, simulation provides an commonly employed in various applications in

System Modeling: An Introduction -2-


the automotive, industrial controls, and robotics often entails upgrading “high-level” models to be
industries, among others. Although this paper more consistent with the intended physical
focuses on this single system, the process used to implementation of the system. SPICE and VHDL-
develop the Position Controller may be applied to AMS models are combined to achieve this goal
a great number of other systems as well. for the Position Controller system.
The Integrate Digital Command and Servo
MODELING THE SYSTEM Subsystems phase discusses how to implement the
Before setting out to model this system the Digital Command subsystem components using
following assumptions will be made: the mixed analog/digital features of the VHDL-
• The Digital Command subsystem will be AMS modeling language. Once the Digital
implemented by another designer Command subsystem is implemented, the entire
• The specification for the Digital Command Position Controller system will be simulated.
subsystem requires that it will generate a All design development and simulation in this
new 10 bit digital word every 2 ms paper is performed with the SystemVision™
System Modeling Solution from Mentor Graphics
The Digital Command and Servo subsystems will Corporation.
be developed individually. Since the Servo
subsystem is this designer’s primary design DEVELOP SYSTEM MODELING
responsibility, special consideration will be given ANALYSIS STRATEGY
to modeling this subsystem. This first phase of a system design deals with
This approach of breaking a larger system many of the decisions that need to be made when
down into manageable subsystem (or smaller) starting development of a new system. Attention
blocks is often helpful during the early phases of a is also given to defining mathematical
design. Once individual subsystems are working descriptions for the various analog components in
properly, they can then be integrated into the full the Servo subsystem, and how to systematically
design. approach the modeling process in general.
The Position Controller will be developed in
four phases as follows: Servo Subsystem
• Develop System Modeling Analysis Since the majority of the modeling tasks exist in
Strategy the Servo subsystem, the first three phases of the
• Develop Conceptual Servo Design design process will focus on this subsystem. The
• Develop Detailed Servo Design Digital Command subsystem will be developed in
• Integrate Digital Command and Servo the fourth phase of the process.
Subsystems The purpose of the Servo subsystem is to
precisely control the position of a motor-driven
The focus of the Develop System Modeling load in response to an analog command. Since the
Analysis Strategy phase will be to mathematically motor/load must be precisely controlled, it
describe the various analog components in the suggests that a feedback control loop will need to
Servo subsystem, and to consider the modeling be employed.
process in general. Since it is ultimately the position of the load
In the Develop Conceptual Servo Design that needs to be controlled, a position feedback
phase the analog Servo subsystem components are loop will be used (which means that the load
implemented using the analog behavioral position must somehow be measured, and fed
modeling features of the VHDL-AMS language. back to close the control loop). Experience with
The Develop Detailed Servo Design phase such systems has shown that both the response
deals with system implementation issues, which and the stability of position control loops can be

System Modeling: An Introduction -3-


enhanced by including some velocity feedback in corresponding “component model” (although it is
the loop in addition to position feedback. An often possible to combine the function of multiple
initial design of the Servo subsystem is shown in components into a single component model).
Figure 2. These component models are then connected
together (as would be their physical counterparts),
to create the overall system model.
What lies at the heart of any computer
simulation, therefore, are the component models.
The “art” of creating the models themselves, and
sometimes more importantly, of knowing exactly
what to model and why, are the primary keys to
successful simulation.
Figure 2 - Servo Subsystem
Modeling Decisions
The Servo subsystem consists of a low-pass When setting out to obtain the models necessary
filter (to filter out quantization noise from the D/A for a system design, the following questions
converter), followed by a position control loop should be considered:
with velocity feedback. Position feedback is 1. Which characteristics need to be modeled,
provided by a potentiometer attached to the motor and which can be ignored without
shaft, and velocity feedback is provided by a affecting the results?
tachometer attached to the shaft as well. The 2. Does a model already exist?
motor itself is driven by a power amplifier. 3. Can an existing model be modified to
The following aspects of the Servo subsystem work in this application?
are of interest from a system design standpoint: 4. What are the options for creating a new
1. Load positioning speed model?
2. Load position accuracy 5. What component data is available?
3. Stability margins
4. Noise rejection These questions will be discussed in turn.
5. Robustness to parameter variations
Which characteristics need to be modeled, and
It is important to consider what specific which can be ignored without affecting the
information is desired from a simulation, as it results?
helps to focus the modeling efforts. For this paper, While it is important to identify component
speed and accuracy are of main concern. The characteristics that should be modeled, it is
primary components that may affect the speed and equally important to determine what
accuracy of the Servo subsystem are the low-pass characteristics do not need to be modeled. By
filter, the motor, and the load (power simplifying the model requirements, the task of
considerations will be deferred until the “Develop modeling will be simplified as well.
Detailed Servo Subsystem” phase of the process). The designer’s first inclination is typically to
By focusing on these critical components, the wish for a model that includes every possible
fidelity requirements on other component models component characteristic. However, most
can be relaxed. situations require only a certain subset of
component characteristics. Beyond this subset, the
Component Models inclusion of additional characteristics is not only
In order to create a system model, each unnecessary, but may increase model
component in the real system will need to have a

System Modeling: An Introduction -4-


development time as well as the time required to number of them very well may be. Whenever
run a given simulation session. possible, designers should make the most from
For example, suppose a design uses a 10kΩ model re-use.
resistor. To simulate this design, a resistor model In order to determine the availability of
is needed. But from the perspective of the design existing models, designers must understand what
in question, what exactly is a resistor? Is a resistor modeling formats are supported by their
a device that simply obeys Ohms law, and nothing simulation tools. One such format, the VHDL-
more? Or does its resistance value vary as a AMS hardware description language, is used in
function of temperature? If so, will this depth in subsequent phases of this design.
temperature dependence be static for a given
simulation run, or should it change dynamically as Can an existing model be modified?
the simulation progresses? If an exact model is not already available, it is
What about resistor tolerance? Is it acceptable also possible that a similar model can be found,
to assume that the resistor is exactly 10 kΩ? What and re-parameterized or functionally modified in
if the actual resistor component supplied by the order to serve the design. Before proceeding
manufacturer turns out to be closer to 9.9 kΩ, or further, however, a distinction should be made
10.1 kΩ (for a +/- 1% resistor)? If the tolerance is between re-parameterizing a model, and changing
important, does the model itself need to account the model functionality.
for this tolerance, or is this accounted for by the Re-parameterizing a model simply means
simulator? passing in new values, or parameters, which are
Take an op amp as another example. used by the model equations. The model
Depending on the application, op amp equations themselves don’t change, just the data
characteristics such as input current, input offset passed into them. For example, a resistor model
voltage and output resistance may prove entirely may be passed in the value of 10 kΩ or 20 kΩ.
negligible. So is it always necessary to use an op The underlying model doesn’t change, just the
amp model that includes these characteristics? value of the resistance.
Maybe all that is needed is a high gain block that In many cases, by contrast, it is necessary to
can be used in a negative feedback configuration. change the underlying model description itself.
In this case, is it even necessary to include power Although not as easy as re-parameterizing an
supply effects in the model? existing model, this approach is often faster than
By answering these types of questions, the creating a new model.
level of complexity required for any component
model can be determined, as well as the What are the options for creating a new model?
corresponding development time that will be So how does one actually go about the process of
needed to create and test it. (Of course, if the goal creating simulation models? There are two
is to create a re-usable library of component general “styles” that dominate the modeling
models, then more device characteristics would landscape today – each with its strengths and
typically be included in order to make the models weaknesses.
as useful as possible to a wide audience of users). The first modeling style uses hardware
description languages (HDLs) that have been
Does a model already exist? specifically developed for the purpose of creating
In a perfect world, all component vendors would models. Creating models with HDLs is often
produce models of any components they referred to as “behavioral modeling”, but this is a
manufacture, in all modeling formats. This is not bit misleading as models can be developed in this
the case in the real world. But even though all of manner to any desired degree of fidelity.
the required models may not be available, a good

System Modeling: An Introduction -5-


Behavioral modeling is discussed extensively in amplifier is not a critical component with respect
this paper. to Servo subsystem speed and accuracy.
The second modeling style is one in which a Therefore, the power amplifier can be initially
“building block” approach is used to create new modeled as a simple gain block with unlimited
models by connecting existing models together in voltage and current drive capacity.
new configurations. This approach is often In reality, this system will likely employ a
referred to as “macro-modeling” or “block- switching amplifier topology to drive the motor.
diagram modeling” and is popular with both Why then start off with such a simplified model of
SPICE-type and control systems simulators. the power amplifier? Aside from the obvious
Since one of the purposes of this paper is to answer that the time required to develop simple
instruct the reader in model development, the models is less than the time required to develop
assumption will be made that all models required complicated models, there are two primary
for the first phases of the design will need to be reasons why this approach should be considered.
created (although the opposite is actually true – First, a switching power amplifier model will
all of the models that comprise the Position typically be driven by a pulse-width modulator
Controller system were actually available in a (PWM). This device is inherently mixed-signal
library supplied with SystemVision, and would (i.e. it consists of both analog and digital
possibly be available from other VHDL-AMS behaviors). As a result, it will be difficult to
simulator vendors as well). perform frequency-domain analysis on a system
using such a component. However, frequency
What component data is available? domain analysis will prove useful as the control
Consideration must also be given to what loop is stabilized and the system bandwidth is
component data is available in the first place. The determined.
capabilities of a model may need to be restricted Second, think about the analog simulation
based on the amount (and quality) of data the process: a simulator “constructs” the time-domain
component’s manufacturer provides. response for a system model from a collection of
system solution points. Each of these solution
Servo Subsystem points represents a corresponding point in time.
Component Model Development The time between each of these solutions is called
The behavior for each of the analog components a “time step.”
required by the Servo subsystem shown in Figure For each one of these time steps, the simulator
2 will be considered next. The D/A converter must solve the entire system model. Further, the
consists of mixed analog/digital functionality, and solving of each time step is in itself an iterative
will be discussed in the Integrate Digital process, often requiring several passes to get a
Command and Servo Subsystems phase of the single time step solution.
design process. Whenever waveforms change as the system
Very simple models will be developed first, model is simulated, time steps are generated. The
followed by models of moderate sophistication. more the waveforms change, the greater the
These behavioral descriptions are actually number of time steps required to account for the
implemented as component models in the next changes. Systems that include switching
phase of the design process. electronics have rapidly-changing waveforms by
design. As a result, these types of systems can
Power Amplifier require large amounts of simulation time.
The “big picture” functionality of the system is of
A portion of such a waveform is given in
primary interest in the initial phase of the design.
Figure 3. For this waveform, each super-imposed
It has also already been determined that the power
“X” represents an actual simulation time step.

System Modeling: An Introduction -6-


defines the behavior to be implemented. The
functionality of each component of the Position
Controller system is described in numerous text
books, technical papers, and data sheets.
In the case of simple models such as a gain
block, the mathematical description is fairly
intuitive, as shown in Equation (1).
vout = K * vin (1)
At a high, abstract level, a power amplifier just
amplifies an input signal and presents it at the
output. Parameter K represents the gain factor.

Summing Junction
A mathematical description of an ideal summing
Figure 3 - Example switching waveform junction is also fairly intuitive. This behavior can
As shown in the figure, it takes quite a few be described as shown in Equation (2).
time steps to construct a single pulse in such a vout = K 1 * vin1 + K 2 * vin 2 (2)
system. A 20 KHz switching amplifier could
easily require more than 1,000,000 time steps for Note that optional gain factors (K1 and K2) have
a 1 second simulation! been included in the model equation. This allows
This is one of the reasons that a simplified either input to be optionally scaled, and also
model is desired. The important question is: “Can allows the model to be changed from a summing
reasonable simulation results be achieved with a junction (e.g. +K1 and +K2), to a differencing
simple gain block approach?” The short answer is junction (e.g. +K1 and –K2).
yes. Even if the actual power amplifier in the The addition of optional gain coefficients is a
system is going to be implemented as a switching recurring theme in many of the models presented
amplifier, the gain block representation is in this paper. This is not by accident. Generally
acceptable given the following two assumptions: speaking, models should be developed so that
they are re-usable. By simply adding user-
• The frequency of the switching amplifier is
adjustable gain coefficients at strategic locations
much greater than the bandwidth of the
control loop (true in the vast majority of in a model, the model becomes useful to a wider
designs) audience at negligible cost in terms of model
development time.
• Power consumption is not of great
concern in this phase of the design process Potentiometer
A potentiometer is a device that generates a
For the purposes of this paper, these are perfectly voltage level in proportion to a rotational angle.
reasonable assumptions in the early phases of the (For greater precision, optical encoders are often
overall design. Ultimately, the actual behavior of employed for this purpose). The behavior of a
the switching amplifier will be accounted for, at potentiometer can be expressed as shown in
which time the simple gain block model will be Equation (3).
replaced by a switching amplifier model.
Now that the scope of the initial power vout = K * anglein (3)
amplifier model has been determined, the next The potentiometer behavior is very similar to that
step is to identify a mathematical description that of the amplifier behavior shown in Equation (1).

System Modeling: An Introduction -7-


The only difference is that the potentiometer input filter behavior using a Laplace transfer function is
is an angle, rather than a voltage. given in Equation (5).
A potentiometer gain block is also included in ωp
Figure 2 in order to reinforce the notion that the vout = vin * (5)
potentiometer feedback level is adjustable. This s +ωp
gain block is also used to ensure proper feedback Where ωp is the cutoff frequency in radians
polarity relative to the other input of the summing per second (rad/s).
junction. The tachometer feedback path includes a Equation (5) represents a low-pass filter as a
gain block for the same reasons. Laplace transfer function with the DC gain
normalized to 1. Laplace transfer function
Tachometer
descriptions are extremely useful for device
A tachometer is a component that generates a
behaviors that are described by 2nd or higher-order
voltage level that represents a rotational velocity.
differential equations. A single pole low-pass
Physical tachometers are basically smaller motors
filter is a marginal case that is as easily expressed
whose shafts are directly coupled onto the main
as a differential equation as it is expressed as a
drive motor’s shaft. As the main motor spins, the
Laplace transfer function. This is illustrated next.
smaller motor generates a back-EMF voltage that
is proportional to the shaft speed. Low-pass filter as differential equation
Since the tachometer is not a “critical” By re-arranging Equation (5) and replacing the
component in this phase of the design, only the Laplace operator s with the differential operator
behavior of the tachometer needs to be accounted d/dt, the low-pass filter action can also be realized
for, not its physical implementation. The in terms of a differential equation1, as shown in
tachometer therefore does not need to actually be Equation (6).
modeled as a motor at this time.
dv out
Tachometer behavior can be approximated by vin = vout + τ p * (6)
differentiating the motor shaft position. This will dt
generate the shaft velocity. The equation To implement a model in this manner, the
describing this behavior is given in Equation (4). frequency must be converted into a time constant.
d (anglein ) This conversion is shown in Equation (7).
vout = K * (4) 1
dt τp = (7)
ωp
Low-Pass Filter Where τp is the time constant in seconds.
As with the other components of this design, the
physical implementation of the low-pass filter is Low-pass filter as RC components
not important at this time, but its behavior is. This Both the differential equation and Laplace transfer
behavior can be realized in several ways. To function approaches for describing the low-pass
illustrate this point, the low-pass filter will be filter behavior are relatively straightforward and
described using three techniques: Laplace transfer commonly used in practice. The filter behavior
function, differential equation, and discrete RC can also be described using discrete RC
(resistor/capacitor) components. (resistor/capacitor) components. The relationship
between the time constant and RC component
Low-pass filter as transfer function values is shown in Equation (8).
Filter behavior is often described using Laplace
transfer functions. The description of the low-pass 1
For additional methods to implement the low-pass filter, as
well as expanded coverage on the derivations shown here,
please refer to Chapter 13 of [1].

System Modeling: An Introduction -8-


τ p = RC Actuator (Motor)
(8)
The motor representation must be carefully
The RC implementation of the low-pass filter is considered. As a primary focus of the design, the
illustrated in Figure 4. In this configuration, the motor in large part determines the overall value of
low-pass filter is realized by a frequency- the system model developed in the early design
dependent voltage divider due to changing phases. The system model is valuable only to the
capacitor impedance. As frequency goes up, extent that it can produce useful information that
capacitor impedance goes down, and the output can further guide the system design process.
voltage amplitude drops. Useful information can only be produced if the
motor model is reasonably accurate.

Motor as resistive load


So how might the motor be represented? One
approach would be to model it as a pure resistive
load, as shown in Figure 5. If the resistance value
Figure 4 - RC Low-pass Filter is chosen to match the winding losses in the
motor, then some static or steady-state analyses
The filter can be modeled using any of these may be performed. This type of motor model may
approaches, all of which can be simulated in prove useful for sizing the power amplifier.
either the time or frequency domains.

Load (Inertia)
The load is a fairly critical system component
since it will likely represent one of the largest
time constants in the entire system. This will
directly influence the speed of the system. For this
design, the load will be represented as an inertia, Figure 5 - Motor as resistive load
the behavior of which is described in Equation
(9). The drawback to this model, of course, is that
it doesn’t take any motor dynamics into account.
dω In addition, this simplistic approach doesn’t even
torq = j * (9)
dt completely model the electrical portion of the
In essence, this equation defines how much torque motor, which includes winding inductance as well
will be required as the load is accelerated as winding resistance.
(acceleration is calculated as the derivative of the
Motor as resistive/inductive load
load angular velocity). Equation (9) depicts load
The resistive load motor model can be improved
torque as a function of (shaft) velocity (ω). The by representing it as a resistor in series with an
load torque can also be calculated as a function of inductor. This includes the electrical dynamics of
(shaft) position (θ). This formulation is given in the winding – i.e. the winding resistance and
Equation (10). inductance, as shown in Figure 6.
d 2θ
torq = j * 2 (10)
dt
This second formulation is used in the Servo
subsystem illustrated in Figure 2.

System Modeling: An Introduction -9-


The dynamic behavior on the mechanical side
of a DC motor can be described with Equation
(12).

torq = − K T * i + d * ω + j * (12)
dt
Equation (12) accounts for motor shaft inertia
(j*dω/dt), viscous damping losses (d*ω), as well as
the generated torque (KT*i). Together, Equations
(11) and (12) provide a reasonable accounting for
Figure 6 - Motor as resistive/inductive load the dynamic behavior of the motor.
A common “control block” model that
Although this is an improvement on the includes this behavior is given in Figure 7. This
previous motor model, the dynamics of the motor model includes all of the basic behaviors of the
are still not represented. For example, there is no motor described in Equations (11) and (12), in a
accounting for back-EMF, so it will appear that fairly intuitive graphical illustration.
there is more voltage available to drive the motor
than there will be in the actual system (since
back-EMF will be subtracted from the drive
voltage in a real system). A real motor will
initially draw a good deal of current from the
power amplifier as it tries to overcome the motor
shaft inertia, but will then draw less current as the
shaft picks up speed. The resistor/inductor model
Figure 7 - Block diagram of DC motor
cannot account for this effect because the
mechanical inertia of the motor and load are not As shown in the figure, the terms in the motor
represented. This model would not provide any descriptions given in Equations (11) and (12) are
real dynamic information – and it is exactly this modeled as functional blocks. Note that the
dynamic information that is needed to verify the resistance and inductance winding losses are
overall system topology. represented by a single Laplace transfer function
block (1/(Ls+r)), as are the mechanical damping
Dynamic motor equations and inertia (1/(Js+d)).
A superior approach to modeling the motor is to The approach used in Figure 7 is often a
obtain the fundamental equations which govern convenient way to model mathematical equations.
motor behavior (widely available from numerous However, as equations grow more complex, or as
sources), and implement these equations in the the number of dependencies between equation
model. variables increases, this approach yields
Using this approach, the dynamic behavior on complicated and unintuitive representations.
the electrical side of a DC motor can be described For example, note that the load torque, TL, is
with Equation (11). fed back into a summing junction in order to be
di accounted for in the model. This is an example of
v = KT *ω + i * r + l * (11) a modeling approach in which energy
dt
conservation is not implicitly built into the
Equation (11) represents motor winding resistance models. For such “non-conserved” models,
losses (i*r), inductance losses (l*di/dt), as well as loading effects must literally be fed back in this
induced back-EMF voltage (KT*ω). manner. This is a common situation that can be

System Modeling: An Introduction - 10 -


avoided by using a conserved-energy modeling motor loading effects needed to be explicitly
approach, which will be considered in the modeled with feedback loops and summing
Develop Conceptual Servo Design development junctions. VHDL-AMS supports this non-
phase. conserved, control block modeling style, as well
Generally speaking, the more complicated the as a conserved-energy modeling style. Before
model description, the better the fit to a conserved engaging in model development, the style or
energy hardware description language such as combination of styles to use for the component
VHDL-AMS. As shown shortly, all of the motor models should be chosen.
effects given in Equations (11) and (12) can be Since the Position Controller is fairly simple,
quickly and easily described in a VHDL-AMS either modeling style could be effectively used for
model. this system. However, as it will be easier to
graduate to more complex models with a
Develop System Model Analysis Strategy conserved-energy style, conserved-energy
Summary component models will be developed.
All of the Servo subsystem components have now
been functionally described. These descriptions Power Amplifier
are based on common mathematical formulas, and As discussed in the Develop System Modeling
will serve as the foundation for creating the actual Analysis Strategy phase, the power amplifier that
component models for the subsystem. drives the motor can be thought of as a simple
This concludes the Develop System Modeling gain block with unlimited voltage and current
Analysis Strategy phase of the Position Controller drive capacity. The functional equation describing
system design. the gain block is given in Equation (13). The
model descriptions developed in the previous
DEVELOP CONCEPTUAL SERVO DESIGN phase will be repeated in this phase for
In this phase of the design each of the analog convenience.
component models required by the Servo
vout = K * vin (13)
subsystem will be developed. This system will be
developed with the SystemVision System This functionality can be easily and directly
Modeling Solution by Mentor Graphics described in the VHDL-AMS modeling language.
Corporation. This simulation environment allows Since this component constitutes a first look at
both VHDL-AMS and SPICE models to be freely VHDL-AMS component modeling, the modeling
mixed throughout the design. How to approach steps for the gain block will be described in great
the modeling tasks is discussed next. detail, and several language concepts will be
In this conceptual phase of building a useful, considered. Subsequent model discussions will be
yet high-level system model, all of the component less rigorous.
models are fairly simple to develop in VHDL-
AMS. Consideration of how the actual VHDL-AMS Models
components will be implemented in the physical VHDL-AMS models consist of an entity and at
system will be given in the detailed design phase. least one architecture. The entity defines the
At that time, it will prove useful to use pre- model’s interaction with other models, via ports
existing, freely-available SPICE models in (pins), and also allows external parameters to be
addition to VHDL-AMS models. passed into the model. The name of the entity is
An additional decision needs to be made as typically the name of the model itself.
well. A “control block” model representation of The behavior of the model is defined within an
the motor was previously illustrated. This was architecture. This is where the actual functionality
referred to as a “non-conserved” model, since of the model is described. A single model may

System Modeling: An Introduction - 11 -


only have one entity, but may contain multiple The port names for this model will be called
architectures. The power amplifier will be input and output. Any non-VHDL-AMS keywords
developed by first describing its entity, and then may be chosen as port names.
its architecture. Since the decision was made to develop the
component models using the “conserved-energy”
Entity modeling style, the input and output ports are
The entity will serve as the interface between this declared as type terminal. In VHDL-AMS, ports
model and other models. The general structure of of type terminal obey energy conservation laws,
an entity for the gain model is as follows: and have both effort (across) and flow (through)
aspects associated with them. It is these two
entity gain is aspects that allow terminals to obey energy
generic (
-- generic (parameter) declarations
conservation laws. This declaration is shown as
); follows:
port (
-- port (pin) declarations entity gain is
); generic (
end entity gain; -- generic (parameter) declarations
);
The model entity always begins with the port (
terminal input : electrical;
keyword entity, and ends with keyword end, terminal output : electrical
optionally followed by keyword entity and the );
entity name. VHDL-AMS keywords are denoted end entity gain;
in this paper by the bold style2.
The entity name gain was chosen because this A terminal is declared to be of a specific
model scales the input voltage by a gain factor, “type.” In VHDL-AMS, the type of a terminal is
and presents the result at the output. Since the referred to as its nature. The nature of a terminal
entity name is also the model name, the entity defines which energy domain is associated with it.
name should accurately describe what the model By specifying the word electrical as part of the
is, or what it does, so its function can be easily terminal declarations, both terminals for this
distinguished by the model user. model are declared to be of the electrical energy
Entities typically contain both a generic domain, which has voltage (across) and current
section (for parameter passing), and a port (through) aspects.
section. These are not always required, as One of the reasons for choosing terminals for
parameters are optional, and a system model (the the ports in the component models is that it allows
highest level model of the design) may not have other “like natured” models to be directly
any ports. The majority of models, however, will substituted in their place. For example, an ideal
contain both sections. gain block could be replaced by an op amp
Comments are included in a model by pre- implementation and the ports will correctly match
pending the comment with “--“. The contents of the connecting components.
both the generic and port sections in the previous As will be shown shortly, there are other
entity listing are comments, and will not be predefined terminal natures besides electrical,
executed as model statements. such as mechanical, fluidic, thermal, and several
others.
Note that the gain model is defined with only
one input and one output port. This is possible
2
See Section 1.5 of [1] for a complete list of VHDL-AMS because there is a predefined “zero reference
keywords.

System Modeling: An Introduction - 12 -


port” called electrical_ref, which can be used in a model is instantiated. Models are not required to
model to indicate that the port values are have default values for generics.
referenced with respect to zero. If the reference
port needs to be something other than zero, or if a Architecture
differential input is required, then a second input Model functionality is implemented in the
port would be added in the entity declaration. An architecture section of a VHDL-AMS model. The
example of how this might appear in the model basic structure of an architecture definition for the
would be: gain model is shown below:

port ( architecture ideal of gain is


terminal in_p, in_m : electrical; -- -- declarations
inputs begin
terminal output : electrical -- output -- simultaneous statements
); end architecture ideal ;

Note how “like-natured” ports are optionally The first line of this model architecture
declared on the same line. If this component was declares an architecture called “ideal.” This
modeled with a non-conserved modeling style, the architecture is declared for the entity called
ports would be declared as port quantities, rather “gain”.
than terminals. In that case, the ports would not As with entities, the model developer also
have across and through aspects. selects the names for architectures. For this
Ports can also be of type signal. These non- model, “ideal” was chosen as the architecture
conserved ports are used for digital connections. name since this is an idealized, high-level
Signal ports will be discussed in the Integrate implementation. “Behavioral” or “simple” could
Digital Command and Servo Subsystems phase of just as well have been chosen to denote this level
the design. of implementation.
Now that the model’s ports are defined, the The actual model equations(s) appear between
model must declare any parameters that will be the begin and end keywords, which indicate the
passed in externally. For the gain model, there is area where simultaneous equations and concurrent
only the gain parameter, K (referred to as a statements are located in the model (concurrent
generic in VHDL-AMS). This generic is statements will be discussed in the Integrate
accounted for as follows: Digital Command and Servo Subsystems phase).
The basic equation for the gain component given
entity gain is in Equation (13) can be implemented as follows:
generic (
K : real := 1.0 -- Model gain architecture ideal of gain is
); -- declarations
port ( begin
terminal input : electrical; vout == K * vin;
terminal output : electrical end architecture ideal ;
);
end entity gain;
In VHDL-AMS, the “==” sign indicates that
this equation is continuously evaluated during
Generic K is declared as type real, so it can be
simulation, and equality is maintained between
assigned any real number. In this case, it is given
the expressions on either side of the “==” sign at
a default value that will be used by the model if
all times.
the user does not specify a gain value when the
The next step is to declare all undeclared
objects used in the functional equation. In this

System Modeling: An Introduction - 13 -


case vin and vout need to be declared (K was port names in_p and in_m), then the branch
declared in the entity). Declarations for vin and quantity declaration would appear as follows:
vout are shown below:
quantity vin across in_p to in_m;
architecture ideal of gain is
quantity vin across input to electrical_ref; The single input port approach was chosen for
quantity vout across iout through the gain model. Should this input present a
output to electrical_ref;
begin
representative load (i.e. draw current from
vout == K * vin; whatever is driving it)? Since this is the
end architecture ideal ; conceptual phase of the system model
development, it makes sense to have the model act
Since the electrical terminals of this model as an ideal load (i.e. no current will be drawn
have both voltage (across) and current (through) from whatever is driving it).
aspects associated with them, these terminals This goal is achieved on the input port of the
cannot be directly used to realize the model model by simply omitting any reference to the
equation. Instead, individual objects are declared input current in the model description. In other
for each terminal aspect, and these objects are words, no branch quantity is declared for this
then used to realize the model equation. current. By not declaring a quantity for it, the
In VHDL-AMS, analog-valued objects used to input current is zero by default.
model conserved energy systems are called What about the output port? The gain
branch quantities. Branch quantities are used component was earlier described as an idealized
extensively in the component models that component that can supply unlimited output
comprise the Position Controller system model. voltage and current. These are the primary
Vin and vout are declared as branch quantities. qualities of the component model that make it
Branch quantities are so-named because they are “ideal.”
declared between two terminals. Branch quantities The model’s output port needs to supply any
for the gain model are illustrated in Figure 8. voltage and current required by whatever load is
connected to it. To achieve this capability,
through quantity iout is declared along with
across quantity vout. The simulator will thus
solve for whatever instantaneous value of iout that
is required to ensure vout is the correct value to
maintain equality for the expressions in the
Figure 8 - Branch quantities equation:
Branch quantity vin is declared as the voltage vout == K * vin;
across port input relative to ground
(electrical_ref). Electrical_ref can be thought of as Model Solvability
a reference terminal (like a ground pin). Branch When solving simultaneous equations, the general
quantity vout is declared as the voltage across port rule is that there must be an equal number of
output relative to electrical_ref. unknowns and equations. Computer-based
As discussed earlier, the gain model could simulation tools typically use Nodal-like analysis
have been declared with two ports, in which case to solve systems of equations. This basically
using electrical_ref within the model would be means that the computer “picks” the across
unnecessary. If this were the case (assuming input branch quantities at the various nodes in a system

System Modeling: An Introduction - 14 -


model, and solves for the corresponding through library IEEE;
branch quantities. use IEEE.electrical_systems.all;
The simulator solves systems of equations by
applying energy conservation laws to through These statements allow the model to use all items
branch quantities. For electrical systems, this in the electrical_systems package of the IEEE
means that Kirchoff’s Current Law (KCL) is library. This package also includes declarations
enforced at each system node. For mechanical for charge, resistance, capacitance, inductance,
systems, Newton’s laws are enforced. flux, and several other useful types.
A VHDL-AMS model with conservation- The complete VHDL-AMS gain model is
based ports must therefore be constructed such given below:
that a through branch quantity is declared for each
library IEEE;
model equation – even if the through quantity use IEEE.electrical_systems.all;
itself is not used in the equation! In the case of the
gain model, quantity iout is needed to satisfy this entity gain is
requirement. generic (
K : real := 1.0 ); -- Model gain
Libraries and Packages port (
terminal input : electrical;
Models often require access to data types and terminal output : electrical );
operations not defined in the model itself. VHDL- end entity gain;
AMS supports the concept of packages to
facilitate this requirement. A package is a architecture ideal of gain is
mechanism by which related declarations can be quantity vin across input to electrical_ref;
assembled together, in order to be re-used by quantity vout across iout through
output to electrical_ref;
multiple models.
begin
The IEEE has published standards for several vout == K * vin;
packages. Such standards have been defined for end architecture ideal ;
various energy domain packages, including
electrical_systems, mechanical_systems, and This gain model is also used for the Ktach and
fluidic_systems, among others. It is within these Kpot blocks shown in Figure 2.
packages that the across and through aspects for
each energy domain are declared. For example, Summing Junction
the electrical_systems package declares voltage The summing junction functional description is
and current types. This is shown in the code given in Equation (14).
fragment listed below: vout = K 1 * vin1 + K 2 * vin 2 (14)
nature ELECTRICAL is A complete summing junction model, summer, is
VOLTAGE across shown below:
CURRENT through
ELECTRICAL_REF reference; library IEEE;
use IEEE.electrical_systems.all;
Packages are typically organized into
libraries. For example, all of the IEEE energy entity summer is
generic (
domain packages are included in the IEEE library. K1 : real := 1.0; -- Input1 gain
In the case of the gain model, the K2 : real := 1.0 ); -- Input2 gain
electrical_systems package is used. This is port (
specified in the model as follows: terminal in1, in2 : electrical;
terminal output : electrical );

System Modeling: An Introduction - 15 -


end entity summer; The potentiometer model contains a non-
electrical input port. Just as mixed-analog/digital
architecture ideal of summer is
quantity vin1 across in1 to electrical_ref;
models are referred to as “mixed-signal” models,
quantity vin2 across in2 to electrical_ref; models such as the potentiometer are referred to
quantity vout across iout through variously as mixed-technology, multi-technology,
output to electrical_ref; multi-domain, and multi-physics models.
begin The potentiometer model represents the first
vout == K1 * vin1 + K2 * vin2;
end architecture ideal ;
departure from an all-electrical model
encountered thus far in the design. The model’s
The summer’s entity passes two generics, K1 input port is still declared as a terminal. The
and K2, into the architecture. The default terminal is declared with a rotational nature,
configuration for this model is to have no gain on which has rotational angle (across) and torque
either input (i.e. gain = 1). (through) aspects associated with it. This means
The Summer’s architecture appears quite that mechanical energy conservation laws will
similar to that used for the gain model. In this apply to this port. Note that the mechanical
case, there are now two input ports, and a separate branch quantity is internally referenced to
branch quantity is declared for each, vin1 and rotational_ref (as opposed to electrical_ref).
vin2. In order to access standard mechanical data
types, the IEEE.mechanical_systems package is
Potentiometer included in the model.
The potentiometer behavior can be expressed as
shown in Equation (15). Tachometer
The tachometer functionality is expressed as
vout = K * anglein (15) shown in Equation (16).
d (anglein )
The complete potentiometer model is shown vout = K * (16)
below: dt
The tachometer model is listed below:
library IEEE;
use IEEE.mechanical_systems.all; library IEEE;
use IEEE.electrical_systems.all; use IEEE.mechanical_systems.all;
use IEEE.electrical_systems.all;
entity potentiometer is
generic ( entity tachometer is
k : real := 1.0); -- optional gain generic (
port ( k : real := 1.0); -- optional gain
terminal input : rotational; -- input terminal port (
terminal output : electrical); -- output terminal terminal input : rotational; -- input terminal
end entity potentiometer ; terminal output : electrical); -- output terminal
end entity tachometer ;
architecture ideal of potentiometer is
quantity ang_in across input to rotational_ref; architecture ideal of tachometer is
quantity v_out across i_out through quantity ang_in across input to rotational_ref;
output to electrical_ref; quantity v_out across out_i through
begin output to electrical_ref;
v_out == k*ang_in; begin
end architecture ideal; v_out == K * ang_in'dot;
end architecture ideal;

System Modeling: An Introduction - 16 -


The VHDL-AMS modeling language provides vout == K * vin'ltf(num, den);
a mechanism for getting information about items end architecture ideal ;
in a model. Several predefined attributes are
available for this purpose3. This low-pass filter implementation uses the
In the tachometer model, the predefined ‘ltf (Laplace transfer function) attribute to
attribute ‘dot is used to return the derivative of implement the transfer function in terms of num
quantity ang_in. Thus v_out will continuously (numerator) and den (denominator) expressions.
evaluate to the derivative of ang_in (times K). These expressions must be constants of type
Other popular predefined analog attributes real_vector. The real vectors are specified in
include ‘integ (integration), ‘delayed (delay), and ascending powers of s, where each term is
‘ltf (Laplace transfer function). The ‘ltf attribute separated by a comma. Since num and den must
will be used in the low-pass filter model discussed be of type real_vector, these vectors must contain
next. more than one element. However, numerator num
only contains a single element, so a second
Low-Pass Filter element, 0.0, is added to satisfy the multiple
As discussed previously, directly implementing a element restriction4.
Laplace transfer function for the low-pass filter is The low-pass filter term from Equation (17) is
quite convenient. This description is given in declared as constant wp, in radians. Since the user
Equation (17). specifies a cutoff frequency in Hertz (Fp), a
ωp conversion from Hertz to radians is performed,
vout = vin * (17) the results of which is assigned to wp. Constant
s +ωp math_2_pi is used for this conversion. It is
This low-pass filter description may be defined along with many other math constants in
implemented directly using VHDL-AMS. The the IEEE.math_real package, which must be
complete VHDL-AMS model for the low-pass included in the model description in order for
filter is listed below: items within it to be accessed by the model.
The ‘ltf attribute is a very powerful and
library IEEE; convenient tool for describing Laplace transfer
use IEEE.electrical_systems.all; functions. It is particularly useful for describing
use IEEE.math_real.all; higher-order systems, which can be difficult to
express using time-based equations.
entity LowPass is
generic ( The ports of the low-pass filter model are
Fp : real := 1.0e6; -- Pole frequency [Hz] declared as electrical terminals. This allows any
K : real := 1.0); -- Filter gain of the filter implementations given in Equations
port (terminal input : electrical; (5), (6), or Figure 4 to be directly substituted for
terminal output : electrical); each other in the system model.
end entity LowPass;

architecture ideal of LowPass is Load


quantity vin across input to electrical_ref; It is ultimately the system load that needs to be
quantity vout across iout through positioned (via the motor shaft). As far as the
output to electrical_ref; system is concerned, this load acts as extra inertia
constant wp : real := math_2_pi*Fp; to the motor, and can be expressed as shown in
constant num : real_vector := (wp, 0.0);
constant den : real_vector := (wp, 1.0); Equation (18).
begin

3 4
See Section 22.1 of [1] for a complete list of predefined Constant wp can also be assigned to a single element in a
attributes. real_vector using the following syntax: (0=>wp).

System Modeling: An Introduction - 17 -


languages. All of these motor effects (and more)
d 2 (anglein )
torque = J * (18) can be quickly and easily described in a model,
dt 2 using the governing equations themselves. The
This behavior can be implemented as a VHDL-AMS version of the DC motor model is
VHDL-AMS model as shown below: listed below.

library IEEE; library IEEE;


use IEEE.mechanical_systems.all; use IEEE.mechanical_systems.all;
use IEEE.electrical_systems.all;
entity inertia_r is
generic (j: moment_inertia); -- Kg*meter**2 entity DCMotor_r is
port (terminal rot1 : rotational); generic (
end entity inertia_r; r_wind : resistance; -- Winding resistance
kt : real; -- Torque Constant
architecture ideal of inertia_r is l: inductance; -- Winding inductance
quantity theta across torq through rot1 d: real; -- Damping coefficient
to rotational_ref; j: moment_inertia); -- MOI
begin port (terminal p1, p2 : electrical;
torq == j * theta'dot'dot; terminal shaft_rot : rotational);
end architecture ideal; end entity DCMotor_r;

architecture basic of DCMotor_r is


The inertial load model contains only a single
quantity v across i through p1 to p2;
mechanical port. Since rotational angle (rather quantity theta across torq through shaft_rot
than rotational velocity) was chosen as the across to rotational_ref;
quantity for this port, the actual model equation is quantity w : real;
formulated in terms of port angle, theta. Theta is begin
w == theta'dot;
differentiated twice before being multiplied by the
torq == -1.0*kt*i + d*w + j*w'dot;
moment of inertia, J, to produce torque. Note that v == kt*w + i*r_wind + l*i'dot;
multiple ‘dot attributes can be applied in end architecture basic;
succession for this purpose.
The motor model is easily implemented by
Motor extending the concepts discussed throughout this
In the Develop System Modeling Analysis paper. Of special note is the actual
Strategy phase two equations which govern DC implementation of the motor’s equations: Since
motor behavior were introduced: the overall design is a position controller (as
di opposed to a velocity controller), the model’s
v = KT *ω + i * r + l * (19) mechanical port is declared in terms of motor
dt
shaft angle (theta). However, it is also desirable to
dω describe the model equations in terms of velocity
torq = − K T * i + d * ω + j * (20) (w), rather than angle.
dt
This is accomplished by declaring an
Equations (19) and (20) provide a practical intermediate quantity, w. This is referred to as a
representation for the dynamic behavior of the free quantity, and it represents the shaft velocity.
motor. Free quantities are used when analog valued
Unlike the non-conserved “control block” objects are required that do not have branch
model implementation introduced in Figure 7, aspects associated with them. For model
Equations (19) and (20) can be directly solvability, each free quantity requires one
implemented in a VHDL-AMS model. This is one
of the strengths of hardware description

System Modeling: An Introduction - 18 -


simultaneous equation to be introduced into the overall bandwidth of about 46 Hz. The low-pass
model. filter (set at 50 Hz) dominates this response. The
Note that these simultaneous equations are bandwidth of the control loop itself is near 200
virtually identical to those given in (19) and (20). Hz.
This direct “mapping” between physical
component descriptions and model representation
is one of the great benefits of the HDL-based
modeling approach. The more direct the mapping,
the more intuitive the model.

Simulation and analysis


Every component in the Servo subsystem now has
a corresponding VHDL-AMS model. The next
step is to create the overall system model out of
the component models. This is typically
accomplished by creating a graphical symbol for
each component model, and then connecting the
ports of the symbols using a schematic capture
environment. The symbols map to an underlying Figure 9 - Closed-Loop Frequency Response
model, and the symbol pins correlate to model Additional frequency-domain analyses that
ports. This was the approach used to create the should be performed include:
Servo subsystem schematic illustrated in Figure 2. • Open-loop phase/gain margin
The next step is to parameterize the • Loop optimization
component models if necessary. The following • Filter settings/system bandwidth tradeoffs
parameter values are used for this design: low-
pass filter cutoff frequency = 50 Hz; power Time Domain Response
amplifier gain = 1000; potentiometer gain = 5; The closed-loop time domain response to a
tachometer gain = 0.01. The motor was specific positioning profile is given in Figure 10.
characterized to drive a 10e-6 Kg*m2 inertial Three waveforms are indicated: the input
load. position profile command, the output of the low-
With the system model complete, various pass filter, and the load position profile.
simulations can be performed to determine overall
system performance. Since the purpose of this
paper is to instruct in the development of a system
model, and not to debug and analyze a Position
Controller system, only a few analysis results are
given. To actually debug a real system, many
simulations would be performed throughout the
design process and beyond.

Frequency Domain Analysis Results


A closed-loop frequency domain analysis was
performed to determine the system bandwidth.
The result of this analysis is shown in Figure 9.
This waveform was measured at the position
Figure 10 - Closed-Loop Transient Response
feedback summing junction. It indicates an

System Modeling: An Introduction - 19 -


The waveforms indicate that the load does in
fact track the input command profile. How well
does it track? Now that a working system model
is available, several simulations can be performed,
and the results measured and analyzed. Gains can
be tweaked, and assumptions can be checked.
For example, it was mentioned earlier that
velocity (tachometer) feedback would help
stabilize the control loop, as well as enhance the
overall response. The system model can now be
used to determine how much tachometer feedback
is required to achieve acceptable performance.
Figure 11 shows load position waveforms as a
function of changing the tachometer component
Figure 12 - Motor overshoot versus tachometer gain
model gain values from 0.005 to 0.05 in steps of
0.005. The subsystem is driven by a voltage pulse This waveform illustrates that position
with a 1 ms rise-time. The amount of ringing overshoot can be virtually eliminated with a
decreases as tachometer gain is increased, as tachometer gain value of 0.009 or greater.
expected. (However, if the tachometer gain is increased too
much, the system response will start to slow
down). The initial value of 0.01 should be
sufficient for the tachometer gain.

Develop Conceptual Servo Design Summary


All of the Servo subsystem components that were
mathematically described in the Develop System
Modeling Analysis Strategy phase have now been
modeled in the VHDL-AMS modeling language.
The seamless mapping of abstract mathematical
descriptions to actual model implementations is
one of the benefits of VHDL-AMS.
This concludes the Develop Conceptual Servo
Design phase of the Position Controller design.

DEVELOP DETAILED SERVO DESIGN


Figure 11 - Motor output versus tachometer gain Thus far, a simulatable conceptual system model
These results can be quantified by performing has been developed and used to verify an
an overshoot measurement on them, and acceptable value for the tachometer feedback
displaying the overshoot values as a function of gain. A possible next step is to consider
tachometer gain values. These results are “upgrading” various component models to
illustrated in Figure 12. account for the eventual physical implementation
of the system.
What does this mean? Recall that the original
goal was to develop a “system model” of the
Position Controller. This system model was to be
used to provide information as to whether the

System Modeling: An Introduction - 20 -


design topology was sound (the example of the For the sake of brevity, only a few component
tachometer feedback gain was used to models for the Servo subsystem will be refined in
demonstrate the usefulness of the conceptual this paper. These are:
model). In the conceptual model the physical • Low-pass filter
implementation of the various components was • Summing Junction
not considered. • Power Amplifier
Now that simulation results have shown that
the topology is indeed sound, a choice needs to be Low-pass filter implementation
made: build the actual design, or increase the Op amps (operational amplifiers) are commonly
value of the system model even more to reduce used to implement analog functions. Both the
risks in the physical system later? Another option low-pass filter and summer functions will be
is to do both concurrently. implemented using op amps. Since there are no
Part of the “art” of designing a system is to be special restrictions on the Position Controller
able to make the transition from simulation model design in terms of high-bandwidth or low-noise,
to physical prototype at some reasonable point in generic op amps can be used for these
the design process. Some designers jump as implementations. LM307 op amps, which are
quickly as possible into “real hardware,” and may inexpensive, and intended for general purpose
even forego the use of simulation as a tool use, will be selected for this application.
altogether. Others tend put off building the The low-pass filter can be implemented with
physical system as long as possible and continue an op amp as shown in Figure 13. The RC values
refining the system model. Where should the line are calculated using the relationship described by
be drawn? It really depends on the amount of risk Equation (8).
that is acceptable for the specific design. For
example, invasive medical devices or space-
related systems cannot tolerate failure. For these
types of systems, highly-refined system models
are often used in conjunction with physical
prototypes to minimize risks.
On the other hand, non-critical systems do not
need to be so rigorously developed, but still
benefit from system models. Such models can
help minimize system performance degradation
due to part tolerances stemming from Figure 13 - Low-pass filter implementation
manufacturing variability. Part costs can be What op amp characteristics should (and
minimized as well. Additionally, having access to should not) be modeled? There are really no
a simulatable system model can help to improve special requirements for the op amp model, as it is
overall system robustness, and foster a better being used in a very general manner. However,
understanding the system in general. the model should take power supply levels into
In the case of the Servo subsystem, a fairly account as this can affect the system bandwidth
high-level subsystem model has been developed, (the ideal power amplifier allowed unlimited
which among other things, does not account for voltage and current).
the power delivery system. Such systems are often As discussed in the Develop System Modeling
the trickiest parts of a design, and should be fully Analysis Strategy phase of the design process, a
explored using simulation technology. check to see if a required model already exists
should be made. Although a VHDL-AMS model
can be developed for the LM307 op amp, it (along

System Modeling: An Introduction - 21 -


with hundreds of other op amp models) is already the MOSFET gates in the H-bridge. The PWM
available in SPICE format. Since the accepts analog inputs, and produces two digital
SystemVision System Modeling Solution allows outputs that are the logical opposite of each other.
any combination of VHDL-AMS and SPICE This operation is illustrated graphically in Figure
models in a design, it makes sense to use a SPICE 15.
model for this component. The upper output pin puts out a pulse width
whose duty cycle is proportional to positive
Summing junction implementation analog inputs. The lower output pin puts out a
The summing junction can be implemented as pulse whose duty cycle is proportional to negative
shown in Figure 14. This is a standard inverting analog inputs.
op amp implementation with three inputs to
accommodate the low-pass filter output,
potentiometer feedback, and tachometer feedback.
A small feedback capacitor is added to filter out
high frequency noise. The SPICE-based LM307
model will also be used for the summing junction
implementation.
Figure 15 - PWM operation

H-bridge with PWM


The H-bridge represents the largest design change
between the conceptual and detailed Servo
subsystem designs. The H-bridge is illustrated in
Figure 16.
Assume that a motor is connected between the
MOT_P and MOT_M terminals of the H-bridge.
The basic concept behind the H-bridge topology
Figure 14 - Summing junction implementation is as follows: if the upper-left (M1) and lower-
right (M4) MOSFETs are driven on together, then
current will flow from the power supply through
Power amplifier implementation
M1, through the motor terminals, through MOT_P
At the Develop System Modeling Analysis
and MOT_M, and back out through M4. This will
Strategy phase of the design process, a very ideal,
cause the motor shaft to rotate in one direction.
high level power amplifier model was developed.
If M1 and M4 are then driven off, and M3 and
The reasoning was that detailed power delivery
M2 are driven on, current will flow through the
analysis was not critical in the beginning phases
motor, but in the opposite direction. This will
of the design.
cause the motor shaft to rotate in the opposite
The power amplifier will now be re-
direction.
implemented as a full-fledged switching
The “fly-back” diodes across each MOSFET
amplifier. Such an amplifier consists of three
are used to provide a path for current to flow
basic building blocks: a pulse-width modulator,
during switching, since the inductance of the
an H-bridge, and H-bridge gate drivers.
motor will not allow the current to switch
Pulse-width modulator instantaneously. Without the fly-back diodes, very
The pulse-width modulator (PWM) is required to large voltage spikes will result from the abrupt
convert analog control loop commands into disruption in motor current.
corresponding pulse widths that are used to drive

System Modeling: An Introduction - 22 -


Assuming that the power required for the Gate Drivers
current application of the Position Controller is Each MOSFET in Figure 16 is driven by a special
fairly small, the power for the H-bridge comes gate-drive component. The purpose of this
from the voltage supplies that are used by the op component is two-fold: first, MOSFETs are most
amps. efficient when driven hard into the “fully on”
position. Capacitance exists between the gate and
source of the MOSFET, and a driver with good
current drive capacity is required to quickly
charge this capacitance.
The second reason the gate-drive component
is required is due to changing reference levels.
The sources of the upper MOSFETs actually
“float” up when switched on. This means that the
gate-drive must also float up, or it will be unable
to keep the FET on. This is accomplished by
referencing the gate-drive output to the source of
Figure 16 - H-bridge motor driver the FET. The gate-drive component accepts a
digital (logic) input from the PWM, and converts
The key H-bridge component is the MOSFET. it to a differential analog output. The positive pin
As with op amp models, there are numerous of the differential drives the FET gate, and the
MOSFET models available in SPICE format. negative pin drives the FET source.
Since appropriate models exist, there is no need to
develop one. An IRF150 MOSFET model will be Servo Subsystem
used for this design. All of the individual models for the
Why use an H-bridge configuration when the implementation phase of the design are combined
same performance could be achieved with a as shown in Figure 17, which represents the
simple push-pull configuration requiring only two complete detailed Servo subsystem.
MOSFETs? One of the unstated goals of this
design topology is that it needs to be easily
reconfigured for different sized loads. In the case
of a fairly light load (as is demonstrated here), the
standard +/-12 volts available for the on-board op
amps are sufficient to drive the load.
However, as the motor/load increase in size,
higher voltage levels will be required. In such
cases it is more efficient to have a single high
Figure 17 – Detailed Servo subsystem
voltage supply rather than two of them. H-bridge
topologies are popular for this use: driving a Figure 18 shows the switching voltage across
motor bi-directionally from a single power the motor input terminals for several PWM
supply. The requirement for higher voltage levels cycles. The resulting motor current is also shown.
is also the reason IRF150 MOSFETs were chosen The figure illustrates a positive average motor
(which are somewhat over-sized for this particular current (resulting in clockwise shaft rotation) in
load). response to a positive input profile command.
Note that the duty cycle of the MOT_P motor
terminal is much greater than that of the MOT_M
terminal.

System Modeling: An Introduction - 23 -


anticipate and fix any design issues – before
actual hardware is built. In fact, since the
conceptual simulation results match the detailed
results, the conceptual system model can be used
for the majority of subsequent (non-power
oriented) analyses.
Further Servo subsystem analyses will not be
pursued in this paper. However, the overall
Position Controller system design will be taken to
the next level by adding in the Digital Command
subsystem model.

Develop Detailed Servo Design Summary


In this phase of the Position Controller
development, selected components were modeled
Figure 18 - H-bridge waveforms and motor current in more detail than in the conceptual design
The load positioning results from simulating phase. This was done in order to produce a system
both conceptual and detailed Servo subsystem model that more closely matches the eventual
models are given in Figure 19. As shown in the hardware implementation of the system.
figure, there is quite a good match between these This concludes the Develop Detailed Servo
subsystem models. Design phase of the Position Controller design.

INTEGRATE DIGITAL COMMAND AND


SERVO SUBSYSTEMS
The Digital Command subsystem represents quite
a different challenge than did the Servo
subsystem. This is because it is assumed that the
Digital Command subsystem is designed by a
different engineer than the Servo subsystem
designer. However, the Servo designer still needs
to perform some “system level” analyses to
determine unanticipated systemic interactions that
will likely occur between the subsystems. It can
be very costly in terms of both time and money to
discover such interactions in the prototyping and
production phases of the design process.
Figure 19 - Conceptual/Detailed Servo waveforms There are other system level issues to explore
Now that the Servo subsystem is completely as well. Recall in previous phases of this design
implemented, is it time to build a prototype? that from a system design standpoint, the
Actually, now is the time to start really testing out following aspects of the Position Controller are of
various aspects of the system model. “What-if” interest:
tradeoffs can be made, performance as a function • Load positioning speed
of component tolerances can be determined, and • Load position accuracy
many other analyses can be performed.
This is the pay-off for the model development These performance measures have already
effort. Now the system model can be used to been investigated with the Servo subsystem

System Modeling: An Introduction - 24 -


model. However, analysis of the Servo subsystem bits. This level of information would be readily
alone cannot account for the effect of Digital available in any subsystem specification.
Command quantization noise. in other words: A more detailed representation of the Digital
how many bits does the system really need to be Command subsystem is given in Figure 21.
to satisfy accuracy specifications, and to what
value should the overall conversion rate be set? Pulse Gen
To answer these questions, some sort of
subsystem model for the Digital Command V_IN LATCH
EOC
subsystem will be needed. The question then OE
A/D BUS D/A Load
becomes “What aspects of the Digital Command
subsystem need to be modeled in order to perform
Clk Delay
reasonable system-level analysis?”
What the servo designer really needs is a test
bench in which discrete versions of the input Start
position profile can be produced, just as they
would be generated by the Digital Command Figure 21 - Digital Command Subsystem Test bench
subsystem. But the servo designer does not really This subsystem works as follows: when a Start
want to implement the full Digital Command pulse is generated, the A/D converter samples the
subsystem. So, how can a test bench be designed analog input, V_IN. This analog value is digitized
without developing a complete Digital Command one bit per clock (Clk) cycle, until all 10 bits are
subsystem model? updated. When all 10 bits are set, the A/D sets the
A simple approach would be to employ the end-of-conversion (EOC) pin high.
D/A converter to convert digitally-generated The EOC output is fed into an edge-to-pulse
profiles into their analog equivalents. Although generator. When EOC goes high, the pulse
possible, how will the digital profiles be generator produces a pulse of user-definable
generated? What is really needed is an analog width. This pulse enables the OE pin on the A/D,
waveform that is digitized, then converted back which allows the 10 bit values to be placed on its
into its quantized analog equivalent. This output pins. The output pins drive a bus connected
approach yields a reasonable solution: an easily between the A/D output and D/A input.
programmable position profile, and a quantized The pulse driving the OE pin on the A/D also
reproduction of the profile to be used as the input drives the latch pin on the D/A through a buffer.
to the Servo subsystem. The buffer includes a delay to allow the A/D pins
A Digital Command subsystem test bench to stabilize to their new values before the D/A
topology that achieves this goal is illustrated in latches them in. Once latched, the digital bits are
Figure 20. converted into an analog value after a
“conversion” delay. The cycle then repeats itself
A2D D2A with the next Start pulse.

Digital Command subsystem component model


Figure 20 - Digital Command Subsystem Block Diagram
development
The various component models required by the
The beauty of this approach lies in its Digital Command subsystem will now be
simplicity: an output for the Digital Command developed.
subsystem can be generated without knowing As with the Servo subsystem, the Digital
anything about the Digital Command subsystem Command subsystem will be developed with the
itself, except its conversion rate and number of SystemVision System Modeling Solution by

System Modeling: An Introduction - 25 -


Mentor Graphics Corporation. These component
models will be developed with the same approach All of the signal ports in this paper will be of
used in the Servo subsystem design. All of the type std_logic. Several “digital logic” packages,
analog portions of the component models will be including std_logic, have been predefined in the
developed using the conserved-energy modeling IEEE.std_logic_1164 package.
style. Signal ports also have a direction: in, out, or
inout. Port input of the buffer model is declared as
Buffer type in, and port output of the buffer is declared
The buffer (Delay) component simply reproduces as type out.
the input signal at its output, after an optional The actual functionality of the model is
delay time. The VHDL-AMS model listing for the described in the architecture with the following
buffer is shown below: statement:

library ieee; output <= input after delay;


use ieee.std_logic_1164.all;
This statement reads “signal output takes on
entity buf is
generic ( the value of signal input after a time specified by
delay : time := 0 ns); -- Delay time delay.”
port ( This expression is referred to as a concurrent
input : in std_logic; signal assignment statement. This is a quite
output : out std_logic); convenient format for expressing simple signal
end entity buf;
assignments. It is actually a shorthand notation for
architecture ideal of buf is the formal digital description mechanism in
begin VHDL-AMS: the process. Processes will be
output <= input after delay; discussed shortly.
end architecture ideal;
Pulse Generator
There are some differences between this The pulse generator component converts a signal
digital model and the analog models discussed edge into a user-specified pulse width. This sort
previously. First, the ports are declared with a of behavior can be implemented directly as a
slightly different syntax: the type of port does not single behavioral model. It can also be
need to be specified. If no port type is specified, it conveniently implemented as a structural model
is assumed to be of type signal. using a collection of basic logic gates (structural
Signal ports do not have “natures.” However, modeling is basically equivalent to the macro-
several types of signals exist. Std_logic is a modeling approach discussed earlier). In order to
general purpose signal type that allows a signal to illustrate the structural-modeling approach, the
take on one of the following enumerated values: edge-to-pulse generator is implemented as shown
in Figure 22.
‘U’ (Uninitialized)
‘X’ (Forcing unknown) EDGE IN PULSE OUT

‘0’ (Forcing zero)


‘1’ (Forcing one)
‘Z’ (High impedance) DELAY = PW

‘W’ (Weak unknown) Figure 22 - Edge-to-Pulse Generator


‘L’ (Weak zero)
‘H’ (Weak one) The edge-to-pulse generator works as follows:
‘-‘ (Don’t care) assume a positive going edge appears on the input
pin, EDGE_IN. A logic ‘0’ appears at the input

System Modeling: An Introduction - 26 -


inverter’s output. This ‘0’ is passed through to an case, the two input pins, in1 and in2 are logically
input to the OR gate. It is also passed through OR’ed, so that the output pin will go high when
another inverter, which after a delay, presents a ‘1’ either input pin goes high (after a time specified
at the input of the OR gate. Thus the output of the by delay).
OR gate is a ‘0’ from the time the edge appears at
the input of the device, until after the second Clock
inverter’s delay, at which time the OR gate output A representative method for implementing a
goes to a ‘1’. digital clock in VHDL-AMS is shown next. This
All of this time, the output inverter is method introduces the concept of a process.
presenting the logical opposite of the OR gate Processes are fundamental to both digital and
output to the device output pin. So the device mixed-signal VHDL-AMS component modeling.
output goes from an initial value of ‘0’ to a value
of ‘1’, and then back to a value of ‘0’. The duration clk_gen : process
begin
of the positive pulse is equal to the user-definable clk_out <= '1';
delay of the second inverter. wait for on_time;
The architectures for both the inverter and OR clk_out <= '0';
gate models will be briefly discussed next. wait for off_time;
end process clk_gen;
Inverter (pulse generator)
A digital inverter is similar to a buffer, but the Process statements between the begin and
inverter produces at its output the logical opposite end process keywords are sequentially executed.
of the signal appearing at its input. The Processes themselves are concurrent statements,
architecture for the inverter model is given below: and are executed simultaneously with respect to
one another.
architecture ideal of inverter is Signals may be assigned new values within
begin processes. However, these signals take on the new
output <= not input after delay; values only after the process execution suspends.
end architecture ideal;
Process execution is controlled with wait
statements. When wait statements are encountered
The inverter model listing is identical to that
in a process, the process execution suspends. How
of the buffer model, with the exception of the not
long it suspends depends on the form of the wait
operator preceding the input signal. This means
statement. There are three wait statement forms:
that signal output takes on the logical opposite of wait on – wait on a signal value change
signal input after a time specified by delay.
wait for – wait for some amount of time
OR gate (pulse generator)
The two-input OR gate produces a ‘1’ at its output wait until – wait until boolean true condition
whenever either input is ‘1’. Otherwise, its output
is ‘0’. The architecture for a two-input OR gate The clock process works as follows: when the
model is given below: simulation begins, the process is automatically
executed during the process execution phase of
architecture ideal of or2 is the simulation cycle (at the beginning of a
begin simulation, signals are updated first, then
output <= in1 or in2 after delay;
processes are executed. This is a result of the
end architecture ideal;
VHDL-AMS digital simulation cycle)5.
The OR gate model listing is again quite 5
Please refer to Chapter 7 of [1] for a comprehensive
similar to the buffer and inverter models. In this discussion of the VHDL-AMS simulation cycle.

System Modeling: An Introduction - 27 -


Signal clk_out is scheduled to take on the Digital-to-Analog (D/A) Converter
value ‘1’, and then the process suspends until a The D/A model is fairly lengthy, so only the
time duration of on_time has elapsed. When the central process which is the “heart” of the model
process suspends, signal clk_out is changed to ‘1’. will be discussed6.
The process remains suspended until the time The overall idea of the D/A model is to sum
specified by on_time elapses, at which time the weighted voltage values that correspond to each
process resumes execution, and clk_out is input bit in the converter. The MSB is assigned ½
scheduled to take on the value ‘0’. Once again, the the full-scale voltage range of the converter, the
process suspends for an additional length of time, next bit is assigned ¼ the full-scale range, and so
determined by the value of off_time. When the on. The voltages corresponding to all of the high
process suspends this time, clk_out is changed to input bits are then summed together. This voltage
its newly-scheduled value, ‘0’. sum is then placed on the D/A’s output terminal.
The process remains suspended until the
amount of time specified by off_time elapses, at proc : process
variable v_sum : real;
which time the process reaches the end process variable delt_v : real;
keywords, causing the process to start over from begin
just below the begin keyword. In this manner, the wait until (latch'event and latch = '1');
process is continuously executed, producing a v_sum := 0.0;
digital clock signal, the period of which is delt_v := (vmax - vmin)/2.0;
for i in high_bit downto low_bit loop
on_time + off_time. Note how on_time and delt_v := delt_v / 2.0;
off_time are interpreted relative to “simulation if bus(i) = '1' or bus(i) = 'H' then
time.” v_sum := v_sum + delt_v;
In the previous digital model examples, a end if;
process statement was not explicitly used. In end loop;
sum_out <= v_sum;
essence, a shorthand notation was employed with end process;
implied wait on statements, the arguments of vout == sum_out'ramp(tr, tf);
which were the input ports of the model. For
example, the OR gate model’s behavior is Refer to Figure 21 for the schematic locations
governed by the following: of the bus and latch ports.
As mentioned in the clock model description,
output <= in1 or in2 after delay; signals take on their newly-assigned values after
the process suspends. There is another digital
Implied in this notation is an unseen “wait on assignment statement, the variable, which can be
in1 or in2” statement. This implied statement declared in a process. Unlike signals, variables
causes the model to respond to changes on either take on their newly-assigned values immediately
in1 or in2. when they are executed.
The wait on statement can also be used at the When the process executes, two variables are
beginning of a process in the form of a sensitivity declared: v_sum and delta_v. V_sum is used to
list. This optional list states what signal(s) the hold the cumulative voltage value that results
process should respond to, or is sensitive to. from adding up the representative bit voltage
values. Delta_v is used to calculate the voltage
weight for each bit, by successively dividing the
previous value by two.

6
Thorough VHDL-AMS implementations for both D/A and
A/D converters are discussed in Chapter 8 of [1].

System Modeling: An Introduction - 28 -


The calculation of bit values and summing of end if;
corresponding voltages all occurs in a for loop. bit_cnt := bit_cnt - 1;
The for loop is entered with the following when output =>
statement: eoc <= '1' after delay ;
wait on oe until oe = '1' OR oe = 'H' ;
for i in high_bit downto low_bit loop bus <= dtmp;
wait on oe until oe = '0' OR oe = 'L' ;
High_bit and low_bit are generics the user sets bus <= (others => 'Z');
bit_cnt := bit_range-1 ;
to establish the number of bits for the D/A. mode := input ;
Starting with the MSB (high_bit), the for loop is end case ;
executed once for each bit, and then stops
executing after the LSB (low_bit). Refer to Figure 21 for the schematic locations
of the various ports used in this model.
Analog-to-Digital Converter (A/D) This model fragment constitutes the core of
As with the D/A model, the A/D model is fairly the A/D model. The three mode approach is
lengthy and complex. For the sake of brevity, only implemented using a case statement. A case
the core functionality of the model will be statement can be used when model behavior
presented. One popular approach to modeling an depends on the value of a single expression. The
A/D converter is to divide the conversion when keyword is used in conjunction with the
sequence into separate modes: the input mode case statement to select between the possible
acknowledges that a new conversion is being alternatives.
requested, and samples the input analog voltage; When in the input mode, the model waits for a
the convert mode is where the actual analog-to- rising edge on the start pin, then samples the input
digital conversion is performed, the results of analog voltage, performs some initialization, then
which are stored internally; and the output mode updates to the convert mode.
is where the internally stored digital bits are Once in the convert mode, a threshold voltage
placed on the output ports of the A/D converter. against which the input voltage is compared is
The A/D model fragment listed below calculated as ½ the reference voltage. The
illustrates this approach. reference voltage specifies the overall input range
of the A/D.
case mode is
when input =>
The model then waits for a rising clock edge
wait on start until start = '1' or start = 'H' ; to begin the conversion sequence. If the sampled
Vtmp := Vin; input voltage is larger than the threshold voltage,
thresh := Vmax ; the MSB is set to ‘1’. If it is smaller, the MSB is
dtmp(Nbits-1) := '0'; set to ‘0’. A counter is decremented to the next bit
eoc <= '0' ;
mode := convert ;
down from the MSB, and the process is repeated,
beginning with reducing the threshold voltage
when convert => again by ½. This “successive approximation”
thresh := thresh / 2.0 ; conversion approach is repeated until all of the
wait on clk until clk = '1' OR clk = 'H'; digital bits have been updated, at which time the
if Vtmp > thresh then
dtmp(bit_cnt) := '1' ; mode is changed to output.
Vtmp := Vtmp - thresh ; Once in the output mode, the end-of-
else conversion (eoc) pin is set high after an optional
dtmp(bit_cnt) := '0' ; delay. When an output enable (oe) rising edge is
end if ; received, all of the internal data bits are placed on
if bit_cnt < 1 then
mode := output; the model’s output pins (bus). When a falling

System Modeling: An Introduction - 29 -


edge is received on oe, the output pins are
updated to a high-impedance state, and the model
is placed in the input mode.
In order to use the concept of a mode in the
model, we define a new VHDL-AMS type called
mode. Type mode has three possible enumerated
alternatives, input, convert, and output. The mode
type is declared as follows:

type mode is (input, convert, output);

Once declared, type mode can be used like


any pre-defined type in VHDL-AMS. The ability
to extend the language in this manner is one of the
features that makes VHDL-AMS such a powerful Figure 24 - Digital Command subsystem input/output
modeling language. Now that the complete Position Controller system
model is available, additional testing may be
Simulation and analysis performed. For example, one of the design criteria
The simulation results for the A/D portion of the was that this is a 10-bit system. Is it possible that
Digital Command subsystem are given in Figure the performance specifications could be met with
23. These results illustrate the analog input profile a less costly 8-bit system? This can be tested by
expressed as digital bits on the A/D output. simply changing the generic parameters in the
A/D and D/A models that control the number of
bits represented by each converter, and re-
simulating the system. The responses of both
simulations can then be compared. These results
are given in Figure 25.

Figure 23 - Digital Command subsystem A/D conversion


The overall results for the Digital Command
subsystem are given in Figure 24. These results
show the input profile along with the quantized
D/A output waveform. It is this D/A output
waveform that is useful for system tests. Figure 25 - Quantization versus A/D conversion time
Although a quantitative analysis will need to
be performed, it looks as though there is relatively
small steady-state positioning difference between

System Modeling: An Introduction - 30 -


the 10-bit and 8-bit systems for this test case. In the Integrate Digital Command and Servo
Depending on the overall system specifications, Subsystems phase, the mixed-analog/digital
this may mean that a less costly 8-bit D/A Digital Command subsystem model was
converter can be used in place of a 10-bit developed and simulated. Both subsystems were
converter. then integrated to form the Position Controller
system model. This system model was simulated,
Integrate Digital Command and Servo Subsystems and a system trade-off (# bits vs. performance)
Summary was considered.
All of the Servo subsystem components that were All of the development and analysis
mathematically described in the Develop System throughout this design process was performed
Model Analysis Strategy phase have now been with the SystemVision System Modeling Solution
modeled in the VHDL-AMS modeling language. from Mentor Graphics Corporation. Although a
The seamless mapping of abstract mathematical Position Controller system was the focus of our
descriptions to actual model implementations is discussions, the techniques presented in this paper
one of the benefits of VHDL-AMS. are equally applicable to other systems.
This concludes the final phase of the Position
Controller design. FOR MORE INFORMATION
Related information/links can be found as
SUMMARY follows:
This paper has presented some fundamental ideas • Download SystemVision for hands-on
for building a simulatable system model for a system modeling and analysis
Position Controller system. www.mentor.com/systemvision/downloads.
The Position Controller system was modeled html
in four progressive phases. In the Develop System • For SystemVision product details, visit
Modeling Analysis Strategy phase, attention was www.mentor.com/systemvision
given to systematically progressing through the
systems modeling process, as well as REFERENCES
mathematically describing the components of the
[1] “The System Designer’s Guide to VHDL-
Servo subsystem.
AMS: Analog, Mixed-Signal, and Mixed-
In the Develop Conceptual Servo Design
Technology Modeling”. Written by Peter
phase, component models were developed for
Ashenden, University of Adelaide, Gregory
each component in the Servo subsystem. A
Peterson, University of Tennessee, and Darrell
subsystem model was developed, and initial
Teegarden, Mentor Graphics.
simulations were performed. Possible problems
http://books.elsevier.com/mk/default.asp?isbn
were identified and resolved. In particular, it was
=1558607498
determined that tachometer feedback was required
to stabilize the position loop. This was dealt with
very early in the design phase.
In the Develop Detailed Servo Design phase,
selected servo component models were further
refined to more closely reflect the eventual
physical implementation of the design.
Simulations were again performed, the results of
which were compared to results from the
conceptual phase.

System Modeling: An Introduction - 31 -

You might also like