Oscillator simulation in LTspice

Discussion in 'Analog & Mixed-Signal Design' started by PeteHL, Aug 2, 2018.

  1. PeteHL

    Thread Starter Member

    Dec 17, 2014
    199
    8
    Can this be done with LTspice? When I ran the simulation of the below phase-shift oscillator, I received the error message that my sim lacked an AC source.

    The circuit constructed at my bench using the op amp LM307 gave me a sine wave output of freq. = 1.4 kHz.

    So far I've used LTspice very little, so hopefully I overlooked something. Lacking a spectrum analyzer at my bench, I was hoping that I could determine by simulation the extent of harmonic distortion.

    Thanks for any advice,

    Pete

    P.S.: It is not possible to convert *.asc to for example *.jpg with LTspice, is that true?
     
  2. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,393
    1,485
    Use transient analysis with a start and stop time instead of AC analysis. AC analysis expects an AC source and it will sweep the frequency of the source to plot the frequency response of a circuit.
     
  3. ericgibbs

    Moderator

    Jan 29, 2010
    5,737
    1,070
    hi Pete,
    Note your Cap values are Farads.
    E

    EDIT:

    Where did you get the OP07 model.?
    With another OPA model it runs OK in .tran

    Update:
    Added a sim with LM324
     
    Last edited: Aug 2, 2018
  4. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,393
    1,485
    Try this one:
     
  5. PeteHL

    Thread Starter Member

    Dec 17, 2014
    199
    8
    Thanks very much @AlbertHall and @ericgibbs. I see the error of my ways.

    The OP07 is one in the LTspice op amp library. I forget now, but somehow I arrived at the conclusion that the OP07 is close to a general purpose op amp such as LM307.
     
  6. PeteHL

    Thread Starter Member

    Dec 17, 2014
    199
    8
    Thanks again. Copying how to do it was a little bit tricky as I found that the parameters of the AC analysis must be entered before the transient parameters to get the simulation to work.

    It looks like the only way that I could determine harmonic distortion would be to simulate band-pass and notch filters connected to the output of the oscillator.
     
  7. RichardO

    Late Member

    May 4, 2013
    2,274
    889
    You can do an FFT from the waveform window. It is in the "View" drop down menu.
     
  8. PeteHL

    Thread Starter Member

    Dec 17, 2014
    199
    8
    Thank you. I will try to see if I can do that tomorrow.
     
  9. ericgibbs

    Moderator

    Jan 29, 2010
    5,737
    1,070
    hi Pete,
    This is the FFT, using Albert's LTS asc.
    E
     
  10. Bordodynov

    Well-Known Member

    May 20, 2015
    1,862
    568
    See
    2018-08-03_12-06-30.png 2018-08-03_12-07-09.png
     
    cmartinez likes this.
  11. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    8,659
    1,975
    You can use the .FOUR command to get harmonics info.
     
  12. Bordodynov

    Well-Known Member

    May 20, 2015
    1,862
    568
    In my example, I did so. Using the "Meas" command, I determined the duration of 1000 periods and calculated the signal frequency. Then I used the "Four" command and ran the calculation again and calculated the harmonics. I made a calculation for 100 periods.
    I also did an FFT analysis.
     
  13. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    8,659
    1,975
    So you did. I hadn't spotted that :) .
     
  14. Audioguru

    Expert

    Dec 20, 2007
    10,506
    1,168
    The distortion is as high as 1% because the opamp output is clipping like crazy.
     
  15. PeteHL

    Thread Starter Member

    Dec 17, 2014
    199
    8
    Very Impressive! Even though I did make some effort to do what you did, I could not duplicate. I am currently not familiar enough with the software and I found little to no guidance in LTspice Help for much of the procedure that you followed. Is it possible to do what you did in LTspice IV?
     
  16. Bordodynov

    Well-Known Member

    May 20, 2015
    1,862
    568
  17. akbarza

    New Member

    Dec 22, 2013
    1
    0
    click on x-axis and choose linear division( in picture, the division are logaritmic).
    do this for y-axis.
    also after doing above, if you see spectrum is compressed then use zoom in ltspice
     
Loading...