¿ªÔÆÌåÓý

Date

Re: using LTSPICE symbols for representation of spice netlist of OPAMP

 

Yes, you can take a standard symbol, edit the attributes, and save it as a "new" *.asy file. Easy peasy.


Re: 12AU7 tube heater model

 

¿ªÔÆÌåÓý

The model is obviously seriously wrong. I? really can't see why a simple formula Rhot = Rcold*(1 +aT + bT^2)? could not be used. That can't possibly 'blow up'. T = Thot - Tcold.

On 2025-02-21 14:01, Andy I via groups.io wrote:
Carlo,
?
In your latest uploaded file (12AU7heater.zip), try this:? Plot V(n001)/I(I1), which shows the effective resistance of the Heater.? Change the .DC sweep past 160m, to 200m.? (.dc I1 120m 200m 1m)
?
It will be difficult to see what happens, because the resistance goes "through the roof" around 168 ma.? But above that spike, the resistance becomes negative.? Click on the plotted formula at the top of the plot to enable the waveform "cursors", then drag the vertical cursor to the right, while noting the resistance values in the pop-up window.? To the right of the spike, they are negative.
?
The spike around 160 mA is the "singularity" I mentioned earlier.
?
This shows how the Duncan Amps heater model fails, when the heater's temperature becomes too great.? The resistance hits the singularity, then goes negative, causing the heater to generate energy instead of dissipating it.
?
By the way, you can eliminate that error message, by adding a 1T resistor across the heater.? That stops LTspice from thinking the nodes are floating.? Adding the 1T resistor changes the location of the singularity where the heater model "blows up", but it still has negative resistance when it gets too hot.
?
Andy
?
--
OOO - Own Opinions only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


Re: PWM Timing Causing Shoot-thru

 

Hi Andy!
?
I am still checking this thread.
?
I did include IR2110.sub in the zip file. I just downloaded my zip, extracted it to a folder and was able to run the simulation without any issues.
?
You are most likely absolutely correct about the "C" signals; I have not yet touched those. Was focused on "A" and "B".
?
Thanks!
-May


Re: 12AU7 tube heater model

 

On Fri, Feb 21, 2025 at 09:06 AM, John Woodgate wrote:

I see; the notation is confusing. But is the synthetic resistor then allowed to be zero ohms?

Hmm.? Define "zero ohms".? :-)
?
The current through the G-source can become zero, which it does when the voltage across it is zero.? It isn't zero ohms in that case.
?
I suppose it could become zero ohms too, but I am not sure if LTspice can handle the math for that, as a G-source.? Maybe an E-source would be better for that.
?
Andy
?
?


Re: 12AU7 tube heater model

 

¿ªÔÆÌåÓý

I see; the notation is confusing. But is the synthetic resistor then allowed to be zero ohms?

On 2025-02-21 13:42, Andy I via groups.io wrote:
On Fri, Feb 21, 2025 at 08:20 AM, John Woodgate wrote:

The term v(u1:hb,0) is in the denominator of the function and I think it is zero at startup.

It is in the numerator.
?
There are no parentheses around "(42 - 6.2)*v(u1:hb,0)".? Only "(42 - 6.2)" is in the denominator.
?
Andy
?
--
OOO - Own Opinions only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


using LTSPICE symbols for representation of spice netlist of OPAMP

 

Hello, In ltspice there are many modles and I like to use the standart symbols to represent the model.
When I create model from a netlist at worst I use a recrangle with pins? and at best I try to draw opamp by myselse and? the result genrally is not looking good.
Is there a way to plug somehow the attached CIR file to standart LTSPICE symbol.
(in AD797 they also have extra decompensation pin)
What could be done ??
Thanks.
?
/g/LTspice/files/Temp/ad797.cir


Re: 12AU7 tube heater model

 

Carlo,
?
In your latest uploaded file (12AU7heater.zip), try this:? Plot V(n001)/I(I1), which shows the effective resistance of the Heater.? Change the .DC sweep past 160m, to 200m.? (.dc I1 120m 200m 1m)
?
It will be difficult to see what happens, because the resistance goes "through the roof" around 168 ma.? But above that spike, the resistance becomes negative.? Click on the plotted formula at the top of the plot to enable the waveform "cursors", then drag the vertical cursor to the right, while noting the resistance values in the pop-up window.? To the right of the spike, they are negative.
?
The spike around 160 mA is the "singularity" I mentioned earlier.
?
This shows how the Duncan Amps heater model fails, when the heater's temperature becomes too great.? The resistance hits the singularity, then goes negative, causing the heater to generate energy instead of dissipating it.
?
By the way, you can eliminate that error message, by adding a 1T resistor across the heater.? That stops LTspice from thinking the nodes are floating.? Adding the 1T resistor changes the location of the singularity where the heater model "blows up", but it still has negative resistance when it gets too hot.
?
Andy
?


Re: 12AU7 tube heater model

 

On Fri, Feb 21, 2025 at 05:37 AM, Andy I wrote:
In the expanded netlist, Ghot connects to nodes U1:HB and 0.? U1:HB connects to the 1 milohm sense resistor, whose other end goes to U1:HA, which then connects through 6.2 ohms to node N001.? N001 is the one driven by the independent current source.? So the whole string of nodes N001, U1:HA, and U1:HB appear to be "floating" in the topology check.
Ah ok. The point is that, by removing both the independent current source I1 and the G-source Ghot from the overall topology, the topology check realizes that there is the series/string of R:U1:cool and R:U1:load resistors (connecting node N001 with U1:HB passing through the intermediate node U1:HA) that are actually disconnected from the rest of the circuit. Therefore the topology check complains that U1:HB node is floating and connected to the (controlled) current source G:U1:HOT.
?
?


Re: Looking for advice on TRAN timing #FFT

 

¿ªÔÆÌåÓý

If you're interested, I have a new tool, which is somewhat faster than the Analyser you mentioned and just as accurate.

I don't know for sure whether using (maximum) timesteps of binary fractions of the period are better, or not, but it is convenient. You might also find THD_Measurement_Test_Results.pdf useful. It shows the THD measurement floor as you increment the exponent, "n", in the expression Tmax = Period/2**n. There's no point in making Tmax shorter than necessary as it just makes the simulation slower for no benefit.

--
Regards,
Tony


On 21/02/2025 13:34, Ryu via groups.io wrote:

I'm looking for help concerning the timing parameters of a TRAN simulation
to evaluate the distortion of an amplified sine wave.
?
I've been reading through lots of messages of this group concerning "distortion" and "tran timing"
recently but could not find an answer to what I was looking for.
[I came across the audio distortion analyser contributed by Tony Casey,
for which I am thankful and it is indeed a fine tool.]
?
Hitherto I've used 1 or 2 per mille of the sine wave period, so the time step would be 1 usec or 2 usec
when testing with 1 kHz. From my tests I decided for myself that values exceeding 1% of the period
should best be avoided.
I also tested time steps adjusted to the power of 2, e.g. 2**14 (interval / 16384).?
?
For the interval (t_stop - t_start) I usually take 16msec when testing with 1kHz
but I have also used values from 10msec to 48msec.
It is this parameter which I personally find most difficult to decide upon.
?
So, to sum it all up, I wonder if there is a guideline which values to use for the time step
and the interval for a certain test frequency when testing audio related circuits with sine waves.
(I'm still using LTspice XVII.)


Re: 12AU7 tube heater model

 

On Fri, Feb 21, 2025 at 08:20 AM, John Woodgate wrote:

The term v(u1:hb,0) is in the denominator of the function and I think it is zero at startup.

It is in the numerator.
?
There are no parentheses around "(42 - 6.2)*v(u1:hb,0)".? Only "(42 - 6.2)" is in the denominator.
?
Andy
?


Re: 12AU7 tube heater model

 

On Fri, Feb 21, 2025 at 08:07 AM, Carlo wrote:
Looking at the complete circuit topology, U1:H2 node is the node where the subckt G-source Ghot joins the external DC independent current source (I1). In the overall circuit this U1:H2 node is connected to GND (0). However U1:HB isn't the node where the two current sources (internal and external) actually join.
I think you are confused about nodenames.
?
There is no U1:H2 node.
?
U1:H2 is a portion of the names of elements R:U1:H2 and C:U1:H2.? There is nothing named U1:H2, neither a node nor an element.
?
In the expanded netlist, Ghot connects to nodes U1:HB and 0.? U1:HB connects to the 1 milohm sense resistor, whose other end goes to U1:HA, which then connects through 6.2 ohms to node N001.? N001 is the one driven by the independent current source.? So the whole string of nodes N001, U1:HA, and U1:HB appear to be "floating" in the topology check.
?
Andy
?


Re: 12AU7 tube heater model

 

¿ªÔÆÌåÓý

The term v(u1:hb,0) is in the denominator of the function and I think it is zero at startup.

On 2025-02-21 13:07, Carlo wrote:
On Fri, Feb 21, 2025 at 04:31 AM, Andy I wrote:
But LTspice doesn't know this.? It sees the circuit topology as a current source connected to another current source, and it thinks the node where they join is "floating".? So it generates the error message, but it continues to process the netlist anyway, and everything works!
Looking at the complete circuit topology, U1:H2 node is the node where the subckt G-source Ghot joins the external DC independent current source (I1). In the overall circuit this U1:H2 node is connected to GND (0). However U1:HB isn't the node where the two current sources (internal and external) actually join.
?
Here the expanded netlist:
? ? --- Expanded Netlist ---
* C:\Users\carlo\Documents\LTspice\Bravo_Ocean_ampli\12AU7heater.asc
r:u1:cool n001 u1:ha 6.2?
r:u1:load u1:ha u1:hb 1m
b:u1:¡ìesens u1:hd 0 v=v(u1:ha,u1:hb)*1000?
b:u1:¡ìepwr u1:he 0 v=v(n001,0)*v(u1:hd)/(pwr(6.3 ,2)/ 42)
r:u1:h1 u1:he u1:hf 91k
c:u1:h1 u1:hf 0 1.05e-05?
b:u1:¡ìeh2 u1:hg 0 v=v(u1:hf)?
r:u1:h2 u1:hg u1:hh 270k
c:u1:h2 u1:hh 0 1.05e-05?
b:u1:¡ìeh3 u1:hj 0 v=limit(v(u1:hh)-0.75,0,1e6)*4?
r:u1:h3 u1:hj u1:hk 91k
c:u1:h3 u1:hk 0 1.05e-05?
b:u1:¡ìghot u1:hb 0 i=(1/(v(u1:hg)+0.001))/(42 - 6.2)*v(u1:hb,0)
i1 0 n001 150m
.dc i1 120m 160m 1m
.end
?
ERROR: Node U1:HB is floating and connected to current source G:U1:HOT
?
--
OOO - Own Opinions only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


Re: Looking for advice on TRAN timing #FFT

 

Time step: Set to half (or less) the period of the highest harmonic you are interested in.

Hmm.? That is a necessary requirement to get anything resembling the right frequency in the simulated waveforms.? But it does not get you a good spectrum from which you can estimate distortion.? For that, time step needs to be MUCH smaller.
?
Andy
?


Re: Looking for advice on TRAN timing #FFT

 

On Fri, Feb 21, 2025 at 07:34 AM, Ryu wrote:
Hitherto I've used 1 or 2 per mille of the sine wave period, so the time step would be 1 usec or 2 usec
when testing with 1 kHz. From my tests I decided for myself that values exceeding 1% of the period
should best be avoided.
In my opinion, those are good choices.? I prefer to keep the timestep smaller than 1% of the period, and sometimes I make it 0.1% or smaller.? It depends on how low I want the artifacts to be, and how low I can make them.? Eventually, "diminishing returns" sets in and it's pointless to change it further, but each case is different and there are no general rules about that.? 0.1% might be overkill in one case, and insufficient in another.
?
Of course it's assumed that you disabled waveform compression.
?
I also tested time steps adjusted to the power of 2, e.g. 2**14 (interval / 16384).?
That might help, but I am not aware that it actually does.? In my experience, keeping the time steps small is more important.

For the interval (t_stop - t_start) I usually take 16msec when testing with 1kHz
but I have also used values from 10msec to 48msec.
It is this parameter which I personally find most difficult to decide upon.
The one most important thing is that the interval MUST be an exact multiple of the signal's period.
?
If you don't make Tstop-Tstart equal to an exact multiple, then make sure that your FFT's time interval is set to an exact multiple.? You do not need to find the FFT over the whole simulated interval.
?
Whether it is 1 period or 100 periods, that might not make much difference when checking harmonics (via FFT or something similar).? But it does make a difference in the display of harmonics in LTspice's View > FFT, but I don't think it affects the numerical results that much.
?
Now this is assuming that each of your cycles looks like the next one.? If, for some reason, they are not, then you may want to re-consider this.
?
Also be aware of the interaction with the "Number of data point samples in time" in the FFT menu.? You have interaction between that number and the number of audio cycles you captured.
?
So, to sum it all up, I wonder if there is a guideline which values to use for the time step
and the interval for a certain test frequency when testing audio related circuits with sine waves.
Experiment!? Other than what I stated above and has been stated and re-stated several times already, my advice is to experiment.? Don't be satisfied with one technique and the same settings every time.? Try things.? See what matters to your simulations.? It won't be the same every time.? Once you find what seems to work best in your situation, then it's OK to stick with that.? But in another simulation, the choices might not be the same.
?
Andy
?


Re: 12AU7 tube heater model

 

¿ªÔÆÌåÓý

The function for G appears to have a divide by zero term at startup.

On 2025-02-21 12:51, Andy I via groups.io wrote:
On Fri, Feb 21, 2025 at 05:27 AM, Carlo wrote:
Does it mean that Ghot is just a behavioral voltage source, or that it is a current source controlled from a voltage (i.e. voltage-controlled current source) ?
Neither.
?
It is not apparent at first, but Ghot as it is written is a behavioral resistor, because of the way it is connected with its input = its own output.
?
I don't believe that Ghot emulates an infinite resistance at start-up or when V(HB,H2) = 0, as John suggested.? I need to re-check, but I'm pretty sure it emulates a resistance of value RCO ohms at start-up.? That is the "cold" heater resistance.
?
Does it mean that Ghot is just a behavioral?voltage?source, or that it is a?current?source controlled from a voltage (i.e.?voltage-controlled?current source) ?
Neither.
?
Technically, Ghot is a G-element which is usually a behavioral current source, as all G-sources are.? But in this configuration with "Value=<expression<", it is a formula-controlled current source, where the formula could be anything.? That fundamentally changes it from being a voltage-controlled current source, to being a (somewhat) arbitrarily-controlled current source.? That syntax is an "enhancement" added to SPICE over its many years of development, and now an accepted form of the syntax.
?
LTspice internally converts it into a B-source.? I am not sure if it's correct that it turns it into a "behavioral voltage source" or perhaps it might be a behavioral current source, but at the end of the day it might not matter if it does the right thing with respect to currents and voltages.
?
The "POLY" syntax is yet another variant that CAN be used with these controlled-sources (E, F, G, H).? In the old days of SPICE, that was the best (or only) way to emulate arbitrary transfer functions.? But the "Value=<expression>" format came along later and made it easier to use arbitrary functions, without the need for "POLY".
?
Mike Engelhardt, who created LTspice, did not want to use the "POLY" syntax at all.? He refused to use it at first, and resisted adding it to LTspice, but eventually gave in because there are so many old SPICE models that use it.? But one of the advantages of "POLY" is that its function and derivative are continuous, making it a good choice because it avoids convergence failure caused by discontinuities.
?
Andy
?
--
OOO - Own Opinions only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


Re: 12AU7 tube heater model

 

On Fri, Feb 21, 2025 at 04:31 AM, Andy I wrote:
But LTspice doesn't know this.? It sees the circuit topology as a current source connected to another current source, and it thinks the node where they join is "floating".? So it generates the error message, but it continues to process the netlist anyway, and everything works!
Looking at the complete circuit topology, U1:H2 node is the node where the subckt G-source Ghot joins the external DC independent current source (I1). In the overall circuit this U1:H2 node is connected to GND (0). However U1:HB isn't the node where the two current sources (internal and external) actually join.
?
Here the expanded netlist:
? ? --- Expanded Netlist ---
* C:\Users\carlo\Documents\LTspice\Bravo_Ocean_ampli\12AU7heater.asc
r:u1:cool n001 u1:ha 6.2?
r:u1:load u1:ha u1:hb 1m
b:u1:¡ìesens u1:hd 0 v=v(u1:ha,u1:hb)*1000?
b:u1:¡ìepwr u1:he 0 v=v(n001,0)*v(u1:hd)/(pwr(6.3 ,2)/ 42)
r:u1:h1 u1:he u1:hf 91k
c:u1:h1 u1:hf 0 1.05e-05?
b:u1:¡ìeh2 u1:hg 0 v=v(u1:hf)?
r:u1:h2 u1:hg u1:hh 270k
c:u1:h2 u1:hh 0 1.05e-05?
b:u1:¡ìeh3 u1:hj 0 v=limit(v(u1:hh)-0.75,0,1e6)*4?
r:u1:h3 u1:hj u1:hk 91k
c:u1:h3 u1:hk 0 1.05e-05?
b:u1:¡ìghot u1:hb 0 i=(1/(v(u1:hg)+0.001))/(42 - 6.2)*v(u1:hb,0)
i1 0 n001 150m
.dc i1 120m 160m 1m
.end
?
ERROR: Node U1:HB is floating and connected to current source G:U1:HOT
?


Re: Looking for advice on TRAN timing #FFT

 

¿ªÔÆÌåÓý

Time step: Set to half (or less) the period of the highest harmonic you are interested in.

Interval: The longer you make it, the lower is the frequency that appears as the fundamental, and the narrower the bandwidth of the peaks in the spectrum display. For example, if you simulate for 100ms, the lowest frequency you can see is 10 Hz, and the spectral 'lines' are 10Hz wide.


On 2025-02-21 12:34, Ryu via groups.io wrote:
I'm looking for help concerning the timing parameters of a TRAN simulation
to evaluate the distortion of an amplified sine wave.
?
I've been reading through lots of messages of this group concerning "distortion" and "tran timing"
recently but could not find an answer to what I was looking for.
[I came across the audio distortion analyser contributed by Tony Casey,
for which I am thankful and it is indeed a fine tool.]
?
Hitherto I've used 1 or 2 per mille of the sine wave period, so the time step would be 1 usec or 2 usec
when testing with 1 kHz. From my tests I decided for myself that values exceeding 1% of the period
should best be avoided.
I also tested time steps adjusted to the power of 2, e.g. 2**14 (interval / 16384).?
?
For the interval (t_stop - t_start) I usually take 16msec when testing with 1kHz
but I have also used values from 10msec to 48msec.
It is this parameter which I personally find most difficult to decide upon.
?
So, to sum it all up, I wonder if there is a guideline which values to use for the time step
and the interval for a certain test frequency when testing audio related circuits with sine waves.
(I'm still using LTspice XVII.)
?
Ryu
--
OOO - Own Opinions only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


Re: 12AU7 tube heater model

 
Edited

On Fri, Feb 21, 2025 at 05:27 AM, Carlo wrote:
Does it mean that Ghot is just a behavioral voltage source, or that it is a current source controlled from a voltage (i.e. voltage-controlled current source) ?
Neither.
?
It is not apparent at first, but Ghot as it is written is a behavioral resistor, because of the way it is connected with its input = its own output.
?
I don't believe that Ghot emulates an infinite resistance at start-up or when V(HB,H2) = 0, as John suggested.? I need to re-check, but I'm pretty sure it emulates a resistance of value RCO ohms at start-up.? That is the "cold" heater resistance.
?
Technically, Ghot is a G-element which is usually a behavioral current source, as all G-sources are.? But in this configuration with "Value=<expression<", it is a formula-controlled current source, where the formula could be anything.? That fundamentally changes it from being a voltage-controlled current source, to being a (somewhat) arbitrarily-controlled current source.? That syntax is an "enhancement" added to SPICE over its many years of development, and now an accepted form of the syntax.
?
LTspice internally converts it into a B-source.? I am not sure if it's correct that it turns it into a "behavioral voltage source" or perhaps it might be a behavioral current source, but at the end of the day it might not matter if it does the right thing with respect to currents and voltages.
?
The "POLY" syntax is yet another variant that CAN be used with these controlled-sources (E, F, G, H).? In the old days of SPICE, that was the best (or only) way to emulate arbitrary transfer functions.? But the "Value=<expression>" format came along later and made it easier to use arbitrary functions, without the need for "POLY".
?
Mike Engelhardt, who created LTspice, did not want to use the "POLY" syntax at all.? He refused to use it at first, and resisted adding it to LTspice, but eventually gave in because there are so many old SPICE models that use it.? But one of the advantages of "POLY" is that its function and derivative are continuous, making it a good choice because it avoids convergence failure caused by discontinuities.
?
Andy
?


Re: Interpreting Noise Simulation Results

 

Thanks for the insight - I read that the voltage sources were treated as noiseless but when I set one of them as the input I lost sight of that. Appreciate the help!


Re: Interpreting Noise Simulation Results

 

I didn't consider the impact of the high impedance of the capacitor increasing the current noise at the input - thank you!