OrCADPSpice软件培训教材
- 格式:docx
- 大小:538.62 KB
- 文档页数:52
OrCAD PSpice 培训教材深圳光映计算机软件有限公司培训目标:熟悉PSpice的仿真功能,熟练掌握各种仿真参数的设置方法,综合观测并分析仿真结果,熟练输出分析结果,能够综合运用各种仿真对电路进行分析,学会修改模型参数。
一、PSpice分析过程二、绘制原理图原理图的具体绘制方法已经在Capture中讲过了,下面主要讲一下在使用PSpice时绘制原理图应该注意的地方。
1、新建Project时应选择Analog or Mixed-signal Circuit2、调用的器件必须有PSpice模型首先,调用OrCAD软件本身提供的模型库,这些库文件存储的路径为Capture\Library\pspice,此路径中的所有器件都有提供PSpice 模型,可以直接调用。
其次,若使用自己的器件,必须保证*.olb、*.lib两个文件同时存在,而且器件属性中必须包含PSpice Template属性。
3、原理图中至少必须有一条网络名称为0,即接地。
4、必须有激励源。
原理图中的端口符号并不具有电源特性,所有的激励源都存储在Source和SourceTM库中。
5、电源两端不允许短路,不允许仅由电源和电感组成回路,也不允许仅由电源和电容组成的割集。
解决方法:电容并联一个大电阻,电感串联一个小电阻。
6、最好不要使用负值电阻、电容和电感,因为他们容易引起不收敛。
三、仿真参数设置1、PSpice能够仿真的类型在OrCAD PSpice中,可以分析的类型有以下8种,每一种分析类型的定义如下:直流分析:当电路中某一参数(称为自变量)在一定范围内变化时,对自变量的每一个取值,计算电路的直流偏置特性(称为输出变量)。
交流分析:作用是计算电路的交流小信号频率响应特性。
噪声分析:计算电路中各个器件对选定的输出点产生的噪声等效到选定的输入源(独立的电压或电流源)上。
即计算输入源上的等效输入噪声。
瞬态分析:在给定输入激励信号作用下,计算电路输出端的瞬态响应。
OrCAD_PSpice简明教程PSPICE简明教程宾西法尼亚⼤学电⽓与系统⼯程系University of PennsylvaniaDepartment of Electrical and Systems Engineering编译:陈拓2009年8⽉4⽇原⽂作者:Jan Van der Spiegel, ?2006 jan_at_/doc/92ba9b2de2bd960590c67752.html Updated March 19, 2006⽬录1. 介绍2. 带OrCAD Capture的Pspice⽤法2.1 第⼀步:在Capture 中创建电路2.2 第⼆步:指定分析和仿真类型偏置或直流分析(BIAS or DC analysis)直流扫描仿真(DC Sweep simulation)2.3 第三步:显⽰仿真结果2.4 其他分析类型:2.4.1瞬态分析(Transient Analysis)2.4.2 交流扫描分析(AC Sweep Analysis)3. 附加的使⽤Pspice电路的例⼦3.1变压器电路3.2 使⽤理想运算放⼤器的滤波器交流扫描(滤波器电路)3.3 使⽤实际运算放⼤器的滤波器交流扫描(滤波器电路)3.4 整流电路(峰值检波器)和参量扫描的使⽤3.4.1 峰值检波器仿真(Peak Detector simulation)3.4.2 参量扫描(Parametric Sweep)3.5 AM 调制信号3.6 中⼼抽头变压器4. 添加和创建库:模型和元件符号⽂件4.1 使⽤和添加⼚商库4.2 从⼀个已经存在的Pspice模型⽂件创建Pspice符号4.3 创建你⾃⼰的Pspice模型⽂件和符号元件参考书⽬1. 介绍是⼀种强⼤的通⽤模拟混合模式电路仿真器,可以⽤于验证电路设计并且预知 SPICE电路的⾏为,这对于集成电路特别重要,1975年SPICE最初在加州⼤学伯克利分校被开发时也是基于这个原因,正如同它的名字所暗⽰的那样:S imulation P rogram for I ntegrated C ircuits E mphasis.PSpice 是⼀个PC版的SPICE(Personal-SPICE),可以从属于Cadence设计系统公司的OrCAD公司获得。
OrCAD PSpice 培训教材培训目标:熟悉PSpice的仿真功能,熟练掌握各种仿真参数的设置方法,综合观测并分析仿真结果,熟练输出分析结果,能够综合运用各种仿真对电路进行分析,学会修改模型参数。
一、PSpice分析过程二、绘制原理图原理图的具体绘制方法差不多在Capture中讲过了,下面要紧讲一下在使用PSpice时绘制原理图应该注意的地点。
1、新建Project时应选择Analog or Mixed-signal Circuit2、调用的器件必须有PSpice模型首先,调用OrCAD软件本身提供的模型库,这些库文件存储的路径为Capture\Library\pspice,此路径中的所有器件都有提供PSpice模型,能够直接调用。
其次,若使用自己的器件,必须保证*.olb、*.lib两个文件同时存在,而且器件属性中必须包含PSpice Template属性。
3、原理图中至少必须有一条网络名称为0,即接地。
4、必须有激励源。
原理图中的端口符号并不具有电源特性,所有的激励源都存储在Source和SourceTM库中。
5、电源两端不同意短路,不同意仅由电源和电感组成回路,也不同意仅由电源和电容组成的割集。
解决方法:电容并联一个大电阻,电感串联一个小电阻。
6、最好不要使用负值电阻、电容和电感,因为他们容易引起不收敛。
三、仿真参数设置1、PSpice能够仿确实类型在OrCAD PSpice中,能够分析的类型有以下8种,每一种分析类型的定义如下:直流分析:当电路中某一参数(称为自变量)在一定范围内变化时,对自变量的每一个取值,计算电路的直流偏置特性(称为输出变量)。
交流分析:作用是计算电路的交流小信号频率响应特性。
噪声分析:计算电路中各个器件对选定的输出点产生的噪声等效到选定的输入源(独立的电压或电流源)上。
即计算输入源上的等效输入噪声。
瞬态分析:在给定输入激励信号作用下,计算电路输出端的瞬态响应。
差不多工作点分析:计算电路的直流偏置状态。
University of PennsylvaniaDepartment of Electrical and Systems EngineeringPSPICEA brief primerContents1.Introductione of PSpice with OrCAD Capture2.1 Step 1: Creating the circuit in Capture2.2 Step 2: Specifying the type of analysis and simulationBIAS or DC analysisDC Sweep simulation2.3 Step 3: Displaying the simulation Results2.4 Other types of Analysis:2.4.1 Transient Analysis2.4.2 AC Sweep Analysis3. Additional Circuit Examples with PSpice3.1 Transformer circuit3.2 AC Sweep of Filter with Ideal Op-amp (Filter circuit)3.3 AC Sweep of Filter with Real Op-amp (Filter Circuit)3.4 Rectifier Circuit (peak detector) and the use of a parametric sweep.Peak Detector simulationParametric Sweep3.5AM Modulated Signal3.6 Center Tap Transformer4.Adding and Creating Libraries: Model and Part Symbol files4.1Using and Adding Vendor Libraries4.2Creating PSpice Symbols from an existing PSpice Model file4.3Creating your own PSpice Model file and Symbol PartsReferences1.INTRODUCTIONSPICE is a powerful general purpose analog and mixed-mode circuit simulator that is used to verify circuit designs and to predict the circuit behavior. This is of particular importance for integrated circuits. It was for this reason that SPICE was originally developed at the Electronics Research Laboratory of the University of California, Berkeley (1975), as its name implies:S imulation P rogram for I ntegrated C ircuits E mphasis.PSpice is a PC version of SPICE (which is currently available from OrCAD Corp. of Cadence Design Systems, Inc.). A student version (with limited capabilities) comes with various textbooks. The OrCAD student edition is called PSpice AD Lite. Information about Pspice AD is available from the OrCAD website: /pspicead.aspxThe PSpice Light version has the following limitations: circuits have a maximum of 64 nodes, 10 transistors and 2 operational amplifiers.SPICE can do several types of circuit analyses. Here are the most important ones: •Non-linear DC analysis: calculates the DC transfer curve.•Non-linear transient and Fourier analysis: calculates the voltage and current as a function of time when a large signal is applied; Fourier analysis gives the frequency spectrum.•Linear AC Analysis: calculates the output as a function of frequency. A bode plot is generated.•Noise analysis•Parametric analysis•Monte Carlo AnalysisIn addition, PSpice has analog and digital libraries of standard components (such as NAND, NOR, flip-flops, MUXes, FPGA, PLDs and many more digital components, ). This makes it a useful tool for a wide range of analog and digital applications.All analyses can be done at different temperatures. The default temperature is 300K.The circuit can contain the following components:•Independent and dependent voltage and current sources•Resistors•Capacitors•Inductors•Mutual inductors•Transmission lines•Operational amplifiers•Switches•Diodes•Bipolar transistors•MOS transistors•JFET•MESFET•Digital gates•and other components (see users manual).2. PSpice with OrCAD Capture (release 9.2 Lite edition)Before one can simulate a circuit one needs to specify the circuit configuration. This can be done in a variety of ways. One way is to enter the circuit description as a text file in terms of the elements, connections, the models of the elements and the type of analysis. This file is called the SPICE input file or source file and has been described somewhere else (see /%7Ejan/spice/spice.overview.html).An alternative way is to use a schematic entry program such as OrCAD CAPTURE. OrCAD Capture is bundled with PSpice Lite AD on the same CD that is supplied with the textbook. Capture is a user-friendly program that allows you to capture the schematic of the circuits and to specify the type of simulation. Capture is non only intended to generate the input for PSpice but also for PCD layout design programs.The following figure summarizes the different steps involved in simulating a circuit with Capture and PSpice. We'll describe each of these briefly through a couple of examples.Figure 1: Steps involved in simulating a circuit with PSpice.The values of elements can be specified using scaling factors (upper or lower case):T or Tera (= 1E12);G or Giga (= E9); MEG or Mega (= E6); K or Kilo (= E3);M or Milli (= E-3); U or Micro (= E-6); N or Nano (= E-9); P or Pico (= E-12) F of Femto (= E-15)Both upper and lower case letters are allowed in PSpice and HSpice. As an example, one can specify a capacitor of 225 picofarad in the following ways:225P, 225p, 225pF; 225pFarad; 225E-12; 0.225NNotice that Mega is written as MEG, e.g. a 15 megaOhm resistor can be specified as15MEG, 15MEGohm, 15meg, or 15E6. Be careful not to use M for Mega! When you write 15Mohm or 15M, Spice will read this as 15 milliOhm!We'll illustrate the different types of simulations for the following circuit:Figure 2: Circuit to be simulated (screen shot from OrCAD Capture).2.1 Step 1: Creating the circuit in Capture2.1.1 Create new project:1.Open OrCAD Capture2.Create a new Project: FILE MENU/NEW_PROJECT3.Enter the name of the project4.Select Analog or Mixed-AD5.When the Create PSpice Project box opens, select "Create Blank Project".A new page will open in the Project Design Manager as shown below.Figure 3: Design manager with schematic window and toolbars (OrCAD screen capture)2.1.2. Place the components and connect the parts1.Click on the Schematic window in Capture.2.To Place a part go to PLACE/PART menu or click on the Place Part Icon. This will opena dialog box shown below.Figure 4: Place Part window3.Select the library that contains the required components. Type the beginning of the namein the Part box. The part list will scroll to the components whose name contains the same letters. If the library is not available, you need to add the library, by clicking on the Add Library button. This will bring up the Add Library window. Select the desired library.For Spice you should select the libraries from the Capture/Library/PSpice folder.Analog: contains the passive components (R,L,C), mutual inductane, transmission line, and voltage and current dependent sources (voltage dependent voltage source E, current-dependent current source F, voltage-dependent current source G and current-dependentvoltage source H).Source: give the different type of independent voltage and current sources, such as Vdc, Idc, Vac, Iac, Vsin, Vexp, pulse, piecewise linear, etc. Browse the library to see what isavailable.Eval: provides diodes (D…), bipolar transistors (Q…), MOS transistors, JFETs (J…),real opamp such as the u741, switches (SW_tClose, SW_tOpen), various digital gates and components.Abm: contains a selection of interesting mathematical operators that can be applied tosignals, such as multiplication (MULT), summation (SUM), Square Root (SWRT),Laplace (LAPLACE), arctan (ARCTAN), and many more.Special:contains a variety of other components, such as PARAM, NODESET, etc.4.Place the resistors, capacitor (from the Analog library), and the DC voltage and currentsource. You can place the part by the left mouse click. You can rotate the components by clicking on the R key. To place another instance of the same part, click the left mousebutton again. Hit the ESC key when done with a particular element. You can add initialconditions to the capacitor. Double-click on the part; this will open the Property window that looks like a spreadsheet. Under the column, labeled IC, enter the value of the initial condition, e.g. 2V. For our example we assume that IC was 0V (this is the default value).5.After placing all part, you need to place the Ground terminal by clicking on the GNDicon (on the right side toolbar – see Fig. 3). When the Place Ground window opens, select GND/CAPSYM and give it the name 0 (i.e. zero). Do not forget to change the name to 0, otherwise PSpice will give an error or "Floating Node". The reason is that SPICEneeds a ground terminal as the reference node that has the node number or name 0 (zero).Figure 5: Place the ground terminal box; the ground terminal should have the name 06.Now connect the elements using the Place Wire command from the menu(PLACE/WIRE) or by clicking on the Place Wire icon.7.You can assign names to nets or nodes using the Place Net Alias command (PLACE/NETALIAS menu). We will do this for the output node and input node. Name these Out andIn, as shown in Figure 2.2.1.3. Assign Values and Names to the parts1.Change the values of the resistors by double-clicking on the number next to the resistor.You can also change the name of the resistor. Do the same for the capacitor and voltage and current source.2.If you haven't done so yet, you can assign names to nodes (e.g. Out and In nodes).3.Save the project2.1.4. NetlistThe netlist gives the list of all elements using the simple format:R_name node1 node2 valueC_name nodex nodey value, etc.1.You can generate the netlist by going to the PSPICE/CREATE NETLIST menu.2.Look at the netlist by double clicking on the Output/ file in the Project ManagerWindow (in the left side File window).Note on Current Directions in elements:The positive current direction in an element such as a resistor is from node 1 to node 2. Node1 is either the left pin or the top pin for an horizontal or vertical positioned element (.e.g aresistor). By rotating the element 180 degrees one can switch the pin numbers. To verify the node numbers you can look at the netlist:e.g. R_R2 node1 node2 10ke.g. R_R2 0 OUT 10kSince we are interested in the current direction from the OUT node to the ground, we need to rotate the resistor R2 twice so that the node numbers are interchanged:R_R2 OUT 0 10k2.2 Step 2: Specifying the type of analysis and simulationAs mentioned in the introduction, Spice allows you do to a DC bias, DC Sweep, Transientwith Fourier analysis, AC analysis, Montecarlo/worst case sweep, Parameter sweep and Temperature sweep. We will first explain how to do the Bias and DC Sweep on the circuit of Figure 2.2.2.1 BIAS or DC analysis1.With the schematic open, go to the PSPICE menu and choose NEW SIMULATIONPROFILE.2.In the Name text box, type a descriptive name, e.g. Bias3.From the Inherit From List: select none and click Create.4.When the Simulation Setting window opens, for the Analyis Type, choose Bias Pointand click OK.5.Now you are ready to run the simulation: PSPICE/RUN6. A window will open, letting you know if the simulation was successful. If there areerrors, consult the Simulation Output file.7.To see the result of the DC bias point simulation, you can open the Simulation Outputfile or go back to the schematic and click on the V icon (Enable Bias VoltageDisplay) and I icon (current display) to show the voltage and currents (see Figure 6).The check the direction of the current, you need to look at the netlist: the current ispositive flowing from node1 to node1 (see note on Current Direction above).Figure 6: Results of the Bias simulation displayed on the schematic.2.2.2 DC Sweep simulationWe will be using the same circuit but will evaluate the effect of sweeping the voltage source between 0 and 20V. We'll keep the current source constant at 1mA.1.Create a new New Simulation Profile (from the PSpice Menu); We'll call it DC Sweep2.For analysis select DC Sweep; enter the name of the voltage source to be swept: V1. Thestart and end values and the step need to be specified: 0, 20 and 0.1V, respectively (see Fig. below).Figure 7: Setting for the DC Sweep simulation.3.Run the simulation. PSpice will generate an output file that contains the values of allvoltages and currents in the circuit.2.3 Step 3: Displaying the simulation ResultsPSpice has a user-friendly interface to show the results of the simulations. Once the simulation is finished a Probe window will open.Figure 8: Probe window1.From the TRACE menu select ADD TRACE and select the voltages and current you liketo display. In our case we'll add V(out) and V(in). Click OK.Figure 9: Add Traces window2.You can also add traces using the "Voltage Markers" in the schematic. From the PSPICEmenu select MARKERS/VOLTAGE LEVELS. Place the makers on the Out and In node.When done, right click and select End Mode.Figure 10: Using Voltage Markers to show the simulation result of V(out) and V(in)3.Go to back to PSpice. You will notice that the waveforms will appear.4.You can add a second Y Axis and use this to display e.g. the current in Resistor R2, asshown below. Go to PLOT/Add Y Axis. Next, add the trace for I(R2).5.You can also use the cursors on the graphs for Vout and Vin to display the actual valuesat certain points. Go to TRACE/CURSORS/DISPLAY6.The cursors will be associated with the first trace, as indicated by the small smallrectangle around the legend for V(out) at the bottom of the window. Left click on the first trace. The value of the x and y axes are displayed in the Probe window. When you right click on V(out) the value of the second cursor will be given together with the difference between the first and second cursor.7.To place the second cursor on the second trace (for V(in)), right click the legend forV(in). You'll notice the outline around V(in) at the bottom of the window. When you right click the second trace the cursor will snap to it. The values of the first and second cursor will be shown in Probe window.8.You can chance the X and Y axes by double clicking on them.9.When adding traces you can perform mathematical calculations on the traces, asindicated in the Add Trace Window to the right of Figure 9.Figure 11: Result of the DC sweep, showing Vout, Vin and the current throughresistor R2. Cursors were used for V(out) and V(in).2.4 Other types of Analysis2.4.1 Transient AnalysisWe'll be using the same circuit as for the DC sweep, except that we'll apply the voltage and current sources by closing a switch, as shown in Figure 12.Figure 12: Circuit used for the transient simulation.1.Insert the SW_TCLOSE switch from the EVAL Library as shown above. Double click onthe switch TCLOSE value and enter the value when the switch closes. Lets makeTCLOSE = 5 ms.2.Set up the Transient Analysis: go to the PSPICE/NEW SIMULATION PROFILE.3.Give it a name (e.g. Transient). When the Simulation Settings window opens, select"Time Domain (Transient)" Analysis. Enter also the Run Time. Lets make it 50 ms. For the Max Step size, you can leave it blank or enter 10us.4.Run PSpice.5. A Probe window in PSpice will open. You can now add the traces to display the results.In the figure below we plotted the current through the capacitor in the top window andthe voltage over the capacitor on the bottom one. We use the cursor to find the timeconstant of the exponential waveform (by finding the 0.632 x V(out)max = 9.48. Thecursor gave a corresponding time of 30ms which gives a time constant of 30-5=25ms (5 ms is subtracted because the switch closed at 5ms).Figure 13: Results of the transient simulation of Figure 12.6.Instead of using a switch we can also use a voltage source that changes over time. Thiswas done in Figure 14 where we used the VPULSE and IPULSE sources from theSOURCE Library. We entered the voltage levels (V1 and V2), the delay (TD), Rise and Fall Times, Pulse Width (PW) and the Period (PER). The values are indicated in the figure below. For details on these parameters click here. A description of other Spice elements can be found in the User’s guide or in the Spice Tutorial.(/~jan/spice/)Figure 14: Circuit with a PULSE voltage and current source.7.After doing the transient simulation results can be displayed as was done before8.The last example of a transient analysis is with a sinusoidal signal VSIN. The circuit isshown below. We made the amplitude 10V and frequency 10 Hz.Figure 15: Circuit with a sinusoidal input.9.Create a Simulation Profiler for the transient analysis and run PSpice.10.The result of the simulation for Vout and Vin are given in the figure below.Figure 16: Transient simulation with a sinusoidal input.2.4.2 AC Sweep AnalysisThe AC analysis will apply a sinusoidal voltage whose frequency is swept over a specified range. The simulation calculates the corresponding voltage and current amplitude and phases for each frequency. When the input amplitude is set to 1V, then the output voltage is basically the transfer function. In contrast to a sinusoidal transient analysis, the AC analysis is not a time domain simulation but rather a simulation of the sinusoidal steady state of the circuit. When the circuit contains non-linear element such as diodes and transistors, the elements will be replaced their small-signal models with the parameter values calculated according to the corresponding biasing point.In the first example, we'll show a simple RC filter corresponding to the circuit of Figure 17.Figure 17: Circuit for the AC sweep simulation.1.Create a new project and build the circuit2.For the voltage source use VAC from the Sources library.3.Make the amplitude of the input source 1V.4.Create a Simulation Profile. In the Simulation Settings window, select AC Sweep/Noise.5.Enter the start and end frequencies and the number of points per decade. For our examplewe use 0.1Hz, 10 kHz and 11, respectively.6.Run the simulation7.In the Probe window, add the traces for the input voltage. We added a second window todisplay the phase in addition to the magnitude of the output voltage. The voltage can be displayed in dB by specifying Vdb(out) in the Add Trace window (type Vdb(out) in the Trace Expression box. For the phase, type VP(out).8.An alternative to show the voltage in dB and phase is to use markers on the schematics:PSPICE/MARKERS/ADVANCED/dBMagnitude or Phase of Voltage, or current. Place the markers on the node of interest.9.We used the cursors in Figure 18 to find the 3dB point. The value is 6.49 Hzcorresponding to a time constant of 25 ms (R1||R2.C). At 10 Hz the attenuation of Vout is11.4db or a factor of 3.72. This corresponds to the value of the amplitude of the outputvoltage obtained during the transient analysis of Figure 16 above.3. Additional Circuit Examples with PSpice3.1 Transformer circuitSPICE has no model for an ideal transformer. An ideal transformer is simulated using mutual inductances such that the transformer ratio N1/N2 = sqrt(L1/L2). The part in PSpice is called TFRM_LINEAR (in the Analog Library). Make the coupling factor K close to or equal to one (ex. K=1) and choose L such that wL >> the resistance seen be the inductor. Thesecondary circuit needs a DC connection to ground. This can be accomplished by adding a large resistor to ground or giving the primary and secondary circuits a common node. The following example illustrates how to simulate a transformer.Figure 3.1.1: Circuit with ideal transformerFor the above example, lets make wL2 >> 500 Ohm or L2> 500/(60*2pi) ; lets make L2 at least 10 times larger, ex. L2=20H. L1 can than be found from the turn ratio: L1/L2 =(N1/N2)^2. For a turn ratio of 10 this makes L1=L2x100=2000H. The circuit as entered in PSpice Capture is shown in Figure 3.1.2 and the result in Figure 3.1.3Figure 3.1.2: Circuit with ideal transformer as entered in PSpice Capture (the transformer TX is modeled by the part XFRM_LINEAR of the Analog Library).Figure 3.1.3: Results of the transient simulation of the above circuit.3.2 AC Sweep of Filter with Ideal Op-amp (Filter circuit)The following circuit will be simulated with PSpice.Figure 3.2.1: Active Filter Circuit with ideal op-amp.We have used off-page connectors (OFFPAGELEFT-R from the CAPSYM library; or by clicking on the off-page icon) for the input and outputs. The name of the connectors can be changed by double-clicking on the name of the off-page connector. By giving the same name to two connectors (or nodes), the two nodes will be connected (no wires are needed). For te voltage source we used the VAC from the SOURCE Library. We gave it an amplitude of 1V so that the output voltage will correspond to the amplification (or transfer function) of the filter. In the Simulation Analysis, select AC Sweep, and enter the starting, ending frequency and the number of points per decade.The result is given in the figure below. The magnitude is given on the left Y axis while the phase is given by the right Y axis. The cursors have been used to find the 3db points of the bandpass filters, corresponding to 0.63 Hz and 32 Hz for the low and high breakpoints,respectively. These numbers correspond to the values of the time constants given in Fig.3.2.1. The phase at these points is -135 and -224 degrees.Figure 3.2.2: Results of the AC sweep of the Active Filter Circuit of the figure above.3.3 AC Sweep of Filter with Real Op-amp (Filter circuit)The circuit with a real op-amp is shown below. We selected the U741 op-amp to build the filter. The simulation results are shown in Figure 3.3.2. As one would expect the differences between the filter with the real and ideal op-amps are minimal in this frequency range.Figure 3.3.1: Active Filter Circuit with the U741 Op-amp.Figure 3.3.2: Results of the AC sweep of the Active Filter Circuit with real Op-amp (U741) of the figure above.3.4 Rectifier Circuit (peak detector) and the use of a parametric sweep.3.4.1: Peak Detector simulationFigure 3.4.1: Rectifier circuit with the D1N4148 diode and a load resistor of 500 Ohm.The results of the simulation are given in Fig. 3.4.2. The ripple has a peak-to-peak value of 777mV as indicated by the cursors. The maximum output voltage is 13.997V which is one volt below the input of 15V.Figure 3.4.2: Simulation results of the rectifier circuit.3.4.2 Parametric SweepIt is interesting to see the effect of the load resistance on the output voltage and its ripple voltage. This can be done using the PARAM part.Figure 3.4.3: Circuit used for the parametric sweep of the load resistor.a. Adding the Parameter Parta.Double click on the value (500 Ohms) of the load resistor R1 to {Rval}. Use curlybrackets. PSpice interprets the text between curly brackets as an expression that itevaluate to a numerical expression. Click OK when done.b.Add the PARAM part to the circuit. You'll find this part in the SPECIAL library.c.Double click on the PARAM part. This will open a spreadsheet like windowshowing the PARAM definition. You will need to add a new column to thisspread sheet. Click on NEW COLUMN and enter for Property Name, Rlval(without the curly brackets).d.You will notice that the new column Rlval has been created. Below the Rlvalenter the initial value for the resistor: lets make it 500, as shown in Figure 3.4.4below.Figure 3.4.4: Property Editor window for the PARAM part, showing the newly created Rlval column.e.While the cell in which you entered the value 500 still selected click theDISPLAY button. You can now specify what to display: select Name and Value.Click OK.f.Click the APPLY button before closing the Property editor.g.Save the design.b. Create the Simulation Profile for the Parametric Analysisa.Select PSPICE/NEW_SIMULATION_PROFILEb.Type in the name of the profile, e.g. Parametricc.In the Simulation Setting window, select Analysis Tab if the window does notopen.d.For the Analysis type select Transient (or the type of analysis you intend toperform; in this example we'll do a transient analysis)e.Under Option, slect Parametric sweep as shown in Figure 3.4.5.f.For the Sweep Variable, select Global Parameter and enter the Parameter name:Rlval. Under sweep type give the start, end and increment for the parameter. We'llused 250, 1kOhm and 250, respectively (see Figure 3.4.5).g.Click OKFigure 3.4.5: Window for the Simulation Settings of the Parametric Sweep.c. Run Spice and Display the waveforms.a.Run PSpiceb.When the simulation is finished the Probe window will open and display a pop upbox with the Available Selection. Select ALL and OK.c.The multiple traces will show, as given in Figure 3.4.6.d.You can use the cursors to determined specific valueson the traces; you can alsoadjust the axis by double-clicking on the Y and X axes.Figure 3.4.6: Results of the parametric sweep of the load resistor, varying from 250 to 1000 Ohm in steps of 250 Ohm.3.5 AM Modulated Signal (AM Modulation)An Amplitude modulated (AM) signal has the expression,v am(t) = [(A + V m cos(2πf m t)] cos(2πf c t) = A[1 + m cos(2πf m t)] cos(2πf c t)in which a sinusoidal high frequency carrier waveform cos(2πf c t) is modulated by asinusoidal modulating of frequency f m. The modulating frequency can be any signal. For this example we’ll assume it is a sinusoid. The modulation index is called m.To generate a AM signal in PSpice we can make use of the Multiplication function MULT that can be found in the ABM library. Figure 3.51 shows the schematic that generates the AM signal over the resistor R1.Figure 3.5.1: Schematic for the generation of an AM signalThe result of a transient simulation is shown in the figure below. One can also look at the Fourier of the simulated output signal. In the Probe window click on the FFT icon, located on the top toolbar, or go to the PSPICE/FOURIER menu. The Fourier spectrum of the displayed trace will be shown. You can change the X axis by double-clicking on it. Figure 3.5.3 gives the Fourier spectrum with the main peak corresponding to the carrier frequency of 5kHz and two side peaks at 4.5 and 5.5 kHz, indicating that the modulating frequency is 500Hz. You can use the cursors to get accurate readings.Figure 3.5.2: Simulated waveform (transient analysis) of the circuit above, with (A=1V,f m=500 Hz, f c=5kHz and m=0.5)Figure 3.5.3: Fourier spectrum of the waveform of Figure 3.5.2.3.6. Center Tap TransformerThere is no direct model in PSpice for a center tap transformer. However, one can usemutually coupled inductors to simulate a center tap transformer. Figure 3.6.1 shows the schematic of the circuit. We used one primary inductor L1 and two secondary inductors L1 and L2 put in series. In addition we added a K-Linear element.Figure 3.6.1: Circuit with Center Tap Transformer with a ratio of 10:1.After placing the element on the schematic give each element its value. Use for the input voltage a sinusoid with amplitude of 100 V and frequency 60 Hz. Notice that we added a small resistor R1 in series with the voltage source and the inductor. This was needed to prevent a short circuit in DC (Spice would give en error without this resistor). We have kept it small equal to 1 Ohm. Assume that we want to have a step-down transformer with a ratio of 10:1 to each secondary output. The ratios of the inductors L2/L1 and L3/L1 must then be equal to 1/102 (or =sqrt(L2/L1)=0.1). We made L1=1000 and L2-L3=10H.Double-click on the K-Linear element and type under the column headings for L1, L2, L3, the values LP, Ls1, Ls2. When done, click the APPLY button and close the propertieswindow.Go to PSpice/CREATE_NETLIST to generate the netlist. To see the list, go to the Project Manager and double-click on OUTPUTs: file. The netlist looks as follows: * source CENTERTAPTRANSFOR2Kn_K1 L_Lp L_Ls1 L_Ls2 1L_Lp 0 N00241 1000L_Ls1 0 VO1 10L_Ls2 VO2 0 10V_V1 N00203 0+SIN 0V 100V 60 0 0 0R_R1 N00203 N00241 1kR_R2 0 VO1 1kR_R3 VO2 0 1kCreate a new Simulation Profile (Transient) with " Time to run = 50ms". The result is shown in Figure 3.6.2. Notice that the max output is 10V as one would expect from a transformer ratio of 10:1 with an input voltage of 100Vmax.. The two outputs are 180 degrees out of phase.。
[教程]OrCADPSpice培训教材OrCADPSpice是电子设计自动化(EDA)工具之一,它广泛用于电子电路的仿真、分析和设计。
尽管OrCADPSpice经过了许多年的发展,但许多人仍然发现入门困难。
为了帮助初学者更好地理解和使用这个工具,我们提供了OrCADPSpice培训教材,此教材将重点介绍OrCADPSpice如何使用和应用。
一、OrCADPSpice的介绍OrCADPSpice是一种基于模拟器的电路仿真软件。
它的主要功能是实施基于电路的仿真和分析,在设计过程中,它可用于实践布线、元器件选择、测试和验证等。
此外,OrCADPSpice还提供了一组高级分析工具,可用于电路设计的分析和验证。
OrCADPSpice是一种强大的工具,可帮助电子工程师更加高效地设计电路。
二、OrCADPSpice的特点1.直观用户界面:OrCADPSpice的用户界面非常直观。
设计者可以使用简单的鼠标操作来绘制电路图。
这个过程非常简单,并且可以通过拖放的方式快速地完成元件的选择和布置。
2.电路仿真和分析:OrCADPSpice可以帮助设计师模拟、验证和分析电路。
在修复问题时,它还可以提供详细的错误报告,以便更好地理解和纠正电路设计错误。
3.多方面支持:OrCADPSpice支持多种文件格式,这使得用户可以很容易地与其他设计软件进行桥梁。
4.个性化配置:OrCADPSpice提供了一整套个性化配置选项,允许用户调整工具和仿真器以适应他们的特定需求。
三、OrCADPSpice培训教材OrCADPSpice培训教材旨在帮助初学者快速入门,了解OrCADPSpice的各项功能和特性。
这个培训教材将基础教程,模拟器的应用以及OrCADPSpice的高级分析工具等三个部分组成,核心内容如下:1.基础教程基础教程将带领读者从OrCADPSpice软件的安装开始,给出详细的介绍和操作指导,让用户了解如何使用此仿真软件工具。
OrCAD----Capture Featuresz Vendor specific librariesz Integration with all other OrCAD EDA toolsz Netlist interface to other PCB desig1packagesz Cross-probing and bi-directional annotation between schematic and PCB designs.z Integration of company parts database (Capture CIS).z Customized Bill of Materials reportsPSpice FeatureszzzzLayout Featuresz PCBz EDAz(Visual CCAD)z GerbToolzOrCADOrCAD*.opj--*.dsn--*.olb--*.lib--*.mnl--*.max--*.tch--*.gbt--*.llb--PCB*.log *.lis--*.tpl--*.sf--OrCAD1*.olb-Capture*.libPspiceTemplatePSpice*.libPspiceTemplate2*.lib-PSpice Spice Capture3*.llb-PCB Layout OrCAD Layout3000OrCAD Capture----OrCAD--Capture CaptureCaptureCaptureCaptureCaptureSchematicSession LogSchematicCaptureCapture(Options>Preferences)(Options>Design Template)Project(create a design project)Capture Project Project Capture DSN OPJ ProjectProject Capture Projectfile>new>Projectproject Schematic1 Place partCapture Capture CIS Internet Cadence 1Place part place>partpart search...2 (Place wire or bus)Place wire(place bus)place junctionplace bus entry3(place net name)place net alias place net alias aliasOK4(place power or GND)Place power Place GND5CaptureCapturePlace Hierarchical BlockPlace Pin6Place Hierarchical Port(place Off-page connector)()PCBTYPEEdit Properties7(place text)place text...DRCCapture*.DSN1DRC(Design Rules Check)(Tools>Design Rules Check)ScopeCheck entire design DRCCheck Selection DRCModeUse instances(preferred)ActionCheck design rules DRCDelete existing DRC marker DRCReport DRCCreate DRC markers for warningsCheck hierarchical port connectionCheck off-page connector connectionReport identical part referencesReport invalid packagingReport hierarchical ports and off-page connectionCheck unconnected netCheck SDT compatibility SDTReport all net name2 DRCCapture(Tools>Annotate)3 CaptureTools>Update Properties()"{Value}" "PCB Footprint" "74LS00" "14DIP300" "74LS138" "16DIP300" "74LS163" "16DIP300" "8259A" "28DIP600"4Capture Capture 39EDATools>Create Netlist...EDA5Tools>Cross Reference...Tools>Bill of Materials...Line Item DefinitionPlace each part entry on a separateInclude File6File>new>libraryNew partNamePart referencePCB FootprintPart perHomogeneousHeterogeneousAlphabeticNumeric7Part manage (Capture CIS)Capture CISPart ManageType value symbol pcb-footprintODBCCapture CIS"ODBC"" DSN" "DSN"Options>CIS configuration...NEWBrowse...Browse Data SourceOK TablesConfigurationCapture place>database part...(part manage)Tools>Part manager>Update...CISPart Manage123OrCAD\CAPTURE\NETFORMS4521。
Pspice教程(基础篇)Pspice教程课程内容:在这个教程中,我们没有提到关于网络表中的Pspice的网络表文件输出,有关内容将会在后面提到!而且我想对大家提个建议:就是我们不要只看波形好不好,而是要学会分析,分析不是分析的波形,而是学会分析数据,找出自己设计中出现的问题!有时候大家可能会看到,其实电路并没有错,只是有时候我们的仿真设置出了问题,需要修改。
有时候是电路的参数设计的不合理,也可能导致一些莫明的错误!我觉得大家做一个分析后自己看看OutFile文件!点一.直流分析直流分析:PSpice可对大信号非线性电子电路进行直流分析。
它是针对电路中各直流偏压值因某一参数(电源、元件参数等等)改变所作的分析,直流分析也是交流分析时确定小信号线性模型参数和瞬态分析确定初始值所需的分析。
模拟计算后,可以利用Probe功能绘出V o- Vi曲线,或任意输出变量相对任一元件参数的传输特性曲线。
首先我们开启Capture / Capture CIS.打开如下图所示的界面( Fig.1)。
( Fig 1)我们来建立一个新的一程,如下方法打开! ( Fig.2)( Fig.2)我们来选取一个新建的工程文件!我们可以看到以下的提示窗口。
(Fig.3)(Fig.3)我们可以给这个工程取个名字,因为我们要做Pspice仿真,所以我们要勾选第一个选项,在标签栏中选中!其它的选项是什么意思呢?Analog or Mixed A/D 数模混合仿真PC Board Wizard 系统级原理图设计Programmable Logic Wizard CPLD或FPGA设计Schematic 原理图设计接下来我们看到了Pspice工程窗口,即我们的原理图窗口属性的选择。
(Fig.4)(Fig.4)我们在Creat based upon an existing project 下可以看到几个画版工程选项!其中包括:新的空的画版,带层次原理图的画版等等。
OrCAD 培训教材深圳光映计算机软件有限公司——洪永思Capture FeaturesVendor specific librariesIntegration with all other OrCAD EDA toolsNetlist interface to other PCB desig1packagesCross-probing and bi-directional annotation between schematic and PCB designs.Integration of company parts database (Capture CIS).Customized Bill of Materials reportsPSpice Features提供一个对电路进行仿真的环境分析验证你的电路对电路进行参数优化对器件的模型参数进行提取Layout Features提供对PCB板进行设计的环境周到齐全的EDA软件接口功能强大的机械设计环境(Visual CCAD)与制作加工相结合的GerbTool工具功能多样的策略与模板OrCAD的基础知识OrCAD常用文档类型*.opj—项目管理文件*.dsn—电路图文件*.olb—图形符号库文件*.lib—仿真模型描述库文件*.mnl—网络表文件*.max—电路板文件*.tch—技术档文件*.gbt—光绘文件*.llb—PCB封装库文件*.log *.lis—记录说明文件*.tpl—板框文件*.sf—策略档文件OrCAD软件包含的库1、*.olb-Capture专用的图形符号库只有电气特性,没有仿真特性的库。
此类库没有相应的*.lib库,且器件属性中没有PspiceTemplate属性。
能够利用PSpice进行仿真的库。
此类库有相应的*.lib库,且器件属性中有PspiceTemplate属性。
2、*.lib-PSpice仿真库,利用Spice语言对Capture中的图形符号进行功能定义与描述,可以编辑。
OrCAD PSpice 培训教材培训目标:熟悉PSpice的仿真功能,熟练掌握各种仿真参数的设置方法,综合观测并分析仿真结果,熟练输出分析结果,能够综合运用各种仿真对电路进行分析,学会修改模型参数。
一、PSpice分析过程二、绘制原理图原理图的具体绘制方法已经在Capture中讲过了,下面主要讲一下在使用PSpice时绘制原理图应该注意的地方。
1、新建Project时应选择Analog or Mixed-signal Circuit2、调用的器件必须有PSpice模型首先,调用OrCAD软件本身提供的模型库,这些库文件存储的路径为Capture\Library\pspice,此路径中的所有器件都有提供PSpice 模型,可以直接调用。
其次,若使用自己的器件,必须保证*.olb、*.lib两个文件同时存在,而且器件属性中必须包含PSpice Template属性。
3、原理图中至少必须有一条网络名称为0,即接地。
4、必须有激励源。
原理图中的端口符号并不具有电源特性,所有的激励源都存储在Source和SourceTM库中。
5、电源两端不允许短路,不允许仅由电源和电感组成回路,也不允许仅由电源和电容组成的割集。
解决方法:电容并联一个大电阻,电感串联一个小电阻。
6、最好不要使用负值电阻、电容和电感,因为他们容易引起不收敛。
三、仿真参数设置1、PSpice能够仿真的类型在OrCAD PSpice中,可以分析的类型有以下8种,每一种分析类型的定义如下:直流分析:当电路中某一参数(称为自变量)在一定范围内变化时,对自变量的每一个取值,计算电路的直流偏置特性(称为输出变量)。
交流分析:作用是计算电路的交流小信号频率响应特性。
噪声分析:计算电路中各个器件对选定的输出点产生的噪声等效到选定的输入源(独立的电压或电流源)上。
即计算输入源上的等效输入噪声。
瞬态分析:在给定输入激励信号作用下,计算电路输出端的瞬态响应。
基本工作点分析:计算电路的直流偏置状态。
蒙托卡诺统计分析:为了仿真实际生产中因元器件值具有一定分散性所引起的电路特性分散性,PSpice提供了蒙托卡诺分析功能。
进行蒙托卡诺分析时,首先根据实际情况确定元器件值分布规律,然后多次“重复”进行指定的电路特性分析,每次分析时采用的元器件值是从元器件值分布中随机抽样,这样每次分析时采用的元器件值不会完全相同,而是代表了实际变化情况。
完成了多次电路特性分析后,对各次分析结果进行综合统计分析,就可以得到电路特性的分散变化规律。
与其它领域一样,这种随机抽样、统计分析的方法一般统称为蒙托卡诺分析(取名于赌城Monte Carlo),简称为MC分析。
由于MC分析和最坏情况分析都具有统计特性,因此又称为统计分析。
最坏情况分析:蒙托卡诺统计分析中产生的极限情况即为最坏情况。
参数扫描分析:是在指定参数值的变化情况下,分析相对应的电路特性。
温度分析:分析在特定温度下电路的特性。
您对电路的不同要求,可以通过各种不同类型仿真的相互结合来实现。
2、建立仿真描述文件在设置仿真参数之前,必须先建立一个仿真参数描述档,点击或PSpice>New simulation profile,系统弹出如下对话框:Profile的名称调用以前Profile的参数设置输入name,选择Create,系统将接着弹出如下对话框:在Analysis type中,你可以有以下四种选择:Time Domain(Transient):时域(瞬态)分析DC Sweep:直流分析AC Sweep/Noise :交流/噪声分析Bias point:基本偏置点分析在Options选项中你可以选择在每种基本分析类型上要附加进行的分析,其中General Setting是最基本的必选项(系统默认已选)。
3、设置和运行DC Sweep点击或PSpice>Edit Simulation profile,调出Simulation Setting 对话框,在Analysis type中选择DC Sweep,在Options中选中PrimarySweep,如下所示:Sweep variable:直流扫描自变量类型V oltage source:电压源Current source:电流源必须在Name里输入电压源或电流源的Reference,如“V1”、“I2”。
Global parameter:全局参数变量Model parameter:以模型参数为自变量Temperature:以温度为自变量Parameter:使用Global parameter或Model parameter时参数名称Sweep type:扫描方式Linear:参数以线性变化Logarithmic:参数以对数变化Value list:只分析列表中的值Start:参数线性变化或以对数变化时分析的起始值End:参数线性变化或以对数变化时分析的终止值Increment、Points/Decade、Points/Octave:参数线性变化时的增量,以对数变化时倍频的采样点。
例:以自变量为Model parameter为例,对于下示电路,对模型Q2N2222的参数BF进行DC Sweep,参数设置如上图所示,对BF 的值从200分析到300,自变量以线性增长,增量为10。
VDDQ3Q2N2222VEERS21kV212V V3-12VVQ1Q2N2222Q2Q2N2222RBIAS 20k RC210kQ4Q2N2222out1C15pRC110kV1FREQ = 5MEGVAMPL = 0.1V VEEout2VDDRS11k在Simulation Setting 中按OK 按钮退出并保存设置参数。
点击或PSpice>Markers>V oltage Level ,放置电压观测探针,位置如上图所示。
点击或PSpice>Run 运行PSpice ,自动调用Probe 模块,分析完成后,你将可以看到如下波形:BF200250300V(OUT1)5.40V5.45V5.50V波形显示出输出V(out1)与模型Q2N2222的BF 参数变化关系。
对于使用Global parameter 参数,必须在原理图中调用一个器件:Capture\Library\PSpice\Special 库中的PARAM 器件。
然后对PARAM 器件添加新属性,新属性即为一个Global parameter 参数。
如新建一个RES 属性。
调用Global parameter 参数采用在PART 的V ALUE 属性值中输入{RES}进行调用。
4、 设置和运行AC Sweep点击或PSpice>Edit Simulation profile ,调出Simulation Setting 对话框,在Analysis type 中选择AC Sweep/Noise ,在Options 中选中General Settings,如下所示:AC Sweep Type:其中参数的含义与DC Sweep的Sweep Type中的参数含义一样。
Noise Analysis:噪声分析Enabled:在AC Sweep的同时是否进行Noise Analysis。
Output:选定的输出节点。
I/V:选定的等效输入噪声源的位置。
Interval:输出结果的点频间隔。
注意:对于AC Sweep,必须具有AC激励源。
产生AC激励源的方法有以下两种:一、调用V AC或IAC激励源;二、在已有的激励源(如VSIN)的属性中加入属性“AC”,并输入它的幅值。
对于Noise Analysis,选定的等效输入噪声源必须是独立的电压源或电流源。
分析的结果只存入OUT输出档,查看结果只能采用文本的形式进行观测。
例:按上图所设参数进行设置:AC Sweep的分析频率从1Hz到1GHz,采用十倍频增量进行递增,每倍频采样点101。
Noise Analysis 的输出节点为OUT1,等效噪声源的输入源为V1,每隔5个频率采样点输出一次噪声分析结果。
下图是AC 分析结果及在10.23KHz 时的噪声分析结果。
Frequency1.0Hz100KHz 10GHzV(OUT1)0V10V20V5、 设置和运行瞬态分析(Time Domain(Transient)) 点击或PSpice>Edit Simulation profile ,调出Simulation Setting 对话框,在Analysis type 中选择Time Domain(Transient),在Options**** 08/01/00 14:42:37 ********* PSpice 9.1 (Mar 1999) ******** ID# 1090601032** circuit file for profile: TRAN **** NOISE ANAL YSIS TEMPERATURE = 27.000 DEG C ****************************************************************************** FREQUENCY = 1.023E+04 HZ **** TRANSISTOR SQUARED NOISE VOLTAGES (SQ V/HZ) Q_Q1 Q_Q2 Q_Q3 Q_Q4 RB 1.033E-14 1.036E-14 1.699E-15 1.696E-15 RC 1.263E-22 9.911E-23 3.507E-23 3.270E-23 RE 0.000E+00 0.000E+00 0.000E+00 0.000E+00 IBSN 2.389E-17 1.621E-16 1.597E-14 1.313E-14 IC 1.161E-14 1.042E-14 4.525E-15 4.404E-15 IBFN 0.000E+00 0.000E+00 0.000E+00 0.000E+00 TOTAL 2.196E-14 2.094E-14 2.219E-14 1.923E-14 **** RESISTOR SQUARED NOISE VOLTAGES (SQ V/HZ) R_RBIAS R_RC1 R_RC2 R_RS2 R_RS1 TOTAL 2.607E-17 1.530E-16 3.512E-19 1.696E-13 1.699E-13 **** TOTAL OUTPUT NOISE VOLTAGE = 4.240E-13 SQ V/HZ = 6.511E-07 V/RT HZ TRANSFER FUNCTION V ALUE: V(OUT1)/V_V1 = 1.012E+02 EQUIVALENT INPUT NOISE AT V_V1 = 6.432E-09 V/RT HZY 轴为系统增益与AC 信号源幅值的乘积。