RMS and DC Value Displays of Waveforms on LTspice

In summary, the software cannot display the DC component of a waveform such as found by determining the Fourier series of a waveform.
  • #1
dvscrobe
51
11
I hope I am posting this in correct forum section. I just downloaded LTspice for my Power Electronics course. Does anyone know if the software can display the DC component of a waveform such as found by determining the Fourier series of a waveform?
 
Engineering news on Phys.org
  • #3
berkeman, I did take notice of that post. I tried this on a Mac and PC and still could not get any results no matter what I clicked. I must be doing something wrong.
 
  • #4
Maybe post some screenshots? The "average" voltage should be the DC voltage. Are the functions not working, or are they giving you answers that don't seem right?
 
  • #5
All I get is zero’s.
 

Attachments

  • A27EF5B0-4269-4DF2-824B-63905B3B4194.jpeg
    A27EF5B0-4269-4DF2-824B-63905B3B4194.jpeg
    51.1 KB · Views: 1,035
  • #6
Huh, weird. What happens when you take out D1?
 
  • #7
dvscrobe said:
Does anyone know if the software can display the DC component of a waveform such as found by determining the Fourier series of a waveform?
I believe that you are looking at too short a part of the plot as the voltage is still increasing from the initial conditions.
RMS must be computed over a time period. To avoid window errors, the number of cycles in that period must be an exact integer, or be very large.

Read help for waveform arithmetic; Section 2. "Compute the average or RMS of a trace".
Select the plot window. Hold down the control key while you left click the mouse on the trace label.

Read the report in the small window.
For your circuit between exactly 1 and 2 seconds, the average is 5.2756V, the RMS is 5.2759V.
 
  • #9
There is a work-around using .MEAS that you might try.

Place a .op command on the schematic;
.measure tran fred RMS V(out)
Then run the simulation;
When it finishes pull down the “view” menu and select “SPICE error log”; or <ctrl>L
You will see a line with the parameter label fred: and the result of the measurement.
fred: RMS(v(out))=5.29009 FROM 0 TO 0.18

Here the default time window for RMS integration is the displayed .TRAN trace.
You can specify all sorts of traps for the time window to synchronise with signal phase.

Attached is the .asc file that works for me.
Remove the .txt extension to run in LTspice.
 

Attachments

  • RMS-measure.asc.txt
    947 bytes · Views: 553
  • #10
I think I may have been the victim of the “always zero” bug. I’ll have to check out the Yahoo group that someone posted here. I’m not a member of that. I contacted the developer and I was asked if I synced my release. I was not sure what that meant but I uninstalled the app from my Mac and reinstalled. This time I noticed that my security settings didn’t recognize the developer. So, I had to approve of the install in my settings. Everything is working fine now. Thanks for the replies here.
 
  • #11
Now that I got the bug out of the way, I can move on to what I was trying to accomplish in the first place. I wanted to prove when RMS and a DC average are the same values and when they are not. I am learning 3-phase rectifiers and the textbook was using the DC average of the pulses to calculate the power output of the diode network. This was a beginner circuit and the load was just a resistor with no capacitor for smoothing out the pulses. I questioned my instructor why RMS wasn’t being used. It turns out from LTspice that the RMS and DC average is the SAME thing! I find that hard to believe.
 
  • #12
Here is my circuit and the waveform of the voltage across the resistor.
245747
245748
 
  • #13
When you “synch” your LTspice you bring it up to the current release version with the latest bug fixes, unfortunately, along with any new bugs.

You have noticed how LTspice sets the amplitude of a sine wave as the peak voltage.
That is why you specify a 170 Vpeak sinewave rather than 120 Vrms.

If you add a .txt extension to your schematic.asc file to make it schematic.asc.txt you can attach it to your post on this forum. I can then modify your schematic.asc by adding an example of the appropriate RMS integration function, without having to re-enter your circuit.

Here is an example.
 

Attachments

  • rect.asc.txt
    1.2 KB · Views: 371
  • #14
Baluncore, that is cool trick. I added the .txt to my circuit file.
 

Attachments

  • Draft1.asc.txt
    1.8 KB · Views: 371
  • #15
Attached.
 

Attachments

  • Draft1Copy.asc.txt
    2.5 KB · Views: 384
  • #16
Balauncore, thanks for this file. I appreciate. That is neat how you can modify someone's test plan simply by having it converted to a text file. This reminds me of an SEL class I attended. SEL makes substation microprocessor relays. I was using a digital test set to simulate voltages and currents to the relay, and the instructor had me create and modify a text file that the test set could use. I haven't play with this file yet, so will follow back. Right now, recovering from a midterm on power electronics.
 
  • #17
The LTspice .asc and .plt files are human readable text files. I do sometimes edit them directly with a text editor when I want to search and replace throughout. But the reason for adding the .txt is to let this forum know it is a text file, so that it can be attached to a post. When the .txt extension is removed, LTspice executes it like a normal.asc file.
 
  • #18
If you have a one volt AC to a full wave rectifier, the DC average of the DC pulses will be .636 but the RMS of same will be .707. What voltage would you use to calculate real power to a resistive load?
 
  • #19
The mean energy per unit time (i.e. average power) will be the RMS value - whatever the waveform. The Mean Voltage for the AC signal is zero but the mean of the rectified signal happens to be 0.636V. There is more than just the DC power in the rectified signal as there is an 'AC Component'.
Take another, SIMPLER, example. A +/- 1V square wave has an RMS value of 1V and that is the same as the RMS value for the full wave rectified signal (1V). The mean voltage for the square wave is zero but the mean voltage for the rectified signal is 1V (it's 1V all the time).
 
  • #20
sophiecentaur, Thanks. It clicks better when you consider a square wave. I think where I have been going wrong is that I was using calculus to determine the average value of a full wave rectifier to calculate the real power to a resistive load. So, for a 1V AC rectified waveform, full wave, real power would be equal to .707 squared divided by resistance. Is that right?
 
  • #21
dvscrobe said:
So, for a 1V AC rectified waveform, full wave, real power would be equal to .707 squared divided by resistance. Is that right?
It depends on what exactly you mean by “1V AC”. It is true for a mathematical sinewave with peak amplitude = 1.

A 1.0V amplitude sinewave generated by LTspice is a ±1.000 Vpeak sinewave = 0.7071 Vrms = 2.0 Vpeak-peak.
If you rectify it perfectly, it still has 0.7071 Vrms, referenced to zero.

A 1.0 Vrms sinewave has a peak amplitude of ±1.4142 Vpeak = 2.8284 Vpeak-peak. For sinewaves in the commercial power world, VAC is assumed to be Vrms unless otherwise specified as say Vp or Vpp.
With an LTspice model source you must be more careful to specify what you mean.

When you refer to a square wave you need to clearly specify if it is symmetrical about zero, or if it is offset and alternates between say zero and a fixed voltage.
 
  • #22
Yes, you are absolutely right. I forgot to clarify that. I meant a 1V peak AC signal. Thanks! If you just say a voltage value, that implies you mean the RMS value. Thanks!
 

FAQ: RMS and DC Value Displays of Waveforms on LTspice

What is RMS value in LTspice?

RMS (Root Mean Square) value is a measure of the average value of a waveform in LTspice. It is calculated by taking the square root of the mean of the squared values of the waveform over a specific time interval. It is often used to represent the effective voltage or current of an AC signal.

How do I display RMS value on LTspice?

To display the RMS value of a waveform on LTspice, you can use the .MEAS command. This command allows you to measure and display various parameters of a waveform, including RMS value. Simply add the .MEAS command to the schematic and specify the waveform and time interval for measurement.

What is DC value in LTspice?

DC (Direct Current) value is the average value of a waveform over a long period of time. In LTspice, it is represented by a horizontal line on the waveform plot. DC value is often used to represent the steady-state behavior of a circuit.

How do I display DC value on LTspice?

To display the DC value of a waveform on LTspice, you can use the .MEAS command as well. However, instead of specifying a time interval, you can use the keyword "DC" in the command. This will measure and display the average value of the waveform over the entire simulation time.

Can I display both RMS and DC values on LTspice?

Yes, you can display both RMS and DC values on LTspice by using the .MEAS command twice - once for each value. You can also use the .STEP command to vary a component in the circuit and observe the changes in both RMS and DC values over a range of values.

Back
Top