Thanks for the replies. I will look into XSPICE and VerilogA. My concern with both is how to debug with them. Andy
Well here is the first piece of the jigsaw that I found on the KiCAD forum: .subckt RPOT 1 2 3 R1 1 2 {value*ratio} R2 2 3 {value*(1-ratio)} * below are default parameters, which are required by some simulators .param value=1k .param ratio=1 .ends So I now need a way of taking the two inputs and converting that to a ramp up or down of the RPOT ratio. Andy
I need to create a spice model of an actuator in order to test a circuit I am reverse engineering. This actuator has two inputs, A and B, and each input can be 0V, NC or 12V, giving nine possible combinations. Only two of the combinations do anything, the others just cause the actuator to hold position. The actuator moves in two directions, up and down and this is represented electrically by a linear change in resistance on an output. I.e. the actuator contains a variable resistor connected to the...
Thanks. I call ngSpice_Circ and pass the netlist witthout a .tran or .control. I then send the command circbyline .tran xxxxx. I then send the command bg_run and nothing happens - simulation doesn't start. Do you have an example sequence for using bg_run? Thanks, Andy
If I call ngSpice_Circ it runs automatically just the same as using the command circbyline - so I don't get a chance to send bg_run. If I miss off '.end' then I get an error from ngSpice_Circ that '.end' is missing. Sending bg_run anyway gives an error that there are no circuits loaded.
There is a return value for the SendData callback - what does that do? I am returning zero. Is there a value that can be returned to stop the simulation cleanly?
Thanks. If I send the command 'quit' from the SendData callback it immediately corrupts memory inside ngspice.dll and crashes the application. I don't want to pause and resume, just stop the simulation.
I am running a simulation using ngspice.dll and I feed in the netlist using circbyline. When I feed in .end then the simulation starts. My simulation could take a couple of minutes to run. If the user chooses to stop the simulation how can I cleanly do this? Thanks, Andy
Ah! Thanks Holger! I have 488 vectors so that is why I didn't know the time info was buried in there - makes sense. Andy
Hi, I am running a simulation by calling ngspice.dll and sending commands, mostly circbyline. When the .end is passed the simulation starts. I can see that the SendData callback is being called and passing values for the nets but I don't see any timestamp information to know where in time that set of data relates to. I am using .tran 8us 200ms 0 which means 25,000 steps. The SendData callback is being called 28,667 times, so it seems I can't just increase a counter by 8 for each call to keep track...
Many thanks Holger - much appreciated. Andy
I am thinking about creating a PC application that calls ngspice.dll to perform a simulation and show the user the results. I've looked at the API description in the manual but before I invest a lot of time in this, does the DLL API allow me to do the following: Manipulate the netlist so I can change VDC to VPWL, etc? I am guessing not but I can parse the netlist file in my own code and do this by changing the lines before feeding them to the DLL. Correct? Obtain a series of time-value pairs for...
Thanks Clyde and Marcel! I think I have what I need now to get my project done. :) Andy
Thanks Marcel, I will double-check this with what I was doing. Any ideas about the .four error I am getting? Andy
Hi Marcel, I tried to do that but just by using the '*' ngspice kept telling me there was no such vector. After an hour of fiddling I gave up and decided it was quicker and easier to do the multiplication myself. Andy
OK, I changed it from AVG to RMS. meas tran rmsv rms V(E3-INJ1-5) meas tran rmsi rms I(VINJCUR1) which gives me: 2.42W a big increase over the average result. What I am trying to do is size components for a pulsed waveform. Go too high and they are physically too large. Andy
I am using ngspice 37 - current windows build downloaded from sourceforge today. I tried this command: .four 50 I(VINJCUR1) and I get: .four: no such command available in ngspice but it seems to be in the manual for ngspice? Andy
Hi Marcel, This is a pulsed waveform that is nearly all above zero volts. So how do I get ngspice to give me the average power consumption? Thanks, Andy
Hi Marcel, Sorry, I don't understand. I am multiplying two averages which have been calculated over 200ms by ngspice, so won't that give an average power over 200ms, not instantaneous? Andy
I have a resistor and an inductor in series connected to the net 'E3-INJ1-5' and this net has pulses and spikes on it. I would like to calculate the average power. Is my method right? I have added a 0V DC voltage source in series with the resistor and inductor called VINJCUR1. I then added the measurements: meas tran avev avg V(E3-INJ1-5) meas tran avei avg I(VINJCUR1) which gives me: avev = 1.698772e-01 from= 0.000000e+00 to= 2.000000e-01 avei = 6.291746e-02 from= 0.000000e+00 to= 2.000000e-01 So...
Hi Giles, many thanks for your work on this! Your slicing idea looks interesting and I will see if I can give that a try! Thanks, Andy
Hi Giles, Thanks. I am running the ngspice windows DLL from pyspice. I'm not sure where this downloads from: conda install -c conda-forge pyspice conda install -n base numpy pyspice-post-installation --install-ngspice-dll pyspice-post-installation --check-install regards, Andy
I looked through all of those examples and I didn't see one that combined edge detection with TO/FROM, so I am still unclear how they are combined. Andy
I gave it a try and it just returns the width of the first pulse every time. Examples: .meas tran pw1 TRIG "V(E3-INJ1-5)" VAL=2.5 RISE=1 TARG "V(E3-INJ1-5)" VAL=2.5 FALL=1 .meas tran pw2 TRIG "V(E3-INJ1-5)" VAL=2.5 RISE=1 FROM=100m TARG "V(E3-INJ1-5)" VAL=2.5 FALL=1 TO=150m .meas tran pw3 TRIG "V(E3-INJ1-5)" VAL=2.5 RISE=1 FROM=200m TARG "V(E3-INJ1-5)" VAL=2.5 FALL=1 TO=250m as if the FROM and TO parameters are being ignored. Andy On Thu, Aug 11, 2022 at 10:42 AM Andy ajayre@users.sourceforge.net...
Thanks Giles! - I now see it in the manual in section 15.4.6 (but no example using them is given it seems?). What confused me with the manual was looking at section 17.5.44 which only shows one general form and that doesn't include FROM and TO, so I didn't see them. Andy On Wed, Aug 10, 2022 at 11:57 PM Giles Atkinson gatk555@users.sourceforge.net wrote: What may work is to also capture the time of the leading edge of the pulse and use that to calculate a window where the next leading edge is expected,...
Thanks Clyde but this is simulating an existing board and that has ringing from inductors so the fact that the ringing in the simulation matches the real thing is actually what we want. :) Andy On Wed, Aug 10, 2022 at 4:12 PM Clyde clyde73@users.sourceforge.net wrote: Why don't you post a waveform? If there is so much ringing, this makes me believe something is horribly out of whack and I would fix that first? Clyde Measuring Pulse Widths https://sourceforge.net/p/ngspice/discussion/133842/thread/973e152274/?limit=25#bf9f/d891...
My circuit outputs a train of pulses, 100ms apart and I want to measure the widths of a set of four pulses. I set up the tran simulation settings to capture 450ms which will give me four pulses. The problem is that the falling edge of each pulse has ringing and I don't know for sure how many time the ringing will cross the measurement threshold. For example I measure the first pulse using: .meas tran pw1 TRIG "V(E3-INJ1-5)" VAL=2.5 RISE=1 TARG "V(E3-INJ1-5)" VAL=2.5 FALL=1 and this works fine. However...
Hi Clyde, Only if you want to satisfy your own curiosity. :) I think we will make multiple pulse width measurements and average them in different situations, automating it from pyspice. Andy On Fri, Aug 5, 2022 at 4:32 AM Clyde clyde73@users.sourceforge.net wrote: Shall I slap a comparitor on the output of the multivibrator to square it up and add a chunk of more bibolar transistors and see how it goes? Or have I beaten this into the ground? Differences in Versions https://sourceforge.net/p/ngspice/discussion/133842/thread/cd8201b6c7/?limit=25#4fd5/8421/c9ed/11f2...
Thanks Clyde for giving it a try! What is causing this must be some corner-case or model I am using but without simplifying my circuit (which I can't do) I guess I won't be able to get to the bottom of it. I do appreciate your help!!! Andy On Thu, Aug 4, 2022 at 11:13 AM Clyde clyde73@users.sourceforge.net wrote: And I get essentially the same answer in version 34 and 37. Clyde Differences in Versions https://sourceforge.net/p/ngspice/discussion/133842/thread/cd8201b6c7/?limit=25#4fd5/8421/c9ed/ba0f/5b41/ee98...
KiCAD 5.1.12 uses ngspice-34. Andy On Thu, Aug 4, 2022 at 1:21 AM Holger Vogt h_vogt@users.sourceforge.net wrote: What is the ngspice version in KiCad 5.1.12? Differences in Versions https://sourceforge.net/p/ngspice/discussion/133842/thread/cd8201b6c7/?limit=25#39c1 Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/ngspice/discussion/133842/ To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
I have a large circuit that produces pulses on an output and I am using a .meas statement to get the pulse width. For the same netlist I have found that different versions of ngspice produce different pulse widths. For example: ngspice built into KiCAD 5.1.12 (Windows): pulse width = 3.277ms Standalone ngspice 36: pulse width = 3.250ms That is a difference of 27us in measurements. That may be small percentage-wise but it is significant for us because we are trying to compare the simulation output...
Many thanks Clyde! Andy On Sat, Jul 30, 2022 at 3:27 AM Clyde clyde73@users.sourceforge.net wrote: Andy, Invariably those diodes are just stock small signal germanium diodes. Here is a model for the ubiquitous 1N34A which should get you past the next hurdle. Clyde .MODEL 1N34A D ( bv=75 cjo=0.5e-12 eg=0.67 ibv=18e-3+ is=2e-7 rs=7 n=1.3 vj=0.1 m=0.27 ) ****** Model Generated by MODPEX *Copyright(c) Symmetry Design Systems All Rights Reserved UNPUBLISHED LICENSED SOFTWARE Contains Proprietary Information...
I used the document that was in the link Clyde gave and I was able to create a basic model. I haven’t verified it but it instantly improved our circuit compared to the real thing so thanks for that! The next problem is the diodes. There are about four different kinds based on appearance. We can easily measure the forward voltage drop for each but how can we create basic models that incorporate the voltage drop without knowing anything more about them? The most common kind has colored stripes but...
Thanks for all of the replies! We are trying to reverse engineer a 1970's circuit board. We have the real thing running on a bench with external stimuli and we have what we think is an accurate schematic, now we are comparing the two side-by-side to see if the schematic really is correct. So I think step 3 is all that we need and we are just trying to get "close enough" that we can write a document describing what each block of this board does and for a given set of external stimuli the output can...
I need to create a model for the AUY21 PNP transistor. I have managed to find a datasheet but how to do this is beyond me. I found an article that shows how to re-create the graphs from a transistor datasheet into Pspice Model Editor which then spits out various values needed for the model (https://www.youspice.com/spice-modeling-of-a-bjt-from-datasheet/2/) , which I don't have. Any hints or pointers? Thanks!
Great description Dick - much appreciated! Andy
Thanks Giles!
I have some input pulses with 2n edges. Worked in simpler circuits. I changed then to 1m edges and that seems to avoid the problem.
I added: .options CHGTOL=1e-25 and the problem moves to a 2n2 capacitor. Andy
Now simulating a large schematic where I have added the custom models I have been working on and I get: doAnalyses: TRAN: Timestep too small; time = 5.57393e-09, timestep = 2.73995e-18: trouble with node "b.xmps1.blc#branch" From the netlist: XMPS1 AUX9-BP E15-MPS E8-MPS E10-MPS ENGINE_VAC 0 mps How do I debug this? I know that this means a solution could not be found. How do I work out what b.xmps1.blc#branch relates to? This model is my vacuum LVDT: .subckt mps pri1 pri2 sec1 sec2 vacpin gndpin...
OK looks like I have to rename all of my transistors from Txxx to Qxxx. What threw me is that the error I was getting was not for the first transistor in the netlist - it was in the middle. Andy
Large circuit and I am getting this: Circuit: KiCad schematic Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Fatal error: t301: transmission line z0 must be given doAnalyses: no such parameter on this device here is T301: .model S2066 pnp ... T301 Int-A1 AUX18-BP Net-_R303-Pad1_ S2066 I can't see what the problem is with this transistor. Attached is the circuit diagram. How do I debug this? Thanks, Andy
Cool, it works! I can now vary the vacuum from 0 to 15 over time. Andy
Ah, thanks!
Ah, so the ( and ) in the functions is the problem? Andy
Here is my current attempt to allow a voltage to be applied to represent the vacuum. Circuit: KiCad schematic PTerror: syntax error PTerror: syntax error PTerror: syntax error PTerror: syntax error Error on line 0 : b.xmps1.bla xmps1.b xmps1.c v= v(xmps1.la_int2) * ( ( ( ( v(net-_mps1-pad5_,0) ) == 0.0000000000e+00 ? 3.7500000000e-01 : ( v(net-_mps1-pad5_,0) ) == 1.0000000000e+00 ? 3.7500000000e-01 : ( v(net-_mps1-pad5_,0) ) == 2.0000000000e+00 ? 3.5800000000e-01 : ( v(net-_mps1-pad5_,0) ) == 3.0000000000e+00...
Thanks! I was able to get it working. Andy
Thanks Clyde! Upon further research it seems I need to implement my configurable inductors as B sources so that I can change the inductance based on a PWL waveform input during simulation, which is my end goal. Current I have to set the vacuum level at the start of simulation and I can't change it, so I want to represent vacuum with voltage and a PWL. Andy
Here is the start of my subcircuit: .subckt mps pri1 pri2 sec1 sec2 vac * Primary coil inductance look up table by vacuum, in Henry .func LpriTable() { vac == 0 ? 375m : vac == 1 ? 375m : vac == 2 ? 358m : vac == 3 ? 350m + : vac == 4 ? 342m : vac == 5 ? 335m : vac == 6 ? 327m : vac == 7 ? 320m : vac == 8 ? 313m + : vac == 9 ? 306m : vac == 10 ? 300m : vac == 11 ? 292m : vac == 12 ? 286m + : vac == 13 ? 279m : vac == 14 ? 271m : vac == 15 ? 265m : 1e308; } vac is a pin that I apply a DC voltage to....
Probably a basic question but I've tried all variations of print and echo that I can find and they give errors. I have the following subcircuit .SUBCKT airtemp 1 2 PARAMS: A=0.001806885 B=0.000261256 C=0.000000615 T=20 .PARAM D={ ((1/(T+273.15))-A)/(2*C) } .PARAM E={ (B/(3*C))**3 } .PARAM F={ SQRT(D**2+E) } .PARAM G={ EXP(PWR(D-F,1/3)+PWR(D+F,1/3)) } R 1 2 {G} The resistance G doesn't seem to be what I expected. I am measuring it with a voltage divider. How can I print out the intermediate values...
Thanks Clyde! PDF is attached. Andy
Waveforms. Andy
Well I ,managed it. Took a lot of components. Had to work around the internal timestamp too small issue by changing the circuit. I have managed to put this circuit into a subcircuit .lib file for used as a single component. Andy
OK, got it working, must have been something to do with me missing out the ON/OFF statement. Using a pulse generator and it's better. Thanks, Andy
OK, got it working, must have been something to do with me missing out the ON/OFF statement. Using a pulse generator and it's better. Thanks, Andy
Doh! Thanks. I changed roff=1Meg but now V(OUT) is always zero for an input voltage of 2V and 5V. Andy
Thanks but I can't get it to work. Here is the .lib: .subckt vcs in_pin out_pin vcc_pin gnd_pin .model vcs_switch sw vt=5.0 vh=0.2 ron=1 roff=1M S1 in_pin out_pin vcc_pin gnd_pin vcs_switch .ends If I input 5V to pin 3 then I get 12V out. If I input 2V to pin 3 I still get 12V out (expected 0V). .title KiCad schematic .include "VCS.lib" V2 Net-_V2-Pad1_ 0 dc(12) VBOGUS1 Net-_V2-Pad1_ E24-12V dc(0) V1 INT-6 0 dc(2.0) XS1 E24-12V OUT INT-6 0 vcs R1 OUT 0 1k .tran 0.05ms 260ms 253m .control run rusage...
Just to clarify, I want to set each switch to a different threshold voltage and I want to be able to clearly see what that is for each switch, that is why I am trying to use the spice_model field. See this screenshot. Thanks, Andy
I set the spice_primitive to 'S' and set the spice_model to SW VT=4.5 VH=0.5 RON=1M ROFF=1 and I get: s1 e24-12v nc_06 int-6 0 sw vt=4.5 vh=0.5 ron=1m roff=1 Unable to find definition of model sw - default assumed What am I missing? Thanks, Andy
I set the spice_primative to 'S' and set the spice_model to SW VT=4.5 VH=0.5 RON=1M ROFF=1 and I get: s1 e24-12v nc_06 int-6 0 sw vt=4.5 vh=0.5 ron=1m roff=1 Unable to find definition of model sw - default assumed What am I missing? Thanks, Andy
Thanks. How do I create a voltage controlled switch in KiCAD? I notice that someone posted a library to the KiCAD forums a couple of years ago but that link is now dead. I've created a component with four pins - two for voltage and two for the switch. I've set the spice_primitive to SW. What do I enter for the spice_model field? Something like: SW(VT=4.5 VH = 0.3 RON=1M, ROFF=1) ? Thanks, Andy
I have a switch that I would like to simulate, ideally as a single component (with a suitable model), but I am not sure how to go about it. The switch needs to have a position value as an input. This is 0% to 100%. I know from my LVDT simulation topic from a couple of months ago how to pass a variable into a model so I can do that bit. The switch has four outputs. Closed when input is 0% to 2%, otherwise open Closed when input is > 92%, otherwise open Output A Output B As the switch moves from 2%...
With Clyde's help I am almost there: meas tran high trig v(E13-PG) val=1.5 rise=1 targ v(E13-PG) val=1.5 fall=1 meas tran low trig v(E13-PG) val=1.5 fall=1 targ v(E13-PG) val=1.5 rise=2 let period = low+high let dutycycle = high/period let circle = 360 let dwell = circle * dutycycle print dwell which gives me 1.2e+02.
Great, that works nicely! Thanks Holger!
With Clyde's help I am almost there: meas tran high trig v(E13-PG) val=1.5 rise=1 targ v(E13-PG) val=1.5 fall=1 meas tran low trig v(E13-PG) val=1.5 fall=1 targ v(E13-PG) val=1.5 rise=2 let period = low+high let dutycycle = high/period let circle = 360 let dwell = circle * dutycycle print dwell which gives me 1.2e+02. Would be nice if I could get this to display
Sorry, another question. If the period of this waveform corresponds to 360 degrees can ngspice convert 6.0e-02 (in seconds) to 120 (in degrees) and display that value? Thanks! Andy
Thanks Holger that worked! It gives me 6.0e-02 (in seconds). Is there a way to have ngspice convert the display to 60 (in milliseconds) automatically to make it a bit more user-friendly? Thanks, Andy
Here is the simulation output. I am interested in the green waveform at the bottom. On the command line I run these: ngspice 16 -> meas tran max MAX v(E13-PG) from=150m to=160m max = 3.000000e+00 at= 1.599868e-01 ngspice 17 -> meas tran max MAX v(E13-PG) from=200m to=210m max = 0.000000e+00 at= 2.099997e-01 but when I try to measure the time between the first rising edge and the first falling edge I get "out of interval". What am I missing? ngspice 23 -> meas tran tdiff trig v(E13-PG) val=3.0 rise=1...
I went through the range of vacuum levels and compared real to simulated peak voltages on input and output. To get them to correlate I had to reduce the simulated impedance of my scope and add an 11k parallel resistance to the output. Andy
Still struggling with this. My scope documentation says the output impedance is 600 Ohms, so how can I simulate that? If I tell my scope to generate a -1V -> 1V (2V ptp) sine wave with it's 600 Ohm output, is this right: I = V/Z = 1 / 600 = 1.67mA Create a 50Hz constant current source sine wave with parameters 0 1.67m 50 ? Thanks, Andy
I found the exact same description of this problem from another PicoScope user, so it seems this is all generated by the PicoScope. https://www.picotech.com/support/topic39334.html so I will first try matching the simulation to the actual input signal and see how close I am before considering getting a dedicated sine wave generator with low output impedence. Thanks, Andy
Thanks Dick.
Hi Marcel, Yes, the LVDT works, I have confirmed that by putting into it's circuit and running it. I have noticed a significant difference between the simulation and my test setup. I am using a waveform generator on my scope to generate the input sine wave. I have this set to 2V ptp and confirmed it is correct by using an input channel on my scope. When I connect the waveform generator to the LVDT the amplitude is reduced. For example it becomes 1.2V ptp at 50Hz. Increasing the frequency of the waveform...
Hi Marcel, This device does not have a differential output. It has an input coil and an output coil (only one secondary). Four wires total. Pulses are applied to the input and the pulses induced on the output are used for the basic pulse shape and timing passed to the rest of the circuitry. The circuit that drives this device is what I am ultimately trying to simulate so I can understand it better but first I want to get the model right so if there is a problem I know it is elsewhere. When a vacuum...
Thanks Marcel, so looking at your questions it seems the spice side should be OK and the problem is the measurement data. I am using a scope for the sine wave generation and measurements. Where did you get 50Hz from? No distortion that I see. Inductance was measured with an LCR meter. I'm not aware of a way to directly measure k so the method I used calculated it. Its two windings, made by Bosch in the 1960s/70s for fuel injection. I make measurements for 15 difference core positions. Thanks, An...
Thanks Marcel, so looking at your questions it seems the spice side should be OK and the problem is the measurement data. I am using a scope for the sine wave generation and measurements. Where did you get 50Hz from? Inductance was measured with an LCR meter. I'm not aware of a way to directly measure k so the method I used calculated it. Its two windings, made by Bosch in the 1960s/70s for fuel injection. I make measurements for 15 difference core positions. Thanks, Andy
Hi Marcel, Thanks. Getting closer. The output max voltage is now 542mV but the real device is 765mV, so much better, however I have spotted a more fundamental problem. This device changes the inductance based on vacuum, where vacuum is 0 -> 15. I've now added the look-up tables using the solution you gave in the other thread and the circuit and model is below so you can try it. When I simulate this: vac = 0 => 542mV max voltage for sine wave output vac = 15 => 581mV max voltage for sine wave output...
Hi Marcel, Thanks. Getting closer. The output max voltage is now 542mV but the real device is 765mV, so much better, however I have spotted a more fundamental problem. This device changes the inductance based on vacuum, where vacuum is 0 -> 15. I've now added the look-up tables using the solution you gave in the other thread and the circuit and model is below so you can try it. When I simulate this: vac = 0 => 542mV max voltage for sine wave output vac = 15 => 581mV max voltage for sine wave output...
Many thanks Marcel - that works great!!! Andy
OK, so I have taken my real LVDT, measured L1, L2 and calculated M and k. I have taken the Cadence example and put the values into it to construct a subckt. I've added a 675 Ohm load to the output and in the simulation I feed in a 1kHz sine wave 2V ptp. I get a 1kHz sine wave out that is 1.2V ptp. Then I do the same thing with the real LVDT. Using my scope I feed in a 1kHz sine wave 2V ptp and with a 675 Ohm load I get out a 1kHz sine wave that is only 765mV ptp, so there is a large difference between...
Thanks Dick, I've just tried it and I get an error: .if (vac == 0) alterparam Lpri=375m .endif reset => Error: too few nodes: reset regards, Andy On Sun, Dec 19, 2021 at 11:41 AM dick freebird dfreebird@users.sourceforge.net wrote: Can you get the table() value into a vector and then use alterparam (+ 'reset')? Or use table() as an argument to alterparam directly? In the manual examples I only see constants as arguments but maybe in the examples that accompany the source, you may find syntax clues...
Hi Marcel - I tried that, see my previous message for the syntax I used and the error I got. Andy
Thanks Dick, I've just tried it and I get an error: .if (vac == 0) alterparam Lpri=375m .endif reset => Error: too few nodes: reset regards, Andy
A couple of things I have tried with no luck. Note that I am running ngspice from KiCAD. .param Lpri {if(vac == 0, 374m, if(vac == 1, 500m, if(vac == 2, 250m)))} ... {Lpri} ... => Undefined number [lpri] .func Lpri2(vac) {if(vac == 0, 374m, if(vac == 1, 500m, if(vac == 2, 250m)))} ... Lpri2(0) ... => Undefined number [if] Thanks, Andy
For example I have an inductance Lpri that is used to define the values of multiple resistors and inductors. I currently pass that as a parameter to the subckt but I would like to vary it based on another parameter where the relationship between the two is not an equation but experimental results. I don't want to hard-code the value and have it appear multiple times in the subckt as that is messy and error-prone when changing it. Thanks, Andy
Thanks Holger - evaluation up front is what I want - a look-up table to initialize a variable based on a parameter to the subckt. Is there another way to do that?
Thanks Marcel!
Thanks Holger - evaluation up front is what I want - a look-up table to initialize an inductor based on a parameter to the subckt. Is there another way to do that?
How can I use a table to initialize a parameter? I have tried this but it generates syntax errors. .param Lpri = TABLE{vac} = (0,374m) (1,462m) where vac is a parameter passed to the subckt. Thanks!
How can I use a table to initialize a parameter? I have tried this but it doesn't work. .param Lpri = TABLE{vac} = (0,374m) (1,462m) where vac is a parameter passed to the subckt. Thanks!
I now have a list of data for various levels of movement of the core I know L1, L2, M and k. I see that k remains fairly constant at 0.92 while M declines as the core is removed. How do I now apply that to my spice model? Seems I can just set k to 0.92 and then change L1 and L2 for each test that I want to run, but what else is needed? So far that doesn't seem to be the sophisticated multi-domain model you mentioned. I've found on the Cadence website this: https://resources.pcb.cadence.com/blog/2019-creating-a-linear-transformer-model-for-circuit-simulations...
I now have a list of data for various levels of movement of the core I know L1, L2, M and k. I see that k remains fairly constant at 0.92 while M declines as the core is removed. How do I now apply that to my spice model? Seems I can just set k to 0.92 and then change L1 and L2 for each test that I want to run, but what else is needed? So far that doesn't seem to be the sophisticated multi-domain model you mentioned. Thanks!
Thanks. I have the real device so I can measure the K factor for various core positions along with the inductances. Do you have any hints on how I can take those measurements and make a more accurate model? Thanks.
Thanks. Resistances are correct. When the core moves the inductances change on the real device. So I should keep K at 1 and change the inductances, right? Can I do that in the Spice_Model line, e.g. mps1 Lin=672m just overriding one or two of the parameters?
Thanks. Resistances are correct. When the core moves the inductances change on the real device. So I should keep K at 1 and change the inductances, right?
Hi Marcel, Yes, you are right. Besides that is there any other reason why this wouldn't work? Also the k-factor is not used when both inductances are given, right? Thanks.
I would like to simulate a custom transformer in KiCAD. It's actually an LVDT. I have created a custom transformer symbol called TR1 with two coils and pins: 1, 2, 3 and 4. Primary coil is between pins 1 and 2. I have created a text file called MPS.lib containing: .subckt mps1 in1 in2 out1 out2 Lin=501m Lout=1.043 Rin=92.8 Rout=345.1 inductances Li in1 intin {Lin} Lo out1 intou {Lout} coupling factors K1 Li Lo 1 * series resistances Ri intin in2 {Rin} Ro intou out2 {Rout} .ends I have edited the...
I would like to simulate a custom transformer in KiCAD. It's actually an LVDT. I have created a custom transformer symbol called TR1 with two coils and pins: 1, 2, 3 and 4. Primary coil is between pins 1 and 2. I have created a text file called MPS.lib containing: .subckt mps1 in1 in2 out1 out2 Lin=501m Lout=1.043 Rin=92.8 Rout=345.1 inductances Li in1 intin {Lin} Lo out1 intou {Lout} coupling factors K1 Li Lo 1 * series resistances Ri intin in2 {Rin} Ro intou out2 {Ro} .ends I have edited the symbol,...
I would like to simulate a custom transformer in KiCAD. It's actually an LVDT. I have created a custom transformer symbol called TR1 with two coils and pins: 1, 2, 3 and 4. Primary coil is between pins 1 and 2. I have created a text file called MPS.lib containing: .subckt mps1 in1 in2 out1 out2 Lin=501m Lout=1.043 Rin=92.8 Rout=345.1 inductances Li in1 intin {Lin} Lo out1 intou {Lout} coupling factors K1 Li Lo 1 * series resistances Ri intin in2 {Rin} Ro intou out2 {Ro} .ends I have edited the symbol,...