2
\$\begingroup\$

I'm trying to make a spreadsheet that calculates lots of things about a common-emitter amplifier, in one point I try to make a convergence to know values without using a simulator. I had success with other 2 convergences (discover VB knowing IRC, and discover VBE and IRo for a lower voltage point), ie. I make a guess and iterate tens of times and it reaches a (very good) small error.

I'm not so familiar with how simulators reach convergence, so this is maybe the reason why I've been stuck for 2 weeks with this issue. I use large signal model because all I want to know is the operating point, which of course, wouldn't require an AC model.

The circuit I've been simulating is this: circuit

which can be simulated here.

So the equations I've been using and checked lots of times are (initiating with a guess and later the equation):

What I know to start:

IS=10 fA

Beta=100

VA (Early Voltage)=10 V

VCC=12 V

VB=1.573315 V

RC=10 kohms

RE=890.7143 ohms

Now I start iterating

VBE=make a guess

Collector current (dependent source): IC=IS*(e^(VBE/0.025865)-1)

Current through the resistance of Early effect: IRo=make a guess

Collector-emitter voltage: VCE=VCC-(IC+IRo)RC-(VB-VBE) also tried with VCE=VCC-(IC+IRo)RC-(IC(1/beta+1)+IRo)RE

(now that I know VCE, recalculate IRo): IRo=(VCE-VBE)*IC/VA

Emitter voltage: VE=(IRo+IC*(1/beta+1))*RE

Ending of first iteration

Calculate VBE: VBE=VB-VE

Now there's nothing new. Calculate IC knowing VBE, calculate VCE, IRo, VE, and so on (more iterations).

Explanation: I'm certain that if I make a guess and the next iteration gives a value that's closer (in modulus) to the real value, it's converging (might oscillate). That's what happens if I put the value I find through simulation (real value), which I don't want to depend. So if I put a different value by a small amount, it oscillates and diverges (doesn't matter if the change occurs in VBE or IRo). It also doesn't matter if I put other real values of VBE and IRo that are compatible with other VB (I did this with the other operation point, which has a lower VB and it worked). So it only is stable, but it doesn't converge.

Edit: The order of the calculation in the iterations matters. It seems that different ways of calculating the same things also matters. I'm tweaking between possible ways of doing the same thing.

*I checked through simulation is that VBE produces a current IC and IRo is a separate effect, scaling with IC and VCB.

I created a copy of the spreadsheet for view only, so if anyone is trying to help me, make a copy of this one https://workdrive.zohopublic.com/sheet/open/cxghkde4696f2596e480abe94daee4d3f2a59 and then you can edit it to try new things. The problem is the convergence below "Maximum values" at cell G60.

Image of the spreadsheet before Early effect was added: The spreadsheet There's more below that my screen couldn't capture at that time.

\$\endgroup\$
9
  • \$\begingroup\$ Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on Electrical Engineering Meta, or in Electrical Engineering Chat. Comments continuing discussion may be removed. \$\endgroup\$ Commented Apr 29 at 18:03
  • \$\begingroup\$ The load line is a static one. \$\endgroup\$ Commented May 2 at 6:07
  • \$\begingroup\$ Knowing the equation of the static load line and the polarization line, the intersection of the two gives the abscissa of the static working point, which, substituted into the equation of the load line, gives the ordinate of the static working point. \$\endgroup\$ Commented May 2 at 6:20
  • \$\begingroup\$ Yes, load line is static, and also yes, knowing the equations and values gives the working point. But I don't know how to reach the values outside simulation. \$\endgroup\$ Commented May 2 at 14:33
  • 1
    \$\begingroup\$ @RuviandeCésaro Ah, the clarification is clear, so the main objective is for studies. But then again, the last statement is still reinventing the wheel. You could build and deploy a Standalone Desktop App from Simulink Model such that everything is available in a single window GUI. mathworks.com/help/slcompiler/ug/… \$\endgroup\$ Commented May 7 at 14:46

3 Answers 3

1
\$\begingroup\$

I think you can just take the Ebers-Moll equation and apply the Newton Raphson method.

You can do it by hand a few iterations and get a pretty close answer.

\$\endgroup\$
5
  • \$\begingroup\$ I'm not sure how to apply the method to that many equations as a whole. Can you give me more tips? \$\endgroup\$ Commented May 2 at 14:25
  • \$\begingroup\$ It's just a single equation for the collector current. I think you will capture the Early effect if you include the Vbc term for base width modulation. \$\endgroup\$ Commented May 6 at 17:55
  • \$\begingroup\$ Yes, I know how to include the Vbc term. What I'm not sure is how I apply the method with collector and emitter resistors. I think that 2 equations called VBE(VBE,IRo) and IRo(VBE,IRo) should converge on its own, no need for the method. Does it make sense to apply the method for both of them? I mean, iterate them. \$\endgroup\$ Commented May 6 at 22:19
  • \$\begingroup\$ Starting with just the collector resistor, you know \$V_C = V_{DD} - I_C \cdot R_C\$ and then you have the expression for \$I_C\$ from Ebers-Moll. Substitute Ebers-Moll in for \$I_C\$ in the first equation, and then Newton method for the answer (i.e. x-intercept from tangent line at initial guess, new x-intercept from new tangent line, and repeat). \$\endgroup\$ Commented May 7 at 14:34
  • \$\begingroup\$ I already did something similar (and it converges) when I know Ic (or in your case, knowing Vc). The hard task for me is to apply a base voltage and get Ic and IRo. \$\endgroup\$ Commented May 8 at 3:15
0
\$\begingroup\$

You should draw a block diagram or flow chart, in which all the constants, variables and formulas used and those involved in the iterations appear. From the data provided, a precise scheme cannot be seen. In general, for the convergence of a quantity x, there must be a loop in which x is increased or decreased, for example x + Δx, and at each loop you compare the x calculated in the previous loop with the new one calculated in the current loop, in this way you obtain a value that can increase and then the algorithm does not converge, or decrease and then the algorithm converges. To interrupt the loop, the program must make a comparison between the previous value and the next one and divide it by the previous one. If the ratio obtained is less than a very small value, for example 0.001, then the loop is exited and the solution is the last x. If this value is unattainable, a limit must be placed on the iterations, for example 100, otherwise the loop can be infinite and the computer crashes.

\$\endgroup\$
2
  • \$\begingroup\$ I understand what you said and agree. The problem is that all the equations are correct (I assume) but still diverge very easily if not put the right values (then it stabilizes). If one or more equations are wrong or if they should be different in some manner, I don't know. I already tried "back and forth" using the IC to calculate VBE (through ln) and tried VBE to calculate IC. Also as I mentioned, VCE=VCC-(IC+IRo)RC-(VB-VBE) is equivalent to VCE=VCC-(IC+IRo)RC-(IC(1/beta+1)+IRo)RE when it's stable, but it may vary when you're trying to pursue a convergence. \$\endgroup\$ Commented May 2 at 16:36
  • \$\begingroup\$ Maybe there's another way of writing some equation that links it up with math (circuits are solvable because there's math links between variables, equations, and coefficients). \$\endgroup\$ Commented May 2 at 16:38
0
\$\begingroup\$

7 months later my brain has recovered of such intense stuckness but also worked in the background, so I was able to provide a solution in a couple of hours.

Asked ChatGPT how simulators get to converge when it's oscillating between interactions. Got various answers, but one of them got highlighted in my mind, which is that simulators use a slow turn on, to vary very slowly the iterations, so I updated every iterations of VBE, IRo to the previous value plus a small gain (0,03 to 0,05) times the difference between previous value and new value. So the iteration goes like this:

Guess a VBE value

IC = IS*[e^(VBE/Vt)-1]

Guess an IRo value (current through the Early effect)

VE=(IRo+IC*(1/beta+1))*RE

VCE=VCC-(IRo+IC)*RC-VE

IRo_n+1=IRo_n+[(VCE-VBE)*IC/VA-IRo_n)*gain

VBE_n+1=VBE_n+(VB-VE-VBE)*gain

VB is a fixed value, as it must not be free. In this case it's 1.5733 V

From now on, it repeats using the generated VBE to calculate IC again, and then VCE, VE, IRo...

Image of starting point and few iterations: Guess value and start iterating

Image of ending point after about 80 iterations: After 80 iterations

It's clear that it has converged and it's the true value because the circuit values are: Falstad Simulation of the circuit, as the question proposes

We can open the model, where IC is the base current times beta, which is 999.09188 µA, the rest (up to 1.02087 mA) is due to the Early effect (I called IRo), which is 21.77912 µA. Other values are right too.

Footnote: the small gain I mentioned should be small because of the high non-linearity of the exponential function, which derivative is as great as its value. That was the source of oscillation, so you must dampen by smaller values the greater the VBE. I updated the spreadsheet that I shared in the question, so anyone can play with values to see the behavior. Here is the link (again): Spreadsheet with solution starting at cell G60

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.