Modelling Real-World Linear and Non-Linear Inductors and ...

32
Design Simulation Systems Ltd Page 1 Modelling Real-World Linear and Non-Linear Inductors and Transformers for SPICE Mark Sitkowski Design Simulation Systems Ltd http://www.designsim.com.au Introduction Many of the currently available transformer models contain no inductors, are unidirectional and have a frequency-response down to DC. These are excellent for the isolated simulation of characteristics of the transformer itself, but fail miserably when included in actual circuits, like those of Royer, Schwartz, Baxandall et al. Similarly, much of the effort in the modelling of magnetic cores is centred around the characterisation of the cores by the use of empirically-derived and curve-fitted parameters. As with the transformer models, this leads to excellent models of the cores, which are totally useless when included in real-world transformers used in real- world circuits. Accordingly, this paper is centred on the vindication of the much-maligned transformer model used by SPICE, which contains actual inductors, is bidirectional and whose frequency response does not go down to DC. Subsequently, it incorporates a magnetic core, whose model can be substantially derived from data sheet parameters. To start the transformer modelling process, we include methods for calculating the coupling coefficients of the windings in various configurations, and then apply the model to the Baxandall inverter. Then, just because we can, we model an automotive ignition coil and spark plug. Later, we detail a preferred method of modelling a saturating core, and apply this to the Royer inverter. Finally, we mention the model of leakage inductance derived by Dauhajre, Dowell and Middlebrook, but, since many of its parameters are determined by empirical methods, and not from calculated data, we leave its application to the user. We naturally assume a knowledge, on the part of the reader, of high-school magnetic circuit theory, and we begin by designing a fictitious device, which we will use to illustrate the modelling procedures which follow.

Transcript of Modelling Real-World Linear and Non-Linear Inductors and ...

Page 1: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 1

Modelling Real-World Linear and Non-Linear Inductors and

Transformers for SPICE

Mark Sitkowski

Design Simulation Systems Ltd http://www.designsim.com.au

Introduction

Many of the currently available transformer models contain no inductors, are unidirectional and have a frequency-response down to DC. These are excellent for the isolated simulation of characteristics of the transformer itself, but fail miserably when included in actual circuits, like those of Royer, Schwartz, Baxandall et al. Similarly, much of the effort in the modelling of magnetic cores is centred around the characterisation of the cores by the use of empirically-derived and curve-fitted parameters. As with the transformer models, this leads to excellent models of the cores, which are totally useless when included in real-world transformers used in real-world circuits. Accordingly, this paper is centred on the vindication of the much-maligned transformer model used by SPICE, which contains actual inductors, is bidirectional and whose frequency response does not go down to DC. Subsequently, it incorporates a magnetic core, whose model can be substantially derived from data sheet parameters. To start the transformer modelling process, we include methods for calculating the coupling coefficients of the windings in various configurations, and then apply the model to the Baxandall inverter. Then, just because we can, we model an automotive ignition coil and spark plug. Later, we detail a preferred method of modelling a saturating core, and apply this to the Royer inverter. Finally, we mention the model of leakage inductance derived by Dauhajre, Dowell and Middlebrook, but, since many of its parameters are determined by empirical methods, and not from calculated data, we leave its application to the user. We naturally assume a knowledge, on the part of the reader, of high-school magnetic circuit theory, and we begin by designing a fictitious device, which we will use to illustrate the modelling procedures which follow.

Page 2: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 2

Our Transformer Model

With the aid of the manufacturer’s data sheet, we define a core of ferrite, with a permeability of 1800, a magnetic path length of 21.6 mm (2.16 cm), and an area of 15.2 sq.mm (0.152 sq.cm). Our design will comprise a single primary and two secondary windings, such that a 12 volt input produces outputs of 1.2 volts and 48 volts on the two secondaries. This will require turns ratios 1 : 0.1 : 4, with reference to the primary, but since fractional turns are rather impractical, we will use actual turns ratios of 10 : 1 : 40. It will be remembered that the inductance of a cored coil is: 4πe-7 * µ * N

2 * A

L = ------------------------- (1) LP Where 4πe-7 is the permeability of free space, µ is the permeability of our ferrite, A is the core area, and LP is the magnetic path length. These are all constants, which we can lump together as: K = (4πe-7 * µ * A) / LP which, in our case equates to (12.566e-7 * 1800 * 1.52e-5) / 2.16e-2 = 1.5917e-6 where dimensions are expressed in SI units. Our inductance formula then reduces to: L = N2 * K So the inductances of the windings are: L1 = 102 * 1.5917e-6 = 159.17e-6 L2 = 12 * 1.5917e-6 = 1.5917e-6 L3 = 402 * 1.5917e-6 = 2.54672e-3 Assuming that we use 30 awg wire for the primary, we can estimate the radius of the coil as being: Area = πr2 = 0.152 sq.cm whence r = sqrt(0.152 / π) = sqrt(48.3831e-3) = 0.219961 cm so the circumference is (2π * 0.219961) = 1.382 cm. Therefore, 10 turns would use 13.82 cm of wire, whose resistivity is: 338.496 Ω per km = 0.00338496 = 3.38496e-3 Ω per cm. The resistance of our 10 turn L1 primary winding, therefore is: (3.38496e-3 * 13.82) = 46.78e-3 Ω That of one turn on the L2 secondary is: (3.38496e-3 * 1.382) = 4.678e-3 Ω That of 40 turns on the L3 secondary is: (3.38496e-3 * 55.28) = 187.1206e-3 Ω

Page 3: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 3

The time constants associated with each winding are therefore: L1 3.4025 ms L2 340.25 µs L3 13.61 ms We may need to use these values later, when calculating rise and fall times. Figure 1 is our representation of the transformer which we have just designed, where the polarity of each winding is defined by the "+" on each inductor, and the comments (in light green) show the properties as they would be defined in GEX, our schematic editor.

Figure 1 Before we can generate a netlist, we need to calculate the coupling factors between the windings.

Page 4: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 4

The Coupling Coefficients

The coupling coefficient is a measure of how much flux from one winding cuts the turns of another winding. Its value can be anything from almost zero to unity. It can never exceed unity. To calculate the (ideal) coupling coefficients, we need a minimum of all the transformer data given in the above drawing, i.e. the winding ratios, inductances and the fact that the primary, L1, is coupled to secondaries L2 and L3. Additionally, we need to specify the coupling between L2 and L3. We can determine the actual coupling coefficients from the winding ratios and inductance values. Since this is a bidirectional transformer, there will be a forward and backward coupling coefficient, k12 and k21, only one of which we need to add to our netlist. There will also be coupling between the two secondary windings. The coefficients are defined as: k12 = N1/N2 * sqrt(L2/L1) k21 = N2/N1 * sqrt(L1/L2) As long as the number of turns and the stated inductance satisfy equation (1), the coupling coefficient will always be unity. Coupling from L1 to L2: k12 = 10 / 1 * sqrt(1.5917e-6/159.17e-6) = 10 * 0.1 = 1.0 Similarly, from L1 to L3: k13 = N1/N3 * sqrt(L3/L1) k13 = 10 / 40 * sqrt(2.54672e-3/159.17e-6) = 0.25 * 4 = 1.0 Now from L2 to L3: k23 = N2/N3 * sqrt(L3/L2) k23 = 1 / 40 * sqrt(1.5917e-6/2.54672e-3) = 1600 * 0.025 = 1.0 Our netlist compiler, GSP, performs these calculations automatically, and produces the following netlist: transformer3 .tran .print tran K0 L1 L2 1.000000 K1 L1 L3 1.000000 K2 L2 L3 1.000000 L1 1 2 159.17UH L2 3 4 1.5917UH L3 5 6 2.54672MH .end

Page 5: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 5

Figure 2

We now add a driving source of 1 volt at 1kHz and two 1kΩ load resistors, and simulate over a few cycles of input. For the sake of clarity, we have omitted the winding resistances, but we have added a primary winding resistance of 1µΩ. This is necessary, since SPICE will not permit driving a pure inductor with a pure voltage source. The simulation results in Figure 3 hold no surprises. Our L2 secondary produces 1/10 of the primary voltage, while L3 produces 4x the primary voltage. It may be worth mentioning that the inductive reactances of our windings at 1kHz are: L1 = 2π * 1e3 * 159.17e-6 = 1.0000 L2 = 2π * 1e3 * 1.5917e-6 = 0.0100 L3 = 2π * 1e3 * 2.54672e-3 = 16.0015 so the effect of the 1k load resistors is negligible. The neat numbers are pure coincidence.

Page 6: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 6

Figure 3 Unlike many of the behavioural models, ours is bidirectional, in that we can drive any winding as a primary, and the other windings will behave as secondaries, producing the correct output voltage.

Page 7: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 7

Figure 4 Figure 4 shows our transformer model with the L2 winding driven as a primary, from a 1.2v source. It may be seen from the simulation results in Figure 5 that the outputs of the L1 and L3 windings are 12v and 48v, respectively, as nature intended.

Figure 5

Page 8: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 8

Tapped Windings

These need special mention, since they are the basis for many inverter circuits, and need special care in the calculation of the coupling coefficients.

Figure 6 Figure 6 shows our transformer, but with the primary winding split into two separate windings, each with half the inductance, and half the number of turns. Each of these two primary windings is shown to be coupled to both secondary windings. If we use these parameters to calculate the coupling coefficients (or let the netlist compiler do the sums) we get: K0 LPA LS1 0.707107 K1 LPA LS2 0.707107 K2 LS1 LS2 1.000000 K3 LPB LS1 0.707107 K4 LPB LS2 0.707107 K5 LS1 LS2 1.000000 Using these numbers will cause misconvergence, as SPICE applies them to both primary windings, which corresponds to K being greater than unity. The coefficients must be modified to reflect the fact that we have two primary windings, so we need to multiply each coefficient by 0.5. Note that if the primary tap was set at a point other than 50%, we would need to multiply the corresponding coefficients by 0.6/0.4, 0.7/0.3 etc.

Page 9: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 9

Our final netlist includes the corrected coupling coefficients: transtap .tran 1u 4m 0 1u .print tran v(7) v(1) v(5) v(4) v(3) v(6) k0 lpa ls1 0.3535 k1 lpa ls2 0.3535 k2 ls1 ls2 0.500000 k3 lpb ls1 0.3535 k4 lpb ls2 0.3535 k5 ls1 ls2 0.500000 lpa 1 0 79.585uh lpb 0 4 79.585uh r1 3 0 1k r2 6 0 1k r3 7 1 1u r4 5 4 1u ls2 0 6 2.54672mh ls1 3 0 1.5917u v1 7 0 sin 0 12 1k ac 1 v2 0 5 sin 0 12 1k ac 1 .end

Figure 7 The simulation results show the correct voltages at the secondary windings. It should be noted that our attempt at keeping the schematic neat, by running the ground wire through the centre, results in the VS2 output having inverted polarity, since we measure VS2 at the other terminal of L2.

Page 10: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 10

The Baxandall Inverter

Throughout the previous analyses, we have been tacitly working with a ferrite core with linear permeability, which leads us conveniently to an inverter which relies on this fact. The Baxandall inverter is a tuned version of the Royer oscillator and has, as its principal advantage, the fact that the core never saturates, so the output is sinusoidal.

Figure 8 Figure 8 shows our transformer connected to a push-pull transistor switching circuit, driven by the output of our LS1 winding. We have tuned the primary to 1kHz by the addition of CX, whose value we set to 159.14µF, with an initial value of 12 volts. This latter was not strictly necessary, as the circuit is self-starting, but it saves watching a screenful of raggedy waveforms as the oscillations build up, and it struggles to life. By reducing the value of the tuning capacitor to 15.914 µF, we can make the circuit happily run at 10kHz, but this is near the upper limit, partly determined by the characteristics of the 2N3055 transistors. The two 12 ohm resistors in the collectors of Q1 and Q2 are there to limit the collector current, while the zero-valued sources VIPA and VIPB are merely ammeters, which may be useful later in this paper. Output is taken from LS2, and is theoretically 48 volts, which we measured as being about 47 volts. The netlist is shown in Appendix 1, and Figure 9 shows the result of a transient analysis with the initial condition set on the tuning capacitor. Switching frequency can be seen to be 1kHz, and the amplitude stabilises after about 20 cycles.

Page 11: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 11

Figure 9

Figure 10

The expanded view in Figure 10 shows VC1 and VC2 flattening at the bottom, as an indication that both transistors go into saturation. However, the output remains sinusoidal.

Page 12: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 12

An Ignition Coil Model

Figure 11

The data for our ignition coil comes from the specification of a randomly chosen device by an unknown manufacturer.

Primary inductance 5.5mH

Primary resistance 0.6 ohms

Primary turns 250

Secondary inductance 57.2 H

Secondary resistance 8.26k ohms

Secondary turns 25000

The spark plug is modelled by the traditional two transistor breakover circuit, at extreme right. The circuit passes no current until the voltage across it reaches 15kV, whereupon it turns on, and becomes a low resistance path. The breakover voltage is set by adjusting RBP and RBN. Additional parasitic capacitances, typical of a spark plug, have not been added, since these would probably be swamped by the CJC and CJE values of the transistors. It should be noted that the transistors chosen are totally unsuited to the currents and voltages being handled, but luckily, there is never any smoke and flame in SPICE.

Page 13: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 13

Figure 12 Appendix 4 contains a netlist for the test circuit of the spark plug, with simulation results in Appendix 5. The distributor and points are modelled by VPT and BPT. VPT produces a gating pulse every 100ms which BPT multiplies by the current through RP. When VPT is positive, a current of (12 / 0.6) = 20 amps flows through the primary, and when it is zero, no current flows. The netlist is in Appendix 4 and the simulation results are shown in Figure 12. We have taken a few liberties with the characteristics of the distributor cam, in the interests of a clearer picture. Normally, the points would not remain open for such a long period, but would close after about 2ms. It may be noticed that we have a voltage pulse of approximately 15kV, which lasts for about 1.5ms after our spark plug has fired. However, the spark shows none of the oscillatory behaviour typical of a real spark, since our breakover circuit does not mimic the ionisation characteristics of a gas. Interested readers are encouraged to add such a feature.

Page 14: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 14

Non-linear inductors

Figure 13 As is well-known, for a given magnetic material, a plot of magnetising force, H, produces a magnetisation, B, as shown in Figure 13. The slope of the curve at any point is the permeability, µ, of the material, as per: µ = B / H The curve has three features, each of which is important to the modelling process. During the steep vertical region, where B changes appreciably with H, the slope corresponds to the initial (maximum) permeability, µini, and is the normal operating region of the material. The curve turns a corner, then, after it has flattened out, B changes little with H, and µ has a much lower value, µsat, in what is the saturation region. The value of H corresponding to this transition point, or corner, between the two regions, is related to the saturation current. Since H is measured in ampere-turns per metre, it is proportional to the inductor current, while B, the magnetic flux, is related to the voltage produced by the current. Our approach may seem to be counter-intuitive in that we model B with a current, and H with a voltage. We will create what is, effectively, a voltage-controlled resistor, placed in series with the inductor, where the current through the inductor is forced to follow a sigmoid characteristic, in response to the voltage across its terminals.

Page 15: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 15

Figure 14 Figure 14 shows the topology, from which it may be seen that the entire terminal current flows through the inductor. The orientation of the source BSIGMOID is circuit-dependent. This approach is diametrically opposed to traditional core modelling techniques, where a controlled current source is placed in parallel with the inductor, as shown in Figure 15.

Figure 15

Page 16: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 16

The inductor L1 has its current measured by zero-valued voltage source VL1. The programmable current source BSAT senses the current through L1, and applies a feedback current defined by an appropriately chosen transfer function. Its current is measured by zero-valued voltage source VSAT. Although it is probably possible to model every nuance of a magnetic core by using this technique, it is totally useless if we need the resulting inductor to be an actual circuit component. The problem is, that only a fraction of the current across its terminals actually flows through the inductor, and the control current represents the bulk of the current though the device.

The Transfer Function

As mentioned above, we will model MMF as voltage, and magnetic flux as current, so we basically have a resistor, whose V-I characteristic is a sigmoid. Although the actual curve may be approximated by any of the standard sigmoid functions, we have chosen three, which meet some arbitrarily chosen criteria. Possibly the most important criterion in the choice of a function needs to be the ease with which the central slope can be modelled, to determine the linear permeability of the material. The ability to easily set the slope is a function of how ‘tame’ is the derivative of the chosen function.

Slope and Permeability

The core material permeability figures given by a manufacturer, and the slope of the B-H curve, are not the same. Specifically, for the material we have chosen, the permeability is 1800, but observation of the B-H curve shows that its slope is never 1800, but nearer to 20. Manufacturers’ measurement methods and units chosen for B and H play a part in this, with combinations of henries, webers, tesla, oersteds, gauss, depending on whose data sheets you read. Our approach, for the scope of this paper, is to examine the B-H curve, and estimate the slope from the picture. In many cases, especially for ferrites, it seems that dividing the quoted permeability by 100 is very nearly equal to the perceived slope.

Saturation

We need our core model to pass current up to a predetermined point, then to flatten out at that limit. If the input increases further, we can either permit the output to gradually increase, or to hard-limit at that value. This latter behaviour is ideal for square loop ferrites, whereas the former will suit most other magnetic materials.

Page 17: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 17

Three Suitable Functions

These functions are by no means the only ones which are suitable, but they have the advantage that their slope can be manipulated by a simple multiplicative factor, and their output can be scaled in the same manner. We include the calculation of the derivative, for the sake of completeness. Arctan

y = arctan(x) We apply a slope scaling factor of ‘a’ to give y = arctan(u) where u = (a*x), dy/du = 1 / (1 + u2) dy/dx = dy/du * du/dx = (1 / (1 + u2) * a dy/dx = a / (1 + a2x2) It should be noted that, when x crosses zero, the slope is ‘a’.

Tanh y = tanh(x) y = tanh(u) where u=(a*x) dy/du = (1 – tanh2(u)) dy/dx = dy/du * du/dx = (1 – tanh2(u)) * a = a – (a * tanh2(a*x)) Again, note that, when x crosses zero, the slope is ‘a’.

Exponential The Fermi-Dirac equation is

1 f(E) = -------------------------

1 + exp((E – Ef)/kT) If we remove the bits we don’t need, and add a scaling factor (‘-a’), we get: 1 1 y = ---------------------- = ---------------- (1 + exp(-a*x)) (1 + exp(u)) The derivative of which is: exp(u) dy/du = ------------------------------------ (1 + exp(u)) * (1 + exp(u)) du/dx is (-a) so -a* exp(-a*x) dy/dx = ----------------------------------

(1 + exp(-a*x)) * (1 + exp(-a*x))

When x = 0, exp(-a*x) = exp(0) = 1, so the slope is (–a / 4) The equation is unipolar so, to force the output to swing between +/- 1, it needs to be modified as per: 2 y = (----------------------) -1, which will change the default slope to (-a/2). (1 + exp(-a*x))

Page 18: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 18

Figure 16 Figure 16 shows a simulation of the test circuit described in Appendix 2, which is a sweep from -2 to +2 volts of the three contenders for the transfer function, using the relationships: i = atan(10*Vin) i = tanh(10*Vin) i = (2/(1+exp(-10.0*Vin))) - 1 We have arbitrarily used a scaling factor of 10 for the slope, to make it more visible. It may be seen that both the tanh function, and the exponential function have a hard saturation value of 1.0, whereas the arctan function saturates in a far more gentle manner. Some ferrites have an almost square hysteresis loop, so the tanh and exponential characteristics may be more suitable when modelling such cores, whereas, for the core used in our transformer, we will opt for the arctan characteristic. An ASCII dump of the data on either side of the zero-crossing yields:

x arctan tanh exp

-1.000000e-03 -1.000133e-02 -1.000133e-02 -5.000167e-03

1.000000e-03 1.000000e-02 1.000000e-02 5.000000e-03

Slope 10.000665 10.000665 5.0000835

(It is worth noting, that SPICE interprets input to its arctan function as being radians, so arctan(90) is 1.56, not 89.4).

Page 19: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 19

Figure 17 Figure 17 shows the effect of various values of the scaling factor ‘a’, on the slope of our arctan function, the netlist of which is in Appendix 3. We have scaled all of the waveforms to the same peak-to-peak amplitude, so that the zero-crossing points coincide, in order to make the slopes easy to compare. An ASCII dump of the waveform data yields the following (unsurprising) results from around the zero-crossing point:

‘a’=1 ‘a’=2 ‘a’=5

x y x y x y -1.000000e-03 -9.999997e-04 -1.000000e-03 -1.999997e-03 -1.000000e-03 -4.999958e-03

1.000000e-03 9.999997e-04 1.000000e-03 1.999997e-03 1.000000e-03 4.999958e-03

slope 0.9999997 slope 1.999997 Slope 4.999958

‘a’=10 ‘a’=20 ‘a’=50

x y x y x y -1.000000e-03 -9.999667e-03 -1.000000e-03 -1.999733e-02 -1.000000e-03 -4.995840e-02

1.000000e-03 9.999667e-03 1.000000e-03 1.999733e-02 1.000000e-03 4.995840e-02

Slope 9.999667 Slope 19.99733 Slope 49.9584

‘a’=70 ‘a’=100

x y x y -1.000000e-03 -6.988600e-02 -1.000000e-03 -9.966865e-02

1.000000e-03 6.988600e-02 1.000000e-03 9.966865e-02

Slope 69.886 Slope 99.66865

This confirms what we already know from the equation of the derivative.

Page 20: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 20

Royer Oscillator

We now add our core to the Baxandall circuit, simulated earlier, and remove the tuning capacitor, to produce the Royer Oscillator. This is an ugly circuit, in that its operating frequency varies with the unknown production tolerances of the magnetic cores used. However, its popularity is based on the fact that it is cheap to produce containing, as it does, only two transistors and a transformer. We designed our original transformer by basically pulling numbers out of thin air, our only goal being to make the turns-ratio correct. Accordingly, our Royer circuit was not optimised in any way, and we accept whatever results we get.

Figure 18 Figure 18 shows the resulting circuit, with three options for the core transfer function. The function shown in yellow is the one being used, while those below are merely comments, to remind us of the different options. The netlist is in Appendix 6, with the currently unused functions commented out. The peak current of the switching transistors is limited by the 1 ohm resistors in the collector circuits, so we decided to make the inductors saturate at (0.7 * 1.55) = 1.085 amps. The ferrite we chose had a very gradual slope to its B-H loop, so we decide that a scaling factor of 1.0 would be adequate, hence: i = 0.7 * atan(1.0 * (v(vt) - v(vcc2))). The simulation results for the arctan transfer function are shown in Figure 14. As may be seen, the circuit is self-starting, and oscillates with a period of 17.8us, corresponding to a PRF of about 56.2kHz. Each transistor draws 1.03 amps, and the output voltage, across a 1k load, is 42.5v rms. (We chose rms, because it’s easy to measure on-screen).

Page 21: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 21

Figure 19

However, this circuit is full of resonances of each inductor with the transistor junction capacitances, CJC and CJE. It is interesting to note that, if the switching circuit is removed, and the primary driven into saturation with AC instead, we have a ferro-resonant regulator. We were interested to see the effects of replacing our cores with a straight path, to which end, we replaced the controlled sources with fixed resistors of 1e-3 ohms (shown commented in the netlist). The simulation of the resulting circuit is shown in Figure 20. As may be seen, the frequency is now dictated by the other circuit components, and has a period of 22.4µs (PRF 44.62kHz). The circuit waveforms are ugly, irregular and are dominated by switching transients.

Page 22: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 22

Figure 20

Figure 21 Figure 21 is an FFT of one of the transistor collector waveforms, showing the mess of harmonics which now pervade the circuit.

Page 23: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 23

AC Analysis

We added 4.678e-3 ohm winding resistances to the base-drive winding, and placed an AC source across the bases. An AC analysis in Figure 17 shows the frequency response of the basic circuit.

Figure 22

Page 24: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 24

What about Losses?

We make no apology for the fact that our hysteresis loop is not a loop. We are producing a circuit element, and need to model all features which are visible from the outside, and which affect its interaction with other circuit components.

Figure 23 The area of a hysteresis loop represents the power losses in the core, but these losses are frequency-dependent, so they would need to be recalculated for each new set of simulation conditions. We consider that the losses may be simply modelled by adding extra resistance to the winding resistance.

Page 25: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 25

What about Leakage Inductance?

The model proposed by Dauhajre and Dowell comprises simple inductances in series

with the windings. The model was extended and improved by Middlebrook, to yield that

shown below, for a simple two-winding transformer, Lp and Ls.

Figure 24 Although the model is simple enough, the methods used to establish the parameters entail a lot of empirical measurement, and are beyond the scope of this paper. However, those interested are referred to the original work by Dowell, Dauhajre and Middlebrook.

Page 26: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 26

Conclusion

The way SPICE handles transformers has had a lot of bad press. This has had the effect of too many researchers giving up at the first hurdle, and producing models which contain no inductors, work down to DC, and are unidirectional. We have shown that SPICE is perfectly capable of simulating all of the commonly-used transformer configurations, and producing results which reflect the real world.

Future Research

We have rather glossed over the relationship between transfer function slope and permeability, largely because permeability is expressed in various systems of units, like gauss, oersted, tesla etc. which define the slope of the B-H curve in numbers which are inconsistent. Although switching circuits only need a value which is ‘close enough’, it would be useful if manufacturers could publish a true dB/dH value for the zero-crossing point.

Page 27: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 27

Appendix 1

baxinv .tran 1u 48m 0 1u uic *#iplot all *#run *#quit .print tran v(11) v(4) v(7) v(8) v(5) v(6) v(2) .model zn3055 npn(is=4.6603p nf=1.0 bf=360 vaf=100 ikf=.25 + ise=33.394p isc=5n rb=3 irb=1m rbm=.4 ne=1.5 rc=.04 br=2 + mjc=.40 vje=1.2 mje=.45 xtb=1 + cje=580.19pf tf=80e-9 cjc=212.15pf tr=2.55u + ptf=120 xtf=1 itf=3) k0 lpa ls2 0.3535 k1 lpa ls1 0.3535 k2 ls2 ls1 0.500000 k3 lpb ls2 0.3535 k4 lpb ls1 0.3535 k5 ls2 ls1 0.500000 q1 7 11 0 zn3055 q2 8 4 0 zn3055 lpa 5 1 79.585uh lpb 1 6 79.585uh ls2 2 0 2.54672mh r1 9 5 12.0 r2 10 6 12.0 v1 10 8 dc 0 r3 2 0 1k c1 1 0 1u v2 1 0 dc 12 r4 1 11 10k r5 1 4 10k v3 9 7 dc 0 c2 5 6 159.17e-6 ic=12 ls1 4 11 1.5917uh .end

Page 28: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 28

Appendix 2

Test circuit for three possible sigmoid functions polytest .dc v1 -2.0 2.0 1.0e-03 .print dc i(v2) i(v3) i(v4) *.tran 100u 1.0 0 100u * spice uses radians, so atan(90) = 1.56 not 89.4 *#iplot all *#run *#quit *.print tran v(2) i(v2) i(v3) i(v4) i(v5) V1 2 0 PULSE -10 10 0 499M 499M 2M 1.0 L1 5 0 79.585UH B3 5 8 I=ATAN(10*V(2)) R1 9 8 23.39E-3 V2 9 2 DC 0 L2 4 0 79.585UH B2 4 7 I=TANH(10*V(2)) R2 10 7 23.39E-3 V3 10 2 DC 0 L3 3 0 79.585UH B1 3 6 I=(2/(1+EXP(-10.0*V(2)))) - 1 R3 11 6 23.39E-3 V4 11 2 DC 0 .end

Page 29: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 29

Appendix 3

slopetest .dc v1 -2.0 2.0 1.0e-03 .print dc i(v2) i(v3) i(v4) i(v5) i(v6) i(v7) i(v8) i(v9) *.tran 100u 1.0 0 100u *.print tran v(2) i(v2) i(v3) i(v4) i(v5) i(v5) i(v6) i(v7) i(v8) i(v9) v1 2 0 pulse -2 2 0 499m 499m 2m 1.0 l1 5 0 79.585uh b3 5 8 i=atan(1.0*v(2)) r1 9 8 23.39e-3 v2 9 2 dc 0 l2 4 0 79.585uh b2 4 7 i=atan(2.0*v(2)) r2 10 7 23.39e-3 v3 10 2 dc 0 l3 3 0 79.585uh b1 3 6 i=atan(5.0*v(2)) r3 11 6 23.39e-3 v4 11 2 dc 0 l4 12 0 79.585uh b4 12 13 i=atan(10*v(2)) r4 14 13 23.39e-3 v5 14 2 dc 0 l5 17 0 79.585uh b7 17 16 i=atan(20*v(2)) r5 15 16 23.39e-3 v6 15 2 dc 0 l6 18 0 79.585uh b6 18 21 i=atan(50*v(2)) r6 22 21 23.39e-3 v7 22 2 dc 0 l7 19 0 79.585uh b5 19 20 i=atan(70*v(2)) r7 23 20 23.39e-3 v8 23 2 dc 0 l8 24 0 79.585uh b8 24 25 i=atan(100*v(2)) r8 26 25 23.39e-3 v9 26 2 dc 0 .end

Page 30: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 30

Appendix 4

Ignition coil netlist

igncoil .tran 100u 200m 0 100u .print tran v(6) i(v3) v(8) i(v2) .MODEL BC338 NPN (IS=162F NF=1 BF=520 VAF=90 IKF=.3 ISE=17.4P NE=2 + BR=4 NR=1 VAR=20 IKR=.45 RE=.363 RB=.852 RC=65.2M XTB=1.5 + CJE=44.7P VJE=1.1 MJE=.5 CJC=14.4P VJC=.3 MJC=.3 TF=454P TR=170N) .MODEL BCY71 PNP (IS=2.03E-14 NF=1.0 BF=321 VAF=121 + IKF=7.0E-02 ISE=4.45E-13 NE=2.0 BR=4 NR=1.0 VAR=20 + XTB=1.5 RE=6.8E-01 RB=2.7E+00 RC=2.7E-01 + CJE=9.8E-12 CJC=9.3E-12 TF=3.2E-10 TR=1.5E-07) K0 LP LS 0.980581 LP 1 3 5.5MH LS 2 4 57.2H R1 7 1 0.6 R2 8 2 8.26K V1 6 0 PULSE 1 0 0 100U 100U 4.0E-3 100E-3 B1 3 0 I=(V(7)/0.6)*V(6) R3 6 0 1G V2 4 0 DC 0 V3 7 0 12 Q1 9 10 0 BC338 R4 10 0 200K R5 8 9 200K Q2 10 9 8 BCY71 .end

Spark plug test circuit

spkplug .dc v1 0 30000 1 .print dc v(5) v(4) i(v1) .model bc338 npn (is=162f nf=1 bf=520 vaf=90 ikf=.3 ise=17.4p ne=2 + br=4 nr=1 var=20 ikr=.45 re=.363 rb=.852 rc=65.2m xtb=1.5 + cje=44.7p vje=1.1 mje=.5 cjc=14.4p vjc=.3 mjc=.3 tf=454p tr=170n) .model bcy71 pnp (is=2.03e-14 nf=1.0 bf=321 vaf=121 + ikf=7.0e-02 ise=4.45e-13 ne=2.0 br=4 nr=1.0 var=20 + xtb=1.5 re=6.8e-01 rb=2.7e+00 rc=2.7e-01 + cje=9.8e-12 cjc=9.3e-12 tf=3.2e-10 tr=1.5e-07) q1 1 3 0 bc338 q2 3 1 4 bcy71 r1 5 4 1k v1 5 0 dc 1 r2 4 1 110k r3 3 0 110k .end

Page 31: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 31

Appendix 5

Page 32: Modelling Real-World Linear and Non-Linear Inductors and ...

Design Simulation Systems Ltd Page 32

Appendix 6

royerosc2 .tran 2n 100u 0 2n uic .print tran v(10) v(11) i(v3) i(v2) v(4) v(7) v(2) *.ac dec 5000 1 500meg *.print ac v(10) v(11) v(2) .model zn3055 npn(is=4.6603p nf=1.0 bf=360 vaf=100 ikf=.25 + ise=33.394p isc=5n rb=3 irb=1m rbm=.4 ne=1.5 rc=.04 br=2 + mjc=.40 vje=1.2 mje=.45 xtb=1 + cje=580.19pf tf=80e-9 cjc=212.15pf tr=2.55u + ptf=120 xtf=1 itf=3 k0 lpa ls2 0.3535 k1 lpa ls1 0.3535 k2 ls2 ls1 0.5000 k3 lpb ls2 0.3535 k4 lpb ls1 0.3535 k5 ls2 ls1 0.5000 q1 10 4 0 zn3055 ic=off r3 10 9 1.0 v3 15 9 dc 0 r5 15 14 23.39e-3 *rq1 6 14 1e-3 b2 6 14 i=0.7*atan(1.00*(v(1)-v(9))) *b2 6 14 i=0.8 * tanh(1.0*(v(1)-v(9))) *b2 6 14 i=(2.0 / (1 + exp(v(9)-v(1)))) -1 lpb 1 6 79.585uh q2 11 7 0 zn3055 r2 11 8 1.0 v2 13 8 dc 0 r4 13 12 23.29e-3 *rq2 5 12 1e-3 b1 5 12 i=0.7*atan(1.00*(v(1)-v(8))) *b1 5 12 i=0.8 * tanh(1.0*(v(1)-v(8))) *b1 5 12 i=(2.0 / (1 + exp(v(8)-v(1)))) -1 lpa 5 1 79.585uh ls2 2 0 2.54672mh r1 2 0 1k v1 1 0 dc 12 c1 1 0 100u r6 1 7 1k r7 1 4 1k ls1 4 7 1.5917uh .end