Arbitrary (saturable) coupled inductors in LTSpice - Page 1
Forum section: electronics / projects

author: uer166
author_rank: Super Contributor
timestamp: June 21, 2019, 11:32:20 pm
content: Trying to simulate saturable coupled inductors/transformers in LTspice for some current sensing project, but seems like I can't couple arbitrary inductors.I would like to simulate a transformer with a defined saturation level, slope, and hysterisis, but seems like I'm going about it the wrong way?I tried readinghttp://ltwiki.org/?title=Transformers,but seems incomplete regarding this topic.. Anyone know what to do?

author: cur8xgo
author_rank: Regular Contributor
timestamp: June 22, 2019, 12:12:35 am
content: I dont know how to do this I just googled it..this looks interestinghttps://electronics.stackexchange.com/questions/243927/transformer-with-hysteresis-in-ltspice

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: June 23, 2019, 02:07:51 am
content: Quote from: uer166 on June 21, 2019, 11:32:20 pmCan you provide details of the core that you are looking to model?I will also need the winding information.This can be done in LTspice, I will try and do it for you.Regards,Jay_Diddy_B

author: uer166
author_rank: Super Contributor
timestamp: June 23, 2019, 09:46:45 pm
content: The core itself is inconsequential, just trying to figure out a general way to do it. As example, and should be pretty close to something realistic I would use:Core material is Square Orthonol:https://www.mag-inc.com/Products/Tape-Wound-Cores/Square-Orthonol/Square-Orthonol-Material-Property-CurvesSome arbitrary core size: 0.5cm^2 cross section area, 10cm magnetic path length.Turns: 20 turns per winding, 1:1 ratio.Use case would be: apply a known DC voltage to one winding, wait for current to ramp and saturate, look at the EMF output of secondary winding.

author: ahbushnell
author_rank: Frequent Contributor
timestamp: June 24, 2019, 12:49:58 am
content: Quote from: uer166 on June 21, 2019, 11:32:20 pmHere is a paper on the topic from TI.http://www.ti.com/lit/ml/slup109/slup109.pdfNonlinear simulation can be complicated. Depends on what you are trying to do.TI as other sources of information. And your local library.Good luckAndy

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: June 24, 2019, 02:04:47 am
content: uer166 and the group,I am going to repeat the experiment that is shown in this MIT video:Link:Using the Magnetics Inc Square Orthonal Material with a core that has a 10cm path length and a 0.5cm2cross section.The Magnetic Inc datasheet shows the BH loop as:The H units are Oested. The conversion from Oested to A/m is multiply by 79.58I will use the Chan model that is described in the LTspice help file.The following material properties are needed:Hc from the material datasheet is 0.16 Oested = 12.7 A/mBs = 1.4TBr= 1.38TThe core dimensions are also needed:BH loop modelThe core model is put in a test circuit, similar to the one shown in the MIT video.The following BH loop can be plotted. This matches the datasheet.Bias Current ModelThe model can be modified to measure inductance versus bias current. The bias current is stepped and a small ac current is used to measure the inductance..The result is:I have attached the LTspice models for those playing along at home.Regards,Jay_Diddy_B

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: June 24, 2019, 02:25:28 am
content: Hi,Now that we know that the model is working we can strip off the 'instrumentation' used to measure B and H.We are left with:This gives the expected result:I have attached the LTspice model.Regards,Jay_Diddy_B

author: BravoV
author_rank: Super Contributor
timestamp: June 24, 2019, 03:28:43 am
content: Jay_Diddy_B, always admire your ltspice kungfu kicks, thanks.

author: uer166
author_rank: Super Contributor
timestamp: June 24, 2019, 05:58:31 pm
content: All I can say is: holy crapThis might take some time to wrap my head around it, but thank you for amazing work!

author: ahbushnell
author_rank: Frequent Contributor
timestamp: June 26, 2019, 12:03:40 am
content: Quote from: Jay_Diddy_B on June 24, 2019, 02:25:28 amLooks linear. Have you tested in the nonlinear region? Validated with real parts?Looks good.

author: uer166
author_rank: Super Contributor
timestamp: June 26, 2019, 12:37:08 am
content: "Have you tested in the nonlinear region?"Oh yes, in simulation the saturation looks great, very similar to real-world trace (albeit of another core).I don't have these specific cores yet but the non-linear region seems to be accurately simulated, which is what I care about most in this application.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: June 26, 2019, 02:28:42 am
content: Quote from: ahbushnell on June 26, 2019, 12:03:40 amThe Square Orthonal material is normally used in special applications. The Magnetics Inc website says:Square OrthonolSquare Orthonol, a grain-oriented 50% nickel-iron alloy, is manufactured to meet exacting circuit requirements for very high squareness and high core gain, and is usually used in saturable reactors, high gain magnetic amplifiers, bistable switching devices, and power inverter-converter applications. Other applications such as time delays, flux counters and transductors demanding extremely square hysteresis loops require selection of Square Orthonol.I am not convinced that this is good material for current transformers. A small amount of dc current will cause the core to saturate.The model matches the Magnetics Inc datasheet for the material.I have used the Chan model for ferrite material and found it to be reliable.Regards,Jay_Diddy_B

author: uer166
author_rank: Super Contributor
timestamp: June 26, 2019, 04:40:33 am
content: Quote from: Jay_Diddy_B on June 26, 2019, 02:28:42 amIt is not a current transformer, rather a DC current sensor based on a different effect. The mechanism relies on the core to be easily saturated, and it does so at some frequency in the "bistable switching devices" use case as postulated by manufacturer of the core.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: June 26, 2019, 12:20:21 pm
content: Quote from: uer166 on June 26, 2019, 04:40:33 amHi,So you want to model a dc current sensor, similar to the one described here:Link:https://www.nutsvolts.com/magazine/article/magnetic-saturation-and-the-100-amp-dc-current-transformerI can modify the model, using the same core described in my earlier post, to include the DCCT functionality:I am stepping the input current from -100A to 100A. The circuit works as described in the Nuts and Volts article.The core is an oscillator, a low pass filter is needed to extract the average value.I have attached the LTspice models.Regards,Jay_Diddy_B

author: uer166
author_rank: Super Contributor
timestamp: July 02, 2019, 10:55:07 pm
content: I think fundamentally the operation of that 100A coil is the same as in what I have in mind, except I'm trying to make use of the coercive magnetization to make a sort of "pseudo"-differential measurement of low current values (in order of a couple mA DC).Basically go one way into saturation, then the other way, and see where the current hits the "wall" that coincides with the Hc point. This wall will move in opposite directions when there's another source of DC flux in the core, making measurement possible.While simulation works great, while waiting for hardware, I'm trying to see all potential real world issues.One thing I'm having a hard time reconciling is the ridiculous change of Hc (Coercive force) with frequency. (Example attached). This means that the location of the "HC wall" shifts with frequency, but I can't visualize how that looks like when one applies some field to the core.What does this really mean? To me, the coercive force is just how much field you need to create in opposite direction to reset the magnetization of material once it hit saturation one way. Why would frequency affect that? Are they talking about a simple sinusoidal field? What happens if the field is close to a square wave? Does that mean the simulation is woefully incorrect since it implies a constant Hc, which is actually 10s or 100s of times higher at high frequency (e.g. at the square wave edges)?This doesn't seem trivial, but I wonder if it's possible to simulateeven more arbitrarycores where the BH curve itself shifts with frequency (becomes much wider at higher frequencies), as it does in real life.

author: emece67
author_rank: Frequent Contributor
timestamp: July 03, 2019, 11:57:46 am
content: .

author: uer166
author_rank: Super Contributor
timestamp: July 03, 2019, 06:26:38 pm
content: Quote from: emece67 on July 03, 2019, 11:57:46 amIt's a simple ungapped toroid. I just use the cross section area and magnetic path length in my simulation. The cores I'm looking at are made by winding a very thin strip of Nickel-Iron or Cobalt-Iron alloy onto a bobbin, I'm assuming to decrease eddy currents, although I presume there is still current flowing in loops in sort of a planar fashion in the metal..

author: emece67
author_rank: Frequent Contributor
timestamp: July 05, 2019, 08:04:55 am
content: .

author: uer166
author_rank: Super Contributor
timestamp: July 24, 2019, 01:35:15 am
content: Sort of, I'm trying to select appropriate cores and basically specify the "ideal" values. I need as high permeability as possible in the Hc regions to make the measurements easier. What's core conductivity? you mean electrical conductivity to calculate eddy current losses? Unfortunately no idea on this one.. Maybe I can take it apart and see, but I know these are very thin (double digit microns?) Nickel or Cobalt-iron tape wound cores.As an update: so far so good! First prototype current meter with a Toshiba core has a DC offset of about 200uA, can measure +-150mA with 2KHz bandwidth, or 20KHz bandwidth if I do less filtering in DSP, at the expense of some noise which would still be less than 1mA RMS. Attached is me manually putting some DC current through core using a power supply with approx. values. and seeing the output. Error is around 0.1% at 20mA which is wayyy better than expected.Also the scope trace are the 2 coil currents of the self-oscillating core, and the ADC sampling ISR in yellow.

author: uer166
author_rank: Super Contributor
timestamp: July 24, 2019, 01:41:23 am
content: Quote from: ahbushnell on June 26, 2019, 12:03:40 amI did now!

author: ahbushnell
author_rank: Frequent Contributor
timestamp: July 24, 2019, 02:17:03 am
content: Cool,Very good.

author: uer166
author_rank: Super Contributor
timestamp: October 02, 2019, 01:47:20 am
content: So I'm a bit stuck now, just as I thought everything was figured out. In general the sensor that was implemented is able to measure down to 0.2mA resolution of DC current with various cores.What the issue is: some cores seem to exhibit highly asymmetric magnetic properties when saturated clockwise vs. counter-clockwise. I'm relying on the symmetry for the sensing, so it blows it all out of the water. I've seen resultant DC offsets of anywhere from 1mA to 20mA caused by this effect.Some observations:It's a consistent core-to-core variation. Cores that are symmetric are always symmetric, ones that aren't, never areIn some cores there's a huge dependence on mechanical stress. If I squeeze a core it can change the level of asymmetry dramaticallyI tried various materials, including Metglas 2714A and some Chinese suppliers. I thought it was a quality issue at first, but even expensive Metglas fails?The asymmetry is somewhere between highly temperature dependent and temperature dependent, so can't simply calibrate it outThe integral of the current going through core seems to still be same one way vs. the other, only shape is different with an inflection pointI've read abouthttps://en.wikipedia.org/wiki/Exchange_biasand similar things, but found no practical info as to how to combat it, or how to specify a core that is fully symmetric..It's possible that I'm going about it the wrong way and the usual peak detection circuit usually used for fluxgate sensors is more appropriate. Right now I'm sampling the current approximately in the coercive force regions to detect asymmetry caused by another current source.

author: uer166
author_rank: Super Contributor
timestamp: November 29, 2019, 03:20:29 am
content: I know it's been a while, thanks for helping out with this thing, the simulation was key to make the sensor work! Also a variation of this made a nice fluxgate magnetometer that picks up earth's field pretty well, useful in a compass application. Would you be able to explain how you coupled the inductors via the .subckt statement? I've tried to draw the V1, E1, F1 sources with their connections as per the statement but still really confused by it..

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: November 30, 2019, 03:03:02 am
content: Quote from: uer166 on November 29, 2019, 03:20:29 amLet me try and build it up.The coreBwinding ModelThis is what the circuit looks like described by these directives:params: n=1 is the default number of turns. The default is one turn.n is the number of turns on that winding..global coreBThis is essentially a global variable that is shared between all the sub-circuits. This how the windings are coupled together.This circuit is an ideal transformer winding. The left side is a single turn winding. The right side is n times bigger in amplitude. F1 draws n times the current from the single turn side.WBxThis is used to define a winding using the coreBwinding subckt.The parameters include setting n, the number of turns and series and parallel resistors.Winding modelThe model includes the parallel and series resistors as shown above.Two winding transformerYou can build a two winding transformer like this:This transformer is 1:1 and is placed in a test circuit. The symmetry is obvious. The model will work equally well if the primary and secondary are swapped.Non-LinearityAs shown so far the model does not include any non-linearity and has no core saturation.The core can be added by connecting the non-linear inductor between coreB and ground.Regards,Jay_Diddy_B