• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LTspice, in SMPS, how can I plot a parameter averaged in each switching period?

Thread starter #1
Hello everyone,
I have a question about LTspice for power electronics.
how can I plot a parameter along the full simulation time, but it is averaged for each switching period?
That is to say, Can I see this averaged value changes along the time?
I know the .meas command can integrate between the period I set. But how can I have thousands of such integration along the whole simulation time?
Thanks so much!

Update:
PS: sorry for my bad description, I found a name for the type of average that I want to see, it is called "moving average". I want to see the "moving average" by each switching period.
 
Last edited:
#2
I dont think I can help you, but what are you trying to average? Do you have an LTspice circuit you could post please so I can have a look at it? LTspice has a variable 'time' and you can edit the plot icon to include 'time' so the waveform is averaged over time. This is about as much I can say without knowing exactly what you are trying to do.
 
Thread starter #3
Hi Simonbramble,
Thanks for your reply. here I attach an LTspice file, for example, how can I plot the inductor current averaged in each switching cycle? which should be a smooth waveform without ripple, and keep changing along the whole simulation.

I dont think I can help you, but what are you trying to average? Do you have an LTspice circuit you could post please so I can have a look at it? LTspice has a variable 'time' and you can edit the plot icon to include 'time' so the waveform is averaged over time. This is about as much I can say without knowing exactly what you are trying to do.
 

Attachments

eTech

Active Member
#4
Hello everyone,
I have a question about LTspice for power electronics.
how can I plot a parameter along the full simulation time, but it is averaged for each switching period?
That is to say, Can I see this averaged value changes along the time?
I know the .meas command can integrate between the period I set. But how can I have thousands of such integration along the whole simulation time?
Thanks so much!
Hi

Hold the mouse pointer over the inductor until it changes to a current meter, then click to display the inductor current wave form in the waveform viewer. CTL-Left Click the waveform label in the waveform viewer. A pop-up window will appear showing the AVG and RMS values over the length of the simulation.

eT
 
Thread starter #5
Hi

Hold the mouse pointer over the inductor until it changes to a current meter, then click to display the inductor current wave form in the waveform viewer. CTL-Left Click the waveform label in the waveform viewer. A pop-up window will appear showing the AVG and RMS values over the length of the simulation.

eT
thanks for the reply! Yes I can see the average and RMS over the length of simulation(or of the period that shown in the waveform).
But what shoud I do, if I want to see the AVG of each switching period? that is, not only one AVG value for the whole simulation, but many AVG values of each switching period?
Thanks!
 

eTech

Active Member
#6
Your asking for average but I think you mean peak for one cycle. Read the help info on “.measure” directive.

You can also zoom in, point and click to measure a cycle in the waveform viewer.
 
Last edited:
#7
I'm not sure if you wanted to average over the complete width of the plot... and just have a number pop up on the screen representing that average, in which case eTech's answer is good. If you want a line passing through the middle of your inductor waveform that represents the average, then the attached will do this. What I did was set up a behavioural voltage source that outputs a voltage equal to the instantaneous current. I then filtered it to give the average. However, this output is a voltage and not a current, so I set up a behavioural current source to output a replica of the voltage, so you get a current. This makes it much easier to fine tune the filter components to increase/decrease the averaging etc. I am sure there are simpler ways of replicating the current directly, but filtering voltage is much easier than filtering current

If you want to zoom in to a precise part of the waveform, right click over the Time axis and set your interval as needed. This works for mine and eTech's answers above.

Have a play with the attached. If you celebrate Christmas where you are, have a good one
 

Attachments

Latest threads

EE World Online Articles

Loading

 
Top