What's wrong with this LTSpice Sim? -- NMOS and PMOS in SineWave

Discussion in 'Programmer's Corner' started by Tonyr1084, Jun 23, 2016.

  1. Tonyr1084

    Thread Starter Active Member

    Sep 24, 2015
    535
    86
    Learning to use Spice. I've drawn up this sim and for all intents and purposes it appears to be doing what it's supposed to do. Please understand this isn't anything I hope to build I just want to understand LTSpice better.

    M1 & M2 are MOSFET's (N type and P type). I'm not certain I have them drawn properly, but from the scope it appears to do what I intended - to pass AC through a series of transistors. I've noticed that there is some clipping at the zero point (if that's the correct terminology) and am wondering why on that as well.

    TP3 is the 2 volt sine wave. TP1 & TP2 are the voltages passing through the MOSFET's. What I'd like from you is to tell me what I created and if it's wired properly. Again, keep in mind I'm not trying to DO something, I'm just trying to learn something.

    Thanks for all the help.
     
  2. ericgibbs

    AAC Fanatic!

    Jan 29, 2010
    2,503
    380
    hi Tony,
    Don't see any images.?
    Please post the LTS asc file for your circuit.
    E
     
  3. Tonyr1084

    Thread Starter Active Member

    Sep 24, 2015
    535
    86
    When posting post #1 I failed to attach the file. I edited it and it is now posted. Sorry, I often do that - post something then have to edit it. Meanwhile people are answering the original question before I've managed to get the edit posted.
     
  4. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,346
    Hello,

    It shows a strange connection.
    Is this correct?

    Tonyr_Screenshot 2016-06-23 06.19.44_commented.png

    Bertus
     
  5. Tonyr1084

    Thread Starter Active Member

    Sep 24, 2015
    535
    86
    I hope this has the ASC file attached. If not - be patient, it'll be posted in another minute.
     
  6. Tonyr1084

    Thread Starter Active Member

    Sep 24, 2015
    535
    86
    Didn't notice that. I moved things a little and failed to notice that. I'll edit it and repost it.

    See what I mean? I'm mechanically inclined - there's nothing I can't screw up.

    [edit] OK, trying again. Oh, and nothing changed on the waveforms.
     
  7. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    I think what you are looking at is the effect of the instrinsic diodes inside the mosfets. I don´t really know what you are trying to simulate, but possibly something simpler like a class-A single transistor amplifier might be a better start.
     
  8. Tonyr1084

    Thread Starter Active Member

    Sep 24, 2015
    535
    86
    Kubeek: I'm just trying to learn more about LTSpice. The goal of the circuit is moot. It's the spawn of the notion that somewhere I heard that a MOSFET can pass current from D to S AND from S to D. According to LTSpice it doesn't appear to be so. And I'm not even sure if that's a definitive answer to that question either. It's just that I thought I read (or heard) that D & S are interchangeable. Is that true? If so - please help me understand.

    Thanks.
     
  9. Tonyr1084

    Thread Starter Active Member

    Sep 24, 2015
    535
    86
    Is the P Chanel wired correctly? Should the source be directly to ground? This is an AC circuit so would that matter? There's a lot to learn (for me) and I can use all the help I can get.

    Way back in the 70's I learned BJT's, and at that I didn't even learn them very well. FET's are quite new to me - even though they've been around a long time. For a long time I was doing the family thing and didn't take time for my electronics hobby. Well, now I'm back to learning about this stuff - so - .
     
  10. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Yes mosfets can pass through current in both directions, but they still need the proper voltage between G and S to be open. N-channel needs roughly 5V on gate with respect to source, and P-channel needs -5V on gate with respect to source to be turned on.

    What I was suggesting was that if you want to be more familiar with LTSpice, you probably should start with a circuit you are sure about and know exactly how it works and what to expect, then move onto circuits you don´t know.
     
  11. Tonyr1084

    Thread Starter Active Member

    Sep 24, 2015
    535
    86
    Thanks Kubeek, that's pretty good advice. AND I've learned something about AC and MOSFETs. I'm going to modify this to supply a constant 5 VDC to the gate of the N chan and read (check for sine waves) coming through the FET.
     
  12. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,797
    1,103
    The inherent body diodes of the FETs don't show up in Spice and so catch a lot of people out.
    This is effectively what your circuit looks like to Spice :-
    BodyDiode.PNG
    Another gotcha is that the generic FET models that you're using don't give realistic results. It's best to right-click the symbol and select a real-world FET.
     
    anhnha likes this.
  13. Tonyr1084

    Thread Starter Active Member

    Sep 24, 2015
    535
    86
    Question about FETs: On an N-Chanel, to be "ON" the gate voltage needs to be lower (more toward zero OR more negative) than the source? Would the P-Channel be just the opposite? more positive than the source? Do I have at least that much right?
     
  14. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    You have it exactly opposite, gate needs to be more positive than source in an N channel fet to turn it on.
     
  15. DickCappels

    Moderator

    Aug 21, 2008
    2,653
    632
    Depletion mode MOSFETs exist but they are rare
     
  16. crutschow

    Expert

    Mar 14, 2008
    13,009
    3,233
    Below is the simulation of an N-MOSFET showing it conducting in both direction when on (Vgs=10V) for the first 4ms and conducting only in the reverse direction when off, due to the substrate diode (which is part of the simulation model here) after that.
    You can see the reduced output voltage in the reverse direction due to the substrate diode forward drop of about 0.7V.

    upload_2016-6-26_0-21-0.png
     
    anhnha likes this.
  17. Tonyr1084

    Thread Starter Active Member

    Sep 24, 2015
    535
    86
    Obviously I have a lot to learn about MOSFETs and a lot to learn about using LTSpice.

    I appreciate all your efforts in helping me to understand. The only way I'm going to learn is to keep messing with LTS and with MOS.

    Thanks all.
     
  18. crutschow

    Expert

    Mar 14, 2008
    13,009
    3,233
    Then mess away.
    You might try simulating my circuit with a sinewave to see the results with that.
     
  19. Tonyr1084

    Thread Starter Active Member

    Sep 24, 2015
    535
    86
    Thanks Crutschow.
     
  20. ci139

    Member

    Jul 11, 2016
    341
    38
Loading...