2
\$\begingroup\$

If one wishes to know the efficiency of a circuit in LTSpice, it is reasonably simple to set up the simulation to give you an efficiency report:

Select Simulate -> Edit Simulation cmd and select 'Stop simulating if steady state is detected'. Rerun the simulation. Select View -> Efficiency Report -> Show on Schematic. The efficiency report appears on the schematic. (Instructions stolen from this website, other sources are available)

This efficiency report is useful for more than just in/out power, but also where the losses are: diodes, transistors, transformers etc. as shown here: Screenshot of LTSpice showing efficiency table

However, this only works if, there is one fixed input (a voltage source) and if there is one fixed output (a current source or resistor called RLOAD)

Which is fine if you have a known fixed load, or only a couple of fixed states.

Is there a method to get the full efficiency report out for a bunch of points? For example, I have a DCDC converter and I need to know how it performs when 0.1, 0.2, 0.3 .... 1.9, 2.0, 2.1W is drawn, and where the power goes (U1, U2 etc).

I'm sure there is a way of doing a batch of runs for a set of options, but I cannot find how to do so for the efficiency reports.

\$\endgroup\$
10
  • 2
    \$\begingroup\$ You can always hack together you .meas commands and step through values \$\endgroup\$
    – PlasmaHH
    Nov 21, 2016 at 17:50
  • 1
    \$\begingroup\$ @PlasmaHH Looks like Mike says that's exactly how to do it! My answer isn't really an answer, so I'll either modify it or delete it when I get a moment. If you answer, then I'll just delete mine. I'm not sure how to get the full report for the OP's question using .MEAS. \$\endgroup\$
    – jonk
    Nov 21, 2016 at 20:08
  • \$\begingroup\$ @jonk You can use these .meas commands, for example, assuming V1 is the input source, V(i) is the input voltage, R1 the load and V(o) the output voltage: .meas Iin rms(-I(v1)) trig time=6 targ time=10 .meas Vin rms(V(i)) trig time=6 targ time=10 .meas Pin param Vin*Iin .meas Pout avg(V(o)*I(R1)) trig time=6 targ time=10 .meas eff param Pout/Pin \$\endgroup\$ Nov 22, 2016 at 7:22
  • \$\begingroup\$ @aconcernedcitizen Thanks very much. Will attempt. If you can write up a nice answer, I'd be happy to delete mine. Otherwise, if I get time to verify and amend my answer, I'll try and do that. \$\endgroup\$
    – jonk
    Nov 22, 2016 at 7:25
  • \$\begingroup\$ Forgot to add that the input is sin 0 1 1 and the simulation is .tran 10, while the whole circuit is a lowpass RL, that's why I wait 6 periods. I measure over 4 for better accuracy, sometimes it "averages" the minor variations. \$\endgroup\$ Nov 22, 2016 at 7:26

1 Answer 1

4
\$\begingroup\$

You can do a batch of runs by adding a .STEP PARAM card, if you add the "Don't reset T=0 when steady state is detected". So you could adjust your RLOAD using such a parameter value. The problem is that the Efficiency Report will only reflect the last run, I think. LTSpice can't produce more than one of them.

You can get a feel for how LTspice's software handles the Efficiency Report by simply adding a card or a part, like a resistor, below your circuit somewhere. The report will "magically" move itself below all the parts. So there is a bit of software going on that is inside the schematic display code. And I doubt that this display code has access to more than one data structure for the report. One reason is that if such data were an array of such structures, then the display code would have to figure out how to display all those reports, automatically. And I suspect that Mike didn't want to have to go figure out some complex "nice appearing" output for that. Another reason is that the efficiency report is probably "hacked in" because the sales department demanded it for LTspice as a way to make selecting their power converter chips easier and more convenient and competitive with others who also have ways to providing such reports for their own parts. And since the sales department didn't require supporting multiple reports, there was no need to "go there."

I've been able to generate multiple runs, no problem, with the .STEP card and with a .OPTION card to play with SSTOL values. So the Spice engine will do it. And I'm sure the data could easily be placed into an array of structures, with a count, too. I'm pretty sure Mike wouldn't have a problem there. So I think it probably won't happen unless someone gives Mike a convincing and clear algorithm that just "sings beautifully" in his mind and is easy to implement, regarding the display of such results from the engine. He probably has very little motivation to provide several reports. But he might be interested if he can clearly see how to do a reliable job in a way that won't cause any additional support phone calls.

(The sales team, I am sure, already accepted the need for support calls regarding ONE such report. It's needed, competitively. So it's a no-brainer. They have to bite that bullet. But they might not be very happy if Mike goes out and adds something that makes the calls more expensive and more frequent, without first asking their permission. Might be able to sneak it in, if he feels there won't be any such problems.)


Another possible suggestion for Mike would be another option on the .TRAN simulation, where it displays the report on the schematic (like it does already) and then merely prompts after each .STEP PARAM for hitting ENTER or something like that to move on to the next .STEP PARAM value. This wouldn't add any changes to the display code, wouldn't add any changes to the Spice code generating the data, and would only add an arcane (and ignored by most people) option allowing this special bit of code pausing before moving to the next .STEP PARAM value. Mike might buy that idea.

I already know that it works, because I can perform a series of simulations right now with the existing product. And it displays the Efficiency Report of the last simulation. So it just picks up the data from the last run. So it's certain that adding a prompting dialog would be pretty easy to do, very clear to Mike, and may have a chance.


I've written to Mike. I will see what he says about all this.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.