Keyboard Shortcuts
Likes
- LTspice
- Messages
Search
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: .MEAS syntax with variable parameters
¿ªÔÆÌåÓýOn 28/03/2025 23:46, Bell, Dave via
groups.io wrote:
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:
Try: |
||
Re: .MEAS syntax with variable parameters
¿ªÔÆÌåÓýOn 28/03/2025 21:16, Bell, Dave via
groups.io wrote:
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:
-- ?
|
||
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:
--
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 |
||
.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. ?
? 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:
? 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
On 3/28/25 11:32 AM, Carlos E. Mart¨ªnez via groups.io wrote:
Hi,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:
--
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 |
||
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 notFor 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:
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:
|
||