FRA measurements and .bode analysis don't match

buck_vm.qsch (19.6 KB)

A simple voltage mode Buck converter:

with .tran analysis and fra measurement:

.tran 0 15m 0 10n
.param f=1K
.step dec param f 1K 100K 50
.measure gain fra f v(mod) v(con) from 10m

the result seems ok:

and is inline with what LTspice gives. However, the simulation takes around 30 minutes to finish.

But when the .bode analysis is used:

.bode V7 10m 1K 100K 100m
.option bodeout=con bodein=mod

what I can get is like the one below:

I don’t think there’s any difference in the two models-under-simulation, but never know if overlooked anything… Or, how can I debug what’s going with .bode analysis?

My QSPICE is up-to-date:

image

Here is the modification that allow .bode to run for your circuit. It seems to me that if IC is used in capacitor, .bode will run into problem (bug?), I will copy this to Mike for review.
Beside of that, you have to add .option bodeampfreq=0… this can force perturbation signal constant over frequency. With multiple change listed in the note in simulation file, simulation can be completed in about 15s in my laptop.

[Update : Mike fixed the problem of using instance parameter IC in capacitor for .bode
10/10/2024 Corrected an error regarding instance ICs on capacitors during a .bode analysis]

buck_vm_removeinitial.qsch (20.3 KB)

As bode got a high Q, you can tighten frequency response analysis relative tolerance (.option BODETOL), with longer simulation time, about 90s in my laptop.

Thanks @KSKelvin ! Your recommendation works, so does the 10/10/2024 “nightly update” (in my time zone) :grinning:

BTW, I wonder if something similar to the “impulse response analysis” of PLECS ( https://www.plexim.com/sites/default/files/demo_models_categorized/plecs/buck_converter_with_analysis_tools.pdf is in the roadmap? (asked since when i start from 100Hz with bodetol=1 the simulation becomes rather slow…

:rofl: I don’t have any insider information about which feature will be implemented next.

If you simulate this circuit from 100Hz, just use the default BODETOL. A .bode analysis between 100 and 100KHz (3 decades) takes about 4 minutes on my laptop with the default BODETOL=10. Avoid running .bode with frequencies over 3 decades, as it can significantly increase simulation time based on my experience.

1 Like