[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Multivibrator Simulation



Hi Micheal,

Sorry about that, Al Davis is right, OFF doesn't seem to help.

Here are two ways to fix the problem.

1) As has already been described, if you start the simulation with the
supply voltage at 9V but apply an initial condition of 0V to one of
the transistor bases - using the .IC spice directive - then
oscillation should start. The initial condition forces one transistor
off while the other is on and then lets it go. This then starts the
first cycle at time zero.

Here's a netlist that does that:
---------------------------------------
V1 V1_P 0 9
R1 V1_P R1_N 15k
R2 V1_P R2_N 15k
R3 V1_P R3_N 1K
R4 V1_P R4_N 1K
.IC V(R2_N)=0 ; this is the initial condition
Q1 R3_N R2_N 0 0 Q2N3904
Q2 R4_N R1_N 0 0 Q2N3904
C1 R1_N R3_N 10u
C2 R4_N R2_N 10u
---------------------------------------


2) Alternatively, if you do two things, it will start oscillating.

i) make the 9V supply ramp up from zero at the start of the
simulation. A short rise time of about 100n should be OK.

ii) make one of the base resistors slightly different from the other.
A difference of even 1 Ohm will do it. This adds a slight imbalance to
an otherwise perfectly balanced circuit. The supply ramp up than acts
to turn one transistor on slightly before the other setting up the
initial conditions for the first cycle just after time zero.

And here's a netlist that does that:
---------------------------------------
V1 V1_P 0  Pulse(0 9 0 100n 100n) ; this is the supply ramp
R1 V1_P R1_N 15k
R2 V1_P R2_N 15.001k ; this is the base resistor imbalance.
R3 V1_P R3_N 1K
R4 V1_P R4_N 1K
Q1 R3_N R2_N 0 0 Q2N3904
Q2 R4_N R1_N 0 0 Q2N3904
C1 R1_N R3_N 10u
C2 R4_N R2_N 10u
---------------------------------------

Try running them for about 500ms to see how the oscillations start up.

I've not used gnucap or ngspice yet so I'm not familiar with how you
drive them. You may need to add the transistor models to my netlists.

---------------------------------------
.model Q2N3904 npn ( IS=2.48E-13 VAF=101.7 BF=400 IKF=0.0334 NE=1.5243
+    ISE=2.113E-12 IKR=0.02 ISC=5.00E-12 NC=1.1 NR=1 BR=10 RC=0.5 CJC=3.50E-12
+    FC=0.5 MJC=0.25 VJC=0.7 CJE=4.50E-12 MJE=0.33 VJE=0.75 TF=2.80E-10
+    ITF=0.4 VTF=2 XTF=10 RE=1 TR=8.00E-07)
*From NS Discrete 1978, Motorola DL126/D rev 4 - Process 66
* Base resistance not modelled - no info.
---------------------------------------

Cheers,

         Andy.

http://signality.co.uk



2009/6/23 al davis <ad252@xxxxxxxxxxxxxxxx>:
> On Tuesday 23 June 2009, Michael B Allen wrote:
>
>> *==============  Begin SPICE netlist of main design
>> ============
>> Q2 output 2 0 2N3904
>> .MODEL 2N3904 NPN (Is=6.734f Xti=3 Eg=1.11 Vaf=74.03 Bf=416.4
>> Ne=1.259 Ise=6.734 Ikf=66.78m Xtb=1.5 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 Tr=239.5n Tf=301.2p Itf=.4 Vtf=4 Xtf=2 Rb)
>
> This syntax is incorrect .. Rb) ???
>
>
>> V1 4 0 DC 9V
>> R4 output 4 0.999K
>> Q1 1 3 0 2N3904
>> .MODEL 2N3904 NPN (Is=6.734f Xti=3 Eg=1.11 Vaf=74.03 Bf=416.4
>> Ne=1.259 Ise=6.734 Ikf=66.78m Xtb=1.5 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 Tr=239.5n Tf=301.2p Itf=.4 Vtf=4 Xtf=2
>> Rb=10)
>
> syntax correct this time, but there should be only one .model statement.
>
>> R3 1 4 1.001K
>> R2 3 4 15K
>> R1 2 4 15K
>> C2 output 3 10uF
>> C1 1 2 10uF
>> .end
>>
>> > You need to explicitly start the oscillator.
>>
>> I'm not having any luck with this. It seems the syntax of
>> netlist vs. interpreter mode commands vs. gspiceui fields is
>> different enough that it's totally unclear as to how to
>> achieve non-trival things.
>
> Why I don't like the GUI ..  There are hundreds of things you can do.
> The GUI gives you about three of them.
>
>> First, do I want to use GNU-Cap or NG-Spice?
>
> Gnucap, if you want my help.  If you are really into it, try both
> and you will see that some things work better in one, some
> in the other.
>
>> Also, what timing do I want? I was thinking something like
>> 50ms - 100ms in 1ms increments reasoning that it will take
>> time for the oscillation to start.
>
> It depends on your circuit.  What frequency did you design it for.
>
> You need to run it a while to start up.  See the example I referenced
> in the other mail.
>
>> Regarding simulating power on, I don't recognize the format
>> on the page cited:
>>
>>   Vcc (vcc 0) pulse(iv=0 pv=12 rise=.01)
>>
>> My netlist above does not have parenthesis.
>
> Parenthesis are optional, but make it easier to read.
>
>> And it seems
>> gspiceui overrules the voltage source properties anyway?
>
> I think you put the whole string pulse ( ...) as the "value" in the schematic.
>
> With Spice, you list a bunch of numbers in a particular order.
> Gnucap accepts that too, but I can never remember what
> order they go in, so the labels are a better way to do it.
>
> That statement says the initial value (iv) is 0, pulsed (final)
> value (pv) is 12, and the rise time is .01 seconds.  Look
> up the "pulse"
>
> http://gnucap.org/gnucap-man-html/gnucap-man094.html
>
>> Similarly I'm not sure where the "OFF" property would go. I
>> tried sticking it in the parameters of the .MODEL description
>> but gspiceui choked on it.
>
> "OFF" may not do what you want.  You really need to ramp
> up the power supply to start the oscillator.
>
>> What is the definitive guide for interactive mode?
>
> The old manual: (for version 0.35)
> http://gnucap.org/gnucap-man-html
> http://gnucap.org/gnucap-man.pdf
>
> The new (unfinished) manual, for the development version:
> http://wiki.gnucap.org/dokuwiki/doku.php?id=gnucap:manual
>
>
>
> _______________________________________________
> geda-user mailing list
> geda-user@xxxxxxxxxxxxxx
> http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
>


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user