Does anyone know how to simulate audio Frequency in Pspice?

Started by Izzy, December 21, 2006, 08:15:15 PM

Previous topic - Next topic

Izzy

So its perfect now?

I thought I would see some voltage around the diode.  :-[ haha

Izzy

One more thing I did run using Transient Analysis to see if the graph shows the wave form of the signal at the output. Maily wanted to see the clipping of the wave.

Then I ran transient from 1 to .002 sec with VSIN. It did give me a sin wave kinda thing  which I am assuming its the wave form of the audio signal. And I dont know  whether that wave is clipping or not coz I thought clipping was supposed to occur at 700mV (1n4148). But it seems cliiping is happening at 500mV.

Is that clipping or something else?
And is that the right way to see the clipping of the wave form? Or am I supposed to do it using the AC analysis?


here are the pictures



Izzy

And one more thing, it is showing 1.918mA at the 9vdc of the circuit. Does it mean that the total current drawn by the citcuit is only 1.918mA? Isnt that too less?

johngreene

The current draw is a function of the load it is trying to drive. You have a 10K resistor in series with the diodes therefore the current requirement is low. So, 1.918mA is reasonable. Diodes Vf is somewhat current dependent so because you are driving so little current through them, they clip at a lower voltage that rated. If you look at the datasheet for the 1N4148 you will see that the Vf is spec'd at a much larger current.

Everything is working now, so experiment and learn!

--john
I started out with nothing... I still have most of it.

Izzy

Thanks  lot guys.
The main reason I tried to learn doing simulation using pspice was because i hoped it will eb easier for me whne I design my own distortion circuit.

I am working on one right now. Today I put everything in pspice to simulation, but its giving some error.
The design is not complete yet. but I wanted to see what simulation would look like.

I tried suing TLC2262 IC from one of th libarry and it didnt take. Then I had to replace it with TL072 from another library. Same thign happened with  2n5088 transistors. I tried  to use from libraru called Transistor.olb, but it didnt take. That green circle thing appeared and  it said, template not found. So I had to choose this 2n5088 from bipolar library.
Anyway there is no Green circle thank fully. But it is showing soem error.
I dont get it. I checked the NETLIST but I caanot find any error. I need your help guys.
What is wrong here??

Quote* source ELECTRIC ZONE
.EXTERNAL OUTPUT Output
.EXTERNAL INPUT Input
X_R21         N48286 N06222 N47912 POT PARAMS: SET=50k VALUE=100k
R_R17         N273561 N29261 1k
R_R1         N02433 N03630 10k
Q_Q6         N02433 N72419 N22928 Q2N5088
R_R16         N74900 0 100k
C_C7         0 N47912 0.1
C_C10         N19849 0 .01uf
R_R2         N03630 0 10k
V_V2         N19849 0 DC 0Vdc AC 0.1Vac
C_C30         N67663 N72419 0.1uf
X_U3B         N00795 N00815 N00815 N02433 0 awbtl072
R_R5         N03630 N02385 10k
R_R7         N012600 N00795 2.2k
C_C1         N02433 0 100uf
X_U4B         N00835 N00857 N00857 N02433 0 awbtl072
R_R9         N00857 N47912 10k
C_C2         N03630 0 47uf
X_R20         N454491 N00795 N00795 POT PARAMS: SET=100k VALUE=100k
R_R14         0 N22928 10k
C_C6         N00857 N48286 .047uf
D_D1         0 N00857 D1N4148_1
R_R15         N148020 N22928 1k
R_R3         N19849 0 2.2meg
C_C9         N19849 N273561 2nf
Q_Q5         N02433 N29261 N00467 Q2N5088
X_R22         0 N67663 N06222 POT PARAMS: SET=50k VALUE=100k
R_R19         N02211 N454491 50k
X_U3A         N02385 N02211 N00795 N02433 0 awbtl072
R_R4         N00467 0 10k
X_U4A         N00815 N00835 N00835 N02433 0 awbtl072
D_D2         N00857 0 D1N4148_1
R_R11         N48286 0 6.8k
C_C4         N02211 N00795 150pf
C_C9         N148020 N74900 10uf
C_C3         N00467 N02385 0.47uf
R_R18         N03630 N29261 1meg
V_V1         N02433 0 9Vdc
C_C5         N012600 0 1uf


Izzy

Finally I was able to make it work but there was some error again at bias point.??


Quote
**** 12/26/06 19:03:00 ******* PSpice 10.3.0 (Jan 2004) ******* ID# 1111111111
** Profile: "SCHEMATIC1-bias"  [ D:\USERS\IZZY\DESKTOP\electric zone-pspicefiles\schematic1\bias.sim ]


****     CIRCUIT DESCRIPTION


******************************************************************************




** Creating circuit file "bias.cir"
** WARNING: THIS AUTOMATICALLY GENERATED FILE MAY BE OVERWRITTEN BY SUBSEQUENT SIMULATIONS

*Libraries:
* Profile Libraries :
* Local Libraries :
* From [PSPICE NETLIST] section of C:\Orcad\tools\PSpice\PSpice.ini file:
.lib "nom.lib"

*Analysis directives:
.AC DEC 1 20 20000
.PROBE V(alias(*)) I(alias(*)) W(alias(*)) D(alias(*)) NOISE(alias(*))
.INC "..\SCHEMATIC1.net"



**** INCLUDING SCHEMATIC1.net ****
* source ELECTRIC ZONE
.EXTERNAL OUTPUT Output
.EXTERNAL INPUT Input
X_R21         N48286 N06222 N47912 POT PARAMS: SET=50k VALUE=100k
R_R17         N273561 N34354 1k
R_R1         N02433 N03630 10k
Q_Q6         N02433 N72419 N22928 Q2N5088
R_R16         N74900 0 100k
C_C7         N47912 0 0.1
C_C10         N19849 0 .01uf
R_R2         N03630 0 10k
R_R23         N03630 N34354 1meg
V_V2         N19849 0 DC 0Vdc AC 0.1Vac
C_C30         N67663 N72419 0.1uf
X_U3B         N00795 N00815 N00815 N02433 0 awbtl072
R_R5         N03630 N02385 10k
R_R7         N012600 N00795 2.2k
C_C1         N02433 0 100uf
X_U4B         N00835 N00857 N00857 N02433 0 awbtl072
R_R9         N00857 N47912 10k
C_C2         N03630 0 47uf
X_R20         N454491 N00795 N00795 POT PARAMS: SET=100k VALUE=100k
R_R14         0 N22928 10k
C_C6         N00857 N48286 .047uf
D_D1         0 N00857 D1N4148_1
R_R15         N148020 N22928 1k
R_R3         N19849 0 2.2meg
C_C9         N19849 N273561 2nf
Q_Q5         N02433 N34354 N29385 Q2N5088
X_R22         0 N67663 N06222 POT PARAMS: SET=50k VALUE=100k
R_R19         N02211 N454491 50k
X_U3A         N02385 N02211 N00795 N02433 0 awbtl072
R_R4         N29385 0 10k
X_U4A         N00815 N00835 N00835 N02433 0 awbtl072
D_D2         N00857 0 D1N4148_1
R_R11         N48286 0 6.8k
C_C4         N02211 N00795 150pf
C_C31         N148020 N74900 10uf
C_C3         N29385 N02385 0.47uf
V_V1         N02433 0 9Vdc
C_C5         N012600 0 1uf

**** RESUMING bias.cir ****
.END

**** 12/26/06 19:03:00 ******* PSpice 10.3.0 (Jan 2004) ******* ID# 1111111111
** Profile: "SCHEMATIC1-bias"  [ D:\USERS\IZZY\DESKTOP\electric zone-pspicefiles\schematic1\bias.sim ]


****     Diode MODEL PARAMETERS


******************************************************************************




               D1N4148_1       X_U3B.DAMP1     X_U3B.DAMP2     X_U4B.DAMP1     
          IS    2.682000E-09   14.000000E-15   10.000000E-15   14.000000E-15
           N    1.836            .5                              .5         
         ISR    1.565000E-09                                                 
         IKF     .04417                                                     
          BV  100                                                           
         IBV  100.000000E-06                                                 
          RS     .5664                                                       
          TT   11.540000E-09                                                 
         CJO    4.000000E-12                                                 
          VJ     .5                                                         
           M     .3333                                                       


               X_U4B.DAMP2     X_U3A.DAMP1     X_U3A.DAMP2     X_U4A.DAMP1     
          IS   10.000000E-15   14.000000E-15   10.000000E-15   14.000000E-15
           N                     .5                              .5         


               X_U4A.DAMP2     
          IS   10.000000E-15


**** 12/26/06 19:03:00 ******* PSpice 10.3.0 (Jan 2004) ******* ID# 1111111111
** Profile: "SCHEMATIC1-bias"  [ D:\USERS\IZZY\DESKTOP\electric zone-pspicefiles\schematic1\bias.sim ]


****     BJT MODEL PARAMETERS


******************************************************************************




               Q2N5088         
               NPN             
          IS    5.911000E-15
          BF    1.122000E+03
          NF    1           
         VAF   62.37         
         IKF     .01492     
         ISE    5.911000E-15
          NE    1.394       
          BR    1.271       
          NR    1           
          RB   10           
          RC    1.61         
         CJE    4.973000E-12
         MJE     .4146       
         CJC    4.017000E-12
         MJC     .3174       
          TF  821.700000E-12
         XTF    7           
         VTF    4           
         ITF     .35         
          TR    4.673000E-09
         XTB    1.5         
          CN    2.42         
           D     .87         


**** 12/26/06 19:03:00 ******* PSpice 10.3.0 (Jan 2004) ******* ID# 1111111111
** Profile: "SCHEMATIC1-bias"  [ D:\USERS\IZZY\DESKTOP\electric zone-pspicefiles\schematic1\bias.sim ]


****     MOSFET MODEL PARAMETERS


******************************************************************************




               X_U3B.MAMP1     X_U3B.MAMP2     X_U4B.MAMP1     X_U4B.MAMP2     
               PMOS            PMOS            PMOS            PMOS           
       LEVEL    1               1               1               1           
           L  100.000000E-06  100.000000E-06  100.000000E-06  100.000000E-06
           W  100.000000E-06  100.000000E-06  100.000000E-06  100.000000E-06
         VTO    1               1.003           1               1.003       
          KP  491.961000E-06  491.961000E-06  491.961000E-06  491.961000E-06
       GAMMA    0               0               0               0           
         PHI     .6              .6              .6              .6         
      LAMBDA    0               0               0               0           
          IS   10.000000E-15   10.000000E-15   10.000000E-15   10.000000E-15
          JS    0               0               0               0           
          PB     .8              .8              .8              .8         
        PBSW     .8              .8              .8              .8         
          CJ    0               0               0               0           
        CJSW    0               0               0               0           
        CGSO    1.000000E-18    1.000000E-18    1.000000E-18    1.000000E-18
        CGDO    1.000000E-18    1.000000E-18    1.000000E-18    1.000000E-18
        CGBO    0               0               0               0           
         TOX    0               0               0               0           
          XJ    0               0               0               0           
       UCRIT   10.000000E+03   10.000000E+03   10.000000E+03   10.000000E+03
      DIOMOD    1               1               1               1           
         VFB    0               0               0               0           
        LETA    0               0               0               0           
        WETA    0               0               0               0           
          U0    0               0               0               0           
        TEMP    0               0               0               0           
         VDD    0               0               0               0           
       XPART    0               0               0               0           


               X_U3A.MAMP1     X_U3A.MAMP2     X_U4A.MAMP1     X_U4A.MAMP2     
               PMOS            PMOS            PMOS            PMOS           
       LEVEL    1               1               1               1           
           L  100.000000E-06  100.000000E-06  100.000000E-06  100.000000E-06
           W  100.000000E-06  100.000000E-06  100.000000E-06  100.000000E-06
         VTO    1               1.003           1               1.003       
          KP  491.961000E-06  491.961000E-06  491.961000E-06  491.961000E-06
       GAMMA    0               0               0               0           
         PHI     .6              .6              .6              .6         
      LAMBDA    0               0               0               0           
          IS   10.000000E-15   10.000000E-15   10.000000E-15   10.000000E-15
          JS    0               0               0               0           
          PB     .8              .8              .8              .8         
        PBSW     .8              .8              .8              .8         
          CJ    0               0               0               0           
        CJSW    0               0               0               0           
        CGSO    1.000000E-18    1.000000E-18    1.000000E-18    1.000000E-18
        CGDO    1.000000E-18    1.000000E-18    1.000000E-18    1.000000E-18
        CGBO    0               0               0               0           
         TOX    0               0               0               0           
          XJ    0               0               0               0           
       UCRIT   10.000000E+03   10.000000E+03   10.000000E+03   10.000000E+03
      DIOMOD    1               1               1               1           
         VFB    0               0               0               0           
        LETA    0               0               0               0           
        WETA    0               0               0               0           
          U0    0               0               0               0           
        TEMP    0               0               0               0           
         VDD    0               0               0               0           
       XPART    0               0               0               0           


ERROR -- Convergence problem in bias point calculation


  Last node voltages tried were:

NODE   VOLTAGE     NODE   VOLTAGE     NODE   VOLTAGE     NODE   VOLTAGE


(N00795)    -.1086 (N00815)    -.1026 (N00835)    -.0970 (N00857)    -.0916     

(N02211)-234.3E+03 (N02385)     .4500 (N02433)     .9000 (N03630)     .4500     

(N06222)-1.832E-06 (N19849)    0.0000 (N22928) 51.11E-09 (N29385)     .0019     

(N34354)     .4484 (N47912)    -.0916 (N48286) 2.492E-12 (N67663)     .0916     

(N72419)     .1657 (N74900)    0.0000 (N012600)    -.1086                       

(N148020) 51.11E-09                   (N273561)     .4484                       

(N454491)-234.3E+03                   (X_U3A.1)-71.84E-06                       

(X_U3A.5)-31.87E-06                   (X_U3A.8)-71.84E-06                       

(X_U3A.9) 188.8E-06                   (X_U3B.1)     .0551                       

(X_U3B.5)     .0345                   (X_U3B.8)     .0345                       

(X_U3B.9) 174.0E-06                   (X_U4A.1)     .0552                       

(X_U4A.5)     .0345                   (X_U4A.8)     .0345                       

(X_U4A.9) 164.4E-06                   (X_U4B.1)     .0553                       

(X_U4B.5)     .0345                   (X_U4B.8)     .0345                       

(X_U4B.9) 155.3E-06                   (X_U3A.10)    -.1090                     

(X_U3A.11)    -.0109                  (X_U3A.12)     .2240                     

(X_U3A.13)     .6760                  (X_U3B.10)    -.1026                     

(X_U3B.11)    -.0103                  (X_U3B.12)     .2240                     

(X_U3B.13)     .6760                  (X_U4A.10)    -.0970                     

(X_U4A.11)    -.0097                  (X_U4A.12)     .2240                     

(X_U4A.13)     .6760                  (X_U4B.10)    -.0916                     

(X_U4B.11)    -.0092                  (X_U4B.12)     .2240                     

(X_U4B.13)     .6760                 



DGTL NODE : STATE  DGTL NODE : STATE  DGTL NODE : STATE  DGTL NODE : STATE


(  Output) : Z     (   Input) : Z     


  These devices failed to converge:
    X_U3A.M2 

Try running with .OPTION STEPGMIN


**** Interrupt ****


Izzy

And I also dont get it why the bias voltage is 450mv instead of 4.5 and the main voltage is 900mv intead of 9v?  ??? ??? ??? ???

johngreene

Where to start.....

Your input transistor is drawing 187 mA of current. That's a problem. You probably need to lable R23 1Meg rather than 1meg. The capital 'M' is necessary otherwise it assumes it is 'milli'.

Your first opamp is wired wrong.

The output transistor has no biasing.

--john
I started out with nothing... I still have most of it.

Izzy

Thanks man I appreciate your help.


QuoteYour input transistor is drawing 187 mA of current. That's a problem.

I think its 187nA. Right?

QuoteYou probably need to lable R23 1Meg rather than 1meg. The capital 'M' is necessary otherwise it assumes it is 'milli'.

I tried with capital M to but still I am not gettign simulation. Does it really matter , I did with "meg" in MXR and it worked fine, I guess.


QuoteYour first opamp is wired wrong.
I saw that, but I dont under stand whats wrong with it? Any Idea?


QuoteThe output transistor has no biasing.
I biased it now with 1 M. That shoudl be ok right?


But it still aint working?

QuoteIn simulation profile it shows :
Reading and checking circuit
Circuit read in and checked, no errors
Calculating bias point
Starting power supply stepping
Convergence problem in bias point calculation
These devices failed to converge:
    X_U3A.M2
Simulation paused


Izzy

Especially that -127.9 KV in the feedback loop of first opamp, sounds terribly weird. :-X

johngreene

Quote from: Izzy on December 26, 2006, 08:34:29 PM
Thanks man I appreciate your help.


QuoteYour input transistor is drawing 187 mA of current. That's a problem.

I think its 187nA. Right?

I can't tell from your picture, it looked like mA to me.

Quote from: Izzy on December 26, 2006, 08:34:29 PM
QuoteYou probably need to lable R23 1Meg rather than 1meg. The capital 'M' is necessary otherwise it assumes it is 'milli'.

I tried with capital M to but still I am not gettign simulation. Does it really matter , I did with "meg" in MXR and it worked fine, I guess.


QuoteYour first opamp is wired wrong.
I saw that, but I dont under stand whats wrong with it? Any Idea?

Read an application note or something on how to design an opamp amplifier. Or at least compare it to the MXR file you had before. The inverting input isn't wired correctly.

Quote from: Izzy on December 26, 2006, 08:34:29 PM
QuoteThe output transistor has no biasing.
I biased it now with 1 M. That shoudl be ok right?


But it still aint working?

QuoteIn simulation profile it shows :
Reading and checking circuit
Circuit read in and checked, no errors
Calculating bias point
Starting power supply stepping
Convergence problem in bias point calculation
These devices failed to converge:
    X_U3A.M2
Simulation paused



It won't work until you fix the first opamp.
I started out with nothing... I still have most of it.

Izzy

Thanks a lot man, You saved me.
I found out the resistor and the caps from feedback loop to the ground was supposed to be on the inverted input side. I changed it.

I checked the voltage after each opamp and it is working . But as soon as it comes out from the 4th opamp the voltage becomes constant at around 1.6v. (Its where the signal meets diodes)

Here
Green is the voltage probe at the output
Pink is at the output of 4th opamp
Red, yellow, Blue (But you will only see blue) is the voltage probe at 1st, 2nd and 3rd opamp's output.






Izzy

ok after a long time, I foudn out  there was supposed to be a resistor before the diodes. I dont know why, So I put 1k resistor.
then I ran the simulation then teh vsignal after the 4th opamp was hanging around 0.7 v.

then instead of shunting Diodes to ground I joined diodes to  4.5V. Which brought the signal wave back to where the signal was before diode. And this time it clipped.

Now the signal becomes low and low as it reaches tone control and volume control pots. Am I supposed to join those tone control's ground to 4.5 v? If yes why?


And one main thing isnt that point of oscilattion is supposed to be at 0v? why is it at 4.5v?

PURPLE    = Voltage probe at the output of 4th opamp
SKY BLUE = After the diodes
Yellow     =  Before the first OPamp
Green      =  At the Output
Orange = at tone control
Red      = at tone control







PenPen


I couldn't get those .olb files to work with LTSpice. Proper files have a .sub or .mod extension and are plain text, that one I downloaded was full of binary.

Izzy

I dont know, all I have is that .olb files. I dont have .sub or .mod extention files. But it works fine in mine.
But yes I couldnt make that opamp.olb and other several files like transistor.olb to work. I dont know why?


johngreene

You have a DC path through the tone and volume controls. So either replace R26 with a capacitor or add a cap in series with it. Or you could attach R11 and R22 to the 4.5V supply. Otherwise it looks like it is working. The tone control is going to attenuate the signal depending on the frequency and the setting of R21. With R22 set to 50% you are going to only get half the signal at the output that you have coming out of the tone control.

I'm not sure what you mean by the 'point of oscillation' being at 0V....

--john
I started out with nothing... I still have most of it.

Izzy

Thank you once again sir. You have been a great help here.

I did as you said. I also joined the tone  controls leg to 4.5 v.

But when I added that capacitor after the opamp it made some hollow slope around 400-600 hz with 1uf, and with even less value, the signal kinda looked weird with some dips, so I had to put 10uf in order to make the AC simulation of freq responce a nice curve. So will there be any problem with 10uf caps? Is it big?

And I too think its working but I think I found out the problem. There is some thing wrong with the output buffer transistor. As soon as the signal passes through the transistor the amplitude gets very low! I think I have biased it right.  So what could be problem here.

In the graph below , tone is at 0 and level is full and gain is at full.


The light green curve around 1 V is the signal before the Output transistor and after the C10. It has amplitude of around 0.5 v. Now as soon as it passes transistor the signal becomes low and amplitude becomes around 0.1V? Why the heck is that? :o

:-[










Izzy

Ouch I think I got it!
The mistake was I didnt label that transistors base as 10 K.
Damn this Units. ;D


One more thing. Is it necessary to put  that capacitor after the opamp? Because I think I got more uniform/better waveform without the cap.

johngreene

Since you have everything now tied to the 4.5V bias, it is no longer necessary to have the cap after the opamp.

--john
I started out with nothing... I still have most of it.