¿ªÔÆÌåÓý

Date

Re: Inductance modeling using table issue.

 

My last message didn't format very well, too early in the morning...obviously it is a sixth order polynomial, x6 means x**6 etc
?


Re: Inductance modeling using table issue.

 

Always good to see examples and I know know more about tables. I was idly playing with your data and whilst not really relevant to the discussion here but if you paste your data into Excel, graph it and "add a trendline" you can get very very vlose to your data with
?
y = -3E-07x6 + 6E-05x5 - 0.005x4 + 0.1689x3 - 2.2061x2 + 16.023x + 4.6329
(R? = 0.9954)
?
8-)
Ian
(Retired people have too much time on their hands)


Re: Conductance Negative

 

Can be done easily with a behavioral current source. The equation can be defined by:
?
I = V(Vi,Vo)/R
?
Where Vi and Vo are the voltages across the current source.
?
Example netlist with a sweep:
?
B1 Vi Vo I = V(Vi,Vo)/V(Vr)
V1 Vi 0 5
Rmeas 0 Vo 1m
V2 Vr 0 1
?
?


Re: .MEAS syntax with variable parameters

 

¿ªÔÆÌåÓý

On 28/03/2025 23:46, Bell, Dave via groups.io wrote:

Anther .meas feature I learned long ago is that sequence of measurements generally doesn¡¯t matter.

This way, I can put the final result on top in the list, and ignore what went into calculating it¡­

Yeah. LTspice is clever about that. The parser must (silently) perform a number of iterations to determine the required evaluation precedence. I don't know whether that's generic in SPICE - I suspect it is. I guess it's not that complicated, actually. One of these days (or perhaps, nights - courtesy Eagles), I will walk/run through the original Berkeley code - I archived it years ago. (I'd better do it soon, while I can still read.?? )

--
Regards,
Tony


Re: .MEAS syntax with variable parameters

 

¿ªÔÆÌåÓý

Bingo!? Thanks, Tony!

?

I ended up with:

.meas T1 TRIG V(N0)=2.25 TD=3u RISE=1 TARG V(Nx)=Vtarg TD=3u RISE=1

.meas VNx MAX V(Nx) FROM {5*Pw} TO {25*Pw}

.meas Vtarg param 0.9*VNx

?

Which returns the same as using cursors in the plot, but more precise and a LOT easier.

?

Anther .meas feature I learned long ago is that sequence of measurements generally doesn¡¯t matter.

This way, I can put the final result on top in the list, and ignore what went into calculating it¡­

?

Dave

?

From: [email protected] <[email protected]> On Behalf Of Tony Casey
Sent: Friday, March 28, 2025 3:31 PM
To: [email protected]
Subject: EXTERNAL: Re: [LTspice] .MEAS syntax with variable parameters

?

On 28/03/2025 21:16, Bell, Dave via groups.io wrote:

T1 Fails if I use this instead:

  1. .meas T1 TRIG V(N0)=2.25 TD=3u RISE=1 TARG V(Nx)={0.9*VNx} TD=3u RISE=1

Try:

.meas VNx MAX V(Nx) FROM {5*Pw} TO {25*Pw}
.meas Vtarg param 0.9*VNx
.meas T1 TRIG V(N0)=2.25 RISE=1 TARG V(Nx)=Vtarg TD=3u RISE=1

..instead. (You also had 2x TD=3u in the constraints, but I guess it ignored the 2nd)

Personally, I never use the Trig/Targ syntax, as it's more difficult to debug. Use an additional directive instead, then you can test Trig and Targ independently. YMMV.

--
Regards,
Tony


Re: .MEAS syntax with variable parameters

 

¿ªÔÆÌåÓý

On 28/03/2025 21:16, Bell, Dave via groups.io wrote:

T1 Fails if I use this instead:

  1. .meas T1 TRIG V(N0)=2.25 TD=3u RISE=1 TARG V(Nx)={0.9*VNx} TD=3u RISE=1
Try:

.meas VNx MAX V(Nx) FROM {5*Pw} TO {25*Pw}
.meas Vtarg param 0.9*VNx
.meas T1 TRIG V(N0)=2.25 RISE=1 TARG V(Nx)=Vtarg TD=3u RISE=1

..instead. (You also had 2x TD=3u in the constraints, but I guess it ignored the 2nd)

Personally, I never use the Trig/Targ syntax, as it's more difficult to debug. Use an additional directive instead, then you can test Trig and Targ independently. YMMV.

--
Regards,
Tony


Re: .MEAS syntax with variable parameters

 

¿ªÔÆÌåÓý

Yeah, with or without parens, it Fails.

?

Nice feature when editing a ,MEAS (after a Run), there¡¯s a Test button that executes the measurements on the last data set.

Click. Fails!

Edit. Click. Data displayed

Even for .stepped runs, which returns the whole list(s)!

?

From: [email protected] <[email protected]> On Behalf Of John Woodgate
Sent: Friday, March 28, 2025 2:14 PM
To: [email protected]
Subject: EXTERNAL: Re: [LTspice] .MEAS syntax with variable parameters

?

I'm no expert in this area, but expressions within { } are evaluated before simulation, which is not what you want, of course. What if you use ordinary ( ) instead?

On 2025-03-28 20:16, Bell, Dave via groups.io wrote:

I¡¯m frustrated by failure of a time measurement I¡¯m trying to make.

?

My circuit generates a pulse train with parameterized width, Pw.

I want to measure a delay, from a rising edge of one node, N0, to the next rising edge of another node, Nx.

Due to a filter action, the amplitude of V(nx) is dependent upon a resistor whose value is stepped, from run to run.

Because of that, I want to make the trigger (target) amplitude a variable, say 90% of the MAX() amplitude of node Nx.

?

  1. .meas VNx MAX V(Nx) FROM {5*Pw} TO {25*Pw}
  2. .meas T1 TRIG V(N0)=2.25 TD=3u RISE=1 TARG V(Nx)=250m TD=3u RISE=1

?

Measurement 1 correctly returns a peak value from say 0.5V to 4.5V.

Measurement 2 returns a time that¡¯s too close to the stat of Rise, instead of near the peak level.

?

T1 Fails if I use this instead:

  1. .meas T1 TRIG V(N0)=2.25 TD=3u RISE=1 TARG V(Nx)={0.9*VNx} TD=3u RISE=1

?

Help??

?

Dave

?

?

--
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: Good settings for RIAA square wave

 

For AC simulation use VOLTAGE-source connected with E-source with string LAPLACE=(1+T3*S)*(1+T5*S)/((1+T4*S)*(1+T6*S)*SCALE_1KHz) in Value field
Place .param T3=3180uS T4=318uS T5=75uS T6=0uS SCALE_1KHz=9.898078642 on schematic
?
E-source output connected with L and R (use parameters from cartridge you use, 370mH and 815 Ohm for Shure V15 Model 5, for example)
--
Kind regards,
Victor


Re: .MEAS syntax with variable parameters

 

¿ªÔÆÌåÓý

I'm no expert in this area, but expressions within { } are evaluated before simulation, which is not what you want, of course. What if you use ordinary ( ) instead?

On 2025-03-28 20:16, Bell, Dave via groups.io wrote:

I¡¯m frustrated by failure of a time measurement I¡¯m trying to make.

?

My circuit generates a pulse train with parameterized width, Pw.

I want to measure a delay, from a rising edge of one node, N0, to the next rising edge of another node, Nx.

Due to a filter action, the amplitude of V(nx) is dependent upon a resistor whose value is stepped, from run to run.

Because of that, I want to make the trigger (target) amplitude a variable, say 90% of the MAX() amplitude of node Nx.

?

  1. .meas VNx MAX V(Nx) FROM {5*Pw} TO {25*Pw}
  2. .meas T1 TRIG V(N0)=2.25 TD=3u RISE=1 TARG V(Nx)=250m TD=3u RISE=1

?

Measurement 1 correctly returns a peak value from say 0.5V to 4.5V.

Measurement 2 returns a time that¡¯s too close to the stat of Rise, instead of near the peak level.

?

T1 Fails if I use this instead:

  1. .meas T1 TRIG V(N0)=2.25 TD=3u RISE=1 TARG V(Nx)={0.9*VNx} TD=3u RISE=1

?

Help??

?

Dave

?

?

--
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.


.MEAS syntax with variable parameters

 

¿ªÔÆÌåÓý

I¡¯m frustrated by failure of a time measurement I¡¯m trying to make.

?

My circuit generates a pulse train with parameterized width, Pw.

I want to measure a delay, from a rising edge of one node, N0, to the next rising edge of another node, Nx.

Due to a filter action, the amplitude of V(nx) is dependent upon a resistor whose value is stepped, from run to run.

Because of that, I want to make the trigger (target) amplitude a variable, say 90% of the MAX() amplitude of node Nx.

?

  1. .meas VNx MAX V(Nx) FROM {5*Pw} TO {25*Pw}
  2. .meas T1 TRIG V(N0)=2.25 TD=3u RISE=1 TARG V(Nx)=250m TD=3u RISE=1

?

Measurement 1 correctly returns a peak value from say 0.5V to 4.5V.

Measurement 2 returns a time that¡¯s too close to the stat of Rise, instead of near the peak level.

?

T1 Fails if I use this instead:

  1. .meas T1 TRIG V(N0)=2.25 TD=3u RISE=1 TARG V(Nx)={0.9*VNx} TD=3u RISE=1

?

Help??

?

Dave

?

?


Re: Good settings for RIAA square wave

 

Carlos,
?
Walter Jung had developed a SPICE file many years ago that uses the LAPLACE function in SPICE to define the precise time constants.? You run your RIAA circuit through his inverse RIAA circuit.? Do a frequency sweep, the plotted output will show the frequency error of your circuit.? You can find it here: ?


Re: Good settings for RIAA square wave

 

Using a pulse or square wave ("SW" in the original message in this thread) can tell you things about the transient behavior, that a small-signal linear frequency sweep might not tell you.
?
Andy
?


Conductance Negative

 

Dear all, I am trying to simulate a circuit with negative conductance using transistors and passive components. Does anyone have a circuit for this?
Best regards.
Sebastian?


Re: Good settings for RIAA square wave

 

On 3/28/25 11:32 AM, Carlos E. Mart¨ªnez via groups.io wrote:
Hi,
This should be the first time I will be using a SW to test a RIAA preamp response.
I was thinking of copying the settings I use for testing power amps, but I am not sure it's correct.
They are: PULSE(-.4 .4 0 10n 10n 25u 50u 10)
Would they be fine for this new test?
I would use an AC analysis. Produces a nice plot of frequency response that you can compare to the RIAA curve. That is what I did when I looked at the Carver C1 preamp stage.


--

David Schultz
"The cheeper the crook, the gaudier the patter." - Sam Spade


Re: Good settings for RIAA square wave

 

¿ªÔÆÌåÓý

It doesn't seem right to use a pulse signal for an audio application.

On 2025-03-28 16:32, Carlos E. Mart¨ªnez via groups.io wrote:
Hi,
?
This should be the first time I will be using a SW to test a RIAA preamp response.
?
I was thinking of copying the settings I use for testing power amps, but I am not sure it's correct.
?
They are: PULSE(-.4 .4 0 10n 10n 25u 50u 10)
?
Would they be fine for this new test?
?
Thanks!
?
Carlos
--
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: Good settings for RIAA square wave

 

On Fri, Mar 28, 2025 at 12:51 PM, Tony Casey wrote:
Not sure what you hope to learn from 20kHz square wave testing of an RIAA preamp, but it would depend on whether the 75¦Ìs pole is implemented passively, or in the main feedback loop. ...
If this is for testing a preamp, it might also depend on whether the preamp has filtering for beyond-audio frequencies, including RFI.
?
Andy
?


Re: Good settings for RIAA square wave

 

On Fri, Mar 28, 2025 at 12:47 PM, Carlos E. Mart¨ªnez wrote:
I want to know if my Pulse settings are correct. Correct point in not
using 20KHz, but something more in the listening range. Like 100Hz to
15KHz
For a 100 Hz square wave, set Tperiod = 10m.? Do you have a calculator?? 1/100 = 0.01 = 10e-3.
?
Then set Ton = Tperiod - (Trise+Tfall)/2.
?
That square wave would generate harmonics extending well past 15 kHz.? I don't know if this meets your needs, so I can't answer that question.? But it seems logical to start with a "square" wave at or near the lowest frequency within the band of interest, and use its harmonics which go up from there, through the audio band.
?
I still can't read your mind.? We can't tell you whether your PULSE settings are "correct", because we do not know what "correct" means to you in this particular situation.
?
Andy
?


Re: Good settings for RIAA square wave

 

¿ªÔÆÌåÓý

On 28/03/2025 17:32, Carlos E. Mart¨ªnez via groups.io wrote:
This should be the first time I will be using a SW to test a RIAA preamp response.
?
I was thinking of copying the settings I use for testing power amps, but I am not sure it's correct.
?
They are: PULSE(-.4 .4 0 10n 10n 25u 50u 10)
?
Would they be fine for this new test?
Not sure what you hope to learn from 20kHz square wave testing of an RIAA preamp, but it would depend on whether the 75¦Ìs pole is implemented passively, or in the main feedback loop. Are you testing it with an inverse RIAA network?

Not that it probably matters, but your pulse specification isn't quite square. To correct that, it should be:

PULSE(-400m 400m 0 10n 10n {25u-10n} 50u 10)

--
Regards,
Tony


Re: Good settings for RIAA square wave

 

I want to know if my Pulse settings are correct. Correct point in not
using 20KHz, but something more in the listening range. Like 100Hz to
15KHz

Carlos


On Fri, Mar 28, 2025 at 1:41?PM Andy I via groups.io
<AI.egrps+io@...> wrote:

On Fri, Mar 28, 2025 at 12:32 PM, Carlos E. Mart¨ªnez wrote:

This should be the first time I will be using a SW to test a RIAA preamp response.

I was thinking of copying the settings I use for testing power amps, but I am not sure it's correct.

They are: PULSE(-.4 .4 0 10n 10n 25u 50u 10)

Would they be fine for this new test?

Un, what are you asking??

What is an "RIAA square wave"?

What is your PULSE waveform intended for? That should lead you in the direction of answering your own question.

We can not read your mind. I have no idea whether your PULSE waveform is "fine" or not.

However, here is one little point about it: Your "square wave" is not a square wave. I am not referring to the fact that the rising and falling edges aren't instantaneous, which is of course impossible. I refer to the fact that it does not have a 50% duty cycle. The pulse is high for 25.01 microseconds, and low for 24.99 microseconds. To correct that, change the "Ton" time to 24.99 us, which is 25 us minus your 10 ns rise and fall time. Then it will be symmetrical, 50% high and 50% low.

Also, do you really need to limit the PULSE train to only 10 cycles? If you don't want to limit the number of cycles, leave that field (Ncycles) blank.

Andy


Re: Good settings for RIAA square wave

 

Also, I wonder why someone would use a 20 kHz square wave, with anything related to RIAA.? Would you not be better off using a lower frequency, something within the audio band?
?
Andy
?
?