SapWin 4.0–A New Simulation
Program for Electrical
Engineering Education
Using Symbolic Analysis
F. GRASSO, A. LUCHETTA, S. MANETTI, M. C. PICCIRILLI, A. REATTI
Department of Information Engineering, University of Florence, 50139, Firenze, Italy
Received 6 February 2015; accepted 26 May 2015
ABSTRACT: The paper presents the main capabilities and the possible applications in the teaching area of Electrical/Electronic Engineering of a software system developed by the authors and aimed at simulating analog linear (or linearized) circuits. The work is the enrichment, enhancement and extension of some programs developed by the same authors along the last two decades and distributed in many schools, institutions, industries, and research centers for different purposes. The feedback (in terms of suggestions, corrections, and improvement requests) has been collected to generate a completely renewed software that could definitely become a really efficient tool in the field of analog circuits, also filling the gap which still exists in the use of very famous and classical circuit simulators (as, for instance, the SPICE family). The application of the past experience involves several courses, as it will be described in the final sections of paper.ß 2015 Wiley Periodicals, Inc. Comput Appl Eng Educ 24:44–57, 2016; View this article online at wileyonlinelibrary.com/journal/cae; DOI 10.1002/cae.21671 Keywords: circuit simulation; CAD; electrical engineering education; power engineering education; symbolic simulation
INTRODUCTION
The circuit theory is a fundamental branch of all the curricula of Electrical, Electronics, and Computer Engineering, both in the Industrial Engineering and Information Engineering areas. At present, in all the Italian Engineering Schools, Circuit Theory is introduced in the basic courses, usually in the second year of First Level (equivalent to Bachelor of Science) of Electrical, Electronics, and Computer Engineering Courses (in some case even in the first year) and then it is recalled and applied in various courses of the following years, of both First Level and Second Level (equivalent to Master of Science), in the programs such as Mechatronics, Power Systems, Automation, Drives and Electrical Machinery, Electronic Filters; this list is of course not exhaustive. All these courses usually cover one of the two semesters included in one academic year.
Over the past two decades, the large diffusion of personal computers, the considerable and fast increase in computing power and the development of simulation programs in several fields of applied sciences has made very common the use of software in supporting teaching process in different stages [1–6]. On the other hand, this kind of software is not always immediate to be exploited inside the previously cited courses, because of several reasons:
in the fundamental courses of the Electrical/Electronics Engineering Schools, using simulators to explain something or showing some result is not always profitable, because it is concrete the risk of“passing over”, and therefore preventing, the real understanding of the phenomenon, of the working principle, of the physical law;
in the advanced courses, where the fundamentals are applied, not always the most common simulation tools are suitable or exhaustive. The most widely used circuit simulator, SPICE [7], in any of its many descendent versions, is very powerful, but being a “numerical” calculation program, it does not allow to obtain and evaluate any aspect of a specific applied problem and in many cases it cannot provide the necessary explanation keys to the teacher
Correspondence to A. Luchetta (luchetta@unifi.it). © 2015 Wiley Periodicals, Inc.
and, consequently, the expected answers to the student; the general purpose simulation packages (i.e., Matlab1 /Simu-link, Mathematica1, Maple1) are very efficient software packages, but often hard to direct apply and use into a 6-9 EU credits course;
at every level of teaching experience, it is a sensitive issue to find the right balance between the theory development and the applied/laboratory experiments in order to take the highest benefit from the available hours and credits. The authors of this paper are directly involved in several basic and advanced courses of Electrical, Electronics, and Information Engineering areas, and, along the last two decades, theyfirst developed, and then used inside their courses, a software package explicitly devoted to the“symbolic simulation” of the electrical circuits, that was named SapWin [8], since the first version of 1995. Now, they repute the right time has come to present in a new paper the many changes, variations and improvements introduced in the program along the last decade.
The paper is organized as follows: Section 2 explains the motivations for developing and upgrading a symbolic simulator and the essential aspects of this approach, the experiences and the previous results, Section 3 briefly describes the new version of SapWin, Section 4 presents its use, detailing application cases in different courses and introducing comparisons with other tools, Section 5 draws the conclusions.
MOTIVATION AND SYMBOLIC APPROACH
As underlined in the introduction, the simulation tools are of great importance today, not only in the industry, but also in education (on the other hand, students of today are the project engineers of tomorrow). In the field of our interest, SPICE constitutes a standard also in many educational experiences [9–12]. There is no doubt that, for many advanced applications, SPICE family is a very good tool for testing what the student has learned in a theoretical way, or through analytical formulations. This is true, for sure, for exercises proposed in the courses of Applied Electronics, Industrial Electronics, Electrical Power Circuits, etc.
On the other hand, SPICE family simulation programs are totally based on algorithms that provide a “translation” of the circuit to the numerical form, since thefirst step and for any kind of element (static or dynamic, linear or nonlinear, passive or active), and then the application of techniques suitable to the iterative numerical solution [13]. The“symbolic” associations among the circuit parameters are lost just in the moment when the simulation starts thefirst step. In order to fill this gap, some work has been done over the years in the scientific community, in particular between 90s and 2000s years, by means of Conferences like IEEE-SMACD (Symbolic Methods and Applications for Circuit Design), Special Sessions of IEEE-ISCASs (International Symposium on Circuits And Systems) or IEEE-ECCTDs (European Conference on Circuit Theory and Design), post-graduate dissertations [14], books [15–17]. Along these years and in conjunction with these events, several efforts have been done to produce and disseminate software tools for symbolic simulation, both powerful and commercial [18–19] and more simple and free [20,21]. On the other hand, the characteristics of these products were not easily transferable in educational use. Sometimes these packages have not been maintained over the
years and became obsolete with respect to the hardware, sometimes they were explicitly designed for the industry and not suitable for educational use, often they relied on general purpose commercial programs (Excel, Matlab, Mathematica, Maple) that made them not autonomous.
For all these reasons, in the opinion of the authors, there is room for maintaining our past programs and also for further work in thefield of symbolic simulation, primarily in two areas:
The applications of these techniques to the design, identification and diagnostic of some particular class of analog circuits, which have not a“full” integration, i.e. DC/DC converters [22],antennas modules [23], etc. The use in educational environment, to teach general
aspects of Circuit Theory and to deepen the understanding of the above systems.
The second point, which is the main motivation of this paper, is also supported by the feedback from colleagues of the Electrical Engineering teaching area, who reported what has been the SapWin impact on the work in the class and laboratory. In order to collect and exploit these opinions, a questionnaire has been sent to and compiled by some of the colleagues who used SapWin during the last years. Another questionnaire has been submitted to a class of students who are using SapWin (in the Course of Electrical Machines and Drives). The “teacher” survey results are shown in the Table 1. This survey contains two indications:first, the use of a symbolic simulator for analog circuits as SapWin“results” in a concrete improvement in the quality of a course; second, the simulator deserves to be, in turn, improved. It is important to emphasize that the majority of respondents find a symbolic simulator an effective tool to improve the various components of an Electrical Engineering Course. In particular, a high percentage of respondents believes the software useful in class exercises, and almost the totality thinks it is very useful in the activity of laboratory, both to prepare and to understand the proposed experiences. The “student” survey results are shown in the Table 2. This survey exhibits the same trend of the one compiled by teachers, also if it is a bit less optimistic and positive, but this is probably due to the fact that, while in the first case the teachers represent a historical sample, students are taken from a class in which the software has been used for a not very extended time.
The answers to the questionnaires, together with the single suggestions, observations, corrections received by the colleagues, have contributed, and continue to contribute to the development of the software, in the direction of adding to the program further capabilities, correcting some bugs and errors of the previous versions, optimizing the simulation engine algorithms.
SapWin
A synthetic description of the program is given in the following.
History of SapWin
Since from the early ’90s some of the authors of this paper developed a seminal version of a simulation program, named Sapec, coded in LISP for the simulation engine part and in C for a very simple schematic entry in MS-DOS. In 1995, SapWin 1.0 for Windows (3.1 edition) was released and made available for free use; it was entirely written in Cþþ and used a simulation engine
based on a matricial Laplace recursive algorithm. After some minor modifications, in 2002 SapWin 3.0 brought a substantial change with the introduction of a new interface and of the more efficient simulation algorithm.
Implementation of SapWin
SapWin is an integrated package of schematic capture, symbolic analysis and graphic post-processing for analog circuits. It is completely coded in Cþþ language and its simulation engine is based on a two-graph method [24,25], enhanced by authors [26].
SapWin Features
The description of the circuit is given by means of a SPICE-like netlist or directly inside the schematic editor of the program, which then performs a translation of the schematic diagram into an ASCII netlist. The schematic entry is drawn over an initially blank table. All the standard two-terminal or two-port elements can be taken from a component list. The available devices are:
resistor (both in resistance or conductance representation); inductor;
capacitor;
independent ideal sources; the four types of controlled sources; ideal transformer;
mutual inductance; ideal operational amplifier;
MOSFET (gm-model) with parasitic capacitances; BJT (hybrid or Giacoletto model);
ideal switch/diode element (for DC/DC converters); sub-circuits can be created by the user as a two-port
combination of previous components.
The schematic of the circuit must be provided with at least one ground connection. The circuit under simulation must also include at least one output probe (voltage or current) in order to set up the simulation. In the same editor it is possible to create and save sub-circuit diagrams. Each component of a subcircuit can be made symbolic or not, editing the component properties. The simulation generates two different outputfiles, in binary format, which can constitute an interface to other programs, and in ASCII format. The ASCIIfile contains the resulting expression of the simulation in the Laplace/frequency domain.
The output of the simulation engine can be elaborated also in a graphical way, to obtain different diagrams:
magnitude response; loss; phase response; time delay; poles/zeroes; step response;
Table 1 Teacher Questionnaire Responses
How frequently have you used the program SapWin in teaching?
0 (Never) 1 2 3 4 5 (Often) (1) 6.7% (3) 20.0% (0) 0.0% (2) 13.3% (5) 33.3% (4) 26.7% If you used SapWin at least once, have you found an improvement in the degree of student understanding of the topics covered?
1(Not at all) 2 3 4 5 (Evident) (0) 0.0% (1) 7.1% (3) 21.4% (4) 28.6% (6) 42.9% If you used SapWin at least once, have you found an increase of the evaluation rating for the students involved in the use of software? 1 (Not at all) 2 3 4 5 (Evident)
(0) 0.0% (0) 0.0% (5) 35.7% (6) 42.9% (3) 21.4% If you used SapWin to prepare exercises and/or tests (for lessons, laboratory, exams), have you found it useful to this purpose? 1 (Not at all) 2 3 4 5 (Evident) (0) 0.0% (1) 7.1% (0) 0.0% (3) 21.4% (10) 71.4% Based on your opinion and experience, is it easy to train students to use SapWin?
Not at all (it would require more than 6 hours inside the course) (0) 0.0% It is easy (less than 2 hours of lessons) if the teacher merely explains the basic functionality (5) 33.3% It is easy (less than 2 hours of lessons) for a good comprehension of all the functionalities of the program (8) 53.3% I have never used SapWin during lessons, but I think it would be easy to train the students to use it (2) 13.3% I have never used SapWin during lessons, and I think it would not be easy to train the students to use it (0) 0.0% Based on your opinion and experience, can SapWin help in the resolution of exercises?
Not at all (it is not suitable for this task) (0) 0.0% SapWin can help in understanding and solving only exercises of introductory level (1) 6.7% SapWin can help in understanding and solving only exercises of advanced level, not for the comprehension of basic concepts (2) 13.3% SapWin can help in understanding and solving exercises both of introductory and advanced level (10) 66.7% I have never suggested students to use SapWin for resolution of exercises, but maybe I will do it in future, because I think it can help
them in this task
(2) 13.3% I have never suggested students to use SapWin for resolution of exercises, because I think it is not useful in this task (0) 0.0% Based on your opinion and experience, can SapWin help during the electrical circuit laboratory experiences?
Not at all (it is not suitable for this task) (0) 0.0% SapWin can give a little help to the teacher in describing laboratory experiments (0) 0.0% SapWin can give a good help both to teacher and students in describing, understanding and elaborating laboratory experiments (11) 73.3% I have never used SapWin for laboratory, but maybe I will do it in future, because I think it can help in this task (4) 26.7% I have never used SapWin for laboratory, because I think it is not useful in this task (0) 0.0%
impulse response;
relative sensitivity (of magnitude and phase).
Algorithms for pole/zero calculation and for the inversion of the network function to obtain step and impulse response can be found in [27]. Algorithms for sensitivity calculation can be found in [28]; it is interesting to underline that these algorithms too take a great advantage from the symbolic form of the network function. When a diagram is visualized in the window, it is also possible to add an X–Y cursor to evaluate the numerical values on the diagrams. The simulation result is given in the Laplace domain, or alternatively in frequency domain.
A New Version of SapWin (4.0)
The new version of SapWin, which has been developed and deployed, contains all the previously mentioned features and includes many substantial changes or additions, among them:
1. Renewed and modernized interface;
2. The possibility of calculate multiple responses and network functions over the same circuit;
3. The calculation of parametric sensitivity of the outputs; 4. The possibility of different output formats, in particular
Matlab;
5. The possibility to repeat very quickly multiple simulations (Monte Carlo style) with a random and established variation of some or all circuit elements.
Many other minor modifications have been done, moreover, following an already adopted philosophy, continuous work is done
“in progress”, with modifications and additions (like zoom, cursors, differential outputs, several output formats, and many others).
APPLICATION OF SapWin IN COURSES
SapWin can have multiple applications, as previously mentioned, but here we are interested in exploring the educational aspects of the program. For this reason, in the next paragraphs, different course examples, both basic and advanced, are proposed.
Power Electronics Circuit Course: A PWM DCM Boost Converter Simulation
A PWM DC–DC power converter switches high voltage and currents in very short times. This makes several numerical simulators to have convergence problems that stop the simulation after it is running for a certain time. Often, these problems are overcome by reducing the simulation accuracy. Moreover, students often complain about time-wasting and useless efforts they spend in using standard numerical simulators, which often result in inaccurate output if an inappropriate power device model is selected among the program libraries.
These problems are overcome if SapWin is used because it is based on numerical solution of a symbolic function instead of numerical approximations of circuit waveforms and, therefore, it results in fast and accurate simulations and convergence problems are drastically reduced. Students using SapWin take advantage of this and they have stopped complaining on convergence problems and long simulation times. They also take advantage of the new features introduced in SapWin 4.0,
Table 2 Student Questionnaire Responses (Electrical Machines and Drives Course) How frequently have you used the program SapWin?
0 (Never) 1 2 3 4 5 (Often) (2) 8.3% (11) 45.8% (6) 25.0% (4) 16.7% (1) 4.2% (0) 0.0% If you used SapWin at least once, have you found an improvement in your understanding of the topics covered?
1 (Not at all) 2 3 4 5 (Evident) (3) 12.5% (5) 20.8% (9) 37.5% (5) 20.8% (2) 8.3% Is it easy for you to learn the use of SapWin?
Not at all (0) 0.0% It is easy if one merely requires explanation on the basic functionalities (12) 50.0% It is easy for a good comprehension of all the functionalities of the program (10) 41.7% I have never used SapWin, but I think it would be easy to be self trained (0) 0.0% I have never used SapWin, and I think it would not be easy to be self trained (2) 8.3% Can SapWin help you in exercise resolution?
Not at all (it is not suitable for this task) (1) 4.2% SapWin can help in understanding and solving only exercises of introductory level (8) 33.3% SapWin can help in understanding and solving only exercises of advanced level, not for the comprehension of basic concepts (4) 16.7% SapWin can help in understanding and solving exercises both of introductory and advanced level (7) 29.2% I have never thought using SapWin for resolution of exercises, but maybe I will do it in future, because I think it
can help in this task
(4) 16.7% I have never thought using SapWin for resolution of exercises, because I think it is not useful in this task (0) 0.0% Does SapWin help you during your laboratory experiences?
Not at all (it is not suitable for this task) (0) 0.0% SapWin can give a little help in describing laboratory experiments (9) 37.5% SapWin can give a good help in describing, understanding and elaborating laboratory experiments (10) 41.7% I have never used SapWin for laboratory, but maybe I will do it in future, because I think it can help in this task (4) 16.7% I have never used SapWin for laboratory, because I think it is not useful in this task (1) 4.2%
e.g., the multi-parametric analysis is very useful in studying and designing the feedback loop of DC–DC power converters where load variations and component tolerances drastically affect the dynamic operation of power converters and their stability. The possibility to have multiple outputs such as voltages in different nodes inside a power converter, currents in different branches and/or currents and voltages related to certain components allows for a better understating of the converter operation. This helps both teachers during lessons and students in the learning process.
Since practical operation of DC–DC power converters is largely affected by parasitic components, they must be considered in the frequency domain analysis. However, this makes the expressions of the converter transfer functions to be cumbersome and they cannot be easily derived. A simulator of DC–DC converters that uses a symbolic approach like SapWin is something totally new and students take advantage of this. An example is given by introducing the simulation of a PWM DC–DC boost converter. A boost converter as shown in Figure 1, designed under the following design specifications, has been simulated and experimentally tested: VI¼ 10 V, VO¼ 20 V, IO¼ 1 A, R ¼ 20 V, fs¼ 50 kHz. An operating duty cycle D ¼ 0.4 has been assumed along with D1¼ 0.4. To achieve a DCM operation of the converter an inductance L¼ 9.45 mH has been designed and assembled. Parasitic resistances of the circuit are also shown in Figure 1 and its equivalent circuit in Figure 2 includes the switch/diode cell equivalent circuit. The resulting inductor equivalent resistance was rL¼ 22 m V and an output voltage ripple of 5% at the nominal output current was achieved with an output capacitance C¼ 440 mF with an equivalent series resistance rC¼ 100 m V. A IRF840
power MOSFET has been utilized as a controlled switch; this device results in a conduction channel resistance rDS¼ 1.2 V. A ultrafast-recovery power diode MUR420 with a threshold voltage VF¼ 0.7 V and a forward resistance rF¼ 194 mV has been used. For the considered circuit, the switching cell averaged voltages, including parasitic components, were VSL¼ 7.25 V and VDL¼ 12.75 V, respectively.
From [29], the parameters of the switching cell equivalent circuit were calculated as:
ki¼ D VI rIO DþDD11 VFDDþD11 h i LfS ; ri¼ 2LfS D2 ¼ 5:906 V; ko¼ D VI rIO DþDD11 VFDDþD11 h i2 LfS VO VIþ rIO DþDD 1 1 þ VFDþDD1 1 h i ; gm¼ D2 V I rIO DþDD11 VFDDþD11 h i LfS VO VIþ rIO DþDD11 þ VFDDþD11 h i and ro¼ 2LfS VO VIþ rIO DþDD 1 1 þ VFDþDD1 1 h i2 D2 V I rIO DþDD11 VFDDþD11 h i2
where, including parasitic components D1¼ 2ILLfS D 1 VI VO raveIO VFDþDD1 1 D ¼2ILLfS D 1 VI VO raveIL VFDþDD1 1 D Numerical values of the cell equivalent circuit parameters are: ki¼ 6.141 A; ri¼ 5.906 A; ko¼ 4.495 A; gm¼ 0.193 A/V; ro¼ 12.746 V
Given the formulas for parasitic resistances, the averaged equivalent resistance to be considered connected in series to inductor L is:
Figure 1 Boost DC-DC converter circuit including parasitic resistances.
rave¼ rFLaveþ rFDSaveþ rFave¼ 4 3 1þ D þ D1 Dþ D1 ð Þ2 ¼ 1:197V As known, the frequency domain behavior of a PWM DC– DC converter is given by four s-domain transfer functions, as follows: the control-to-output transfer function Tp(s), the input-to-output transfer function Mv(s), the input impedance Zi(s), and the output impedance Zo(s).
Manual derivations of the four transfer functions and their expressions were presented in [29]. In the lesson, the analytical expressions and curve plots of the four transfer functions have been derived using SapWin. Figure 2 shows the small-signal equivalent circuit of a boost converter utilized in SapWin to derive the control-to-output transfer function. All voltage-controlled current-sources (VCCS) must be identified with names with H as afirst letter inside the program, sources HKi and HKoare driven by the converter duty–cycle and, therefore, their positive control terminals are connected to an independent voltage source representing the ac component of duty cycle. The
controlled current sources HKi, HKo, and Hgmin Figure 2 take into account coefficients ki, ko, gm, and,finally, resistances RI and RO correspond to ac model resistances ro and ri, respectively.
Figure 3 shows the symbolic expression of the circuit control-to-output-transfer function relevant to the boost converter equivalent circuit shown in Figure 2, as it is derived by SapWin.
The magnitude plot of the Tp expression, reported in Figure 4, shows that a 0 dB value occurs at 1.1 kHz. Proceeding in the same way poles and zeros of the real equivalent circuit Tp are easy to calculate. The equivalent circuit results in two poles (p1¼ 274.34 and p2¼ 1.48 106) and one zero z1¼ 2.27 103.
Electronic Filter Course: A Case Study
In the Electronic Filter Course, the SapWin program is mainly used for evaluating symbolic network functions and sensitivity, one of the new capabilities: in fact the efficiency of SapWin 4.0 in
Figure 3 Boost converter control-to-output transfer function symbolic expression derived by SapWin.
performing these operations makes it extremely attractive with respect to other programs, such as SPICE and Matlab. However, these are not the only applications; the gain constant adjustment of active RCfilters is another very interesting issue that SapWin can handle.
Suppose the following low-pass transfer function must be synthesized:
T sð Þ ¼ 20000 s2þ 100s þ 10000
A possible low-passfilter is that of Sallen and Key, whose schematic is shown in Figure 5A, together with the symbolic
transfer function generated by SapWin. For example, by setting C1¼ C2 ¼ 0.1 mF, R1 ¼ R2 ¼ 100 k V, R4 ¼ R3 ¼ 10 k V, SapWin is able to plot thefilter gain, as shown in Figure 5A, the pole/zero diagram and the sensitivity to C1 of the magnitude response, as shown in Figure 5B. A frequency scaling of the gain, by a factor 10, is also shown in Figure 5B. It is obtained by dividing all the capacitance values by 10. It is interesting to observe that it is not necessary to analyze again the circuit, but only to vary the capacitance values in the evaluation of the gain starting from the symbolic transfer function given by SapWin. By applying the frequency scaling technique, students can easily understand that it is not necessary to determine again circuit parameter values if the frequency characteristics are scaled with respect to an already
Figure 5 Sallen and Key low-pass filter: (A) schematic, symbolic transfer function and gain; (B) pole/zero diagram, magnitude response sensitivity to C1 and frequency shift of the gain.
realizedfilter design. Using SPICE it is not so easy to scale in frequency thefiltering features, because it is in any case necessary to repeat the whole simulation for every scaling factor.
Suppose now to modify the multiplicative constant of the transfer function by a factor two, that is consider this new transfer function:
T sð Þ ¼ 40000 s2þ 100s þ 10000
Two gain enhancement techniques can be used, one approximate and one exact. The approximate technique is very easy and consists in adding a voltage divider network (R5–R6) at the operational amplifier output, as shown in Figure 6A, where also the symbolic transfer function is reported.
Obviously this function is different with respect to the original Sallen and Key low-passfilter, but it reduces again to it when R6 is set to zero. If R6 is zero, R5 can take any value without affecting the transfer function, because it is connected to the operational amplifier output. In order to increase the transfer function by a factor two, the ratioR5þR6
R5 must be equal to two, that is, more in general, it has to equate the desired scaling factor. However the introduction of the resistances R5 and R6 affects the entire behavior of the circuit, beyond the mere doubling of the multiplicative constant. The effect of equating the desired scaling factor is obtained only if R5 and the parallel R5//R6 are small compared to the impedance Z of the RC network seen by R5. In fact, if Z is not large compared to R5, the two resistors R5 and R6 do not realize the desired voltage
Figure 6 Sallen-Key low-pass filter modified for the gain adjustment: (A) schematic, symbolic transfer function and parametric gain; (B) pole/zero diagrams for two different values of R5 (10000V and 10 V) and R6 (0 V and 10 V).
divider network. Furthermore, if Z is not large compared to R5// R6, its amplitude is affected by the values of R5 and R6 and this negatively influences the transfer function, whose deviation from the ideal value grows when Z approaches R5//R6.
Then this gain enhancement technique is applicable only if R5 and R6 are suitably chosen, that is the resistance values must be small, but not so small that the maximum deliverable current of the operational amplifier overcomes its upper limit. Furthermore, it is applicable when the gain enhancement is of the order of the unity or at most few tens. The choice of the suitable resistance value is not a trivial operation, and SapWin can be helpful in this respect. It is in fact sufficient to evaluate the gain for different resistance values; this requires just a single run, that is it is not necessary repeating the simulation for the different gain values. In the case under
consideration, where R5 and R6 share the same value, the gain can be enhanced by a factor two. SapWin allows to plot the gain in a parametric form, so in Figure 6A the gains relevant to R6¼ 0 (original Sallen and Key low-passfilter) and R6 ¼ R5 ¼ 100 V are drawn together. As it can be noted, the increase of 6 dB is guaranteed until about 1,500 rad/s. Beyond this value, the two gains start to differ. Comparing parametric plots, it could be verified that, when R5¼ R6 ¼ 10,000 V, the gain is not enhanced by 6 dB, because the resistances are too large; when R5¼ R6 ¼ 10 V, the behavior is better with respect to the case of R5¼ R6 ¼ 100 V.
In Figure 6B the pole/zero diagrams for two different situations are shown. Thefirst diagram is relevant to the original Sallen and Key low-passfilter, the second diagram is relevant to the case where R5¼ R6 ¼ 10 V; the presence of two undesired
Figure 7 Sallen-Key low-pass filter modified for the gain adjustment, with real operational amplifier: (A) schematic and symbolic transfer function; (B) gain and pole/zero diagram (R5¼ R6 ¼ 0.001 V).
zeros at very high frequencies can be spotted looking at the drawing. However these zeros are very far from the poles, so their effect is negligible even at frequencies much higher than the cutoff. As the value of R5 and R6 increases, the zeros get closer to the poles, until when their effect can no longer be neglected, and their influence grows with R5 and R6. This could be easily confirmed by the pole/zero diagrams relevant to the cases R5¼ R6 ¼ 100 V and R5 ¼ R6 ¼ 10,000 V. In the simulations the operational amplifier is considered ideal. This implies that a reduction in the values of R5 and R6 is beneficial for the circuit, that is the gain enhancement of 6 dB is guaranteed for a larger frequency range, in contrast with the above consideration. This is not surprising, being an obvious consequence of the operational amplifier ideality, more specifically the unrealistic lack of limitation for the maximum current. If a model nearer to reality is considered, as, for example, a voltage controlled voltage source with a large control parameter and finite nonzero resistances, the correct behavior will certainly be obtained. Such a model for the operational amplifier is used for the circuit whose schematic and symbolic transfer function are shown in Figure 7A. It could be easily verified that the pole/zero diagrams and gains for R5¼ R6 ¼ 100 V and R5 ¼ R6 ¼ 10,000 V are identical to the cases with ideal operational amplifier. In Figure 7B the pole/zero diagram and gain for R5¼ R6 ¼ 0.001 V are shown: in this case the resistance values are too little and the behavior deviates from the desired one. The possibility to obtain pole/zero diagrams, also in parametric form thanks to the new version of SapWin, is a very important characteristics, absent in many other simulation programs, as for example SPICE. In fact it allows the student to immediately understand the voltage divider network influence, hence helping the teacher in its educational role. The exact gain enhancement technique consists in the insertion of a capacitor and a resistor in the circuit. The capacitor must be connected to the feedback capacitor and the resistor must be connected to the feedback resistor.
The new capacitance and resistance values must be suitably selected and the feedback capacitance and resistance values must be suitably modified, in such a way that the partition of the capacitance and resistance values equates the inverse of the gain enhancement factor. Further-more the parallel between the new components and the feedback ones must equate the corresponding original capacitance and resistance values. The schematic of the Sallen and Key low-pass filter modified in this way is shown in Figure 8. As it can be noted from the symbolic network function, pole/zero diagram and gain, in this case the gain enhancement of a factor two is exactly obtained without the introduction of finite zeros in the transfer function. The resistors R5 and R6 in the circuit must have a partition value equal to 0.5 and a parallel value equal to 10,000V, then their resistances are equal to 20,000V. The capacitors C1 and C3 in the circuit must have a partition value of 0.5 and a parallel value equal to 0.1mF, then their capacitances are equal to 0.05mF.
As the example has shown, the use of the program SapWin can help to better understand the characteristics of each technique with a little number of simulations, taking advantage from the availability of symbolic transfer functions.
Drives and Machines Course: Stability Analysis of DC Motor
In this example, the stability analysis of a separately excited DC motor is evaluated [30]. The objectives are to implement the SapWin model of a DC motor and to use, for the stability analysis, time domain analysis, frequency domain analysis and pole/zero analysis using state space averaging technique. Although SapWin does not provide explicit models for electro-mechanical devices, like a DC motor, creating one is simple and straightforward. In fact, most physical behaviors, whether mechanical or electrical,
Figure 8 Modified Key low-pass filter: schematic, transfer function, pole/zero diagram and gain of the Sallen-Key low-passfilter modified for the gain adjustment.
can be described by a set of equations. For a desired mechanical action (inertia, friction, etc.), it is possible tofind an equivalent electrical circuit (consisting of inductance, resistance, etc.) described by analogous equations.
To obtain the electrical equivalent model of a DC motor, we consider the real system, reported in Figure 9. On the electrical side of the DC motor, a current iaflows through the armature according to the amplifier’s drive voltage va, the motor’s inductance La, resistance Raand the back emf voltage eg.
va eg¼ La dia
dt þ Raia eg¼ Kgv
In SapWin these components are represented by Va, Ra, La, and Y_Eg. The motor converts the electrical armature current into a mechanical torque applied to the shaft:
Tdð Þ ¼ Jt dv
dt þ Bv ¼ KTia
where, J is the equivalent moment of inertia of motor and load referred to motor shaft, B is the viscous friction constant and K is the torque constant. However, because inertia and friction don’t exist in SapWin, it is possible to consider the electrical equivalent circuit of the mechanical part of equation above as an RL series circuit, described by:
vTorque¼ LJ di2
dtþ Rbi2¼ Kia
Then, the torque Tdð Þ can be obtained by using a currentt controlled voltage source (CCVS) and the components Lj and Rb act as the motor mechanical inertia and friction.
Finally, considering that the angular position is the integral of velocity, it is possible to obtain the position considering a copy of the current i2 (equivalent of the velocity v) and feed it to a capacitor Cposwhere it is integrated to get a voltage representing the motor shaft’s angular position u. In this sense, the equivalent electrical circuit of a DC motor is shown in Figure 10. The parameter values are:
Ra¼ 0:5V;La¼ 1:5mH; KT¼ 0:05Nm=A; J ¼ 0:00025kgm2; B¼ 0:0001Nms=rad; Kg ¼ 0:05Vs=rad: In few steps it is possible to obtain the numerical form of the transfer function between the engine speed and the input voltage:
v ang pos¼ 1:3333e þ 05 þ1
s3þ 333:73s2þ 6800s þ 0:0068 Now, by using the Routh–Hurwitz criteria, it is verified that the system is stable. In fact, all the elements of thefirst column of the Routh array are positive. In addition, it is possible to obtain the magnitude/phase and the pole/zero plots of the transfer function (Fig. 11). Starting from these results, it is also possible to develop the control analysis of DC motor by using any of the well known techniques [30].
Figure 9 Equivalent circuit of separately excited DC motor.
Previously, to explain the consequences of a parameter change on the poles and zeros of the transfer function, it was necessary to make various simulations with PSPICE or set up a complicated parametric analysis with Matlab. Students were forced to spend several hours in computer labs to get the required results for homework. By implementing these simulations in SapWin, students can compare the result of simulation and experimentation in a very short time. The interactive experiments help the students to understand the concept of stability in electrical
machines. The results illustrate the efficacy of the software and the methodology in improving students’ technical skills and motiva-tion towards experimental work. Also in this case, it is important to underline as all these steps can be visualized, explained, and executed in “real time”, during a single lesson of the course, without any previous setup that would be required if different kind of already cited tools (SPICE, Matlab, etc.) were used.
Basic Circuit Theory Course
The usefulness of SapWin in teaching is not limited to complex circuits, but it is extended also to simple configurations, as, for instance, resonant circuits, which are paradigmatic circuits, often used in basic Circuit Theory courses to highlight many general proprieties.
In Figure 12 a basic configuration of a parallel resonant circuit is shown. The teacher (and the student), after the description of the circuit, theoretical development and physical interpretation, can easily draw the schematic diagram of the circuit with the components and connections and rapidly calculate the network function in frequency domain and any of the previously described responses, in analytical (numerical, symbolical or semi-symbolical) or graphical form. Then each student can have the immediate visualization and perception of what has just been explained. It should be underlined that in basic courses the possible alternatives for the representation and simulation of circuits are particularly hard to use. In fact, the classic analog circuit simulator SPICE is very powerful, but in a Circuit Theory course (frequently situated in the second semester offirst year of a BS degree Course) it requires a too long teaching time to make the student able to gain insight of it. Moreover, no evident correspondence is given between the circuit and the transfer function, that is one of thefirst important concepts that a student must associate to a circuit. On the other hand,
Figure 11 Frequency gain (A) and pole/zero (B) plots of position transfer function.
still harder could be to use in this kind of courses a general purpose mathematical simulator (like Matlab, Maple, Math-ematica, etc. . .).
CONCLUSIONS
In this paper, the last version of the program SapWin, for the symbolic simulation of analog circuits, is described, with a particular attention to the possible and useful applications in education, as a powerful teaching/learning tool in all the courses related to the Electrical Engineering area. It is highlighted along the paper as this tool, still keeping a good simplicity in the use, offers a set of unique tools able to greatly potentiate the teaching ability of the educator. The positive results in the use of this program are demonstrated in two different ways:first, reporting the answers of two surveys, submitted to a sample of teachers in the area of electrical engineering and to a class of students of the same area; second, several examples of use in the class or laboratory are given, highlighting all the steps where the use of the program is essential and introducing a continuous comparison with other tools which could be used, in particular SPICE. At present, the program is available for downloading, installing and registering in beta version via the website www.sapwin.info.
REFERENCES
[1] J. Zueco, An electric simulator to solve education engineering problems influid mechanics, Comput Appl Eng Educ 21 (2013), 748– 757.
[2] Z. Stanisavljevic, V. Pavlovic, B. Nikolic, and J. Djordjevic, SDLDS —System for digital logic design and simulation, IEEE Trans Educ 56 (2013), 235–245.
[3] M. Billaud, D. Geoffroy, P. Cazenave, T. Zimmer, and N. Lewis, A distance measurement platform dedicated to electrical engineering, IEEE Transac Learn Technol 2 (2009), 312–319.
[4] N. Rutten, W. R. Van Joolingen, and J. T. van der Veen, The learning effects of computer simulations in science education, Comput Educ 58 (2012), 136–153.
[5] K. Kayisli, S. Tuncer, and M. Poyraz, An educational tool for fundamental DC–DC converter circuits and active power factor correction applications, Comput Appl Eng Educ 21 (2013), 113– 134.
[6] A. M€using, U. Drofenik, and J. W. Kolar, Circuit simulation applets for online education in power electronics, In: Proc. of the 5th IEEE International Conference on E-Learning on Industrial Electronics (ICELIE 2011) Melbourne, Australia, 2011, pp 70–75.
[7] L. W. Nagel and D. O. Pederson, Simulation program with integrated circuit emphasis (SPICE), In: Proc. 16th Midwest Symposium on Circuit Theory 1973.
[8] A. Luchetta, S. Manetti, and A. Reatti, SAPWIN - A symbolic simulator as a support in electrical engineering education, IEEE Trans Educ 50 (2001), 213 and CDROM enclosed Issue.
[9] D. C. Hamill, Learning about chaotic circuits with SPICE, IEEE Trans Educ 36 (1993), 28–35.
[10] H. Hodge1, H. S. Hinton, and M. Lightner, Virtual circuit laboratory, J Eng Edu 90 (2001), 507–511.
[11] I. Alhama Manteca, A. Soto Meca, and F. Alhama Lopez, FATSIM-A: An educational tool based on electrical analogy and the code PSPICE
to simulatefluid flow and solute transport processes, Comput Appl Eng Educ 22 (2014), 516–528.
[12] G. E. Pazienza, and J. Albo-Canals, Teaching memristors to EE undergraduate students, IEEE Circuits Syst Mag 11 (2011), 36–44. [13] T. Quarles, The SPICE3 implementation guide. Electron. Res. Lab.,
Univ. California at Berkeley, UCB/ERL M89/44 1989.
[14] E. Hennig, Symbolic approximation and modeling techniques for analysis and design of analog circuits. Ph.D. dissertation, Dept. of Elec. and Inf., Univ. Kaiserslautern , Kaiserslautern., Germany 2000. [15] A. Konczykowska, Symbolic circuit analysis in Wiley Encyclopedia of Electrical and Electronics Engineering. Dec. John Wiley & Sons, 1999.
[16] F. Fernandez, A. Rodriguez Vazquez, J. Huertas, and G. Gielen (Eds.), Symbolic analysis techniques, IEEE Press, New York, USA, 1998. [17] L. P. Huelsman, G. Gielen (Eds.), Symbolic analysis of analog
circuits, Kluwer Academic Publisher, Boston, USA, 1993. [18] G. Gielen, H. Walscharts, and W. Sansen, ISAAC: A symbolic
simulator for analog integrated circuits, IEEE J Solid-State Circuits 24 (1989), 1587–1597.
[19] R. Sommer, E. Hennig, M. Thole, T. Halfmann, and T. Wichmann, Analog insydes 2 - New features and applications in circuit design, In: Proc. 6th International Workshop on Symbolic Methods and Applications in Circuit Design (SMACD2000), Lisbon, Portugal, Oct 2000.
[20] J. Hospodka, J. Bicak, Symbolic analysis of nonlinear electronic circuits by PraCAn package in Maple program, In: Proceedings of the International Workshop on Symbolic and Numerical Methods, Modeling and Applications to Circuit Design (SMACD2010), Tunis,Tunisia, Oct 2010.
[21] Z. Kolka, SNAP - Program for symbolic analysis, Radioengineering 8 (1999), 23–24.
[22] F. Grasso, A. Luchetta, A. Reatti, L. Serri, Symbolic analysis of PWM DC–DC converters operated under both continuous and discontinu-ous conduction modes, In: Proc. of IX Int. Workshop on Symbolic and Numerical Methods, Modelling and Applications to Circuit Design (SM2ACD’08), Erfurt, Germany, 2008, pp. 95–101.
[23] A. Bonci, C. Carobbi, and A. Luchetta, Complex Valued Neural Network Modelling of the Balun of a Biconical Antenna, In: Proc. of the 2014 IEEE International Conference on Electromagnetic Compatibility (IEEE-EMC 2014), Raleigh, USA, 2014.
[24] B. Grimbleby, Algorithm forfinding the common spanning trees of two graphs, Electron Letts 17 (1981), 470–471.
[25] B.S. Rodanski, Modification of the two-graph method for symbolic analysis of circuits with non-admittance elements, In: Proc. of the International Conference of Signals and Electronic Systems (ICSES’02), 2002, pp 249–254.
[26] F. Grasso, A. Luchetta, and M.C. Piccirilli, Applications of symbolic analysis in the design of analog circuits, In: Analog/RF and Mixed-Signal Circuit Systematic Design, Springer, New York, 2013, pp 171–194.
[27] J. Vlach and K. Singhal, Computer Methods for Circuit Analysis and Design. Van Nostrand Reinhold, New York, 1994.
[28] L. P. Huelsman, Active and passive analogfilter design. McGraw-Hill Int., New York, 1993.
[29] A. Reatti, and M. K. Kazimierczuk, Small-signal model of PWM converters for discontinuous conduction mode and its application for boost converter, IEEE Trans Circuits Syst I 50 (2003), 65–73. [30] A. Ahmed, S.S. Subedi, Stability analysis and control of DC motor
using fuzzy logic and genetic algorithm, In: Proc. of 2014 IEEE Students’ Conference on Electrical, Electronics and Computer Science (SCEECS), Bhopal, India, 2014, 1–8.
BIOGRAPHIES
Francesco Grasso received the MSEE degree and the PhD degree in electronic devices and circuits from the University of Florence, Florence, Italy, in 2000 and 2003, respectively. He is currently Assistant Professor with the Department of Information Engineering (DINFO) at University of Florence. He teaches in the courses of Electrical Machines and Drives in the Master Degree in Electrical and Automa-tion Engineering. His research interests are in the areas of power electronics and drives, circuit theory, neural networks, fault diagnosis of analog circuits and symbolic analysis. Prof. Grasso is adviser of AEIT.
Antonio Luchetta graduated in electronic engineering at the University of Florence, Italy, in 1993. From 1995 to 2005, he was an Assistant Professor at the University of Basilicata, and at the Department of Electronics and Telecommu-nications of the University of Florence, where he is at present Associate Professor at the Depart-ment of Information Engineering. He teaches in the courses of Circuit Theory for Computer Engineering and Fundamentals of Electrical Engineering for Civil and Environmental Engineering. His research interests are in the areas of circuit theory, neural networks, symbolic analysis of analog circuits. Prof. Luchetta is member of AEIT.
Stefano Manetti was born in Florence, Italy, in 1951. He received the Laurea degree in electronic engineering from the University of Florence in 1977. From 1977 to 1979, he was a Research Fellow with the Engineering Faculty, University of Florence. From 1980 to 1983, he was an Assistant Professor of Applied Electron-ics with the Accademia Navale of Livorno, Italy. He was a Researcher from 1983 to 1987 and an Associate Professor of Network Theory from May 1987 to 1994 with the Electronic Engineering Department, University of Florence. In 1994, he was a Full Professor of electrical sciences with the University of Basilicata, Potenza, Italy. Since November 1996, he has been a Full Professor of electrical sciences with the University of Florence. He has been the Dean of the Engineering Faculty of the University of Florence from 2009 to 2013. His research interests are in the areas of circuit theory, neural networks, fault diagnosis of electronic circuits, and symbolic analysis of analog circuits. Prof. Manetti is member of AEIT.
Maria Cristina Piccirilli received the laurea degree in electronic engineering from the University of Florence, Italy, in 1987. From 1988 to 1990, she was a Research Fellow at the University of Pisa, Pisa, Italy. From March 1990 to October 1998, she was a Researcher in the Department of Electronic Engineering, Univer-sity of Florence. Since November 1998, she has been an Associate Professor of Network Theory in the same Department, now Department of Information Engineering, where she works in the area of circuit theory, analogfilters, fault diagnosis of electronic circuits, neural networks and symbolic analysis. Prof. Piccirilli is member of AEIT.
Alberto Reatti (M’ 91–98 and M’13) received the degree and in electronics engineering, from the University of Florence, Florence, Italy, in 1988 and the PhD degree 1993, from the University of Bologna. In 1992, he was an Associate Researcher in the Department of Electrical Engineering, Wright State University, Dayton, OH. He is currently an Associate Professor at the Department of Information Engineering of University of Florence, Italy. His research interests include high-frequency, resonant and pulse-width modulation dc–dc power converters, dc-ac inverters, high-frequency rectifiers, electronic ballasts, modeling and control of converters, high-frequency magnetic, and power semiconductor devices, renewable power sources. He has published more than 100 technical papers, 70 of which have appeared in IEEE Transactions and Journals. Dr. Reatti served as a Chairman of the Power Electronic and Power Systems Committee of IEEE ISCAS and as an Associate Editor of the IEEE Transactions on Circuits and Systems-I: Regular Papers. Prof. Reatti is member of AEIT.