4

Click here to load reader

An early introduction to circuit simulation techniques

  • Upload
    lt

  • View
    216

  • Download
    1

Embed Size (px)

Citation preview

Page 1: An early introduction to circuit simulation techniques

I6 IEEE TRANSACTIONS ON EDUCATION, VOL. 36, NO. 1, FEBRUARY 1993

REFERENCES

PSpicr Reference Manual Version 5.0, MicroSim Corporation, Irvine, CA., 1991. D. W. Hart, “Using PSpice for undergraduate design projects in power electronics,” ASEEAnnuul ConJ Proc., pp. 1717- 1720, June 1991. V. Agrawal, A. K. Argarwal, and K. Kant, “A study of single-phase to three-phase cycloconverters using PSpice,” IEEE Trans. Industrial Elect., vol. 39, no. 2, pp. 141-148, Apr. 1992. LJ. Giacoletto, “Simple SCR and Triac PSpice computer models,” IEEE Truns. Industrial Elect., vol. 36, no. 3, pp. 45 1-455, Aug. 1989. M. J. Fisher, Power Electronics.- N. Mohan, T . M . Undeland, and W.T. Robbins, Power Electronics: Converters, Applications, and Design. M. H. Rashid, Power Electronics: Circuits, Devices, and Applicutions. Englewood Cliffs, NJ: Prentice-Hall, 1988.

Boston: PWS-Kent, 1991.

New York: Wiley, 1989.

seven years. His interesl undergraduate education.

Daniel W. Hart (S’69-M’85-SM’92) was born in Woodstock, IL, on January 16, 1948. He received the BSEE degree from Valparaiso University, Val- pariso, IN, in 1970. the MSE and Ph.D. degrees from Purdue University, Lafayette, IN, in 1975 and 1985, respectively.

He is currently an Associate Professor of Elec- trical and Computer Engineering at Valparaiso Uni- versity, where he has been teaching at the under- graduate level for twelve years. Prior to that, he was a design engineer in the power industry for

ts include power electronics, power systems, and

An Early Introduction to Circuit Simulation Techniques

Lawrence T. Pillage, Member, IEEE

Abstracf- Introducing simulation tools such as SPICE at the undergraduate level can sometimes cause the students to lack an appreciation for circuit theory and solving circuits. At the University of Texas, some of our undergraduates question the need to solve circuit problems by hand when SPICE can easily do the job for them. In order to motivate circuit theory, and to instill an appreciation for the limitations of powerful computer aids such as SPICE, we are introducing circuit simulation at the freshman level as part of a pilot course, “Introduction to Electrical and Computer Engineering.’’

b

I . INTRODUCTION

HE capabilities and the availability of circuit simulation T software result in most electrical engineering students using a circuit simulator before they have enough background to understand anything about the inner workings of one. This ease of acquiring circuit solutions can cause the students to lose appreciation for their linear circuit theory course(s). Our experience is that some of the students question the assignment of homework problems which require hand-analyses of circuits since SPICE can solve these problems for them. And, keeping circuit simulators a secret is not possible, since even our freshman have heard of SPICE and its powerful capabilities.

As part of a pilot-project course, Introduction to Electrical and Computer Engineering, we are introducing the freshmen to SPICE and computer-based methods for solving circuits. This introduction is, of course, somewhat superficial; however, it stresses the importance of knowing the underlying circuit analysis techniques, particularly for understanding the limita- tions of these and other software tools. This introduction also

Manuscript received June 1992. This work was supported in part by the

The author is with the Department of Electrical and Computer Engineering,

IEEE Log Number 9202851.

National Science Foundation under Grant USE-9 150505.

the University of Texas at Austin, Austin, TX, 78712.

helps to expose the students to the subject of computer-based problem solving. Namely, it provides practical applications for numerical techniques such as numerical integration and New- ton:s method which are introduced in their calculus courses.

The following sections sketch out our approach to intro- ducing circuit simulation to the freshman at the University of Texas at Austin. First, we address the power of computer- based techniques for solving dc circuits. Then, we can consider numerical approximations for performing transient analysis of circuits which includes an introduction to circuit models, both linear and nonlinear. These circuit simulation topics are covered as part of the introduction to linear circuit analysis in our freshman course. This material also provides a link to other topics in the course, namely, the concept of delay in digital logic, and numerical methods.

11. DC NODAL ANALYSIS

Nodal analysis is perhaps the most popular method for formulating circuit equations, especially when they are formed and solved using a computer. One potential problem with nodal analysis is the perception that voltage sources are not readily handled. And it is desirable to introduce voltage source models to freshman since, unlike current sources, they can easily be related to a physical device (the battery). For circuit simulation, however, voltage sources actually simplify the complexity of the circuit equations solution by eliminating one node voltage variable. In particular, grounded voltage sources are trivially handled by nodal analysis, and therefore, we consider only grounded voltage sources and batteries for the freshman class. The students, however, seem highly motivated to learn nodal analysis once they realize that it is the method used in SPICE.

c

0018-9359/93$03.00 0 1993 IEEE

Page 2: An early introduction to circuit simulation techniques

I

IEEE TRANSACTIONS ON EDUCATION, VOL. 36. NO. I , FEBRUARY 1993 17

Fig. 1. A circuit sample to demonstrate nodal analysis.

First, we explain the manual formulation and solution of nodal equations for a simple circuit. For example, the equa- tions below are the nodal equations for the circuit in Fig. l:

node 1: 711 = 9v node 2: ? R I + I R ~ + I R ~ = 0

02 - U 1 112 - I Q 19 - 1’3

1 ~ 3 - I R ~ = 0

+-+- = 0 R1 R2 R3

node 3: 112 - 713 713 - ‘00

= 0. R3

One possible scenario for solving this set of equations is to solve for the voltage v2 by variable substitution. This can be done by first substituting 1 into 2 to eliminate the variable 111,

then substituting 3 into 2, to eliminate the variable 713.

We are then quick to point out to the students that the steps used in solving for uz are formal enough that they could be done by a computer program. The only “intelligence” that we applied was in deciding that it is easier to first solve for v 3

in terms of v2, then substitute the solution back into node-2’s equation. A computer program can do the same thing if the problem can be formally structured.

Matrix and vector notation is then introduced as the structur- ing that is needed to solve sets of equations on the computer. We demonstrate to the students that the Gaussian Elimination, which places the matrix equations into upper triangular form, is done by manipulating and adding rows (equations) similar to the way in which we substituted the equation for 713 into the expression for node 2. We also go on to show that since the goal is to obtain an upper triangular matrix, some equation orderings are better than others to achieve this goal. When we solved the set of equations by inspection, it was obvious to first solve for 7i3 in terms of 712, then substitute into 2. For the Gaussian Elimination problem we reach the same conclusion by noticing that swapping rows 2 and 3 and swap- ping columns 2 and 3 brings the matrix closer to the upper triangular form prior to performing any elimination steps.

111. A LINEAR RC CIRCUIT MODEL

Transient analysis using SPICE seems to remain a mystery even for our upper-division undergraduate students since they have difficulty relating it to the second-order systems which they solve by hand as sophomores. First, there is some questioning as to why the waveforms are analyzed or displayed for discrete points in time. Secondly, there is confusion over the importance of properly limiting the timestep size which can result in “timestep-too-small’’ errors. To introduce transient analysis we try to use an interesting example which motivates the problem, and in doing so we also introduce the concept of modeling.

time (nanoseconds)

Fig. 2. The switching delay of a CMOS inverter model.

black bpx

t > O

5 0 volts 7 625mA D3 2 5 volts

I i *

Fig. 3. Black box model of an inverter.

Since this material follows a brief introduction to digital logic, simple logic gates, and the concept of capacitance, the transient analysis of a single RC circuit model is used to motivate the concept of delay. A zero to five volt change at the input of the inverter shown in Fig. 2, does not result in an instantaneous change in the output, as shown by the SPICE plot in the figure. This delay is noted as being due to the time it takes for charge to redistribute at the output, which is modeled by the time it takes for the inverter to charge the 5 pF capacitance.

In an attempt to model the switching inverter in Fig. 2 by a linear resistor, we think of it as a “black box,” as shown in Fig. 3. We then measure the inverter’s resistance using SPICE. (This measurement would be even more effective if carried out in the lab if sufficient lab resources are available.) With no load on the inverter we verify the steady state values of the inverter. Then, with a 2.5 volt source at the output of the gate, we measure the gate’s current in order to approximate it’s resistance, as shown in Fig. 3. For the CMOS gate used in our experiment, the current was measured as 7.625 mA, which corresponds to an effective resistance of 3280.

Next, we test our linear model as it compares with the SPICE results in Fig. 2. (The students have already been in- troduced to the solution of a single RC circuit.) The results are shown in Fig. 4. The model captures the general waveshape, but obviously there is some error since we have modeled a nonlinear gate with a linear resistor. The data in Fig. 5 is then generated to show that the gate’s output resistance changes significantly as a function of the output voltage, thereby accounting for the approximation error.

IV. TRANSIENT ANALYSIS

From the example in the previous section, the students begin to appreciate the difficulty in solving complex models, in this case, nonlinear models. Next, we show them that as the problem sizes get bigger, it is more difficult to reach a

Page 3: An early introduction to circuit simulation techniques

18

0 1 2 3 4 5 6

time (nanoseconds)

Fig. 4. Accuracy of the linear resistance model for an inverter.

600 1 I

500

0 400

.$ 300

Oi B

200

100

0 0 5 I I 5 2 2.5 3 3.5 4 4.5 5

Voltage

The variation in the inverter’s “resistance.” Fig. 5.

power suuulv black box

Fig. 6. Inverter model with a nonideal power supply.

closed form solution. To demonstrate the increased complexity for a second-order linear circuit, we consider once again the inverter modeled by the same linear resistor, however, now we consider the output capacitance charging instead of discharging, as shown in Fig. 6. To increase the number of capacitors, we also consider a nonideal power supply model for the inverter (a subject which is addressed earlier in the course when discussing nonideal batteries and voltage sources).

The nodal equations for this circuit result in the following second order differential equation for the voltage at node 3:

We point out that ( 2 ) is a second-order differential equation that cannot be solved by integration as was shown for the case of a single RC circuit equation. Furthermore, we go on to explain that even the powerful Laplace transforms which they will learn about do not provide for general closed form

IEEE TRANSACTIONS ON EDUCATION, VOL. 36, NO. 1 , FEBRUARY 1993

6’

- Inverter - piecewise R-model

0 1 2 3 4 5

time (nanoseconds)

Fig. 7. Piecewise linear inverter model.

solutions for Nth order differential equations with arbitrary input forcing functions. Therefore, we begin to discuss the usefulness of numerical approximations (such as those used in SPICE) to solve large RC circuits.

V. NONLINEAR TRANSIENT ANALYSIS

Finally, we discuss nonlinear models and nonlinear analysis by following on the result that the numerical integration of linear differential equations discretizes the “time” in a circuit simulator. Thus in a circuit simulator, we may still appr6ximate a nonlinear relationship by a linear one, however, we may do it for a smaller range of voltage and current.

As an example, we return to the single resistor model for an inverter shown in the previous section. We refer to Fig. 5 which shows that the resistance actually varied quite significantly over the 5.0-0.00 volt range. For this example, since we know the resistor values as a function of where we are on the output voltage curve, we demonstrate the improved accuracy by using this information.

For the time period from t = 0 until the output voltage drops to 4.5 volts, we might say that the inverter resistance is 541 0 from Fig. 5; therefore, we can solve for the time that it takes this voltage transition as follows:

(3) -11

4 . 5 ~ = 5 u . j tl = .285nS.

The complete results obtained from this piecewise model approximation are shown in Fig. 7.

VI. CONCLUSIONS

In summary, our introduction to circuit simulation tech- niques appears to motivate the students to learn more about nodal analysis, Gaussian Elimination, etc., while also introduc- ing them to the powerful capabilities of SPICE. Although the students do not learn everything that they will need to know about circuit simulation, it is our belief that this introduction to the inner workings of SPICE will give them a better understanding of its overall capabilities, and more importantly, its limitations.

I

i

Page 4: An early introduction to circuit simulation techniques

IEEE TRANSACTIONS ON EDUCATION, VOL. 36. NO. I . FEBRUARY I9Y3 1 Y

Lawrence T. Pillage (M’U-S’X7-M‘W) received the B S E E and the M S E E degrees from the University of Pittsburgh, PA, in 1983 and 1985, respectively He received the Ph D degree in electri- cal and computer engineering from Cdrnegie Mellon University, Pittsburgh, PA, in 1989

He has worked as an 1.C designer dt We\ting- house Research where he dcquired three pdtents He 15 currently an Assistant Professor of electricdl dnd computer engineering at the Universit) of Texds dt

Austin

Dr Pillage holds the Temple Endowed Faculty Fellowship #1 in engineer- ing He is a recipient of Westinghouse’s highest engineering achievement dward In 1991, he recelved the Presidentid1 Young Investigator Award from the Nationdl Science Foundation and the 1991 Best Paper Award for IEEE TRAN~ACTIONS ON CAD In 1992 he received a Technical Excellence Award from the Semiconductor Research Corpordtion His research interests include circuit and timing simulation and VLSI design

KIRCHHOFF: An Educational Software for Learning the Basic Principles and Methodology in Electrical

Circuits Modeling FrCdCric d e Coulon, Senior Member, IEEE, Eddy Forte, and Jose Maria Rivera

Abstract-For most courses in the electrical engineering cur- riculum, proficiency in circuit modeling is a prerequisite. This also holds for related engineering curricula. In this paper we describe an interactive courseware package designed to be used as an auxiliary instructional tool by lower division students. The pedagogical goal of KIRCHHOFF is to foster mastery of basic methodological skills in the study of lumped electrical circuits. For a given circuit layout, proposed by the teacher, this is verified when the circuit has been systematically labeled and when a correct, complete and nonredundant set of algebraic and integro- differential equations has been written down by the student. The purpose of KIRCHHOFF, a symbolic exercising tool, is to provide graphic guidance in such a process and, when needed, give the learner suitable corrective explanations.

I. INTRODUCTION

TUDENTS entering their first course in electrical engi- S neering must master quickly one of the internationally accepted graphical conventions for defining positive currents and voltages. They must also understand that in order to obtain a valid mathematical model of a given lumped circuit, they have to proceed methodically. What we would like them to acquire rapidly is a basic but solid circuit modeling ability: they must learn how to identify the different circuit elements (resistors, capacitors, inductors, sources), to label the required circuit nodes, and to define all the branch currents and voltages. Then, they should proceed to write down the node and loop equations according to Kirchhoff’s lemmas, as well as the integro-differential equations relating each branch voltage to the corresponding branch current [l], [ 2 ] . We are not considering here more advanced network analysis techniques

Manuscriot received June 1992

relying on matrix notations, such as the state variables or the T model methods [ 3 ] .

Beginners are usually somewhat confused by the con- ventions used for defining the arbitrary signs of algebraic currents and voltages. They have not yet mastered the physical integro-differential laws governing time-dependent current- vo!tage relations for ideal capacitive or inductive elements. Furthermore, they lack any methodology and do not yet have rigorous understanding of the concepts of node and loop. Thence, they often come up with wrong equations or an insufficient or redundant set of equations.

In order to help them acquire this know how, which is an ab- solute prerequisite to circuit analysis-either by the classical pencil and paper method or by Computer Aided Design (CAD) techniques-”KIRCHHOFF” a Computer Aided Learning (CAL) software package has been developed at the Swiss Federal Institute of Technology in Lausanne [4]. KIRCHHOFF is not a simulation package but a symbolic, preliminary exercising tool intended for absolute beginners in electrical engineering. It is easy to use, requires no programming knowl- edge and no lengthy training phase, as most of the learner’s moves consist in direct interactions with the circuit’s graphical representation. In the rest of this paper, we shall describe the courseware user interface and go through a typical session. We also present some preliminary assessment data and comment on desirable future enhancements to this first package.

11. USING THE COURSEWARE

A. The User Interface and the Circuit Editor

KIRCHHOFF’s initial main screen displays the library of . .

The authors are with the Computer Aided Learning Laboratory and the Electrical Engineering Department of the Swiss Federal Institute of Technol- ogy (EPFLzEcole Polytechnique FCdCrale), Lausanne, Switzerland.

available circuits, The working Screens are divided into two rectangular regions: the graphics window and the command menu window (Fig. 1). The graphics window (upper and IEEE Log Number 9205775.

0018-9359/93$03.00 0 1993 IEEE