Moeling time-varying storage components in PSpice Dalibor Biolek, Zenek Kolka, Viera Biolkova Dept. of EE, FMT, University of Defence Brno, Czech Republic Dept. of Microelectronics/Raioelectronics, FEEC, Brno University of Technology, Czech Republic fax 973442987- e-mail alibor.biolek@unob.cz- http://user.unob.cz/biolek Abstract The paper escribes a metho of moeling linear non-stationary capacitors an inuctors in PSpice. The capacitance or inuctance is generally varying in time accoring to a law which can be escribe either by an analytical formula or by a set of points, acquire by measurement. This metho is verifie by comparing the simulation results of a sample circuit in OrCa PSpice with the results from Micro-Cap, which enables irect moeling of the time-varying capacitances an inuctances. 1 Introuction The impossibility of a irect simulation of circuits with time-varying capacitors an inuctors belongs to well-known limitations of the PSpice program [1]. This program enables only the moeling of nonlinear polynomial capacitance/voltage an inuctance/current relations [2]. By means of tools of behavioral moeling, general nonlinearities can be moele aitionally on the assumption that the component parameters are time invariant [3]. From this point of view, there is a problem if one nees a transient analysis of parametric circuits in which the storage components vary their parameters accoring to a function of time that is perioical in most cases. This function can be available in the analytical form or as a set of measure points. It is well-known that the common equations v = i, ic = C vc (1) are not true when capacitances an inuctances are time-varying [4]. More complicate equations must be use for such cases: v = ( ( i ) = ( i + i ( (2) ic = ( C( vc ) = C( vc + vc C( However, there are two reasons why the above equations are not a proper starting point for PSpice moeling: 1. They contain the time erivatives of variables an C. While moeling the an C variables versus time via a look-up table, then the piece-wise approximation in PSpice leas to time-iscontinuous erivatives. It can be a source of potential problems uring the simulation incluing the convergence problems. 2. The a C variables as functions of time still appear in the equations. That is why these components cannot be moele by conventional PSpice storage components.
In this paper, a simple proceure is escribe how to overcome both problems, incluing the possibility of efining the initial conitions, i.e. the inuctor current an the capacitor voltage at time. The proceure is vali for linear time-varying an C evices. 2 ( an C( moeling The integration of ifferential equations (2) with subsequent simple arrangement will yiel the equations of time-varying inuctor an capacitor in the integral form: i () i () + t C C = ( v C() v () +, (, vc =, C(. (3a, b) C( It follows from these equations that the inuctor can be moele by a controlle current source an the capacitor by a controlle voltage source. The value of inuctor current at a concrete time instance is given by the initial value of the prouct of current an inuctance, by the integral of voltage, an by the instantaneous value of inuctance. Similarly, the value of capacitor voltage at a concrete time instance is given by the initial value of the prouct of voltage an capacitance, by the integral of current, an by the instantaneous value of capacitance. It is necessary to ensure that neither the capacitance nor the inuctance are zero at any time instance uring the simulation. However, it is a common limitation in the PSpice program. A emonstration of the Spice subcircuit for moeling the inuctor base on Eq. (3a) is in Table 1. The following function is use for moeling the time-varying inuctance: = (1 +.8sin(2π f ), = 1mH, f 5kHz. (4) ( =.subckt inuctor + - params: I=.func (time) {1m*(1+.8*sin(2*pi*5k*time))} gcurr + - value={(s(v(+,-))+i*())/(time)}.ens Table 1: Spice subcircuit for moeling ( accoring to (4). The inuctance is moele via the user-efine function. The inuctor current accoring to (3a) is generate by the G-type current source. The stanar SDT function of PSpice is use to integrate the inuctor voltage. The subcircuit can be calle with the I parameter, which inicates the initial current of the inuctor. A similar subcircuit for moeling the capacitor accoring to Eq. (3b) is in Table 2. For illustration, the time epenence of the capacity is now moele via a look-up table. At time, the capacitance is 5nF, after 1ns it is proportionally increase to 1nF, keeping this value till the time of 1us. Then it falls linearly to 5nF within a time slot of 1ns..subckt capacitor + - params: VC=.func C(time) {TABE(time, +, 5nF, 1ns, 1nF, 1us, 1nF, 1us+1ns, 5nF)} Ec + - value={(s(i(ec))+vc*c())/c(time)}.ens Table 2: Spice subcircuit for moeling the time-varying capacitance by piece-wise-linear function. t i
A rawback of the TABE function consists in the inability of making the time-omain function perioical. This can be overcome by a trick in which the time-varying capacitance or inuctance is moele in PSpice as a signal in the form of voltage or current by an inepenent V- or I- source, associate with the PW attribute. A emonstration is in Table 3..subckt capacitor + - params: VC=.param C 5nF Vc c PW + REPEAT FOREVER + (, {C}) + (1ns, 1nF) + (1us, 1nF) + (1us+1ns, 5nF) + (2us, 5nF) + ENDREPEAT Ec + - value={(s(i(ec))+vc*c)/v(c)}.ens Table 3: Moel of perioically varying capacitance; the look-up table is efine within one repeating perio. 3 Examples of computer simulation et us consier the benchmark RC circuit in Fig. 1. In the first step, the capacitor has a fixe capacitance of C = 7.5nF whereas the inuctance varies in time accoring to formula (4). The transient phenomenon cause by applying the battery is analyze. The initial conitions are as follows: v C () = V an i ()=, 1mA, an 2mA. R out V 1V 1k C Fig. 1: Benchmark circuit with time-varying storage components. The analysis in OrCa PSpice A/D program v. 15.7 using the inuctor subcircuit from Table 1 leas to the results in Fig. 2. The voltage an current waveforms converge to a perioical steay state with a repeating perio of 2µs. It correspons to the frequency of variation of the inuctance values. Since the analytical solution of this circuit is complicate, the simulation results have been compare to those from Micro-Cap program v. 9 [5], in which the moels of time-varying storage components are irectly implemente. In Micro-Cap, two circuits have been analyze simultaneously: the circuit with the utilization of Micro-Cap moels, an the original circuit from PSpice, whose moel bas been exporte into Micro-Cap as a Spice netlist. The results are virtually ientical with small ifferences of less than fractions of percentage points.
4.mA A SE>> -4.mA 1.V I(X:1) V -1.V s 2us 4us 6us 8us 1us V(ou Time Fig. 2: Results of transient analysis of circuit from Fig. 1 for C = 7.5nF an time-varying inuctance accoring to Table 1, for initial conitions i ()=, 1mA, an 2mA. In the next step, the capacitor with C = 7.5nF was replace by a time-varying capacitor accoring to Table 3, when the capacitance is toggle every microsecon between the values of 5nF an 1nF. The resulting waveforms generate by PSpice are in Fig. 3. The agreement with Micro-Cap is again excellent.
4.mA A -4.mA 1.V I(X:1) V SE>> -1.2V s 2us 4us 6us 8us 1us V(ou Time Fig. 3: Results of transient analysis of circuit in Fig. 1 for time-varying inuctance an capacitance accoring to Table 1 an Table 3 an for zero initial conitions. 4 Conclusions An effective metho of moeling time-varying storage components in PSpice is escribe in the paper. The time epenence can be moele by mathematical formulae or via look-up tables, acquire e.g. by measurements. In all the above cases, it is possible to perioize these an C time-omain functions. The metho escribe can take avantage of the transient analysis of a number of parametric circuits whose operation is base on parametric control of storage components.
References [1] PSpice A/D Reference Guie, inclues PSpice A/D, PSpice A/D Basics, an Pspice. Prouct Version 15.7, July 26. In OrCAD_15.7\oc\pspcref\ [2] Vlaimirescu, A. The Spice Book. John Wiley&Sons, Inc., 1994. [3] A Nonlinear Capacitor Moel for Use in Pspice. Application Note, Caence, 1999. http://www.caence.com/appnotes/anonlinearcapacitormoelforuseinpspice.pf [4] Desoer, Ch. A. an Kuh, E.S. Basic Circuit Theory, McGraw-Hill Book Company, 1969. [5] http://www.spectrum-soft.com Acknowlegment This work is supporte by the Grant Agency of the Czech Republic uner grants No. 12/5/771 an 12/5/277, an by the research programmes of BUT MSM216353, MSM2163513, an UD Brno MO FVT43.