Measuring AC Current & Voltage - LTSpice

Papabravo

Joined Feb 24, 2006
20,600
.meas TRAN acvolts RMS V(Vout)
.meas TRAN acamps RMS I(RL)

where TRAN tells which analysis you are interested in measuring, acvolts and acamps are "dummy names" for the results RMS is the function you want and V(Vout) and I(RL) are the things to be measured.

Other functions you could specify would be AVG, MAX, MIN, PP, INTEG. These measurements will be performed over the range of the abscissa unless further restricted by additional qualifiers.
Like this:
1686591725715.png
Results of the .meas statement are in the SPICE Error Log. The "dummy name" is replicated in all lower case in the error log and was pasted back into the schematic (.asc) file.
 

Thread Starter

jp648

Joined Jun 12, 2023
9
.meas TRAN acvolts RMS V(Vout)
.meas TRAN acamps RMS I(RL)

where TRAN tells which analysis you are interested in measuring, acvolts and acamps are "dummy names" for the results RMS is the function you want and V(Vout) and I(RL) are the things to be measured.

Other functions you could specify would be AVG, MAX, MIN, PP, INTEG. These measurements will be performed over the range of the abscissa unless further restricted by additional qualifiers.
Like this:
View attachment 296306
Results of the .meas statement are in the SPICE Error Log. The "dummy name" is replicated in all lower case in the error log and was pasted back into the schematic (.asc) file.
Thx Papabravo. I am seeing the values in the error log. Been messing around trying to get them to
display on the schematic but no luck so far.
J
 

Papabravo

Joined Feb 24, 2006
20,600
Thx Papabravo. I am seeing the values in the error log. Been messing around trying to get them to
display on the schematic but no luck so far.
J
You can place a behavioral voltage or current source on the schematic and write an expression for the thing you want to display. Generally speaking, voltage sources are easier to work with than current sources. You could also create functional blocks (a .subckt) that would compute RMS values for you.
 

Audioguru again

Joined Oct 21, 2019
6,436
Your 20 number for "tran" showed too many waves. I changed it to 92 to clearly see if there is distortion.
On the left display I show the collector DC output with peak input and output voltages, 5dB per graticule.

On the right display I show the frequency response to 10kHz at the output.
 

Attachments

Thread Starter

jp648

Joined Jun 12, 2023
9
Your 20 number for "tran" showed too many waves. I changed it to 92 to clearly see if there is distortion.
On the left display I show the collector DC output with peak input and output voltages, 5dB per graticule.

On the right display I show the frequency response to 10kHz at the output.
Thx AG.
 

Thread Starter

jp648

Joined Jun 12, 2023
9
I have done a few hand calculations for the ac currents.

irl = Vout/Rl = 0.05297/10K = 5.30 μA
irc = (RL/RC) * irl = (10K/4.7K) * 5.3 μA = 11.27 μA
ic = irc + irl = 11.27 μA + 5.30 μA = 16.57 μA
ie = (ic/βac) * (βac+1)=(16.57/300)*(300+1)=16.63μA
ib = ie - ic = 16.63-16.57=6 μA

My irl agrees with Spice but my ic does not. Can you please tell me where I went wrong.

thx
J
 

Thread Starter

jp648

Joined Jun 12, 2023
9
I have done a few hand calculations for the ac currents.

irl = Vout/RL = 0.05297/10K = 5.30 μA
irc = (RL/RC) * irl = (10K/4.7K) * 5.3 μA = 11.27 μA
ic = irc + irl = 11.27 μA + 5.30 μA = 16.57 μA
ie = (ic/βac) * (βac+1)=(16.57/300)*(300+1)=16.63μA
ib = ie - ic = 16.63-16.57=6 μA

My irl agrees with Spice but my ic does not. Can you please tell me where I went wrong.

thx
J
Correction. My irl agrees with Spice but my irc does not. Can you please tell me where I went wrong.
 
Last edited:

Thread Starter

jp648

Joined Jun 12, 2023
9
I have done a few hand calculations for the ac currents.

irl = Vout/RL = 0.05297/10K = 5.30 μA
irc = (RL/RC) * irl = (10K/4.7K) * 5.3 μA = 11.27 μA
ic = irc + irl = 11.27 μA + 5.30 μA = 16.57 μA
ie = (ic/βac) * (βac+1)=(16.57/300)*(300+1)=16.63μA
ib = ie - ic = 16.63-16.57=6 μA

Hand calculated irc does not agree with Spice.

Can someone please tell me where I went wrong with my calc?
Thx
 

Attachments

Audioguru again

Joined Oct 21, 2019
6,436
Maybe the error is because the input signal source has a series resistance of 1k ohms which reduces the actual input to 8mV peak instead of 10mV peak.
 

Thread Starter

jp648

Joined Jun 12, 2023
9
Maybe the error is because the input signal source has a series resistance of 1k ohms which reduces the actual input to 8mV peak instead of 10mV peak.
Maybe you could look at my calc and see where the problem is. The calc is based on the fact that there is an attenuation of
20% on the input voltage.
 

ericgibbs

Joined Jan 29, 2010
18,219
hi jp,
I did read your question, your problem could be due to the input impedance of the amplifier, especially when you had 1k source resistance.!

So much for trying to help you with LTSpice simulations.

E

The problem is simple enough.
Assume 1k source resistance and 4k Zin and a 10mV signal.

Attn = (1k/(1k+4k) *10mV = 2mV loss
 
Last edited:
Top