Bug Report: Frequency Domain sim seems to be broken.



Copy of spott's circuit from the original post:

And a copy of my comments to spott to demonstrate that there is a bug:

CL seems to have made Frequency Domain Analysis as obscure as possible and broken it in the process.

i) First off please see:


You need to enter the source description by hand into the Frequency Domain "Input" box.

ii) In your sim as posted, the V_ref.Phase you are adjusting is not what you think. You are not adjusting the phase of the AC signal source for the Frequency Domain simulation. You are adjusting the initial phase of V_Ref in the time domain. So in practice what your AC sim is doing is adjusting the DC offset of V_ref as a result of the change in the initial phase steps.

To see this, just run a Time Domain sim with V_ref.Phase as the swept parameter and look at the initial DC offset of the input signal.

If you do a Time Domain sim with a stop time of 2ms and look at the output of your sim, you'll see that the amplifier seems to be giving the expected sort of output signal. You may notice however that some outputs seem to start up from zero rather than the initial DC_offset*100 (the DC gain of your amp). This seems to be for a V_Ref.Phase of 180 degrees.

Similarly if you sweep V_Ref.DCOffset between 290mV and 301mV with a 10mV step you'll see this startup from zero for V_Ref.DCOffset = 300mV.

This does not appear if you assign the phase or offset values manually and rerun a sim each time.

This is a clue that all is not quite right in CL space. There would appear to be some inconsistency in how the initial conditions are being solved for the amp.

iii) If you replace the CL signal source you have chosen with a simple DC source (retaining the name V_Ref) and set the DC source to voltage of 300mV and run a Frequency Domain simulation (with swept parameter unticked) you'll see a sensible looking Bode plot with the expected low frequency gain of 40dB and phase shift of zero.

iv) Re-run this sim with manually adjusted voltage values of 290mV and 310mV and all will still look OK.

v) Now, using the same source, reset the DC source voltage value to 300mV and then run a Frequency Domain simulation whilst sweeping V_Ref.V between 290mV and 310mV with a step size of 10mV (i.e. 3 steps).

Now you'll see the gain apparently drop to a low value of -20dB when V_ref.V = 300mV.

This is clearly nonsense.

vi) Using the same source, with the swept parameter unticked again, when you change the phase of this source (as described in the link above) and run the Frequency Domain simulation, you'll find that the amplitude response is constant and the phase response has a shift corresponding to the phase you have now assigned to V_Ref.

vii) Repeating (v) with different phases set in the input source box shows rubbish when the DC offset is 300mV.

CL is clearly broken.


by signality
October 15, 2015

Post a Reply

Please sign in or create an account to comment.

Go Ad-Free. Activate your CircuitLab membership. No more ads. Save unlimited circuits. Run unlimited simulations.

About CircuitLab

CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.