Title: PWL_FILE Product: OrCAD PSpice A/D, OrCAD PSpice AA

advertisement
Title:
PWL_FILE
Product:
OrCAD PSpice A/D, OrCAD PSpice AA
and Allegro AMS Simulator
Summary:
This application note shows you how to
use PWL_FILE to configure your measured
data as a source
Author/Date: Wei Ling / 03.09.2009
Table of Contents
1
2
3
4
Introduction .................................................................................................................... 2
Demo Project ................................................................................................................. 2
Using VPWL_FILE ......................................................................................................... 3
Bibliography ................................................................................................................... 4
Application Note
PWL_FILE
Page 1 von 4
1 Introduction
It is known that you can define many voltage and current sources for your design. But
sometimes you have measured data from the real word and you want to use them as a
source for your PSpice simulation. You can achieve this with the help of VPWL_FILE for
voltage source and IPWL_FILE for current source. In this application note we would like to
use VPWL_FILE as an example to show you how it works. The procedure for using
IPWL_FILE is the same.
2 Demo Project
The example circuit we would like to build up is a simple voltage divider. A demo circuit in the
project VPWL_FILE.opj is created as follows:
R1
MEASURE
1k
V1
R2
1k
TSF =
VSF =
FILE =
0
If you double click the symbol of the voltage source V1, the Property Editor will open.
Through the property Source Library you will know that this part VPWL_FILE comes from
the library source.olb under <install_dir>\tools\capture\library\pspice.
Application Note
PWL_FILE
Page 2 von 4
3 Using VPWL_FILE
Let’s assume you have a .csv file, for example my_data.csv, in which the measured data are
saved.
The fist column specifies the time and the second column specifies the value at that time.
The columns are separated using commas.
The part VPWL_FILE has some properties, where
V1
VPWL_FILE
TSF = 1
VSF = 0.1
FILE = F:\Application Notes\FlowCAD\Projects\User_File\my_data.csv
TSF stands for Time Scale Factor and
VSF stands for Voltage Scale Factor
In the demo circuit we set TSF = 1 and VSF = 0.1. This means if the voltage at 1µs is 416.40625 volt in my_data.csv file, for the PSpice simulation the voltage at 1µs is -41.640625
volt.
The path of the file must be set properly. You can use either the absolute path or the relative
path.
Application Note
PWL_FILE
Page 3 von 4
Note:
If you saved the measured data file in the profile folder, you can just specify the name of the
file. For example, if you placed the my_data.csv file in the profile folder test_1,
you can specify the value of the property FILE as follows:
V1
VPWL_FILE
TSF = 1
VSF = 0.1
FILE = my_data.csv
Run the simulation, for example, for 150µs. The voltage V(MEASURE) can be displayed in
the following diagram.
200V
100V
0V
-100V
0s
50us
100us
150us
V(MEASURE)
Time
In the above diagram you can see the time scale is the same as in the my_data.csv file but
the voltage is one tenth smaller than in the file because of the definition of TSF and VSF.
Note:
You can also use the text file format in which you can separate the columns using spaces.
4 Bibliography
[1]
[2]
PSpice User’s Guide, Cadence
OrCAD Capture User’s Guide, Cadence
Application Note
PWL_FILE
Page 4 von 4
Download