Current transformer inductance: What is this weird scope trace? How do I sim? - Page 1
Forum section: electronics / beginners

author: wootwoot
author_rank: Contributor
timestamp: July 16, 2025, 05:03:19 am
content: HiI have a circuit I'm trying to trouble shoot that has a current transformer in it. I thought I'd run a spice simulation to give insight on how the circuit worked, and started looking up how to model a transformer. The first thing I learned was that the model relies on an inductance ratio rather than a turn ratio so I quickly set about trying to measure the inductance.I have one of those transistor testers, and I measured a random crossover coil with it, and it successfully identified an inductor with close to the labelled inductance of 4mH, about an ohm of resistance. Cool. Put the current transformer on and it found an inductor, 6H, 63Ω. That definitely seems incorrect. Tested the DC resistance with a meter and that was accurate, about 63ΩSo, I set about using my old signal generator and scope to estimate the inductance. Found the sine wave generator had a very weak output stage, so I made a buffer amplifier out of a 741 op amp.So I have this circuit.And I made a measurement of the crossover coil based on thisperiod = 133.5μs, R=330Ω, V1 = 6.5 Vpp, V2 = 3.25 VppThis bloke also shows a couple of different methods that involve a sine wave responseBut, for the current transformer, which I assume is just a coil, gives a very strange response.https://5nrorwxhmqqijik.leadongcdn.com/ZMCT103C+specification-aidirBqoKomRilSjpimnokp.pdfAt higher frequencies there is no attenuation and no phase shiftAt lower frequencies some distortion appearsAnd at lower frequencies it goes completely wildHopefully someone can help me understand:What I am seeing here?Is a current transformer not simply an inductor?Is there active circuitry in this component?Is my component broken?In LTSpice, how would I try and model this component?

author: jwet
author_rank: Frequent Contributor
timestamp: July 16, 2025, 03:31:52 pm
content: The inductor is saturating. The voltage across an inductor is Ldi/dt. You can rearrange things and get di=Vdt/L, with a little linear handwaving, call this I=VT/L (this is true for step waveforms but you have to do some calculus with sines). Saturation is where the inductor stops behaving like an inductor and just acts like a wire, this is where the the flux in the core reaches a point where there is nothing more to magnetize. The "volt-seconds" product (VT) is what drives this current. At low frequencies, (big T), current get very high over the period.An experiment you might want to try is to reverse the resistor and the inductor. V2 will now directly represent inductor current and V1 will show the sum of the voltage drop and v across the L. Drive it with a square wave. What you'll see is a ramp on V2 that rises linearely with time until at some time, it saturates and the current will rise rapidly. This is what happening in your low frequency tests but its a bit harder to see with sines.This is why switching power supplies can be much smaller. In order to make a 60 Hz transformer, you need a lot of inductance to keep things from saturating- this takes copper and iron, big heavy transformers. At 100 Khz, you can push signals through a transformer with much lower inductances so they can be small and light. The general rule is to keep the inductive reactive 10 x the resistive component to keep heating down. I don't think schools teach inductors and magnetics so well. Most engineers are more comfortable with capacitor operation. Inductors do the complement of caps with current that caps do with voltage.Good luck.

author: Benta
author_rank: Super Contributor
timestamp: July 16, 2025, 08:35:03 pm
content: "The first thing I learned was that the model relies on an inductance ratio rather than a turn ratio"Where did you get that from? First time I ever heard of it, and I've worked with CT circuits.The CT has practically zero primary inductance, and the current forced through it is not affected in any way.The secondary side is a different story. It will try to output a current inversely proportional to the turns ratio in all situations, which is why a burden resistor is always needed to keep thing under control. Otherwise the output voltage will rise to unmanageable levels. Dunno if you've ever seen a CT in a power station with failed burden resistor. It literally explodes.Thinking about CTs in terms of inductance is a cul-de-sac.

author: langwadt
author_rank: Super Contributor
timestamp: July 16, 2025, 08:51:11 pm
content: Quote from: Benta on July 16, 2025, 08:35:03 pmthat's how spice works,https://electronics.stackexchange.com/questions/611142/how-to-simulate-a-transformer-in-ltspice-with-custom-turns-ratio-and-inductiviti

author: Benta
author_rank: Super Contributor
timestamp: July 16, 2025, 08:57:19 pm
content: I think an understanding of how CTs work is more to the point than how LTSpice works. And what you linked to has absolutely nothing to do with CTs.But perhaps I'm old-fashioned.Why don't you ask ChatGPT?. I'm sure it'll be a howl.

author: langwadt
author_rank: Super Contributor
timestamp: July 16, 2025, 09:48:47 pm
content: Quote from: Benta on July 16, 2025, 08:57:19 pmhow is a transformer not a transformer?

author: Benta
author_rank: Super Contributor
timestamp: July 16, 2025, 10:15:37 pm
content: A transformer is a transformer.But analyzing a CT by applying voltage to it is not a good idea.Just as applying current to a voltage transformer is not a good idea.Both approaches tell you nothing. Or at least nothing useful.

author: wootwoot
author_rank: Contributor
timestamp: July 16, 2025, 11:37:37 pm
content: Quote from: Benta on July 16, 2025, 08:35:03 pmHey yeah, its an LTSpice thing. And no idea why they do it that way, but they must have some reason. I'm a mech eng, so yup some pretty big holes in my knowledge when it comes to electronics. And expressing myself accurately.Basically I have a circuit here that does something based on the current in a wire, and I just wanted to knock up a sim to help me understand what its supposed to be doing.This started with 'oh I need that value, oh well I'll just measure it and throw it in'. Literally had two inductors dropped into spice at that point.Am enjoying learning a bit about transformers though.I think intuitively I understand how the big ones can explode. Its like an ignition coil, and it just wants to make current until something somehow limits the voltage. This little one pushes current through a 100Ω resistor when its in the circuit.I guess I thought the current transformer would be something I can measure like an inductor after seeing illustrations like this:Without a wire in there, it just looks like a coil.Quote from: Benta on July 16, 2025, 10:15:37 pmSo if I have a current transformer in my hand, and all I know is it is small and it has 1000 turns, how do I measure or derive the appropriate inductances to represent it in LTSpice?Quote from: jwet on July 16, 2025, 03:31:52 pmYeah I made a post on reddit and a few replies said it might be saturating. Which makes sense, the thing is tiny! So I tried bigger resistor values to drop the current down. Eventually getting to 470kΩThis worked, no weird traces, amplitude went down. But the calculation came back as 18-23 Henrys...This is surely too high300kP = 664 μsL = SQRT(1/3)*R*P/2/π = SQRT(1/3)*300e3*664e-6/2/π = 18.3470kP = 540 μsL = SQRT(1/3)*R*P/2/π = SQRT(1/3)*470e3*540e-6/2/π = 23.3

author: wootwoot
author_rank: Contributor
timestamp: July 17, 2025, 04:16:34 am
content: Quote from: jwet on July 16, 2025, 03:31:52 pmThanks for the suggestion. I tried it.I made this circuit. The response of the 741 was too slow, it was giving trapezoids.Based on your description, I was expecting it to possibly do something like thisWith 300kΩ I was getting thisLowering the frequency just had it sitting along the top of the square wave for longer.Thought it may have been the scope probe after noticing and being reminded the scope is 1MΩ (not so far away from 300kΩ). But, then I confirmed my probe was set to 10x. Which would make it 10MΩI tried lowering the resistance to 22kΩ and 4.3kΩ and got something approaching what you describeBut it doesn't really seem to have a defined inflection pointThe spike is interesting. Is it capacitance?Tried to get something similar with the crossover coil, but I think it maybe too fast. Lowering the resistance further, to 330Ω just pulls the voltage down too muchTrying 330Ω on the transformer sees the voltage sag. But, it seems to sag more past a certain point. Perhaps this is where it reaches saturation?

author: MariuszD
author_rank: Regular Contributor
timestamp: July 17, 2025, 01:11:13 pm
content: Default inductor in LTSpice is a linear one. You can simulate non-linear inductor.Current transformer is supposed to work with shorted secondary (or low resistance burden) this prevents saturation.Saturation distorts the voltage waveform. But even if the voltage is not distorted, the magnetizing current (Im) causes a measurement error. Therefore, it is better to work with a low load resistance. This makes Im small. CT manufacturers use high permeability cores to achieve very high inductance in order to minimize Im.Specifying the inductance of coils is the simplest, which is why transformers in LTSpice are specified the same way. Inductance is proportional to the square of the number of turns. The transformer turns ratio is proportional to the square root of the inductance ratio. A non-linear inductor requires specifications for the number of turns, hysteresis loop parameters, and core dimensions. There is no non-linear transformer in LTSpice. Linear (ideal) transformer must be connected with non-linear inductor

author: jwet
author_rank: Frequent Contributor
timestamp: July 17, 2025, 01:51:01 pm
content: The spike is interesting. Is it capacitance?Yes- exactly. The L has some shunt capacitance and it shoots through.

author: Terry Bites
author_rank: Super Contributor
timestamp: July 17, 2025, 02:08:26 pm
content: An air cored transformer does not saturate but its ability to store and release energy over the period of a cycle becomes limited.Then it will distort.A broad band transformer would have a high indcutance windings to be able to store enough energy per cylce at lower frequqncies.You also have to match your load to the impedance presented by the secondary. Zs=Zp/n^2 for maximum power transfer.

author: wootwoot
author_rank: Contributor
timestamp: July 18, 2025, 05:20:46 am
content: Oh wow. How you were able to replicate that waveform is brilliant.So I am guessing the best thing to do here, because I am really interested in the rest of the circuit and not so much the current transformer, is just use linear inductors and build a transformer out of those.Quote from: MariuszD on July 17, 2025, 01:11:13 pmThis is where I've been a little lost because I know the inductance ratio from the turns ratio, great, but I need to put that in as a pair of absolute values and I have no feel for what they should be.Quote from: MariuszD on July 17, 2025, 01:11:13 pmSo I shouldn't be surprised about measuring a high inductance. Should I trust that inductance, 18H, and back calculate the inductance for the primary?Or, should I just use a reasonable inductance for the primary (wire) and back calculate the inductance for the secondary? Embarrassingly, I only just thought of that solution. Though, I have no idea what a reasonable inductance would be for just a single core of wire (rated for 20A if that matters).Quote from: Terry Bites on July 17, 2025, 02:08:26 pmCan we tell its an air cored transformer? I guess wrapping 1000 turns around a ring would be a pain, but they want to get that very high inductance like MariuszD said?

author: wootwoot
author_rank: Contributor
timestamp: July 18, 2025, 07:38:49 am
content: Before I packed my gear up I tried to make a better circuit for doing the step response. Put the opamp back in because I realised I am not going to go up into high frequencies. Used the 2N7000 to enable more drive current.Then the frequency multiply switch jammed on the wave generator, so until I fix it its locked at lower frequenciesIt was fun brushing off the maths and figuring out how to check if the MOSFET was going to burn out.Ran the speaker crossover coil again, with 100ΩIt weighs like 200g for 4mH, so wont have saturatedAnd the current transformer. At an attenuated voltage, as that seems to slow down the response.Then I put the plain buffer amplifier back together and actually used the transformer to measure a current. I know, crazy.6.5Vpp sine at 50Hz through a 330Ω resistor. 19.69mApp. Divide by the number of turns in the transformer, 1000. 19.69μApp. Into a 100Ω burden resistor. Should give 1.97mVpp.The resolution of the scope isn't the greatest, but it says 2mApp. Scaling the traces so they overlap, again limited resolution, but no noticeable phase shift. Winner.

author: Ian.M
author_rank: Super Contributor
timestamp: July 18, 2025, 10:26:47 am
content: I am *NOT* a magnetics expert, but here's my attempt at modelling your CT in LTspice with a Chan inductor to handle its saturation. Its complicated by Chan inductors not being couplable by a K statement, so you need to connect the Chan inductor to a matched ideal inductor that can be coupled in a K statement to form a transformer.First I went looking for typical CT core material properties and found this:https://www.mag-inc.com/Products/Tape-Wound-Cores/Nanocrystalline/Material-Curvesspecifically the BH loop for a CT core. I then read Hc and Br and estimated Bs from the BH loop as per Chan section of L - Inductor in LTspice help.From the CT dimensions I estimated the magnetic path length Lm as 36.5mm. An initial estimate of the core area was 25 mm2(25E-6 m2) but that did not give saturation near the expected limit.The CT datasheet specs linearity between 5% and 120% of rated current, so I guessed saturation may start at 130%. In the absence of any conclusive measurement of the secondary inductance I took it to be the 6H initially measured by the transistor tester.I then set up the simulation with an ungapped Chan inductor having the same number of turns as the CT ratio in parallel with a third winding on the core of the same inductance as the secondary and fiddled with the core area till I got the onset of visible saturation to be slightly over 130% overload, with a 50 ohm load resistor connected to the secondary as per datasheet.What does the mismatch between the expected core area and that required to get saturation onset where I think it should be tell me?If it was a bit different it could be wrong material parameters for the core, or simply a bad guess at the core dimensions, but as its very different, I suspect the 6H secondary inductance the transistor tester measured is too low.How could you do better? Set up to plot the BH curve with your own known winding through the core, and possibly even dismantle one to measure the core dimensions. Measure the onset of saturation and see if my guess of 130% overload was any good. Also you could short the primary by fitting a short thick ring of pure copper wire through the core, and measure the secondary leakage inductance to better estimate the coupling coefficient K. Also, if you can do a frequency sweep, you may be able to determine the parasitic shunt capacitance of the secondary and add that to the model.Edit: s/Chen/Chan/ - John Chan et la. IEEE Transactions On Computer-Aided Design, Vol. 10. No. 4, April 1991

author: wootwoot
author_rank: Contributor
timestamp: July 21, 2025, 12:54:04 pm
content: Quote from: Ian.M on July 18, 2025, 10:26:47 amThanks for that Ian! My question for MariuszD was about to be can you use those complex inductors coupled together? I assumed you could, answer is of course you can. I might tweak yours and use it.

author: mtwieg
author_rank: Frequent Contributor
timestamp: July 21, 2025, 01:13:55 pm
content: Quote from: wootwoot on July 16, 2025, 11:37:37 pmLTSpice implements basic transformers as multiple inductors (which of course must each have an inductance defined for each of them) and a coupling coefficient K. This isn't the most intuitive way, especially for engineers not already familiar with magnetics, and think of things in turns rather than henries, but there are very good reasons for it.Anyways, to answer your modelling questions (basically summarizing what others have said):Let's assume there are only two windings, made of inductors Lp and Ls. And let's assume the coupling coefficient K is exactly 1 (this is a reasonable assumption for a low frequency current transformer). In this case, the turns ratio Np/Ns is equal to the square root of the inductance ratio Lp/Ls. So if you know your CT has a ratio of 1:1000, then you know Lp:Ls = 1:1,000,000. For example if Ls is 4mH, then Lp is 4nH. This sounds impractically small, but it's actually plausible for a small CT.Measuring Lp might be difficult due to it's nonlinearity, as you've already found. If you are seeing distortion, you should reduce the voltage being applied. You could also increase the signal frequency, though you shouldn't go very far above the intended frequency of operation.If you're interested in modelling the nonlinearity/saturation of the core, then things get a lot messier. As Ian.M showed above, LTspice can model some behaviors of core materials with a few parameters, but I can't speak for its validity. Regardless, if your circuit is well-designed (i.e. the burden resistance is low enough to prevent saturation), the nonlinearities should not be important. The CT should have some ratings (like volt-time product, or a suggested burden resistance and max primary current) to help guide you.

author: wootwoot
author_rank: Contributor
timestamp: July 21, 2025, 01:50:58 pm
content: OK, I've made my final measurement of the bulk inductance of this current transformer. A while ago I managed to flash the EEPROM of my 35670A Dynamic Signal Analyser to get all software options enabled, including Swept Sine and curve fitting. This seemed like a great use case for it.I measured the 4mH speaker crossover coil first, with the 330Ω resistor wired in like so, creating a Series RL circuit.https://en.wikipedia.org/wiki/RL_circuitIt can be seen that the point of half voltage amplitude is at -6dB, as this instrument displays the power magnitude. The same frequency is found as with the function generator and oscilloscope, 7,490Hz.The corner frequency is a little high though, so I ran a 100Ω resistor to bring it down a bit.the -6dB point is now around 2,264Hz. Putting that into the original formula gets the right answer, L = sqrt(1/3) 100Ω/2/π/2,264Hz = 4.059mH.I thought I would try curve fitting. The curve fitting option will fit a general transfer function with up to 20 poles and 20 zeros to a measured frequency response captured by FFT analysis or swept sine. It can try to determine the appropriate number of poles and zeros itself, or optionally it can be provided with a target and any known positions. Looking at equations, a series RL circuit has one pole, and a zero at the origin.The results for a one pole transfer function with a fixed zero at 0Hz is:Rearranging the formula for the pole, s = - R/L the inductance is L = - 100Ω/-3,734/2/π = 4.262mHNote the 2/π in the denominator. This is due to the units of s being in Hz and not rad/sec.Moving onto the current transformer, the curve is different. It doesn't quite reach 0dB, and it dips down again as the frequency climbs. R is 47kΩ. Source voltage adjusted down until no obvious distortion was visible on the oscilloscope at 20Hz, ending up at a value of 200mVp (400mVpp).Using the -6dB point, the inductance comes back as L = sqrt (1/3) 47e3Ω/2/π/311.45Hz = 13.87HThe dipping a high frequencies suggests there is another pole in the transfer function. Adding in the shunt capacitance and working out the transfer function confirms there is a second pole, due to the quadratic denominator. The zero at the origin still exists.Fitting a curve on the DSA with an extra pole gives usThe poles are the roots of the denominator of the transfer function. The denominator of the transfer function is a quadratic function of s who's coefficients are made up of the C and L values we are wishing to calculate. If we arrange the equation so that it is monotonic (the s^2 term has a coefficient of 1), we can get equations for the remaining coefficients, which will be functions of C, L and the poles. We can then use these equations to find C and L. Using the poles shown above, I calculated C = 308pF and L = 15.05H. Hopefully you can follow Maxima CAS languageNote: To account for s being in Hz, I substitute s = s*2*π into the transfer function before manipulating the quadratic.

author: wootwoot
author_rank: Contributor
timestamp: July 21, 2025, 03:12:43 pm
content: Looking at a quick spice simulation, the curve looks promising.Confirmed by exporting and plotting all data sources togetherSo summing up:For the crossover coil: All methods pretty accurate.For the current transformer:The transistor tester: 6HThe function gen + oscilloscope: 18H-23HFrequency response through DSA: 15H, 304pF capacitanceLooks like current transformers are tricky to measure! And, more props to the transistor tester. It got it quite wrong, but at least it know it it was an inductor! Surely they don't get put onto 15H inductors very often.I have attached all the raw data from the HP, in case anyone wants to see what format it comes out in. And perhaps they might like to fit a curve themselves.Haha I did enjoy using these things. Bit of a blast from the pastPS: Handy software for viewing HPGL fileshttps://service-hpglview.web.cern.ch/service-hpglview/

author: wootwoot
author_rank: Contributor
timestamp: July 21, 2025, 04:38:16 pm
content: Quote from: mtwieg on July 21, 2025, 01:13:55 pmSo 15H:15μH is a plausible ratio?Thankyou for your reply. So far you are the only person to mention anything that might suggest plausible magnitudes of inductance! Lp of 4nH does seem small, but its is just a single piece of wire, so I imagine it would have a pretty small inductance? How do you calculate the inductance of a length of wire passing through a ring, as it relates to a transformer like this?

author: mtwieg
author_rank: Frequent Contributor
timestamp: July 22, 2025, 12:57:56 pm
content: Quote from: wootwoot on July 21, 2025, 04:38:16 pmSure, for a larger CT. Could you show a picture?Large inductances in the Henry range can also be difficult to measure with normal equipment. Another way to check your measurements of secondary inductance is to make your own winding around the core and measure its inductance as a function of N (leave the actual secondary winding open-circuit). That way you can basically choose the inductance range that suits your equipment. There you should observe that L scales nicely with N2. From that, you can extract the inductance factor ALfor the core, and use that to calculate the inductances of the actual windings. Keep in mind this test winding will still be coupled to the actual secondary winding, thus your test winding will also have the same self-resonant frequency. For this method to work you should be measuring far below that frequency (a factor of 10 should be plenty).QuoteI'll admit, I misread your post and thought you were measuring 4mH for the CT, not the crossover inductor. 4nH is a lot lower than what I would expect for a typical CT, because CTs are usually meant to measure large currents at low-ish frequency. I've definitely made CTs in the past for RF circuits which had primary inductance in the single-digit nanohenry range, though.Calculating inductance for the primary could be done using the same approach as any other inductor. Inductance can be defined as Webers (flux) per Amp. So if you know your core geometry and permeability, you can calculate that fairly easily.

author: wootwoot
author_rank: Contributor
timestamp: July 22, 2025, 01:45:20 pm
content: Quote from: mtwieg on July 22, 2025, 12:57:56 pmIt is quite small. Which is why I'm surprised I keep measuring a high inductance! I posted a picture above, but it is probably lost in the noise.https://5nrorwxhmqqijik.leadongcdn.com/ZMCT103C+specification-aidirBqoKomRilSjpimnokp.pdfQuote from: mtwieg on July 22, 2025, 12:57:56 pmHaha yeah, I'm finding that. I am about to post a final update on that, because after pondering today I realised with the frequency response measurement and transfer function fitting, ideally you want to be able to add a constraint between polynomial terms which you cannot do on this DSA.Do you think the swept sine measurement made above on the DSA is trustworthy? After refitting to the frequency response in MATLAB I've come up with 12H.Quote from: mtwieg on July 22, 2025, 12:57:56 pmIts a little difficult to know the construction of this particular CT. But, if it is a ring core I could wrap, say, 10 windings around it and measure that? That sounds easy enough, I might give that a try.I am learning so much about things I should have picked up in 2nd and 3rd year, this is great. Haha I just had to refresh on complex number math...

author: wootwoot
author_rank: Contributor
timestamp: July 23, 2025, 06:22:36 am
content: I am going to amend the curve fitting approach I presented earlier.While idly pondering yesterday, I realised that as we know the form of the transfer function through circuit analysis, we actually have more information about the relationships between the poles and zeros which could be added as constraints during the curve fitting process. These are not possible to program into the DSA as it can only fix known pole and zero positions to the s plane, where as the additional constraints are between the poles themselves.In an environment like MATLAB, it is relatively easy to construct a simple cost function and minimise it. As we know the transfer function in terms of L and C, it is simple enough to solve for them directly.The single zero two pole solution is equivalent to this circuit:The MATLAB code (I used) to fit this is:Code:% Data from the DSA is a nx3 array. Col 1 is s in Hz, col 2 is mag in dB% col 3 is angle in deg.% Split up measured frequency responses_Hz = instrument(:,1);mag_dB = instrument(:,2);angle_deg = instrument(:,3);% Convert Mag and Angle signals to complex representationz_inst = 10.^(mag_dB / 20) .* exp(1j * angle_deg./180.*pi); % Complex representation% Define known impedancesR_src = 47e3;% Transfer Function Form (See circuit diagram)tf = @(s,C,L,R1) (L.*s)./(C*L*R1.*s.^2+L.*s+R1);% Cost Function% Note the log terms added in to give logrithmically weight the errorscf = @(s,C,L,R1,z) sum( abs( log(z) - log(tf(s,C,L,R1)) ).^2 );% Convert s array from Hz to rad/secs_comp = s_Hz.*2.*pi.*1j;% Initial guess for solverguess = [3e-10,15];% Run solverfitted = fminsearch(@(x) cf(s_comp,x(1),x(2),R_src,z_inst),guess)Adding in the coil resistance, R2, an extra zero is added to the transfer function. We know it is around 63 ohms from multimeter measurements, but we can use the solver to fit it.The following lines of code changeCode:tf = @(s,C,L,R1,R2) (C*L*R2.*s.^2+L*s+R2)./((C*L*R2+C*L*R1).*s.^2+L.*s+R2+R1);cf = @(s,C,L,R1,R2,z) sum( abs( log(z) - log(tf(s,C,L,R1,R2)) ).^2 );guess = [3e-10,15,63];fitted = fminsearch(@(x) cf(s_comp,x(1),x(2),R_src,x(3),z_inst),guess)Plotting these together, it can be seen that the estimates for L and C are quite close, and the biggest effect of coil resistance is just in the phase at low frequencies.There is a discrepancy at the peak of the magnitude curve. The fitted curves go right up to 0dB, but the measurement is always somewhat lower.I did have an oscilloscope and the DSA both attached, and given the source impedance is quite high, 47kΩ, this could be attenuating the response a little.It is possible to add this into the transfer function.Code:load('MATLAB_Data.mat')% Data from the DSA is a nx3 array. Col 1 is s in Hz, col 2 is mag in dB% col 3 is angle in deg.% Split up measured frequency responses_Hz = instrument(:,1);mag_dB = instrument(:,2);angle_deg = instrument(:,3);% Convert Mag and Angle signals to complex representationz_inst = 10.^(mag_dB / 20) .* exp(1j * angle_deg./180.*pi); % Complex representation% Define known impedancesR_src = 47e3;R_scp = 1/(1/1e6+1/10e6);% Transfer Function Form (See circuit diagram)tf = @(s,C,L,R1,R2,R3) (C*L*R2*R3.*s.^2+L*R3.*s+R2*R3)./(((C*L*R2+C*L*R1)*R3+C*L*R1*R2).*s.^2+(L*R3+L*R1).*s+(R2+R1)*R3+R1*R2);% Cost Function% Note the log terms added in to give logrithmically weight the errorscf = @(s,C,L,R1,R2,R3,z) sum( abs( log(z) - log(tf(s,C,L,R1,R2,R3)) ).^2 );% Convert s array from Hz to rad/secs_comp = s_Hz.*2.*pi.*1j;% Initial guess for solverguess = [3e-10,15,63];% Run solverfitted = fminsearch(@(x) cf(s_comp,x(1),x(2),R_src,x(3),R_scp,z_inst),guess)The extra resistance does not add any poles or zeros.The fit is very good now. Though, I remember having the scope probe set to 10x to raise the impedance. The case where both probes are at 1x, 1MΩ each, fits best.I might run one more time, with 1 10x probe into the DSA and no oscilloscope.

author: wootwoot
author_rank: Contributor
timestamp: July 23, 2025, 02:39:35 pm
content: I remeasured and got things as accurate as I can. I ended up using plain coax for all connections. Given the highest frequency is 50kHz I presume reflections and that sort of thing should not pose a concern. I actually found the scope probes did not have flat frequency responses on x10, presumably due to the compensation networks.L = 14H!I found out I wasn't using the right sub circuit model for the inductor!The fit is quite good. The new measurement is now around 14H for the CT. I constrained the known DC resistance, rather than leaving it to the solver.I ended up using coax instead of scope probes because I their frequency response wasn't flat!Here is a script that will produce the figure shown above. It should work in GNU Octave now.Code:load('instrument_coax.mat')% Data from the DSA is a nx3 array. Col 1 is s in Hz, col 2 is mag in dB% col 3 is angle in deg.% Split up measured frequency responses_Hz = instrument_coax(:,1);mag_dB = instrument_coax(:,2);angle_deg = instrument_coax(:,3);% Convert Mag and Angle signals to complex representationz_inst = 10.^(mag_dB / 20) .* exp(1j * angle_deg./180.*pi); % Complex representation% Define known impedancesR_src = 47e3;R_scp = 1e6;R_dc = 63;% Transfer Function Form (See circuit diagram)tf = @(s,C,L,R1,R2,R3) (L*R3.*s+R2*R3)./(C*L*R1*R3.*s.^2+((C*R1*R2+L)*R3+L*R1).*s+(R2+R1)*R3+R1*R2);% Cost Function% Note the log terms added in to give logrithmically weight the errorscf = @(s,C,L,R1,R2,R3,z) sum( abs( log(z) - log(tf(s,C,L,R1,R2,R3)) ).^2 );% Convert s array from Hz to rad/secs_comp = s_Hz.*2.*pi.*1j;% Initial guess for solverguess = [3e-10,15,R_scp,R_dc];% Run solverfitted = fminsearch(@(x) cf(s_comp,x(1),x(2),R_src,x(4),x(3),z_inst),guess)Rp = (fitted(3)*R_scp)/(R_scp-fitted(3));% transfer function as anonymous functionC = fitted(1);L = fitted(2);R2 = fitted(4);R1 = 47e3;R3 = 1/(1/Rp+1/R_scp);H = @(s) (L*R3.*s+R2*R3)./(C*L*R1*R3.*s.^2+((C*R1*R2+L)*R3+L*R1).*s+(R2+R1)*R3+R1*R2);% frequency vector of domain to be evaluatedmin_freq = 5;max_freq = 51000;omega = 2 * pi * logspace(log10(min_freq),log10(max_freq),1000);% magnitude estimationmag = abs(H(1j*omega));magDB = 20 * log10(mag);% phase estimationphaseDeg = rad2deg( angle(H(1j*omega)) );% plot resultsfh = figure;ah = subplot(2,1,1,'Parent',fh);bh = subplot(2,1,2,'Parent',fh);semilogx(ah,instrument_coax(:,1),instrument_coax(:,2),'Linewidth',2)semilogx(bh,instrument_coax(:,1),instrument_coax(:,3),'Linewidth',2)hold(ah,'on')hold(bh,'on')semilogx(ah,omega/2/pi,magDB,'Linewidth',2)semilogx(bh,omega/2/pi,phaseDeg,'Linewidth',2)grid(ah,'on')grid(bh,'on')xlabel(ah,'frequency ');ylabel(ah,'magnitude ');xlabel(bh,'frequency ');ylabel('phase angle [°]');title(ah,['Frequency response comparison ',func2str(H)]);xlim(ah,[min_freq,max_freq])xlim(bh,[min_freq,max_freq])legend(ah,{'HP35670A Measurement','Transfer Function'},'location','southeast')On the DSA, I enabled display of the timeseries measurement. Could now confirm without the scope that the level of distortion is low.After getting what seemed to be less accurate traces with the x10 oscilloscope probes, I took the Device Under Test out of the loop and characterised the probe on its own.I have a Tektronix P2220 probe. On the x10 setting, it showed a 5dB magnitude variance and a change in phase at around 1kHz! I don't really know what's going on here. The input impedance of the DSA is 1MΩ, like a normal scope, nothing looks unusual in the time series window, the source should not be overloaded, 1kHz is a pretty low frequency. 5dB is nearly 50% attenuation!I find I don't need to adjust the compensation between channels on my scope. I note is has 28pF on its inputs, where the DSA just says its less that 100pF. I did not experiment with adjusting the compensation screw.A cheap 80MHz probe does the same on x10Plain coaxial cable produces a flat frequency responseThe Tek probe on x1 showed a flat frequency responseI worked out how to handle raster captures on the HP35670A. Use Ghostscript PCL with the commandCode:gpcl6.exe -sDEVICE=pngmono -r75 -o OUT.png -dBATCH IN.rtl

author: wootwoot
author_rank: Contributor
timestamp: July 24, 2025, 09:10:00 am
content: After trying out the correct model for the inductor, I was able to work the maths outMoving the capacitor out from under the DC resistance removes one of the zeros from the transfer function. I also didn't know there was a parallel resistance. This explains the misalignment I was seeing earlier that I put down to the front end resistance of the DSA and the oscilloscope.With the new transfer function, you can find closed form solutions for L, C, R2 and R3 from the zeros, poles and gain of the fitted transfer functionThis means the curve fitter in the DSA can be used. It doesn't offer as much control as doing the fitting with a script, but it is pretty fast doing it on the instrument and its nice to know how to use your tools properlyFor me, the key was to put the transfer function into the right form. The DSA can put the curve fit into polynomial form, and when it does this it always makes the denominator monic, meaning the highest coefficient is 1. (I presume) this is because the coefficients of a monic polynomial can be calculated directly from its roots through a procedure calledVieta's formulas. The poles are the roots of the denominator, and the zeros are the roots of the numerator. To make a polynomial monic just involves dividing through the leading coefficient of that polynomial. Because the transfer function as a whole is a ratio, so the numerator and the denominator cannot be made monic at the same time. What you do to the bottom, you must do to the top. That's why the DSA gives the gain term. It is essentially the coefficient of the leading term of the numerator when the transfer function is in polynomial form. And that's what you need to turn the numerator monic. Neat!So for this one zero two pole transfer function, the DSA is more or less using this formula to go between poles and zeros and polynomial form. (p1 and p2 are poles, z1 is the zero)With some algebra (or, you know, a CAS) the transfer function we have derived from the circuit can be put into the same form.Then using Vieta's formulas we can make equations that relate the coefficients of the polynomials in the transfer function to the poles and roots.With some algebra (or, you know, again, a CAS) these can be solved simultaneously to give the quantities we're interested in. The capacitance, inductance and resistances.Practically, the fitter doesn't handle the zero well. Running with no constraints it returns this:Plugging into the formulae, the results are:C=3.80126E-10 L=430.8145719 R3=1525038.245 R2-45594.8179L is massive and the DC resistance is negativeBecause in the simplest case the zero is at the origin, and the zero is the only thing we can constrain using this solver, we can set that to zero.C=3.35275E-10 L=14.15629 R3=301841.44 R2=0.0This has set the DC resistance to zero.We know it is about 63Ω from a multimeter. Can try and use that to calculate what z1 should be.Solving from the other poles and is complicated. But doing it from the inductance and other values, that should be close, is pretty simpleWhen R2 is put in as 63, the formula returns z1=-708.2900e-3C=3.40267E-10,L=14.10887 R3=416811.97 R2=62.79Compared to the MATLAB fitC=3.79214E-10 L=14.04702 R3=549425.86 R2=63.0Given how the curve diverges at the bottom, it is possible that the DSA is using linear weighting in the cost function. It may be possible to adjust this, there is a function for user defined weights, but I wont do that now.For now here is a comparison plot of the results.

author: iMo
author_rank: Super Contributor
timestamp: July 24, 2025, 10:54:13 am
content: FYI - I've found this model in my LTspice (Bordodynov mega lib):PS:no idea how to use it..There are zillion of examples in the lib from the Book..PPS: Mind the typo in the lib: the line 34 shall look like "I6 6 12 {IHYST}"The nodes "B and H" are the outputs such you may see them in the graphs if selected..Code:.subckt Lsat L0 L2 110 100 params: Feddy=25k IVSEC=0 Ae=0.000067 lm=0.037+lg=0 Bsat=350m ur=6000 N=15 Hc=50 Rser=1m Cpar=0*Reference:* "Switch-Mode Power Supplies Spice Simulations and Practical Designs", Christophe P. Basso, McGraw-Hill, 2008, ISBN-13: 978-0071508582* For more information and sample circuits, please refer to the book.*.param VSEC={N*Ae*Bsat}.param u0={1.25u}.param u1={u0*ur/(1+ur*(lg/lm))}.param Lmag={u1*N**2*Ae/lm}.param Lsat={u0*N**2*Ae/(lm+lg)}.param IHyst={Hc*lm/N}.param Cjo={3*VSEC/(6.28*Feddy*clamp*Lmag)}.param clamp={250}*Cpar L0 L2 {Cpar}Rser L0 L1 {Rser}Rdum phi 0 10GF1 L1 12 VM 1Gint 0 phi 12 L1 -1C1 phi 0 {VSEC/Clamp} IC={IVSEC/VSEC*clamp}Ebuf 5 0 phi 0 1Rmag 8 0 {Lmag*clamp/VSEC}VM 5 8D3 2 9 D2modV6 9 0 {Clamp}R2 2 8 {Lsat*clamp/VSEC}V8 0 10 {Clamp}Vdum 12 L2 0D4 10 2 D2modI1 6 L1 {IHYST}B1 100 0 V= (N/lm)*I(VDUM)B2 110 0 V= V(phi)*VSEC/(N*Ae)/CLAMPI6 6 12 IHYSTD1 L1 6 coresatD2 12 6 coresat.MODEL coresat D N=1 cjo=1f.MODEL D2mod D CJO={Cjo} VJ=25.ENDS Lsat

author: wootwoot
author_rank: Contributor
timestamp: July 29, 2025, 01:51:14 pm
content: After coming across this, and before soldering the transformer back into the device, I decided to get one more trace.https://wiki.analog.com/university/labs/comms_lab_isr_adalm2000It is more or less just swapping around the resistor and the inductor, giving a chart like this with an obvious dip at the self resonant frequency.So its setup like this on the DSAGiving this circuitWith this transfer function (a little complicated)MATLAB/Octave can fit it, no problem. One thing I found critical was the inclusion of the oscilloscope/DSA front end capacitance. It has a very large effect on the right most side of the curve, and no matter how many times I measured the DSA front end, I could not get the 164pF the curve fit indicated. It was coax going straight into the DSA, and it is supposed to have an input capacitance of less that 100pF. So I don't know, there must be something there I haven't factored in. I figured it best not to battle with the numbers and accept that's what it must be in this particular circuit.C=1.9794e-10 L=13.9930 Rs=63 Rp=1.9523e6 For the DSA front end: Cs=1.6463e-10The curve fit on the DSA works. This time there are complex zerosBut the math is more complicated to convert them to useful quantities. I couldn't find closed form equations for them like I could for the last transfer function. So, I had to use MINPACK to solve the system of simultaneous equations and get the quantities of interest.Had to use a couple of tricks to get it to converge properly, like substituting the square of the quantities to stop the solver trying to use negative quantities, and using the log of difference for cost to weight low magnitude quantities more heavily, like I did in the MATLAB script (for lack of a better way of explaining it)But In the end it gave a reasonable result. It doesn't look like it is as tight as the MATLAB fit, its a little shifted to the left. This is a limitation of the curve fitter, not the math. If you zoom in to the screen shot of the instrument you can see the shift is there. The quantities calculated from it are still pretty close.C=2.06070e-10 L=14.149644 Rp=1.909675e6 Cs=1.72436e-10

author: wootwoot
author_rank: Contributor
timestamp: July 29, 2025, 02:16:49 pm
content: Quote from: mtwieg on July 22, 2025, 12:57:56 pmI gave that a go. There were 7 turns, which I assume should give (7/1000)^2*14 = 686μH. Unfortunately, the transistor tester did not register an inductor

author: Ian.M
author_rank: Super Contributor
timestamp: July 29, 2025, 05:03:48 pm
content: '328' transistor testers typically measure inductance with a range of 10uH - 20H. We already know its probably reading low for the secondary inductance, as it read 6H in your iniital post, but it *should* be able to read the 7 turn primary. I suspect the high resistance is fooling it into going down the resistor route - possibly due to poor contact at the ZIF socket.Try a 20 or 30 turn primary wound with magnet or solid core wire and see if it can read *that* as an inductor.

author: wootwoot
author_rank: Contributor
timestamp: July 30, 2025, 01:26:27 am
content: Quote from: Ian.M on July 29, 2025, 05:03:48 pmI have no doubt. I've had this one for years, it's such a good device considering what its built from. I love it.Quote from: Ian.M on July 29, 2025, 05:03:48 pmYou could be right, but I tried it a number of times. The ZIF socket on this one is a little flogged out, so I'm used to checking the component is in properly.I should have tinned the ends of the wires a bitQuote from: Ian.M on July 29, 2025, 05:03:48 pmHere it is measuring a 500μH crossover coil. Like a champ

author: Zero999
author_rank: Super Contributor
timestamp: July 30, 2025, 10:58:18 am
content: Quote from: wootwoot on July 16, 2025, 11:37:37 pmIt's not an LTSpice thing, but a general SPICE thing.The reason is because SPICE models a transformer as two or more coupled inductors. An inductor is specified in henrys, not the number of turns and depends on the mechanical dimensions and core material, which SPICE doesn't care about.No doubt there are SPICE implementations which allow the user to input say the inductance of the primary, then the turns ratio, along with other properties, but internally they will be converted to inductance and other non-ideal parameters will be modeled as other components in series and parallel.It doesn't matter whether it's, transforming voltage or current. A transformer works on exactly the same principle. The main difference with a current transformer is it's never operated open circuit.

author: wootwoot
author_rank: Contributor
timestamp: July 30, 2025, 01:02:34 pm
content: Quote from: Zero999 on July 30, 2025, 10:58:18 amSooo the reason spice models transformers as two coupled inductors is... because spice models transformers as two coupled inductors?Quote from: Zero999 on July 30, 2025, 10:58:18 amDon't know what you mean by that. What transformers are operated open circuit?

author: Zero999
author_rank: Super Contributor
timestamp: July 30, 2025, 01:32:28 pm
content: Quote from: wootwoot on July 30, 2025, 01:02:34 pmA transformer is two coupled inductors. When making a transformer, the number of turns on the primary and secondary and the core size, dimensions and type are chosen depending on the frequency, primary/secondary voltages, current etc. but none of that matters as far as SPICE is concerned. As far as the simulator is concerned, a transformer is just two or more inductors coupled together, hence why the inductance is specified, rather than the core material, turns ratio etc.QuoteAny voltage transformer can be operated open circuit i.e with nothing connected to the secondary winding. A current transformer must have a burden resistor connected to the secondary winding, otherwise it will generate high voltages, which can damage the insulation.

author: wootwoot
author_rank: Contributor
timestamp: July 30, 2025, 02:16:25 pm
content: Quote from: Zero999 on July 30, 2025, 01:32:28 pmI'm totally fine using inductances, no worries. But is there a physics or mathematical reason for running the simulator this way? I guess one thought I had was the inductance has a pretty big impact on the rest of the circuit, so the absolute values of inductance give the simulator more information above whatever the ratio is. So if you're in the 70's writing SPICE, and you've got to define a transformer some way, why not that wayQuote from: Zero999 on July 30, 2025, 01:32:28 pmThats mainly because the current transformer has so many turns, isn't it. Without the burden resistor pulling the voltage down it just shoots very highWhat use is voltage transformer? Are they used for measurement? To step down large voltages i guess using a high number of primary turns?

author: Zero999
author_rank: Super Contributor
timestamp: July 30, 2025, 02:54:06 pm
content: Quote from: wootwoot on July 30, 2025, 02:16:25 pmThat's pretty much it. I also wouldn't be surprised if transformers didn't exist in the earlier SPICE versions, but couldn't find anything definitive.QuoteYes, the turns ratio of a current transformer is 1:100 or more. Look at it another way. One way to measure current is to use a current sensing resistor and the burden resistor connected to a current transformer is just that: a current sense resistor.The transformer has advantages to just using a plain old current resistor:Isolation from hazardous voltages and much lower voltage loss. If the current transformer has a ratio of 1:1000, the voltage drop across the burden resistor is 1000 times that of the primary winding. The burden resistor might drop 10V, yet the drop across the primary will be a little over 10mV, to account for losses. Another way to look at it is the transformer divides the burden resistor's value by the turns ratio squared as well as dividing the primary current boosting the voltage. A turns ratio of 1:1000, reduces the burden resistor's value by a factor of 10002or a million.Designing an isolation amplifier with a gain of 1000 would be expensive and require an external amplifier. The current transformer does all of that with no external power supply.Yes, technically a voltage transformer is for measuring voltage, but I was also referring to most power transformers which can be operated open circuit, with no problem.