Help with the simulation of Phase 90 on LTSpice!!! JFET's giving 0.3 Volt sweep

Started by savethewhales, September 05, 2020, 11:17:12 PM

Previous topic - Next topic

Rob Strand

QuoteCurious, I plotted the one Zener in my spice. (Yes, a 4.7V breakover is different from a >7V breakover.) At 0.4mA (9V through 10K) it reads a little low, though not as low as is reported for P90s.
The MXR is nominally 5.1V (so perhaps a 1N751 is more the shot ) and ends up at 4.8V @ 420uA.

So some very crude scaling for the 4.7V 1N750 would be 4.8 * (4.7 / 5.1) = 4.4V @ 420uA.
Your sim shows the model at 4.1V to 4.2V so not too bad.

But yes for > 7V or so the knees are on the spice models are probably a bit softer than a real zener.

Of hand the one in this thread is the Motorola/On-semi model and think they only use BV which is the sloppy model.
Some manufacturers have more elaborate sub-circuits.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

savethewhales

Quote from: Rob Strand on September 08, 2020, 07:26:12 PM

The low current thing is a real effect.   For transistors the spice models are quite good and can represent real life.  However just like you found with the two JFET models, the spice model for a given part might not be trustworthy unless you verify it - which takes extra effort.


Yeah, I wouldn't want to take that "effort" because I actually want to build the pedal, so no spare time.

Quote from: Rob Strand on September 08, 2020, 07:26:12 PM

For the zener the low voltage a low currents is a known characteristic of zeners.   People have measured the voltage on the MXR pedals over the years and it does come out around 4.8V.

There's no zener model in spice and zener models are the least trustworthy.   Many won't show enough drop in voltage at low currents.


I will actually assume 4,8 V then (I will have to trust you and mr. PRR), cause I understand that it doesn't do as well as we imagine, never, and it makes sense that at a low current, there's less voltage drop. 

Quote from: Rob Strand on September 08, 2020, 07:26:12 PM

If you take your simulation you have a solid Vbias.    Physically that's not realistic but it's often a good strategy.   To make the simulation better you would use the human knowledge that the zener voltage is 4.8V and not the 5.1V on the label.    The simulation would represent reality quite well and you don't have to deal with the messy problem of having an exact zener model with a 10k resistor to 9V, which is going to give you 4.8V anyway!

In general you have to have a good level of mistrust in spice.    The models are rarely good.   Different models from different manufacturers vary.    I've got about 5 models for LM741 opamps and only one or two are even close to reality.    For AC simulations, I don't even use real models I use something like LTspice's model "opamp";  IIRC the supplied model had a bug.  For .TRANS you need on opamp model with PSU rails.


Yeah, I'm going to do that, or at the worst case, try to simulate with the LTSpice zener model with modified values for what I want (like 5.1 V/ 4.8 V etc).
I'm getting to know better Spice and assume that it's kinda getting on my nerves. But I will keep the information you are telling me for the future.
One thing I would ask is if there's any better/reliable/free software for simulation than Spice (maybe MultiSim?)?

Quote from: Rob Strand on September 08, 2020, 07:26:12 PM

The key thing is it doesn't plot gain.   It plots dBV, which is defined as

    dbV = 20*log10( V  / 1V)  = 20*log10(V)

It is simply a conversion of volts to dB without any consideration of the input source level.   

For gain you need,

     dB gain = 20*log10(Vout/Vin).   

So the two only agree when Vin is 1V.

You can actually plot expressions in LTspice and other Spice versions, so if you wanted you could plot the AC analysis expression,

      Vout/Vin

and then plot would show  dB gain = 20*log10(Vout/Vin).

In some versions of spice the variable expressions are already in dB and to get gain you can type something like Vout - Vin, which is actually dB(Vout) - dB(Vin).


I know what is dBV and dBu etc, cause I actually learned it at college, and that's really why I thought it was strange that those results were given to me as dB in software. In this matter, I didn't understand well how I can get "the real" dB in Spice. Maybe doing that dB(Vout)-dB(Vin) as you said, is that it? If so, where do I write the expression?

Quote from: Rob Strand on September 08, 2020, 07:26:12 PM

Unfortunately with spice sims it only takes one thing to go wrong and it all falls in a heap; like not plugging in the power on your breadboard.   Small differences between packages can confuse things.    I often start with simple dumb circuits where you already know the answer, then run a lot of sims and play with the waveform plotter.   No doubt you will find some things which don't make sense.  Good to keep notes.


For my case, I already knew what was supposed to come out of the circuit (out of the phase shifting part) but of course if I wanted to "test" a component (like I ended up doing on the JFET) I would have to do simple circuits and see through my own eyes how it responded.

Quote from: Rob Strand on September 08, 2020, 07:26:12 PM

I'm not sure what you are asking here.


Better forget it, neither I do, as I'm looking back.

savethewhales

Quote from: PRR on September 08, 2020, 09:43:21 PM

Yes, don't trust SPICE at all, or its models.

The "sag" of Vz at low currents is 'normal' of course; philosophically it must go to zero at zero current, and there may be no "magic current" where it jumps-up to rated value.

Curious, I plotted the one Zener in my spice. (Yes, a 4.7V breakover is different from a >7V breakover.) At 0.4mA (9V through 10K) it reads a little low, though not as low as is reported for P90s.



Yeah, that of the Zener current makes all sense.

It's actually impressive what you plotted there. Pretty curious how the Zener diode operates under lower currents. In this case, the plot is of the only zener that there is on Spice right?  And did you put that Bv yourself or does it come like that? Another thing is where is the 10k? Are you refering to the current that goes to the zener on the schematic of the P90? Or smth else?

Would you reccomend me using another way to have a reference voltage, or the Zener would serve me well, for the likes of the P90 schematic? Because the maximum that will happen is that I will not have as linear a frequency sweep on the output as I would want if I use a Zener and it changes voltage too much, I guess.

Quote from: Rob Strand on September 08, 2020, 10:56:47 PM

The MXR is nominally 5.1V (so perhaps a 1N751 is more the shot ) and ends up at 4.8V @ 420uA.

So some very crude scaling for the 4.7V 1N750 would be 4.8 * (4.7 / 5.1) = 4.4V @ 420uA.
Your sim shows the model at 4.1V to 4.2V so not too bad.

But yes for > 7V or so the knees are on the spice models are probably a bit softer than a real zener.

Of hand the one in this thread is the Motorola/On-semi model and think they only use BV which is the sloppy model.
Some manufacturers have more elaborate sub-circuits.


Funny thing is I bought this one: https://www.musikding.de/Zener-51V-05W_1 and I'm already predicting it's not very accurate for sure.

I understand where you're trying to get, but where did this expression came from: 4.8 * (4.7 / 5.1) = 4.4V @ 420uA ?

Rob Strand

Quote
I'm getting to know better Spice and assume that it's kinda getting on my nerves. But I will keep the information you are telling me for the future.
One thing I would ask is if there's any better/reliable/free software for simulation than Spice (maybe MultiSim?)?
Most simulators are basically spice.   Spice mostly works.   The root of the problems that come up are quite technical and there's multiple layers to the causes.

Spice is just a big calculator.   Each type of device is based on a mathematical model of the device, for example there is a mathematical model for a diode.   The mathematical model has parameters which are different for each part, for example the parameters for a 1N4004 diode are different to the parameters for a 1N4148 diode.

So the problems,
1) The parameters in the model don't represent reality.  I'd say this is the biggest problem in spice.   
   As you can imagine this will happen on any package.  For example you have a 1N4148 diode model  but in spice the behavior doesn't match the real part.   This is exactly the problem you had with the JFET.   There's not much you can do.  Try another model or tweak the parameters yourself.  What I do is verify models just like I verified the JFET and found the problem.   After that I make notes explaining which models are bad and which are good.  In the end you create you own set of verified models.   These are the models you know work.

2) The parameters are sort of correct.    The model works at say 1mA but it doesn't work at 10uA.    This is common as well.
     There are two causes:

      2a) the spice parameters for the part are only partially correct.   Whoever created the model didn't match the full behaviour
         of the device.   This one is pretty common as well.
         The fix is to try another model, one from a different source or manufacturer.

      2b) The mathematical model in spice isn't good enough to cover a wide range of operating conditions.
             So this is like the zener case.    You can tweak the parameter to be roughly right in one region, say Iz=20mA,
             but when you look at 20uA it is way off.     You get similar problems with MOSFETs as well.

            Not much you can do.  In some cases I have two models one for high-currents and one for low currents.

One way people deal with case 2b is to come up with a macro model.   This is a whole circuit which better models the part.
https://www.onsemi.com/pub/Collateral/AND8250-D.PDF

In theory this is OK but the problem with these models is: they are not available for many parts.  You have to work out the
parameters from the datasheet or from measurements.   Because model is more complex you have a lot more parameters to
tune-up.    Most people that do this use numerical optimization software to choose the parameters based on a least squares fit.
Way beyond what most people do.

The next step up from the macro model is to come-up with better sets of equations that represent the parts.   You will see this in research papers.   The only way you will get those equations into spice is with a complex macro model, or re-compile the spice engine with a new model.    Also, you it has the same problem as the macro model that you have a heap of parameters to tune-up.

QuoteI didn't understand well how I can get "the real" dB in Spice. Maybe doing that dB(Vout)-dB(Vin) as you said, is that it? If so, where do I write the expression?
Don't use the dB()-dB() thing in LTSpice, that only makes sense in *some* *other* spice programs.  In LTspice you would type,  V(Vout)/V(Vin) where Vout and Vin are labels you have added.   The *waveform viewer* will convert the linear variables to dB.

To add expressions right click on the plotted variable that appears at the top of the Waveform Viewer window; you need to have plotted something already.   The change what is displayed by typing in an expression.

Quote
For my case, I already knew what was supposed to come out of the circuit
You pretty much have to be on your guard all the time.   If you trust your models and you know what silly mistakes you do then it's a lot easier to pick up problems.    I've used spice for about 35 years and there's plenty of stuff I trust 99%.  I don't even bother doing hand calculations because I know spice will do the same darn thing with no effort.    However, if I grab an unverified model for a part I don't trust it at all.   That's especially true for IC models.  For things like diodes, transistors and jfets  I might choose not to use a model from the web which matches the part number, I'll use one of my trusted models which is close first.
Quote
I understand where you're trying to get, but where did this expression came from: 4.8 * (4.7 / 5.1) = 4.4V @ 420uA ?
If we know the 5.1V zener is 4.8V at 420uA  then we know the voltage drops by a factor of 4.8/5.1.
So if we assume the 4.7 zener drops roughly by the same factor at low currents, we expect it to be 4.7 * (4.8/5.1) = 4.4V @ 420uA as least to ball-park accuracy.  I wouldn't be confident applying the factor to a 9.1V zener as they will not behave like a 5.1V zener.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

PRR

> if there's any better/reliable/free software for simulation than Spice (maybe MultiSim?)?

SPICE is a black box.
https://en.wikipedia.org/wiki/SPICE
http://bwrcs.eecs.berkeley.edu/Classes/IcBook/SPICE/
I *have* piped hand-typed text files to SPICE, a very long time ago. What everybody uses is a "spice package" such as Orcad/Pspice, NGspice, LTspice, Tina-TI, NL5, Cadence, Proteus, MultiSim, SIMetrix, Beige Bag, Electronic Workbench............. generally a bundle of schematic input, test parameters, pre- and post-processing and viewing, with at least a starter pile of parts (models).
  • SUPPORTER

PRR

> where is the 10k? Are you refering to the current that goes to the zener on the schematic of the P90?

It is generally as easy to solve for "ALL cases" as for the "P90 case". I swept the zener voltage around the nominal voltage and plotted the current. Now I have a reference, not just for 9V 10k, but for 50V 2k 300V 300k etc.

It might be clearer, in retrospect, to sweep current from 1uA to 100mA. I know zeners and know it make no difference; some other parts/systems it might.
  • SUPPORTER

Rob Strand

One thing which is interesting is the spec for the 1N750 says the slope is Zd = 19 ohms @ 20mA  but the simulation is about 3 ohms @ 20mA.    If you look at the1N5230B datasheet it quotes the same value, and in addition a Zd value at a lower current.

If you imagine modifying the curve to change the slope (actually 1/slope) from 3 ohms to 19 ohm  it's a big change in slope.   It hardly seems possible to get that slope to pass through 4.4V @ 420uA - even as a curve drawing exercise, never mind a model.   I did a simple change to the model to match Zd = 19 ohms @ 20mA and it hits 10mA @ 4.4V.




FWIW the 19 ohm could the maximum although it does not say so in the datasheet.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

savethewhales

Quote from: Rob Strand on September 09, 2020, 11:09:27 PM

Most simulators are basically spice.   Spice mostly works.   The root of the problems that come up are quite technical and there's multiple layers to the causes.

Spice is just a big calculator.   Each type of device is based on a mathematical model of the device, for example there is a mathematical model for a diode.   The mathematical model has parameters which are different for each part, for example the parameters for a 1N4004 diode are different to the parameters for a 1N4148 diode.


Yeah, I even got problems with literally the 1N4148 if I'm not mistaken hahahah (or smth involved with amplifiers).

That of writing down what is right/wrong could help a ton. I just don't feel the need right now because I'm realising the other JFET model you sent me works fine.

Quote

In some cases I have two models one for high-currents and one for low currents.


This is really smart. I'll start doing that when I need it. The part where I don't know yet is changing the parameters myself, which I would kindly ask you to teach me if you'd be able to.

Quote

One way people deal with case 2b is to come up with a macro model.   This is a whole circuit which better models the part.
https://www.onsemi.com/pub/Collateral/AND8250-D.PDF


Super interesting. I'll check on that when I can. It seems really hard to get this right, but in theory seems what's correct, as the components are never linear.

Quote

Don't use the dB()-dB() thing in LTSpice, that only makes sense in *some* *other* spice programs.  In LTspice you would type,  V(Vout)/V(Vin) where Vout and Vin are labels you have added.   The *waveform viewer* will convert the linear variables to dB.

To add expressions right click on the plotted variable that appears at the top of the Waveform Viewer window; you need to have plotted something already.   The change what is displayed by typing in an expression.


Ok now this helped me a lot. I get the actual gain of the circuit. It's 5 dB no matter what voltage I put, which makes total sense (the why's will come later).

Quote

You pretty much have to be on your guard all the time.   If you trust your models and you know what silly mistakes you do then it's a lot easier to pick up problems.    I've used spice for about 35 years and there's plenty of stuff I trust 99%.  I don't even bother doing hand calculations because I know spice will do the same darn thing with no effort.    However, if I grab an unverified model for a part I don't trust it at all.   That's especially true for IC models.  For things like diodes, transistors and jfets  I might choose not to use a model from the web which matches the part number, I'll use one of my trusted models which is close first.


Wow 35 years it's a heck of a long time on this soft. How do you know when a Model is verified? I'd like to learn that, and to be able to change my models to what I want, but that's what I asked above hahah.

Quote

If we know the 5.1V zener is 4.8V at 420uA  then we know the voltage drops by a factor of 4.8/5.1.
So if we assume the 4.7 zener drops roughly by the same factor at low currents, we expect it to be 4.7 * (4.8/5.1) = 4.4V @ 420uA as least to ball-park accuracy.  I wouldn't be confident applying the factor to a 9.1V zener as they will not behave like a 5.1V zener.

Wow this is smth else, I don't think I got it but I got it at the same time. I'd have to do simulations to see with my own eyes (don't think I'm doubting.. I won't forget what you're saying here.)

savethewhales

One thing, I just received my shipment of components, and I ordered a matched set of 4 FET's, which (as I did the JFET VGS R.G. Keen's test) are matched at around -0.7 V (2x -0.7 and 2x -0.67). That didn't seem to satisfy me, and at the same time this didn't surprise me. Does anyone think these too low values and this 5% difference will make a big deal on the phaser? I'm just thinking a 0.7 Volt sweep (or less) on the LFO might be too low (I would have to change the integrating time I guess).

savethewhales

Quote from: PRR on September 10, 2020, 04:12:12 PM

SPICE is a black box.
https://en.wikipedia.org/wiki/SPICE
http://bwrcs.eecs.berkeley.edu/Classes/IcBook/SPICE/
I *have* piped hand-typed text files to SPICE, a very long time ago. What everybody uses is a "spice package" such as Orcad/Pspice, NGspice, LTspice, Tina-TI, NL5, Cadence, Proteus, MultiSim, SIMetrix, Beige Bag, Electronic Workbench............. generally a bundle of schematic input, test parameters, pre- and post-processing and viewing, with at least a starter pile of parts (models).

Okk, understood... So for what I'm seeing, I must choose the best user interface for me and I should be good to go, right?

Quote

It is generally as easy to solve for "ALL cases" as for the "P90 case". I swept the zener voltage around the nominal voltage and plotted the current. Now I have a reference, not just for 9V 10k, but for 50V 2k 300V 300k etc.

It might be clearer, in retrospect, to sweep current from 1uA to 100mA. I know zeners and know it make no difference; some other parts/systems it might.


Okk nice! I will do the simulation myself too, it's good for me to understand (and put on my project maybe hahah).

savethewhales

Quote from: Rob Strand on September 11, 2020, 02:05:57 AM
One thing which is interesting is the spec for the 1N750 says the slope is Zd = 19 ohms @ 20mA  but the simulation is about 3 ohms @ 20mA.    If you look at the1N5230B datasheet it quotes the same value, and in addition a Zd value at a lower current.

If you imagine modifying the curve to change the slope (actually 1/slope) from 3 ohms to 19 ohm  it's a big change in slope.   It hardly seems possible to get that slope to pass through 4.4V @ 420uA - even as a curve drawing exercise, never mind a model.   I did a simple change to the model to match Zd = 19 ohms @ 20mA and it hits 10mA @ 4.4V.




FWIW the 19 ohm could the maximum although it does not say so in the datasheet.

I would like to know this kind of simulation.. I will give it a try and give feedback here. Cause I'm not understanding much, what I get is that you can prove that the simulation doesn't reflect real life in this case.

Another thing is the impedance which you refer , how do you calculate it? It's not only Voltage/Current in this case , right? Like if the voltage is 4.7 V and the current is 20mA, shouldn't the impedance be 235 ohm? hahhahah

savethewhales

Quote from: PRR on September 08, 2020, 09:43:21 PM
Quote from: Rob Strand on September 08, 2020, 07:26:12 PM...the zener voltage is 4.8V and not the 5.1V on the label.  ... problem of having an exact zener model with a 10k resistor to 9V, which is going to give you 4.8V anyway!

Yes, don't trust SPICE at all, or its models.

The "sag" of Vz at low currents is 'normal' of course; philosophically it must go to zero at zero current, and there may be no "magic current" where it jumps-up to rated value.

Curious, I plotted the one Zener in my spice. (Yes, a 4.7V breakover is different from a >7V breakover.) At 0.4mA (9V through 10K) it reads a little low, though not as low as is reported for P90s.


PRR, regarding this post, how do I plot current? Because when I add traces I can't seem to find the right current, there's only current in the Zener diode and current of the source...



Rob Strand

QuoteThe part where I don't know yet is changing the parameters myself, which I would kindly ask you to teach me if you'd be able to.
It's largely a mathematical game.   You have to know the relationship between measurements or datasheet specs and the spice parameters.   It's helps to pull-up the equations spice uses and to know the equations for the "basic theory" of a device.   Some things are easy but on the whole it's quite difficult and you need to pull on a lot of knowledge.    Much easier is to try a few models form other sources or manufacturers and just try them.  (It's very much like software development, if the library you downloaded doesn't work you can find another one or spend many hours fixing the broken one.)

QuoteIt seems really hard to get this right, but in theory seems what's correct, as the components are never linear.
There's no corrrect model yet, only OK-ish models, and small improvements.   If you read the opening paragraphs of this paper, you begin to see the problem,
https://www.aeng.com/articles/Zener.pdf

Quote
One thing, I just received my shipment of components, and I ordered a matched set of 4 FET's, which (as I did the JFET VGS R.G. Keen's test) are matched at around -0.7 V (2x -0.7 and 2x -0.67).
RG's tester is fine for matching but the actual voltages you measure are always low (in magnitude).  Maybe a factor of 1.5 or so (can't remember the details).  If you go to section 11 here,
http://runoffgroove.com/fetzervalve.html
The resistors in the source are much higher.   You need 1M ot 10M.   BTW, connecting your multimeter alone can be 1M or 10M, even without the resistor in the circuit.

Quote
Ok now this helped me a lot. I get the actual gain of the circuit. It's 5 dB no matter what voltage I put, which makes total sense (the why's will come later).

That's weird.  It's like the voltage used for the AC sim isn't the one you are changing.   Best thing here is to probe you input voltage  voltage source.   Make sure it follows what you set.     Are you sure you are changing the AC value?  If you the DC value or the SINE magnitude it will not affect the AC simulation at all - they are all different numbers.

Quote
How do you know when a Model is verified? I'd like to learn that, and to be able to change my models to what I want, but that's what I asked above hahah.
When it matches the datasheet and/or the measurements.   Also you might verify a model with DC bias points but that doesn't not verify it for frequency response.   For example DC bias lets you tune the gain and Vbe of a transistor but it gives no indication of the AC performance.   So you need to very under different conditions.   Then neither of those will verify when the transistor is operated as a switch!

QuoteI would like to know this kind of simulation.. I will give it a try and give feedback here. Cause I'm not understanding much, what I get is that you can prove that the simulation doesn't reflect real life in this case.
The problem here is real life doesn't seem to make sense.  The slope at 20mA is from datasheet.  The 4.4V at 420uA is from measurements.  It looks like both together can't make sense.  That was my main point.   When that happens I start to suspect the meaning of the the values in the datasheet.  You get maximum values, minimum values and typical values.     Our measurements are usually close to typical, you don't really know.    However, you rarely get real devices which are at the minimum and maximum.  In fact manufacturers may not even have produced them.   If something went wrong they are "allowed" to ship them because they are still in spec.

I wouldn't worry to much about the example, other than it shows something isn't right.  I'm starting to think the datasheet is the maximum Zd even though it doesn't actually say that.

QuoteAnother thing is the impedance which you refer , how do you calculate it? It's not only Voltage/Current in this case , right? Like if the voltage is 4.7 V and the current is 20mA, shouldn't the impedance be 235 ohm? hahhahah

It's a parameter given for Zeners.    It represents how constant the voltage is when the current is varied.   The resistance increases at low current, which means that zeners don't regulate well at low currents.    If a zener was 4.7V at 20mA and 4.8V at 21mA  then the (local) slope is (4.8-4.7)/(21mA - 20mA) = 100 ohm.   That would be a zener that doesn't regulate too well.     In fact if you just had a 235 ohm resistor  it would produce 4.7V drop at 20mA and 4.935V ar 21mA.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

Here's an example showing how RG's tester produces small Vgs measurements.

Take a 2N5485,  from datasheet some representative parameters are,
VP = 2.25V
YFS0 = 5250uS
IDSS= 5.91mA   (consistent with VP and YFS0)

RG's circuit tests by adjusting VGS so the drain current is such that there is 4.5V across a 10k resistor, ie.

   ID_test = 4.5 / 10k = 450uA

The JFET equation is,

   ID  = IDSS (1+ VGS / |VP|)^2   ; VGS  <= 0

The VGS value measured by RG's tester will be

  450uA   = 5.91mA  (1+ VGS/|VP|)^2

ie.

VGS/|VP|  =  - 0.724

So the VGS measurement will be,

VGS_meas  =    = -0.724 |VP| = - |VP| / 1.38

Which is quite a bit lower than |VP|.

In this case we can get the true VP by multiplying VGS_meas by 1.38.

Unfortunately the multiplying factor depends on the actual IDSS for that specific JFET.  You can't use the datasheet IDSS.   You would need to measure IDSS for each JFET in order to get a correction factor for each JFET.

A correction factor of 1.4 is only good for ball-park comparisons against other testers.

The GGG tester tests at a much lower current and the measured |VGS| is much closer to |VP|.   For a 10M resistor it's very close indeed.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

PRR

It may not be necessary to quote-back the ENTIRE text you are responding to.

Quote from: savethewhales on September 11, 2020, 09:12:25 PM....PRR, regarding this post, how do I plot current? Because when I add traces I can't seem to find the right current, there's only current in the Zener diode and current of the source...

What other currents did you expect to find?

A single loop with no side-loops, the current is the same anywhere in the loop.

Basics like that come before fine details of crappy model approximations.
  • SUPPORTER

savethewhales

Quote
...It's largely a mathematical game... you can find another one or spend many hours fixing the broken one.)

Ok thank you very much. The thing is, do I change them in those lib folders in the Spice menu? Or elsewhere?

QuoteThere's no corrrect model yet...
https://www.aeng.com/articles/Zener.pdf

Yeah I understand that.. At least it’s better than the normal models.
I read it and it really gives life and meaning to what we were talking here in the forum…

Quote
RG's tester is fine for matching but the actual voltages... BTW, connecting your multimeter alone can be 1M or 10M, even without the resistor in the circuit.

So you’re saying they’re low, as for they’re wrong?
The resistors in the text you sent are really very big (differently from R.G's test), but I will give it a try, then.

Quote
That's weird...  they are all different numbers.


I did the testiings changing the input (AC small-signal) and putting there a probe (and the gain). Here you go:

Voltages are 0.1, 0.5, 1, 2, 15 V.











Quote
When it matches the datasheet and/or the measurements... Then neither of those will verify when the transistor is operated as a switch!

Alright, that’s important. But you don’t go there verifying every component you use, or do you? Like really seriuosly, if I would do that it “seems” (because it’s just a guess) that it would take a very long time.

Quote
The problem here is real life doesn't seem to make sense... I'm starting to think the datasheet is the maximum Zd even though it doesn't actually say that.

Fair enough, Just starting to understand the bullcrap regarding electronics.

Quote
It's a parameter given for Zeners... it would produce 4.7V drop at 20mA and 4.935V ar 21mA.

Nice… So it’s all about the slope then! And in the datasheet is it supposed to show the slope related to the maximum and minimum values of voltage? The slope that appears there should be related to the subtraction of the max/min I would suppose.

QuoteHere's an example showing how RG's tester produces small Vgs measurements...For a 10M resistor it's very close indeed.

Nice man! Understood, gonna do the GGG test as soon as I can. What is now pissing me is that R.G does refer to the values measured as VGSoff somewhere in the text, which is not correct…


savethewhales

Quote
It may not... Basics like that come before fine details of crappy model approximations.

You're right, I was quoting too much, but now I'm starting to understand this better...

It's just with the plot I would like to have reasonable results like yourself, and I didn't...

Oh and one more thing, the model approximations wasn't something I wanted to go more deep, I just wanted help to find me some model that would work, and that's what you guys helped me to. The rest of the discussion was important to me, but not mandatory.

savethewhales

Alright.. after writing down this message I went down and finally understood the problem. The current was inverted, of course, and I was able to plot it right doing -Id (as you did):




Rob Strand

 
QuoteThe thing is, do I change them in those lib folders in the Spice menu? Or elsewhere?

The general idea is covered here,
https://adamsiembida.com/adding-spice-models-to-ltspice/

A few of things worth adding:
- you can add models to your project folder, which is only available to the project,
  or, you can add them to the LTspice folders so they are available to all project.
The precise location of the folders depends on you OS, it's in the article.
- Normally you have to put a .lib or .inc on your schematic.
- You can put a heap of .models or .subckts in the one file to make a project library
  or you own personal library.
- The article talks about the <system path> \lib\sub folder.   There's also stuff
   in the <system path> \lib\cmp folder.
- On LTspice I haven't worked out how to add you own library without adding .lib or .inc;
   just as you don't need to add .lib or .inc for the "builti-in" LTspice parts

QuoteSo you're saying they're low, as for they're wrong?
QuoteWhat is now pissing me is that R.G does refer to the values measured as VGSoff somewhere in the text, which is not correct...
They are only wrong if you interpret them as VGS_off.   Some people have complained about this in the past.   The values produced by RG's tester are fine for matching.   However, yes, calling it VGS_off does cause problems; I guess that's my only beef.    The main problem is people on the group use different testers and that don't say which one they use.  So when people put up their VGS measurements you have no idea how to interpret the value.   If people say which tester they use then at least you can correct the values from RG's using the correction factor I calculated (or one like it). 


QuoteI did the testiings changing the input (AC small-signal) and putting there a probe (and the gain). Here you go:

Voltages are 0.1, 0.5, 1, 2, 15 V.

OK I get it.

When you plot gain (Vout/Vin) you *expect* the gain to be constant with level.    If you have a gain of 10 (20dB), 1V in is 10V out and 2V in is 20V out but in both cases Vout/Vin is 10 (or 20dB).     The whole reason for plotting Vout/Vin was to get a gain which is independent of Vin!   The other alternative, which is what I prefer,  is to plot Vout and use 1V inputs.  That way plotting Vout is the same as gain.    However, if for some reason you want to see the output voltage for a different input you just chain it - since you changed it you don't expect to see gain anymore.

I doesn't matter which way to you do so long as you know how to interpret the results - otherwise you will be scratching your head in frustration!  (And no,  I'm not immune to this even after 35 years of using spice,  I just do it less often.)

Quote
Alright, that's important. But you don't go there verifying every component you use, or do you? Like really seriuosly, if I would do that it "seems" (because it's just a guess) that it would take a very long time.
So the main problem is if you *never* check against reality you are just seeing numbers on the computer.  They could be anything.  One simple check against reality is what you expected, perhaps from rough calculations, perhaps from when you build the real unit, perhaps from experience, perhaps from common sense.

Beyond that yes it's a big job.    So the idea is you use existing models, if they look wrong, find another one.   If you develop a mistrust for all the models you need to check against reality.    Then if you are convinced all the models suck you need to create your own.

To tell you the truth I vary rarely enter a whole circuit from the "design" schematic into spice.   I use the least amount of models possible.   For example a circuit might have an oscillator using a NE555 timer.   I don't use the NE555 I use a spice square wave or rectangular wave.   That replaces 50 parts in a possibly non-working model with one part which has to work.   If I'm simulating AC response I never use opamp models ie. the ones with a power supply.   For opamps I'd use something like the 'opamp' model and type-in the Gain and Bandwidth product into the  parameters.   For a zener I use a voltage source.

For the phaser AC response I'd probably enter most of it like you have but with the simpler opamp model.   I would replace the LFO with a DC fixed DC voltage.   I might simulate the LFO separately to work out the peak to peak output voltage and frequency.   If I wanted the LFO I'd probably use spice voltage source to create a triangle wave.

Basically I don't *rely* on models.     My simulations are probably 10 times faster than most peoples.  They much easier to debug because most of it *has* to work.    When you plop down a whole heap of ICs with unverified models the results are hit and miss.

Quote
Fair enough, Just starting to understand the bullcrap regarding electronics.
There's a lot of it.    Some things are just technically difficult you might to know a whole book to answer one seemingly simple question.   However, things like datasheets can be difficult to interpret or don't have the full enough info.   It's often difficult to translate datasheet to spice models.  There are programs to do this but they aren't free.   There's a few sites on the web about converting datasheets to spice models

QuoteNice... So it's all about the slope then! And in the datasheet is it supposed to show the slope related to the maximum and minimum values of voltage? The slope that appears there should be related to the subtraction of the max/min I would suppose.
Slope is about how well the Zener regulate, which is kind of it's job.  The slope changes at different currents.     There's other issues like one manufacturer will rate their 4.7V zener at 5mA and another might rate theirs at  20mA or 43mA.    As far as the datasheet goes they are incomplete from a spice model perspective, or even a from a user perspective for that matter eg. little low current info.    For design we might care about worst case but for spice we might want to know typical.    The datasheet have a few spare points maybe Vz + Iz or Zz (slope) vs Iz.    Typical values aren't always given.    The manufacturer tests against the values in the datasheet, so they will use min and max.   that's all they are willing to guarantee you.     If you measured 10 zeners with the same part number and the same batch you might end-up with a different view  of the world, but at least one which will match the circuit you build.

A lot of parts are not precisely defined.   Look at transistors (BJTs).  The gain(hFE) in the datasheet is all over the map.   If you measured 10 real parts the hFE values will be tighter.   Next batch you might measure something else.    It's a moving target from a spice point of view.   At best you could come up with three models for the same part:  low gain, typical gain, high gain.    You might do your basic checks against typical  but  then you need to make sure the circuit at least works with high and low gain cases. 

The fine details of electronics is a headache.   You can go a long way with ignorance is bliss philosophy but one day it will catch up with you.   There's plenty of debugging threads on this forum with some very obscure problems, often they are very difficult to debug via forum posts.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

PRR

> The current was inverted

Same thing either way. SPICE tends to use the notion of current "IN" to a part leg, so if you probe the other leg (of a 2-leg part) you get the complement. But usually the direction is "obvious by inspection". Water runs downhill; if we start with a dry ocean and water on the mountain then water runs to the sea and air flows up the mountain to replace it. Same with electrons and positive conventional current.

I rigged the plot with LOG to cover a huge range. Your LIN plot exposes a model oddity: it is three straight (resistive) segments, no blending. Easy to compute but physically unlikely.
  • SUPPORTER