The Virtual Prototype; An Advanced Reality Check in the Iterative Simulation Process

Publish Date: Oct 02, 2012 | 43 Ratings | 1.98 out of 5 |  PDF

Overview

NI Electronics Workbench Group latest release of Version 10 delivers a platform of tools for electronics design, marking a significant advance in the vision of tightly integrated design and test. The platform, comprised of NI Multisim, NI Ultiboard, and NI measurement technology including NI LabVIEW and NI SignalExpress, introduces a large number of new professional tools for an easy-to-use and improved methodology to capture, simulate and test a design.

The integration between capture and simulation, with the industry leading virtual test of NI LabVIEW, provides exciting new possibilities for design engineers powered by test and measurements. One such possibility is a design method called the virtual prototype.

The virtual prototype is a distinct step in the iterative simulation process which acquires a real-signal and introduces this data into a SPICE simulated circuit. This combination of a mathematical SPICE model of a circuit with real stimuli better approximates the behavior of a circuit and therefore improve the final product of the design stage.

In this article we will investigate this simulation process and learn:

  • What is iterative simulation?
  • What is a virtual prototype?
  • How applying the virtual prototype will improve a design
  • How to use NI Multisim and NI LabVIEW to create a virtual prototype

Table of Contents

  1. Introduction
  2. Circuit Simulation
  3. The Capabilities of Traditional Simulation
  4. What is a Virtual Prototype?
  5. Using NI LabVIEW and NI Multisim to build the Virtual Prototype
  6. A New Design Approach
  7. Unconventional Simulation
  8. Custom NI LabVIEW Virtual Instruments
  9. Build Your Virtual Prototype
  10. Example LVM Files
  11. Conclusion
  12. Related Links

1. Introduction

Engineers, scientists and researchers alike need to ensure that their project or design is successful. Throughout any discipline it is essential that a designer systematically plan, develop and produce any project. Success transcends just the correct functionality of the final product, but includes the overall cost and delivery time of the final project to efficiently translate an idea to manufacturing.

A powerful process to drive efficiency in the design flow is iterative simulation. Simulation applies a mathematical model to a design allowing analysis without having to physically build a prototype. Simulation allows any designer to analyze, understand and predict the behavior of the modeled system. By using simulation as a preliminary stage in the design process engineers can discover flaws and design oversights well before a costly prototype is made. The benefit of simulation is that errors are corrected at a conceptual stage, eliminating costly iterations of a prototype.

Circuit designers are able to utilize simulation in the form of SPICE and XSPICE to predict the behavior of a circuit and analyze the effects of various components and signals in the design

Since simulation is a mathematical model, the accurate definition of a model is of paramount importance an analysis. When a model, for example of a transistor, is defined, it approximates its real-world counterpart at specific conditions and is accurate for a certain temperature or operating conditions.  Therefore the accuracy of the model will define how closely a component will resemble the real-world performance in the simulation environment, and thereby will affect an engineer’s analysis of a design. Certain models for BJTs, FETs and Opamps are defined to accurately predict the behavior of the device with a great deal of precision such that it effectively mirrors the physical real world. These models tend to encompass various parasitic effects and complex behavior.

Despite having a comprehensive SPICE model for sophisticated components like MOSFETs, a simulation still has one limitation, namely the circuit stimulus. A standard SPICE simulation source is typically a simple periodic wave-form (such as a sine wave) and does not characterize either the sophisticated source which will be used for the physical prototype, or does not contain the various elements such as noise and phase-shift which are representative of a real signal.

For any designer questions becomes apparent; how can the simulation model of the source be improved to better approximate the real-world?  What can be done to model effects such as noise and cross-talk in a designed circuit? How can a sophisticated stimulus such as from a mechanical system be modeled such that it can interface to a SPICE model?

Designers and engineers are now able to utilize a simulation methodology called the virtual prototype. The virtual prototype is a distinct step in the iterative simulation process which acquires a real-signal and introduces this data into a SPICE simulated circuit (Figure 1). By combining a mathematical model of a circuit with real stimuli, an engineer can better approximate the behavior of a circuit and therefore improve the final product of the design stage.

 

Figure 1 - Virtual Prototype: Data Acquistion of a Real Signal for SPICE Simulation

 

Back to Top

2. Circuit Simulation

Simulation Program with Integrated Circuit Emphasis, or SPICE, has been used for over thirty years to predict the behavior of electronics circuits. The original implementation of SPICE was developed at the University of California Berkeley campus in the late 1960s. SPICE was developed largely as a derivative of CANCER (Computer Analysis of Nonlinear Circuits, Excluding Radiation) also developed by UC Berkeley.

A group at Georgia Tech enhanced SPICE to include an event-driven algorithm and add code modeling ability. The resultant simulation technology was named XSPICE.

NI Multisim incorporates SPICE and XSPICE in a mixed-mode simulation environment to seamlessly simulate analog and digital circuits.

To learn more about SPICE, view the following articles collected in the SPICE Simulation Fundamentals resource .

To learn more about mixed-mode simulation in Multisim read this article onMixed-Mode Simulation in NI Multisim .

 

Iterative Simulation

Upon capturing a schematic in NI Multisim, an iterative simulation approach can immediately examine circuit behavior; traditional iterative simulation consists of interactive SPICE simulation and analyses to systematically study a design and explore the changes and improvements that will improve the circuit.

The traditional simulation steps in the design flow consist of:

  1. The circuit schematic
  2. Utilize Interactive simulation and SPICE based instruments to drive, measure and investigate the behavior of a circuit. SPICE simulation instruments such as an AC voltage source, Function Generator, Oscilloscope etc… drive and visualize the transient circuit characteristics. To learn more about how to use virtual instruments in NI Multisim to interactively simulate a circuit click here.
  3. Feedback changes and improvements to the circuit schematic in the design flow
  4. Employing SPICE Analyses such as AC, Monte Carlo, and Worst Case provide advanced understanding of circuit behavior.
  5. Feedback changes and improvements to the circuit schematic in the design flow
  6. Build and validate the prototype

 

Back to Top

3. The Capabilities of Traditional Simulation

Simulation alone can not always perfectly describe the real-world. This is an inherent limitation of all simulation languages, including SPICE and XSPICE.

Simulation is ultimately limited by how comprehensive the models are. Models for transistors, switched-mode power supplies and MOSFETS are complex and sophisticated models that emulate circuit behavior quite accurately within defined regions of operation. In interactive simulation and SPICE analyses, these models allow an engineer to predict the design behavior based upon a mathematical model of the environment in which a circuit will operate in.

The traditional SPICE source, such as a square wave, is not necessarily a good representation of what will power the eventual physical prototype. For many applications the stimulus for a circuit will be an unconventional signal that is not characterized by a traditional SPICE periodic waveform. For example a real sine-wave from a function generator may have noise that alters the way in which a circuit will respond. In a different domain, a mechatronic engineer will design a circuit which must interface to a signal which is completely distinct from something such as a sine-wave. Therefore an engineer will not discover the effect of these real-sources until physically plugging a prototype of the design into a real function generator or source during the latter stages of the design flow.

From a traditional design perspective, this means that real-world effects can considerably alter final design performance and these effects are not recognized until deep into the prototyping stages. This means that an engineer must add additional iterative steps to their design flow to resolve such issues – costing an organization both time and money.

 

Back to Top

4. What is a Virtual Prototype?

A Virtual Prototype is an advanced approach to electronics design in which signals are acquired from a real-source, saved to a measurement file, and then incorporated into a SPICE simulation as the circuit stimuli (Figure 2).

The principle of the virtual prototype enables an engineer to simulate a design based upon real input stimuli, building a model that better approximates the behavior of a circuit. This method effectively plugs a physical function generator or power supply into the SPICE simulation engine providing an engineer with a reality check; better understanding of the circuit performance in real life.

Figure 2 - Build a Virtual Prototype using data acquisition and NI LabVIEW to save real data and simulate in NI Multisim

 

Back to Top

5. Using NI LabVIEW and NI Multisim to build the Virtual Prototype

The virtual prototype allows an engineer to take advantage of the NI LabVIEW programming language to easily connect to a real-world function generator, arbitrary waveform generator or any other electrical source that will stimulate the prototype during the test, verification and validation process. These signals can be measured and saved to a LabVIEW measurement file (.LVM) on a PC with all the real-world effects acquired (such as noise, phase and amplitude shifting etc…) These are all elements of a signal that cannot be easily modeled using just SPICE alone.

Within the integrated NI circuit design platform the LVM format is native to the tool-chain so data can be easily used through-out the design process. Therefore acquired measurements can be effortlessly imported into NI Multisim and converted into a source to drive a circuit

With the virtual prototype, an engineer benefits from a computer simulation in Multisim which is driven by the same inputs that will eventually power a prototype, or final production circuit. Therefore the effect of unconventional signals upon a circuits performance can be immediately ascertained.  Noise, crosstalk, and EMI interference, can be seen and resolved in the design stages using NI Multisim

By acquiring a real-signal with NI LabVIEW we can effectively plug a physical source, noise and effects included, into a Multisim simulation, thereby creating a virtual prototype. This means;

  1. Design modifications associated with real source effects can be uncovered at the earliest stages of the design process rather than during the prototype stages.
  2. Reduced cost to prototype. Iterating fewer times to the prototype stage means lower cost.
  3. Faster time to market. Less time spent re-designing boards means getting a final design to manufacturing faster.

 

Back to Top

6. A New Design Approach

By acquiring and saving multiple sets of measurement data, from various sources, a library of LVM files can be built which can be instantly utilized in any simulation. By doing this, a design engineer is immediately empowered with numerous real-world sources as well as the ability to formulate answers to big “what-if-scenarios” related to the effects of non-ideal (i.e. real) design elements. This immediately leads to an improved design.

A new design approach adds an addition step to the traditional simulation flow (Figure 3) examined previously;

  1. the circuit schematic
  2. Utilize Interactive simulation and SPICE based instruments to drive, measure and investigate the behavior of a circuit. SPICE simulation instruments such as an AC voltage source, Function Generator, Oscilloscope etc… drive and visualize the transient circuit characteristics.
  3. Feedback changes and improvements to the circuit schematic
  4. Employing SPICE Analyses such as AC, Monte Carlo, and Worst Case provide advanced understanding of circuit behavior.
  5. Feedback changes and improvements to the circuit schematic
  6. Virtual Prototype the design by replacing the traditional SPICE source with a LabVIEW Measurement (LVM) source and link a real signal into the simulation process.
  7. Feedback changes and improvements to schematic
  8. Build and validate the prototype

 

Figure 3 - An iterative approach to simulation

 

Back to Top

7. Unconventional Simulation

In this article we focus upon the idea of building a better model of the electric signal that will drive a circuit (a real sine wave from a bench-top function generator for example), however this is but one application of virtual prototyping. This method can be applied to any real-world signal that can be measured.

Biomedical and mechantronic engineers also create advanced circuitry, however rather than interfacing to a sinusoidal signal they utilize signals that are unconventional to SPICE simulation. Because of their unconventional nature, they are difficult to model and simulate

For example a mechatronics engineer may need to design a PCB which will respond to a mechanical stimulus and a biomedical engineer may need to develop circuitry that responds to a biological signal such as an electrocardiogram (ECG) or electromyogram (EMG) (Figure 4). If these engineers are building an amplifier or circuit which responds to these types of signals, the ability to supply such signals during simulation is beneficial to the overall understanding of circuit behavior.

For any biomedical or mechatronics engineer a question becomes apparent; how can you interface a mechanical or biomedical signal to a circuit simulation?

Again the virtual prototype is the methodology to help build a better simulation model. Utilizing the power and flexibility of LabVIEW and data acquisition a mechanical or biological signal can be measured and introduced to a NI Multisim simulation.

The integrated National Instruments platform provides a simple and efficient design flow to incorporate real-world signals in the simulation process even when investigating circuit simulation outside of the conventional domain of traditional electronics design.

Figure 4 - The virtual prototype allows an engineer to use an unconventional signal such as a heart beat in simulation

 

Back to Top

8. Custom NI LabVIEW Virtual Instruments

In the virtual prototype investigated in this article an integrated NI Multisim and NI LabVIEW platform is utilized. However the process can be further simplified by creating a custom LabVIEW virtual instrument that both acquires a real-world signal from WITHIN NI Multisim and behaves as the source (Figure 5). Such an instrument can be placed into a circuit in a similar manner to any other instrument (such as the Multisim function generator).

To learn more about creating custom virtual instruments, view the How to Create a LabVIEW Based Virtual Instrument for NI Multisim article.

Figure 5 - Creating custom LabVIEW virtual instruments

 

Back to Top

9. Build Your Virtual Prototype

To create a virtual prototype only 2 steps are required.

Step 1: Acquire and Save a Real Signal as a LabVIEW Measurement (LVM) file

Step 2: Apply the acquired data in the LVM file to simulation

 

Step 1: Acquire and Save a Real Signal

Both NI LabVIEW and NI LabVIEW SignalExpress are easy-to-use tools that can quickly measure signals from the real-world. Either tool can be used to measure an input signal from a function generator, power supply, or any real-world source such as a heartbeat sensor and save it to a text-based LabVIEW Measurement file (LVM). 

Available Resources on data acquisition hardware and software:

 

Step 2: Acquire and Save a Real Signal

To create the virtual prototype in NI Multisim build a circuit and simply replace the current SPICE simulation source (AC source, Clock source, Function Generator as seen in Figure 6a, Figure 6b and Figure 6c) with an LVM source (Figure 7) linked to data contained in an LVM file.

 

 

 

 Figure 6a - AC Souce

 Figure 6b - Clock Source 

 

 

 

 

 

 

 Figure 6c - Function Generator

 Figure 7 - LVM Source

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Note: Although in this article an LVM voltage source is utilized, an LVM current source, and TDM (binary measurement file) sources provide similar functionality.

To place an LVM source:

  1. Go to Place >> Component
  2. Select the Master Database (Figure 8, red box)
  3. Select the Sources group (Figure 8, blue box)
  4. Select the SIGNAL_VOLTAGE_SOURCES family (Figure 8, black box)
  5. Select the LVM_VOLTAGE component (Figure 8, green box)
  6. Click on the OK button and wire into the circuit as shown in the Figure 9 example.

 

Figure 8 - Component Browser

 

Figure 9 - Complete circuit with an LVM source

Assuming you have already acquired a real signal through NI LabVIEW or NI LabVIEW SignalExpress, you can now link an LVM file into the simulation source:

  1. Double-click on the LVM source (placed in steps a-f)
  2. Select the Browse button in the LabVIEW LVM Voltage dialog box
  3. Browse to the saved LVM file acquired in Step 1
  4. Click on Open
  5. If multiple channels of data have been acquired in Step 1, click on the Channel drop-down box to select the appropriate channel of measurement data. Click on the OK button.
  6. To preview the text-based measurement data click on the Preview Data check-box.
  7. You will have only acquired but a few periods of data in Step 1, therefore to have a continuous simulation click on the Repeat check-box.
  8. Click on the OK button to save all your changes.

The Virtual Prototype is created! Now simulate!

 

Back to Top

10. Example LVM Files

To begin building a library of LVM files of real-world sources download the following 4 example LVM files. Each of these files contains various signals with noise, typical of what would be seen, as measured from a real-world function generator with uniform, Gaussian and periodic noise.

 

File Name Channel Types of Wave
5751_sine.lvm Channel 1 Sine (ideal)
Channel 2 Sine with Uniform Noise
Channel 3 Sine with Gaussian Noise
Channel 4 Sine with Periodic Noise
5751_square.lvm Channel 1 Square (ideal)
Channel 2 Square with Uniform Noise
Channel 3 Square with Gaussian Noise
Channel 4 Square with Periodic Noise
5751_triangular.lvm Channel 1 Triangle (ideal)
Channel 2 Triangle with Uniform Noise
Channel 3 Triangle with Gaussian Noise
Channel 4 Triangle with Periodic Noise
5751_complex.lvm Channel 1 Step Signal
Channel 2 Linear Sweep
Channel 3 (Sin(x)/x)

To quickly view the 4 different channels of information on a single oscilloscope, download the 5751_file_example.ms10 (Figure 10) file attached to this article. Add the 5751_sine.lvm file to ALL 4 LVM sources in the circuit (however set the channel in the V1 source to Channel 1, set the channel in the V2 source to Channel 2, set the channel in the V3 source to Channel 3 and set the channel in the V4 source to Channel 4).

Note: For additional reference on how to add the LVM files and set the channel, refer to steps a – n as listed in the Steps to Create a Virtual Prototype section of this article.

Figure 10 - 5751_file_example.ms10

 

For the various examples, you will see the wave forms displayed in Figures 11, 12, 13 and 14.

Figure 11 - Sine Wave Example

 

 

Figure 12 - Square Wave Example 

 

Figure 13 - Triangular Wave Example

 

Figure 14 - Complex Signals Example

 

Back to Top

11. Conclusion

The NI circuit design platform provides an engineer with a simplified process to acquire and utilize real signals in an NI Multisim circuit simulation. The limitation of the simpler SPICE representation of a source is overcome by effectively plugging a physical source into the simulation process.

The two step process to build the virtual prototype can be applied to the design process to better understand how a circuit will behave when introduced to a real-world signal. The value of the virtual prototype is that iterative steps are eliminated from the design flow, reducing the cost to prototype and translating the design to final product more quickly.

Back to Top

12. Related Links

Learn more about NI's approach to prototyping

 

    

Back to Top

Bookmark & Share

Ratings

Rate this document

Answered Your Question?
Yes No

Submit