1
\$\begingroup\$

I have some troubles with LTSpice for simulating a Type II compensation network. Here is the simulation:

enter image description here

Here is the result for the ideal opamp and for the non ideal opamp (UniversalOpAmp2):

enter image description here

The UniversalOpAmp2 does not give the same result than the ideal op amp. The right result is the one with the odeal opamp. I do not understand why I have completely different results between the 2 models.

Version 4
SHEET 1 3148 680
WIRE -80 -544 -304 -544
WIRE 160 -544 48 -544
WIRE 352 -544 224 -544
WIRE 960 -544 736 -544
WIRE 1200 -544 1088 -544
WIRE 1392 -544 1264 -544
WIRE -304 -480 -304 -544
WIRE 736 -480 736 -544
WIRE -80 -464 -80 -544
WIRE 960 -464 960 -544
WIRE 48 -448 48 -544
WIRE 96 -448 48 -448
WIRE 240 -448 176 -448
WIRE 352 -448 352 -544
WIRE 352 -448 304 -448
WIRE 1088 -448 1088 -544
WIRE 1136 -448 1088 -448
WIRE 1280 -448 1216 -448
WIRE 1392 -448 1392 -544
WIRE 1392 -448 1344 -448
WIRE -304 -336 -304 -400
WIRE -80 -336 -80 -384
WIRE 48 -336 48 -448
WIRE 48 -336 -80 -336
WIRE 128 -336 48 -336
WIRE 736 -336 736 -400
WIRE 960 -336 960 -384
WIRE 1088 -336 1088 -448
WIRE 1088 -336 960 -336
WIRE 1168 -336 1088 -336
WIRE 1392 -320 1392 -448
WIRE 1392 -320 1264 -320
WIRE 1424 -320 1392 -320
WIRE 1264 -288 1264 -320
WIRE 128 -272 128 -336
WIRE 192 -272 128 -272
WIRE 1168 -272 1168 -336
WIRE 1216 -272 1168 -272
WIRE 352 -256 352 -448
WIRE 352 -256 256 -256
WIRE 1424 -256 1424 -320
WIRE 192 -240 96 -240
WIRE 544 -240 544 -256
WIRE 640 -240 640 -256
WIRE 1216 -224 1136 -224
WIRE -80 -208 -80 -336
WIRE 960 -208 960 -336
WIRE 352 -192 352 -256
WIRE 1264 -176 1264 -208
WIRE 96 -144 96 -240
WIRE 544 -144 544 -160
WIRE 640 -144 640 -160
WIRE 1136 -144 1136 -224
WIRE -80 -80 -80 -128
WIRE 960 -80 960 -128
WIRE 1424 -80 1424 -176
WIRE 352 -16 352 -112
WIRE 656 -16 656 -32
WIRE 656 80 656 64
FLAG 640 -144 0
FLAG 544 -144 0
FLAG 544 -256 +V
FLAG 640 -256 -V
FLAG 1424 -80 0
FLAG 656 80 0
FLAG 656 -32 Vref
FLAG 1136 -144 Vref
FLAG 960 -80 0
FLAG 736 -336 0
FLAG 1264 -176 0
FLAG 352 -16 0
FLAG 96 -144 Vref
FLAG -80 -80 0
FLAG -304 -336 0
FLAG 224 -224 -V
FLAG 224 -288 +V
FLAG 352 -256 Out1
FLAG 1392 -320 Out2
SYMBOL voltage 544 -256 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value 15
SYMBOL voltage 640 -256 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V2
SYMATTR Value -15
SYMBOL res 976 -112 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R7
SYMATTR Value 1k
SYMBOL res 976 -368 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R8
SYMATTR Value 1K
SYMBOL voltage 656 -32 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V3
SYMATTR Value 2.5
SYMBOL voltage 736 -496 R0
WINDOW 3 24 44 Left 2
WINDOW 123 24 44 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V4
SYMATTR Value ""
SYMATTR Value2 AC 1
SYMBOL res 1232 -464 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 10k
SYMBOL cap 1344 -464 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C1
SYMATTR Value 15.9n
SYMBOL cap 1264 -560 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C2
SYMATTR Value 32p
SYMBOL e2 1264 -304 R0
SYMATTR InstName E1
SYMATTR Value 10Meg
SYMBOL res -64 -112 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R3
SYMATTR Value 1k
SYMBOL res -64 -368 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R4
SYMATTR Value 1K
SYMBOL res 192 -464 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R6
SYMATTR Value 10k
SYMBOL cap 304 -464 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C3
SYMATTR Value 15.9n
SYMBOL cap 224 -560 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C4
SYMATTR Value 32p
SYMBOL Opamps\\UniversalOpamp2 224 -256 R0
WINDOW 38 -33 88 Left 2
WINDOW 123 -369 258 Left 2
WINDOW 39 -371 281 Left 2
WINDOW 40 -376 308 Left 2
SYMATTR InstName U3
SYMATTR Value2 Avol=10Meg GBW=100Meg Slew=200Meg
SYMATTR SpiceLine ilimit=25m rail=0 Vos=0 phimargin=90
SYMBOL voltage -304 -496 R0
WINDOW 3 24 44 Left 2
WINDOW 123 24 44 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V6
SYMATTR Value ""
SYMATTR Value2 AC 1
SYMBOL res 336 -208 R0
SYMATTR InstName R2
SYMATTR Value 100k
SYMBOL res 1408 -272 R0
SYMATTR InstName R5
SYMATTR Value 100k
TEXT 284 84 Left 2 !.ac dec 100 0.1 100Meg
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Always check the dc operating points before considering the ac results. It means that you must superimpose a dc bias on the ac source so that the op-amp dc output is meaningful like 2-3 V and does not rail up or down which is most likely the case. \$\endgroup\$ Feb 21, 2023 at 19:10

4 Answers 4

1
\$\begingroup\$

When you try to exercise an op-amp in an active filter configuration, always check the operating point and make sure the op-amp does not rail up or down. If it does, SPICE will deliver an ac result but it is garbage. Look at the below figure in which the right-side source exactly provides the 12-V bias to the type 2 compensator so that its output is set to an arbitrary level of 2.5 V for instance:

enter image description here

The right-side macro automates the pole-zero placement and the gain calculation to meet the design goal which is 20 dB at 1 kHz:

enter image description here

The trick is always the same: the LoL inductor closes the loop in dc and forces the op-amp to approach the setpoint given by V2. When the ac analysis starts, LoL blocks the modulation and effectively opens the loop while CoL injects the ac. The resulting plot confirms the response. You can find these ready-made compensators simulating in SIMPLIS in my web page.

\$\endgroup\$
2
\$\begingroup\$

The ideal op-amp you have used is a voltage controlled voltage source with a gain of 10 million. It's as near to ideal as anything you could conjure up and massively more "ideal" than any real-life practical op-amp AND will be able to cope with Vref being non-zero: -

enter image description here

On the other hand, the "Universal op-amp" will have a large DC open-loop gain that rolls-off around a few tens of Hz and becomes unity gain in the high-kHz to low-MHz region. In other words you are not comparing apples with apples. The universal op-amp circuit AC simulation is unlikely to cope with any value of Vref other than zero volts.

If instead you made your ideal op-amp in three stages: -

  • ideal differential input with gain of 10 million followed by
  • a low pass filter with a cut-off of around 10 Hz followed by
  • an ideal unity gain buffer

Then, you will likely get a response that is much closer to the universal and more practical and realistic op-amp.

The right result is the one with the ideal op-amp

No, that's the ideal result but we will never achieve this with real op-amps. I mean, you are making a type II compensator and although it's presence is needed in many circuits to maintain closed-loop stability, the fact that you are using it means you should recognize that an ideal op-amp is a dream.


You should set Vref to be 0 volts and see if the actual output graph for the universal op-amp now starts to make sense. Currently, as shown, the output would hit the end stops (power rails). This might upset LTspice's ability to do a proper AC plot on that particular circuit.

\$\endgroup\$
1
\$\begingroup\$

For whatever reason , your lower plot is wrong. If you inverted, you will find that it is identical to the ideal one in shape up to where the game bandwidth starts to impact the results.

Try to correct your variables for transfer function and start from .1 Hz.

enter image description here

\$\endgroup\$
1
\$\begingroup\$

The discrepancy is due to UniversalOpamp2's power rails. The ideal model can pull its power from the ether and satisfy any non-practical requirement. If you hover your mouse cursor over Out2, you'll see at the bottom-left of the screen that the DC operating point for that node is 25 megavolts. Do the same for Out1 and you'll see it says something close to 15V, which is the positive rail of your opamp. It's therefore saturating and producing different results than the ideal model which is incapable of saturating.

The 25MV should be a clue for you. If you set Vref to 0V instead of 2.5V (or something else that won't equal 15V after 10megs of gain...such as 100mV) you'll see that both opamps now begin to operate similarly.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for your help :) \$\endgroup\$
    – Jess
    Feb 23, 2023 at 8:56

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.