BJT Astable Multivibrators

Started by imJonWain, July 21, 2020, 06:39:29 PM

Previous topic - Next topic

imJonWain

I've been messing around with more discreet circuits lately and trying to get a better handle on how they work and the math behind them.

I understand how a standard BJT Astable Multivibrator works and it follows the equation nicely.


However I'm currently playing with a variable frequency version as seen in the MXR µChorus where the frequency is modulated slightly by an LFO driving R29 and R30 instead of them being connected to VCC as in the standard circuit.  I get why this circuit doesn't follow the same frequency equation since the vcc cancellations done in the derivation don't apply here.  I tried working back through the equation on Wikipedia to account for the different voltages but it still wasn't working out.  Anyone able to point me in the right direction on this?     

Also.
As the LFO output voltage increases @ R34 output frequency drops and vise versa.  It's centered at 4.5V and triangles from 3 to 6V.  I can watch this on my scope and in simulation. 
I thought it would work opposite of this.  Can anyone explain this to me?  I feel like I am missing something simple.



  • SUPPORTER
TFRelectronics

Rob Strand

#1
QuoteAs the LFO output voltage increases @ R34 output frequency drops and vise versa.  It's centered at 4.5V and triangles from 3 to 6V.  I can watch this on my scope and in simulation.
I thought it would work opposite of this.  Can anyone explain this to me?  I feel like I am missing something simple.

Which side of R34 are you looking at?

In the weird case, can you look at the base voltages on the simulation?

For sanity maybe simplify the simulation and put a voltage source at the point where R28 and R29 join (Control voltage point Vx).  Start with Vx = Vcc = normal astable case, then Vx = Vcc/2.

Here's how I see it:   
- Choose the convention that the astable cap voltages are positive at the base side.
- Suppose Q1 is currently on and Q2 off.  The astable cap C1 on the base of Q1 will be at voltage Vc1 = -(Vcc-Vbe).
- Now suppose the circuit changes state, starting with transistor Q2 turning on.
- That pulls one end of the cap C1 to ground, which causes the voltage on the base of Q1 to be at Vc1 = -(Vcc-Vbe), and that forces Q1 off.
-  At that point the cap C1 charges towards the control voltage Vx (the voltage at the point where and R28 and R29 join)
-  The half-cycle ends when the cap voltage hits Vbe as that will turn on Q1.

The time for that is  t1 = R C * ln( (Vcc + Vx - Vbe ) / (Vx - Vbe) ).   The total period is twice that, T = 2*t1.  At Vx = Vcc you get the normal form of the equation.

So if the circuit seems to follow that behaviour with a voltage source at the point where R28 and R29 join, ie. Vx, maybe something weird is going on at the point where R28 and R29 join due to the large resistor value of R34.  The thing is, if you consider R28 or R29 as part of a divider with R34 (1M),  it's dividing down the voltage on the R28 side of R34 quite a bit, which is making Vx close to Vbe.   Normally the Vx voltage is somewhat larger than Vbe.

------------
EDIT: fixed equation typo.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

jatalahd

I got the same result as Rob. The loading equation for one capacitor in the vibrator is:

vc(t) = Vx - (VCC + Vx - VBE) e^(-t/RC),

where vc is the voltage over the capacitor at time t and Vx is the voltage from where the loading happens. The initial state is taken when capacitor is fully charged from VCC. Transistor is triggered open and the collector voltage drops to 0 volts, that is time t = 0 and then from the previous equation

at t = 0:
vc = -VCC + VBE

and the half-period (T/2) of oscillation is completed when vc = VBE, that triggers the other transistor open and starts the second half-period. The half-period can be solved from the first equation by setting the target capacitor voltage vc to VBE and the time to T/2:

VBE =  Vx - (VCC + Vx - VBE) e^(-T/2RC)

Solving this for T/2  gives the same result as Rob posted for t1.

So check how the voltage behaves on top of that C19 tantalum cap, that is the Vx in this case.
  • SUPPORTER
I have failed to understand.

imJonWain

Well, at least I can still do math, I got the exact same equation as you guys haha.  It's fairly off from what I am seeing in both simulation and breadboard. Equation shows 89-141kHZ from 3V to 6V range vs ~ 70 - 80kHz.  Since the simulation is so close there has to be something else I am misunderstanding.   

Breadboard:
I'm watching the LFO waveform @ LFO side of R34
If I watch it at @ C19 (the other side of R23) the waveform is still there but attenuated to about 300mV and biased at about -840mV.
I can probe the transistor bases and see the voltage go from .7V to about -5.6V and back as well.

I'm using a 10X probe that should be 10MΩ and 10pF capacitance so I don't think It's loading anything much.

Simulation:

Tried with 4.5V source at C19/R29/R30 and it's showing ~72kHz.  Similar to what I am seeing on the breadboard with the LFO connected and in the simulated version.

@ C19/Vx the simulation seems to be showing garbage, 940mV slowly declining to some mystery point.  For a reason I am not totally sure the simulation spits out triangle waves and noise if I try to run the simulation for 100mS or longer.






  • SUPPORTER
TFRelectronics

Rob Strand

QuoteWell, at least I can still do math, I got the exact same equation as you guys haha.  It's fairly off from what I am seeing in both simulation and breadboard. Equation shows 89-141kHZ from 3V to 6V range vs ~ 70 - 80kHz.  Since the simulation is so close there has to be something else I am misunderstanding.   
One significant different between the equations and the real circuit is the transistor capacitance.

When the circuit changes state and the cap charged to -(Vcc-Vbe) is whacked across the base of an on transistor you will get some charge transfer.   That's probably why your base waveforms are starting at -5.6V at the beginning of the charge cycle instead of -8.4V.    That speeds-up the charging process.

Even that isn't enough to explain what is going on.   On your simulation with 4.5V at the 1M resistor, the Vx voltages is 0.945V.   So the divider effect due the 1M is significant.  I'm getting about 42kHz directly from the equations for Vx=0.945V.   If I fudge the equations for -5.6V it only pushes the frequency up to 47kHz.

The small rise in the collectors voltages is a sign of something more is going on.   With low a Vx =0.945, there's not a lot of base current available across the 180k resistors.   It's like the 20pF is helping the on transistor for a while then the base current poops out when the cap charges.   I'm having trouble visualizing that clearly at 4:00am but it seems like that is what is going in.   As to how it affects the timing isn't clear.

If you wanted to verify the equations then setting C=1n or 10n would dilute the transistor capacitance.  If it still doesn't match the base-current issue needs to be checked.

I have built these VCOs for audio frequencies in the past and I thought things matched up OK with the equations.  The circuit isn't guaranteed to start-up on power-up if everything is matched too well. 
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

diffeq

ZTX109 has a bit more gain than 3904 - could that be contributing to frequency mismatch due to higher base impedance?

jatalahd

I did not previously realize that the multivibrator had 20pF caps (I thought this is an audio forum  :icon_wink:).

To verify the equations, I simulated the simplest possible case of the multivibrator, fixed voltage source directly at Vx and using SPICE model
.MODEL NPN1 NPN (Is=1.0e-14 Bf=500) for the transistors, neglecting therefore the internal capacitances of the BJT.
Vx 3.0 V:    SPICE: 95 kHz --- Equation: 89 kHz
Vx 4.5 V:    SPICE: 120 kHz --- Equation: 116 kHz
Vx 6.0 V:    SPICE: 145 kHz --- Equation: 141 kHz

When I look at the results, in my opinion the equation for oscillation frequency works, when NOT taking into account the transistor internal capacitances AND the effect of C19, the 330 nF tantalum.

As a next step, I added a "real" BJT model to the simulation (BC549C) (still neglecting C19 in the circuit model):
.MODEL NPN1 NPN (Is=5.911f Xti=3 Eg=1.11 Vaf=62.37 Bf=1.122K Ne=1.394 Ise=5.911f Ikf=14.92m
+ Xtb=1.5 Br=1.271 Nc=2 Isc=0 Ikr=0 Rc=1.61 Cjc=4.017p Mjc=.3174 Vjc=.75
+ Fc=.5 Cje=4.973p Mje=.4146 Vje=.75 Tr=4.673n Tf=821.7p Itf=.35 Vtf=4 Xtf=7 Rb=10)

By making the values of Cjc and Cje larger, the simulated oscillation frequency goes lower, and vice versa. So the internal capacitance matters in this case... But ..

That does not explain all, not even half of it. The combination R28, R34 and C19 mix things up even more and when taking those along, I cannot get the simulation working anymore properly, but it seems that C19 interacts with the multivibrator in a way that I cannot figure out at this moment (probably never will...) C19 charges through R34 and discharges through the 180k resistors, but not sure if that is a noticeable effect or not. Most likely not, because the multivibrator wiggles so fast that 330nF does not care much about it. Maybe the best way is to look at it as a voltage divider formed by R34 and C19. If the OP has the circuit built and an oscilloscope available (multimeter should be ok as well), it would be interesting to know what is the (average) voltage level or the actual waveform at Vx (top of C19).

I think this is all I am able to contribute on this. I am counting on Rob or any other smart person in this forum to figure out what is going on...
  • SUPPORTER
I have failed to understand.

imJonWain

Interesting.  That makes sense about the base capacitance effect with the capacitors being so small.  I was surprised to see 20pF.

I have a scope and I have the circuit on the breadboard as well as an actual uChorus.  I'll scope them both and save some wave forms to post.


I wonder if MXR designed it as such intentionally or they just added parts to get it working/stable?  I assume Keith Barr designed it.
  • SUPPORTER
TFRelectronics

Rob Strand

#8
I haven't gone over this stuff 100% but what i can confirm at this point is:
- When the voltage Vx (at the junction of the 180k's) gets below about 1.3 to 1.4V the frequency starts to go up from that predicted by the equations.
- As Vx goes below 1.5V  the VCE step starts to get worse (higher).    When Vx = 1.5V the VCE step is about 1V but at Vx=1.4V the step was about 2V.  So the frequency increase problem seems to occur around the point when the VCE step becomes larger than Vx.
- I plotted the forced beta_f = Ic(Q1)/Ib(Q1).   At middle of the VCE step, the forced beta becomes equal to the transistor beta.   What that means is there isn't enough base current to turn the transistor on and it is operating in a linear region.
- It does look like the discharged cap helps saturate the transistor a short period after the flip-flop changes state.

So the problem is:   
When Vx is too low  there's not enough base current to keep the on transistor saturated.    The on transistor then falls out of saturation into the linear region at which point VCE rises and that kicks the base current of the off transistor (better stated: )  increases the base voltage and decreases the time for the voltage at the base to reach Vbe.   This action effectively decreases the normal charging time of the cap and so the frequency goes up.

I haven't looked at the effect of the transistor capacitances but jatalahd has already done that.  The transistor caps slowing things down makes sense but I have a feeling Cbe alone should speed-up the charging
EDIT: Cbe seems to always slow down the oscillator.   The reason is: while the start voltage on the cap(s) is smaller in magnitude, the total amount of capacitance is increased, so the net effect is a small amount of slowing down.

EDIT:  *** forgot to mention the VCE effect occurs even when the caps are large and the frequency is low.
-----------------------------
QuoteI wonder if MXR designed it as such intentionally or they just added parts to get it working/stable?  I assume Keith Barr designed it.
Maybe it's just hanging on by a thread.  Perhaps the transistors they used *just* make it.  I have trouble seeing it work at Vx=0.95V, like your simulation showed though.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

imJonWain

#9
Here's the waveform at C19 (Vx) in blue on my breadboard setup.  Yellow is before the 1M R34.  It's pretty much the same in the actual pedal too.

It's showing ~ -1V?

For fun here's the base voltage waveform in the uChorus on the PCB itself. Bread board is pretty much the same.

\

I changed the BB C14/C16 values to 47pF for kicks and the frequency didn't change, simulation also goes along with this.

Perhaps the idea was to make the design so that capacitor variation wouldn't effect the circuit much for the desired frequency?
  • SUPPORTER
TFRelectronics

Rob Strand

#10
QuoteIt's showing ~ -1V?
Any sane person would think no ... but ... it looks like that's the case.  :o

I stuck LTSpice on my machine but I was having trouble matching your waveforms.    The difference was I  had a voltage source connected to Vx.   The average base voltages are negative, and all along I'm thinking that 1M is far to weak for the circuit to work normally.    So I'm thinking what the hell, put the 1M and the 330n in and see how it plays out.    After letting the 330n cap voltage settle  it settled at around -0.82V.    How the oscillator starts with the 330n cap discharged to 0V is still a mystery, maybe power-up glitches from the 20pF's.

If we consider the input side of the 1M resistor as the control (not Vx), as that voltage decreases Vx decreases (more negative) the frequency rises.

So the entire behaviour is out of whack to the normal behaviour of that two transistor VCO.   It looks like the way the timing initiates is when the on-transistor falls out of saturation not when the off-transistor turns on.    In this respect it's more like the Royer oscillators which use transformers (but not quite).

Quote
I changed the BB C14/C16 values to 47pF for kicks and the frequency didn't change, simulation also goes along with this.

Perhaps the idea was to make the design so that capacitor variation wouldn't effect the circuit much for the desired frequency?

I see the same thing, double the caps and the frequency decreases by 25% or so.   I need to go back and check it with the "ideal" transistor that jatalahd used.

I've never seen that type of oscillator working this way.  It looks like fluke behaviour to me - but what do I know  :icon_mrgreen:
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

#11
QuoteI need to go back and check it with the "ideal" transistor that jatalahd used.

Well, it seems the transistor capacitance has a lot to do with it.  With C=20pF and ideal transistors the clock frequency  goes up to 1MHz.   The quick test I did also showed the oscillations stopped after a while.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

jatalahd

Quote from: imJonWain on July 23, 2020, 04:59:38 PM
Here's the waveform at C19 (Vx) in blue on my breadboard setup.  Yellow is before the 1M R34.  It's pretty much the same in the actual pedal too.

It's showing ~ -1V?

For fun here's the base voltage waveform in the uChorus on the PCB itself. Bread board is pretty much the same.

\

I changed the BB C14/C16 values to 47pF for kicks and the frequency didn't change, simulation also goes along with this.

Perhaps the idea was to make the design so that capacitor variation wouldn't effect the circuit much for the desired frequency?
These oscilloscope traces are so good. Especially the bottom one showing the voltage at the base in the multivibrator. From that we can see that at first it resembles the "normal" charging graph at first but then linearizes to indicate that the charging happens through a constant current source. The first part of loading comes from Vx through the 180k resistors (Vx is in the beginning still more positive) and the second linear part ... hmm ... could it be charging somehow from the base current of the transistor? Since the emitter is at ground, the base should be at VBE above ground. I just cannot really figure out the direction of the currents ... Also the voltage difference between Vx and base is on average -1V - 0.65V = -1.65V  . When this is used (with inverted sign) in the derived equation we arrive at around 75 kHz. But this might be a coincidence and the direction of currents does not really match up and it makes me very confused in this case.

And in addition, I believe that the Vx on top of C19 is settling to the average voltage wiggling at the bases of the multivibrator, because the 1M resistor cannot load C19 fast enough. That is why it is negative (only my assumption).

I just wrote my thoughts here, they are more likely to be wrong that right, but thoughts anyway :)
  • SUPPORTER
I have failed to understand.

Rob Strand

#13
QuoteWhen this is used (with inverted sign) in the derived equation we arrive at around 75 kHz. But this might be a coincidence and the direction of currents does not really match up and it makes me very confused in this case.
It's confusing to me as well.   When you put in the "ideal" transistors the oscillation frequency goes way up to 1MHz so the timing is more like the delay "around the loop".     What's even trickier is what makes it work like a VCO.

Suppose we label the parts as Q1, Q2, C1 to the base of Q1 and C2 to the base of Q2.
(you will need to draw a pic)
- To make it easier to think:  the collector sides of the caps are always positive
   so I'm calling the collector side of the caps the positive side and the
   base side the negative side.
- Suppose Q1 is currently off and Q2 is currently on.
- The negative side of C1 is charging towards Vx  (like the normal circuit except in this case Vx is negative).
-  The negative side of C2 is at +Vbe and the positive side is charging towards vcc.
    *** The key points are C2 is charging via the 20k collector load of Q1 and the charging current
    is flowing through the base of Q2.
-  Keep in mind while this is happening, the negative side of C1 has moved closer towards Vx
   ie.  C1 has discharged a bit, and how much depends on Vx.
-  When the charging current gets too small (<Vcc/20k/Beta) the base current gets too low and Q2 starts to turn off. 
- When Q2 turns off:
   The voltage on C2 is approximately Vcc-Vbe.
   C1 is at a voltage which depends on Vx, and how long it took C2 to charge.
- So when Q2 turns off it starts it turns on Q1 via C1 and the whole cycle repeats.
  However, the longer C1 had to discharge while Q2 was on the longer it will keep Q1 on.

I'm pretty sure that's the process.   The key points:
- charging occurs via the 20k collector resistors
- the switching threshold is when the cap current hits Vcc/20k/beta
- the charged cap has a start voltage which depends on the current period (and Vx)
  This interdependence means we will need to solve an equation.

Completely different to the normal way the circuit works.

That's only the basic process.  It doesn't include the transistor capacitances or the fact Vx wanders to find its own equilibrium.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

imJonWain

#14
I love when things that look simple aren't, what a neat circuit.  Thanks for taking the time to go over this.
  • SUPPORTER
TFRelectronics

Rob Strand

QuoteI love when things that look simple art, what a neat circuit.  Thanks for taking the time to go over this.
It's something to put in the "you learn something new everyday" pot that's for sure.  I built that astable circuit when I was about 10yo.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.