+ Post New Thread
Results 1 to 12 of 12
  1. #1
    Advanced Member level 5
    Points: 31,819, Level: 43
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,641
    Helped
    483 / 483
    Points
    31,819
    Level
    43

    Bode plot for opamp circuit different depending whether in LTspice or Excel..why?

    Hello,

    Please can you advise on why the Bode plot for an opamp circuit is different depending on whether I use LTspice to get it , or when I calculate it in Excel?

    (If I do the Bode plots for a simple, passive RC circuit, then they are the same whether I use Excel or LTspice)

    The below shows the opamp schematic in question, and the bode plots, plus LTspice simulation.

    For example, at 50.31KHz…
    Excel gives a gain of -6.74dB & phase of 163 degrees
    LTspice gives a gain of –9.202dB & phase of 155 degrees

    Also, as you can see, at low frequencies of around 1Hz, the gain and phase are massively different between Excel and LTspice.

    The LTspice bode plot is the red one and the phase is a broken line.

    Do you know the reason for the differences?

  2. #2
    Advanced Member level 5
    Points: 18,686, Level: 33
    Achievements:
    7 years registered
    crutschow's Avatar
    Join Date
    Feb 2012
    Location
    L.A. USA Zulu -8
    Posts
    3,608
    Helped
    858 / 858
    Points
    18,686
    Level
    33

    Re: Bode plot for opamp circuit different depending whether in LTspice or Excel..why?

    I don't see the Excel plot. How are you doing this in Excel? The Excel calculation likely is a more crude approximation as compared to the LTspice calculation.
    Zapper
    Curmudgeon Elektroniker


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  3. #3
    Advanced Member level 5
    Points: 31,819, Level: 43
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,641
    Helped
    483 / 483
    Points
    31,819
    Level
    43

    Re: Bode plot for opamp circuit different depending whether in LTspice or Excel..why?

    are you sure you cant see the excel plots, I can see them in the top post.
    The excel sheet is attached...I used the complex number function
    maybe not..it wont let me upload excel spreadsheets...anyway, here are excel plots again, as jpg's, as before

    Click image for larger version. 

Name:	EXCEL _GAIN VS FREQ.jpg 
Views:	5 
Size:	43.5 KB 
ID:	100987
    Click image for larger version. 

Name:	EXCEL _PHASE VS FREQ.jpg 
Views:	1 
Size:	42.4 KB 
ID:	100988



  4. #4
    Advanced Member level 5
    Points: 20,393, Level: 34
    Achievements:
    7 years registered

    Join Date
    Jan 2011
    Posts
    3,352
    Helped
    1192 / 1192
    Points
    20,393
    Level
    34

    Re: Bode plot for opamp circuit different depending whether in LTspice or Excel..why?

    Hint: check the DC operating points of the circuit.


    1 members found this post helpful.

  5. #5
    Advanced Member level 5
    Points: 31,819, Level: 43
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,641
    Helped
    483 / 483
    Points
    31,819
    Level
    43

    Re: Bode plot for opamp circuit different depending whether in LTspice or Excel..why?

    I did an .op analysis and they all came out very low numbers....like 3e-9 etc



    •   AltAdvertisment

        
       

  6. #6
    Advanced Member level 5
    Points: 18,686, Level: 33
    Achievements:
    7 years registered
    crutschow's Avatar
    Join Date
    Feb 2012
    Location
    L.A. USA Zulu -8
    Posts
    3,608
    Helped
    858 / 858
    Points
    18,686
    Level
    33

    Re: Bode plot for opamp circuit different depending whether in LTspice or Excel..why?

    Okay, I see the plots. (Working on simulation)...
    Last edited by crutschow; 14th January 2014 at 21:53.
    Zapper
    Curmudgeon Elektroniker


    1 members found this post helpful.

  7. #7
    Advanced Member level 5
    Points: 40,276, Level: 49
    Achievements:
    7 years registered
    LvW's Avatar
    Join Date
    May 2008
    Location
    Germany
    Posts
    5,771
    Helped
    1726 / 1726
    Points
    40,276
    Level
    49

    Re: Bode plot for opamp circuit different depending whether in LTspice or Excel..why?

    Quote Originally Posted by mtwieg View Post
    Hint: check the DC operating points of the circuit.
    Yes - it is agood and necessaryx hint because the opamp has no dc feedback to fix and stabilize the operating point.


    1 members found this post helpful.

  8. #8
    Advanced Member level 5
    Points: 49,758, Level: 54
    Achievements:
    7 years registered
    Audioguru's Avatar
    Join Date
    Jan 2008
    Location
    Toronto area of Canada
    Posts
    8,652
    Helped
    2018 / 2018
    Points
    49,758
    Level
    54

    Re: Bode plot for opamp circuit different depending whether in LTspice or Excel..why?

    Excel is correct, LTspice is wrong.
    The opamp has no negative feedback so its gain is millions at DC and low frequencies but LTspice says its DC and low frequency gain is only about 5.


    1 members found this post helpful.

  9. #9
    Advanced Member level 5
    Points: 18,686, Level: 33
    Achievements:
    7 years registered
    crutschow's Avatar
    Join Date
    Feb 2012
    Location
    L.A. USA Zulu -8
    Posts
    3,608
    Helped
    858 / 858
    Points
    18,686
    Level
    33

    Re: Bode plot for opamp circuit different depending whether in LTspice or Excel..why?

    Yes, the problem is the circuit is an integrator and has no DC feedback so the DC operating point is not correct in LTspice (as it would be in the real world). Below is the simulation with two added resistors for feedback to give the proper operating point. I also added a large capacitor to ground at the junction of the two resistors so the AC response is not significantly affected. The LTspice plot now looks quite close to your Excel plot I believe.

    Click image for larger version. 

Name:	Type 2 bode-mod.gif 
Views:	11 
Size:	36.0 KB 
ID:	100993
    Last edited by crutschow; 14th January 2014 at 22:29.
    Zapper
    Curmudgeon Elektroniker



  10. #10
    Advanced Member level 5
    Points: 31,819, Level: 43
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,641
    Helped
    483 / 483
    Points
    31,819
    Level
    43

    Re: Bode plot for opamp circuit different depending whether in LTspice or Excel..why?

    Guys, you are genius's, and thanks Crutschow for your two resistors and cap!



  11. #11
    Advanced Member level 5
    Points: 40,276, Level: 49
    Achievements:
    7 years registered
    LvW's Avatar
    Join Date
    May 2008
    Location
    Germany
    Posts
    5,771
    Helped
    1726 / 1726
    Points
    40,276
    Level
    49

    Re: Bode plot for opamp circuit different depending whether in LTspice or Excel..why?

    Quote Originally Posted by treez View Post
    Guys, you are genius's, and thanks Crutschow for your two resistors and cap!
    treez, I hope you are aware that such a dc stabilization is necessary not only for simulation purposes but, of course, also for hardware realization - unless the circuit is part of another (larger) feedback loop which is active down to dc.



    •   AltAdvertisment

        
       

  12. #12
    Advanced Member level 5
    Points: 31,819, Level: 43
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,641
    Helped
    483 / 483
    Points
    31,819
    Level
    43

    Re: Bode plot for opamp circuit different depending whether in LTspice or Excel..why?

    Thanks LvW, the error amplifier is seen here in the flyback....(LTspice simulation and schematic attached)
    (although this is the opto isolated version of that type 2 error amplifer being used here)



--[[ ]]--