Strange `.bode` results in a COT converter

(Basically, this is a similar problem as posted earlier in FRA measurements and .bode analysis don’t match - QSPICE - Qorvo Tech Forum. However, previous issue is caused by element-wise IC setting and is solved. So I decided to post a new thread here.)

buck_cot.qsch (17.2 KB)

This is a simplified COT (constant on-time) Buck converter and I was trying to make the loop gain plot (I knew it might not be a minimum-phase system or whatsoever, just being curious).

What I got from .bode analysis

.bode V4 10m 1K 100K 100m
.option bodeout=out bodein=pert
.options BodeAmpFreq=0 

is like:


which looks really strange from 1kHz to 8kHz.

For comparison, the stepped transient analysis with fra measurement

.tran 0 12m 0 10n
.step dec param f 1K 100K 32
.measure gain fra f v(pert) v(out) from 10m

gives


which seems more reasonable. (However, I haven’t compare these results to PLECS or LTspice.)

It looks to me the multitone injection has led to some sort of aliasing effects…

Again, LTspice gives similar results as with .measure ... fra:

In your FRA analysis, it appears that you are using a constant amplitude perturbation source from 1k to 100kHz. From the FRA plot, the gain rolls off quickly when the frequency exceeds 20kHz. If I simulate a .tran with a 30kHz 100mV perturbation, the gating is in burst mode. With such a condition occurs, you might obtain an incorrect result from .bode

Simulating this circuit with .bode is very challenging.

  1. I have to remove IC=0 in C2, as it seems to trigger a bug again (I will report this to Mike).
  2. It cannot use a constant perturbation source because this circuit has a very high gain (>60dB) before 3kHz, and it easily becomes overdriven above 10kHz. What I need to do is apply a high level of perturbation at low frequencies to get enough signal level from V(pert) for analysis and a low level at high frequencies to prevent saturating the controller or causing the inductor current to become discontinuous. Therefore, I added BodeLoPow ,BodeHiPow and set BodeAmpFreq to force a suitable perturbation signal.

This is the simulation result from .bode, without the drop in gain above 20kHz as explained in the first part.
buck_cot-3.qsch (19.8 KB)

Many thanks, @KSKelvin !

Indeed, the IC setting of the output capacitor was still causing problems. And the “high gain” + “mode change” is overlooked in my previous simulation.

However, the last result you gave in buck_cot-3.qsch indicates the bandwidth is above 100kHz which may be incorrect. Guess the root cause is the perturbation signal rolls off too fast at 100kHz: (100kHz / 1kHz) ^ (-0.8) * 500mV ≈ 22mV, and this is close to the output ripple which is required to make the system work. When I change the perturbation frequency characteristics to

.bode V4 10m 1K 100K 100m
.option bodeout=out bodein=pert
.options BodeAmpFreq=10K 
.options BodeLoPow=1 BodeHiPow=0
.options BodeTol=1

the results match what the fra measurement (.meas ... fra) gives:

Again, had to say the converter model is not well defined…

In addition, another problem was found when I tried to compare the simulation of QSPICE to LTspice:

  • in QSPICE, when a 20pF capacitor is placed in parallel to S1, and when the maximum time step is unlimited (using .tran 12m instead of .tran 0 12m 0 10n), an oscillation at the sw node was observed, which in turn drives the output v(out) to half of the input voltage, 6V. It seems the Buck diode D2 fails to keep conducting even when i(L1) is 10A with small ripples.
  • in LTspice, with same ideal voltage controlled switch and diode models used, no matter what capacitance is placed in parallel to S1 or D2, the circuit works as expected.

The following waveforms show what I meant.

QSPICE

LTspice:

Wonder if you ever observed similar issue?

What you encountered is trap ringing with using trapezoidal integration. Search the keyword “trap ringing” in forum to get more information, there are multiple discussion threads as your reference. Here is one of my summary,
Voltage oscillation in different transformer modeling approach - QSPICE - Qorvo Tech Forum

LTspice and Qspice are quite different in certain area, and trap ringing is one of it. Mike explained why he no longer smooth trap ringing in Qspice in this reply
Need guidance on qspice integration method and this feather parameter - QSPICE - Qorvo Tech Forum

Initially, people may think prior art is better, but it just hide a problem that you should be aware of. In your case, few things can help

  • .option maxstep=10n - reduce timestep
  • .option feather=.1 - trap with feather (experimental damping)
  • .option method=gear - change of integration method (to gear integration)

maxstep is the best amount them.

Trap ringing in general appear in simulation with near ideal component in SPICE.

Or, if you change Vh=+0.1 to Vh=-0.1, your simulation file can also run reasonably. It force the switch to smoothly transition between on and off.

Thanks again, @KSKelvin . It now reminds me of some self-made simulation program years ago, such ringings were also observed and a general solution was to stamp the circuit with Gear method or to hard code the piecewise linear behavior of switching circuits :slight_smile:

1 Like

I=idt(1/500n,0,v(gdrv))>1 Rpar=1, what does “idt()>1” mean?

This is circuit by @Yufei , I just answered about how to perform .bode.

Here is what idt()>1 represent. One formula to output comparator results of a sawtooth compare to 1V reference.

idt.qsch (3.5 KB)

Hi Kevin, understood. Thanks a lot!