# colpitts oscillator pspice

Discussion in 'Homework Help' started by darkbasic, Jan 18, 2015.

1. ### darkbasic Thread Starter New Member

Jan 18, 2015
5
0

Hi,
I'm trying to simulate exercise 13.21(a) from Sedra-Smith, with:
• Vcc=5V
and the following BJT model:
Code (Text):
1. .model modn NPN(Is=6.734f Xti=3 Eg=1.11 Vaf=74.03 Bf=416.4 Ne=1.259 Ise=6.734f Ikf=66.78m Xtb=1.5
2. Br=.7371 Nc=2 Isc=0 Ikr=0 Rc=1 Cjc=3.638p Mjc=.3085 Vjc=.75 Fc=.5 Cje=4.493p Mje=.2593 Vje=.75
3. Tr=239.5n Tf=301.2p Itf=.4 Vtf=4 Xtf=2 Rb=10)
This is the circuit in pspice:

(I had to put R2=1f because otherwise the simulation didn't converge)

Since I have two conditions for oscillation:

Code (Text):
1. Im{A*B(jw)}=0
Code (Text):
1. A*B(jw0)=1
but three electrical reactancesto size, then I have one degree of freedom so I chosed C1=L.

I also chosed I = 1*10^-6 A which should be fine because the BJT works in the forward-active region.

Unfortunaly when I simulate it I get very different results when I change the Run Time or Max Step Size values:

What's wrong? :-(

2. ### crutschow Expert

Mar 14, 2008
16,206
4,330
If the step size is too large you will not get good results.
Why are you changing the Max Step Size from the default value?

3. ### darkbasic Thread Starter New Member

Jan 18, 2015
5
0
Because I didn't get the oscillation I wanted and so I started experimenting...
This is with default Max Step Size and a 200us Run Time (20*T):

This is with default Max Step Size and a 130us Run Time (13*T):

I didn't change Max Step size but the result doesn't make sense...

This is with 250ns Max Step Size and a 100us Run Time (10*T):

This is the project file, including the models library if someone wants to try it:

Thanks

I forgot to specify f=100 kHz

Last edited by a moderator: Jan 19, 2015
4. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
784
Using I1=100uA, L=330uH and C1=C2=15nF, I obtain oscillation at ~100KHz using my Spice based simulator. Tstep=100 nano sec. Oscillations took 500usec to commence.

5. ### darkbasic Thread Starter New Member

Jan 18, 2015
5
0
Hi, thanks for your answer. Unfortunately I cannot even manage to simulate the circuit with I1=100uA, L=330uH and C1=C2=15nF. I tried with both pspice and ltspice, with a 1ms Run Time and a 1us Max Step Size it takes way too much to complete...

6. ### crutschow Expert

Mar 14, 2008
16,206
4,330
Oscillators often don't start in a simulator without a little help.
Set the simulation to remove the initial conditions calculation (in the LTspice Transient Analysis window select either Start external DC supply voltages at 0V or Skip initial operating point solution [UIC]) to help start the oscillations.

7. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,023
1,453
You have R2 = 1 femtoOhm??
With R2 = 1k, I1=100u and the initial solution skipped as per Crutshow, LTspice runs ok and gives a 110kHz frequency output delayed by ~50mS.

8. ### darkbasic Thread Starter New Member

Jan 18, 2015
5
0
Hi Alec, thanks for your help.

In the original circuit (the one which I have to simulate) there was no R at all except for the load. I had to put R because otherwise the simulation didn't converge, so I chosed it as small as possible.

If you change the current generator value then you will have to change the reactances values too, otherwise the oscillation conditions aren't satisfied anymore. Anyway I tried with "Start external DC supply at 0V", R=1k and I=1uA/100uA (I tried both). This is the result:

If someone has it working for PSpice or LTSpice, can you please send me the project file? Thanks.

9. ### JoeJester AAC Fanatic!

Apr 26, 2005
3,661
1,527
Is everyone using 1000 farads for C3?

10. ### crutschow Expert

Mar 14, 2008
16,206
4,330
Below is my simulation. I increased the emitter current to a more reasonable 1mA and selected a transistor type (the default generic transistor doesn't always work well).
Note that a 1 Farad capacitor for C3 is way too large.

File size:
1.6 KB
Views:
17
11. ### darkbasic Thread Starter New Member

Jan 18, 2015
5
0
Finally I found the problem(s), there were many of them!

1) The biggest one were the initial conditions. After selecting "Skip the initial transient bias point calculation" (SKIPBP) in PSpice simulation's options everything got better.
2) Another big problem was in the math: I didn't size reactances well. I did it well, but just barely. In fact assuming A*B(jw0)=1 you barely get a persistent oscillation and a small rounding is enough to let it fade. So I assumed A*B(jw0)=100 when sizing reactances.
3) I had to put another small resistor in the project (R2=1f) because otherwise the simulation didn't converge, but it seems it was too small and I still had convergence problems in some circumstances. So I changed it to 1 mOhm instead.
4) The output capacitor took a long time to load (which wasn't a problem), but also lead to convergence problems in some circumstances. So I changed it to 1nF.
5) I also increased the current generator I1 to 1mA to get the oscillations sooner.
6) Finally I sized the reactances once again, assuming L=C1*10^3 to get more realistic values.
7) Now THD is ~1% for the first 50 harmonics!

Thanks to everybody, I would have never made it if it wasn't for your help!