Hello,
I was trying to model the current saturation in inductor using a piecewise equation . I tried to make a macro myself . The macro compiles successfully but it shows no saturation whatever the dc value of current becomes . I am adding the code below .
.SUBCKT in0 n0 n2
R_R1 n0 n1 320m * modelling the internal resistance of the inductor
Vn n3 0
HI_2_V n1 n2 Vn 1 * copying the current in the inductor to a voltage
Epwl_ n5 0 TABLE {V(n3)} = (-.57V,0V) (-.36V,57.4uV) (-.34V,65.6uV) (-.3V,73.8uV) (0V,82uV) (.34V,65.6uV) (.36V,57.4uV) (.57V,0V)
Gind n1 n2 LAPLACE { V(n1,n2)/V(n5,0) } {1/s} * V(n5,0) is my value of inductance and this equation makes the 1/Ls equation
.ENDS
I used R1 to model the internal resistance of the inductor .Please note that whenever I tried to used the command TABLE with a current controlled current source it returned an error . That is why , I first converted the current in n0 n1 to a voltage n3 and then created TABLE which returns the requires 'value' of inductance in Volts. And I used this value to model the inductance in the last line using Laplace 1/Ls
I connected a voltage source to the this model and gave a DC offset to it . But I couldn't observe any significant saturation in the current waveform .
I am quite new to coding macro in TINA . If there is any better way to model the inductance current saturation , plz tell me . I am attaching the simulation file too .
Thanks and Regards
Deepak Mathew