Author Topic: How hard is it a make a transistor opamp like LM358 ? Chances of working ?  (Read 12816 times)

0 Members and 1 Guest are viewing this topic.

Offline lordvader88Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 935
  • Country: ca
I don't have any certified brand name transistors (mine could all knock-offs I suppose) I do have Beta testers tho to try and match a few transistors. So I'm wondering how easy/hard it is to get an opamp working with the +20 transistors like in 1/2 of an LM358.



I'd like to try for the fun of it, at least in stages. Or is it to much like trying to balance a pencil on its tip and probably won't work at all ???
 

Offline Vtile

  • Super Contributor
  • ***
  • Posts: 1144
  • Country: fi
  • Ingineer
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19519
  • Country: gb
  • 0999
It will work, but the voltage and bias current offsets will be worse than with the IC design. Matched pairs could be used for the current mirror and input stage, which should give comparable performance to the IC.

I've done a similar thing myself, for educational purposes, but I used a much simpler design, than any IC op-amp. It worked and produced an OK op-amp, but nothing which could match an IC, purchased at a much lower cost.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14195
  • Country: de
An exact copy could be tricky as there are no multi-collector transistors available. One would need to use 2 or 3 matched ones to replace one of those multi emitter transistors.

The main part to look for might be thermal coupling at some current mirrors. It might need extra emitter transistors to get good accuracy.

I don't know about the 358, but the 741 uses quite unusual PNPs with pretty poor parameters (low beta and slow) however with a high permissible base emitter voltage. There may not be a direct replacement discrete transistor available.

Otherwise most of the OPs internal circuits should work - discrete audio amplifiers in the 1970's-1980's where not not that much different.
There should be simpler circuit with maybe 10 transistors.

 

Offline glarsson

  • Frequent Contributor
  • **
  • Posts: 814
  • Country: se
You have to redesign the current sources as they are constructed from multi-collector transistors where the sizes of the collectors set the current. See for example Q19. You will not find discrete of-the-shelf  transistors with these characteristics.
« Last Edit: January 18, 2018, 05:33:56 pm by glarsson »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12859
You aren't going to get there with discrete transistors - they wont have the close thermal coupling required for their characteristics to track accurately so some parts of the circuit will go out of balance even if you start with well-matched parts.  Also I see a lot of multiple collector transistors in that schematic.  If the ratio of junction areas between collectors isn't unity or a small integer, they will be impossible to reproduce using discretes.   You *may* be able to do something with carefully selected monolithic transistor arrays, but if you really want to build a retro OPAMP, why not take a look at the generation of discrete OPAMPs built with silicon BJTs from the early 60's, prior to the launch of Bob Widlar's uA709 in 1965 and the subsequent commercial dominance of the monolithic IC OPAMP?

See https://www.eevblog.com/forum/projects/doing-opamp-educational-stuff-suggestions-wanted/ where I linked to the GAP/R P65 OPAMP (six transistor potted module) schematic and specs.
« Last Edit: January 18, 2018, 03:56:57 pm by Ian.M »
 

Offline Lee Leduc

  • Regular Contributor
  • *
  • Posts: 84
  • Country: us
« Last Edit: January 18, 2018, 05:46:53 pm by Lee Leduc »
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline lordvader88Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 935
  • Country: ca
Ok I'll try an easier/older op-amp, and I never realized what those double collector things are.

I think I have dual triode tubes, but no transformer for them right now. Maybe I can try a JFET setup, I'll have a look in the future.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Datasheet for KW-2 -


http://www.philbrickarchive.org/k2-w_refurbished.pdf


and general archive -


http://www.philbrickarchive.org/



Note you could try it with some of the lower voltage tubes, the space charge tubes.


http://www.junkbox.com/electronics/lowvoltagetubes.shtml



Regards, Dana,
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19519
  • Country: gb
  • 0999
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #10 on: January 18, 2018, 08:42:49 pm »
Here's a design, similar to the one I used. I say similar, because I drew it from memory. Later, I'll update this post with a better description.
 
The following users thanked this post: lordvader88, Neomys Sapiens

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21681
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #11 on: January 18, 2018, 09:19:55 pm »
You have three problems:
- Matching.  Thermally, and by geometry.  You can select transistors with same Vbe at the same current (not hFE, that basically doesn't matter -- in fact all the PNPs in that design were hFE of 5-10), but you can't guarantee those Vbe's will stay matched as different transistors heat up due to current flow.
- Geometry.  Many of those transistors had different sizes.  A typical example is a bandgap voltage reference (which wasn't used here, I think), where a ratio of transistor is used to create a stable voltage output.  Now, the application here is mainly about having transistors sized appropriately for their place in the amplifier: you use small widths for the input transistors, and small bias currents; and larger ones towards the output.  This isn't as big of a deal, because you can operate a given transistor at much lower currents than its size suggests (e.g., a 2N4401 is rated for 600mA, but it works just fine at 10uA), albeit with way more capacitance than you would have otherwise (which slows down the amplifier a whole lot).
- Ratings.  Most of those transistors are pretty normal (the NPNs are something like Vceo = 40V, Vebo = 7V, hFE ~ 100), but the PNPs are actually an ingenious hack.  On the upside, Vebo = Vceo, which means using PNPs for the input stage gets you the full input voltage range (cool!).  In short, 2N3906s would only give you a ~15V input range on this circuit, not the full 30 or 40V.

For sure, there's a lot that can be simplified, at the expense of supply voltage range, distortion, and such.  The typical discrete op-amp circuit has:
- Input diff pair: 2 transistors
- Volt amp stage (VAS): 1 transistor
- Follower: 2 transistors (diode biased, no current limiting)
This can be enhanced with current sources in various places:
- Input diff pair "tail": increases gain and input voltage range, reduces DC offset
- Diff pair collector load (current mirror): increases gain significantly
- VAS load: increases gain, output voltage range, output bias stability

Further, there are options for biasing (Vbe multiplier to set output stage bias to something other than a multiple of Vbe's from stacking diodes), current limiting, and alternative topologies to improve speed, input and output voltage ranges, and so on.

Spotting which options they used in the above circuit is a fun exercise for the student... :)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: lordvader88

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #12 on: January 18, 2018, 10:27:20 pm »
Maybe w2aew's video on the long tail pair differential amplifier will help:

 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19519
  • Country: gb
  • 0999
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #14 on: January 19, 2018, 11:11:19 am »
As promised, here's an overview of the components used in my circuit.



Q1 & Q2: both emitter followers, forming the output stage. R1 and R2 improve the thermal stability and prevent thermal runaway.

Q3 & Q4: Current mirror. This converts the differential output of the long tailed pair (see below) to a single ended output. It acts as an inverting amplifier. When Q5's collector current increases,  Q4 will turn on more, pulling its collector voltage up.

Q5 & Q6: long tailed pair. This was described in the video, previously, so there's not much point in going into to much detail. Obviously the transistors need to be fairly well  VBE matched. A matched, high Hfe is good, as it keeps bias currents balanced and low.
https://www.eevblog.com/forum/beginners/how-hard-is-it-a-make-a-transistor-opamp-like-lm358-chances-of-working/msg1403984/#msg1403984

Q7, D1 & D2 and R3 & R5 form a constant current sink for Q5 and Q6. According to the simulation, the current is about 55µA.

Q8, D1 & D2 and R4 & R5 form a 630µA constant current sink for Q9, a common emitter amplifier.

Q10 is an emitter follower, which buffers the output of the input stage (Q3 to Q6), allowing it to drive the common emitter amplifier: Q9.

D3 to D5 produce a voltage drop of about 1.9V, which bias Q1 and Q2 on. The simulation says the current through R1 and R2 is 2.65mA, which makes sense because the base-emitter drop of Q1 and Q2 will be a bit higher than the two of D3 to D5, leaving 0.53V across R1 and R2. Try removing one or two of D3 and D5, and see the current consumption go down, but crossover distortion increase.

C1 is a phase compensation capacitor. Try changing its value. Higher values will slow it down, reducing the bandwidth and slew rate, but make it more stable and less likely to ring and oscillate. Lower values will speed it up, but make ringing and oscillation more likely.

I've just realised I've used different transistors in the simulation, to the ones I used to build the real circuit. I think I used BC548C for the NPNs and BC558 for PNPs.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14195
  • Country: de
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #15 on: January 19, 2018, 11:43:42 am »
The circuit Hero999 showed is the basic discrete amplifier. It would profit from a base to emitter resistor at Q9 to give Q10 a little more current to work with. The shown output stage with 3 diodes and rather large resistors R1,R2 is one option with quite some standing current for low distortion. It would be also possible to use only 2 diode and smaller values for R1,R2. The alternative would be an VBE multiplier set to a voltage in between.

There is headroom for small resistors (up to a value close to R3) at the emitters of Q3 and Q4 to reduce the demand in coupling / matching  these two.

The circuit is limited to a differential input voltage of about 5 V. So one might consider protection if needed.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #16 on: January 19, 2018, 12:49:03 pm »
I did similar for a 555 Timer.  I got it to work, took me about 4 multi hour sessions though.  It was only about 18 transistors.  Quite a lot of fun.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline IanMacdonald

  • Frequent Contributor
  • **
  • Posts: 943
  • Country: gb
    • IWR Consultancy
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #17 on: January 19, 2018, 02:11:23 pm »
Many of the techniques used in ICs are not applicable to discrete circuits. Although the reverse is true as well, and that is part of the reason why the ICs are so insanely complex. The minimalist opamp is just three transistors (Long tailed pair and class A amp) and works reasonably well so long as you don't need the inputs or output to go too close to the supply rails. 

Increase that to 5 and you can give it much more current driving ability. (You can use a complementary power stage, which can't easily be done in an IC)

Other major improvement is a couple for current sources in place of feed resistors - Works better when inputs are near to supply rails. Plus, a Vbe multiplier for more accurate output stage bias. Then, maybe make your class A amp cascode for better HF performance.

Think that makes ten in all for a fairly kickass design. Still a LOT simpler than the IC variant with its need for convoluted designs to avoid PNP transistors, etc.
« Last Edit: January 19, 2018, 02:19:43 pm by IanMacdonald »
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #18 on: January 19, 2018, 03:20:06 pm »
Why did you choose the lousy old LM358 dual opamp to copy? It has almost the worst spec's of any opamp because it is "low power" then it produces noise and crossover distortion and has a poor high frequency slew rate. One of its features is that its inputs work all the way down to its negative supply so it does not need a negative supply.

Whenever I see a circuit using it I use an MC3317x low power opamp instead that has the same input voltages but no crossover distortion and a slew rate to 35kHz.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16615
  • Country: us
  • DavidH
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #19 on: January 19, 2018, 03:31:13 pm »
Many of the techniques used in ICs are not applicable to discrete circuits. Although the reverse is true as well, and that is part of the reason why the ICs are so insanely complex.

Exactly.

A discrete implementation of an integrated operational amplifier will take advantage of discrete design elements instead of integrated ones.  The big differences are availability of matched transistors, precision resistors, and weird circuit elements like super gain and effectively chopper bipolar transistors which have a high base-emitter breakdown voltage.

Discrete current mirrors which rely on good resistor tolerance replace integrated current mirrors which rely on transistor matching and emitter ratios.

Low offset voltage differential pairs will require monolithic pairs or arrays from suppliers like Linear Systems and they also have super beta parts.  Analog Devices appears to be discontinuing their matched transistor products.  The last time I checked, Diodes Inc. and NXP had some surface mount matched pairs also.

Some "chopper" transistors are made which could be used in a high differential input voltage design but none of them are matched monolithic pairs.  Alternatively a pair of diode connected monolithic transistors could be used to replace the PNP cascodes in a 741 or 301A design or for a single supply PNP input design; I have seen some discrete designs which do this.

Discrete input bias current cancellation in a discrete design can take advantage of high value precision resistors.

Discrete designs have some advantages.  The lack of thermal feedback from the output stage to the input stage increases precision but you can get most of this advantage in an integrated part by limiting the output loading.

Why did you choose the lousy old LM358 dual opamp to copy? It has almost the worst spec's of any opamp because it is "low power" then it produces noise and crossover distortion and has a poor high frequency slew rate. One of its features is that its inputs work all the way down to its negative supply so it does not need a negative supply.

The difficult part of the 324/358 to copy is the high differential input voltage range without chopper type transistors.  The crossover distortion issue can be solved by replacing the class-b output stage with a class-ab output stage like Fairchild did in their 324/358 equivalents.

If you took a 301A and swapped all of the transistor types, then it becomes a single supply input operational amplifier.
 

Offline Lee Leduc

  • Regular Contributor
  • *
  • Posts: 84
  • Country: us
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #20 on: January 19, 2018, 03:35:21 pm »
I did similar for a 555 Timer.  I got it to work, took me about 4 multi hour sessions though.  It was only about 18 transistors.  Quite a lot of fun.

Discrete 555 Timer kit from Evil Mad Scientist Laboratories is a faithful and functional transistor-scale replica of the classic NE555

https://shop.evilmadscientist.com/productsmenu/652
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #21 on: January 19, 2018, 04:47:49 pm »
I did similar for a 555 Timer.  I got it to work, took me about 4 multi hour sessions though.  It was only about 18 transistors.  Quite a lot of fun.

Discrete 555 Timer kit from Evil Mad Scientist Laboratories is a faithful and functional transistor-scale replica of the classic NE555

https://shop.evilmadscientist.com/productsmenu/652

Seen Dave building it.  Mine was copying an instructable.  I used 2n3904s and 2n3906s and it took up two breadboards.

I then simplified it down, replacing the comparators with actual comparators and then the latch with a set of NOR gates, leaving only the discharge and output driver transistors.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19519
  • Country: gb
  • 0999
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #22 on: January 20, 2018, 05:33:06 pm »
The circuit Hero999 showed is the basic discrete amplifier. It would profit from a base to emitter resistor at Q9 to give Q10 a little more current to work with.
Why do recommend a base-emitter resistor on Q9? The only reason I can think of is speed.  The downside is it will increase Q10's base current, which will load the previous stage down more, resulting in a reduction in gain and a greater current imbalance in the differential pair, which will increase the offset, voltage and bias, current slightly.

Quote
The shown output stage with 3 diodes and rather large resistors R1,R2 is one option with quite some standing current for low distortion. It would be also possible to use only 2 diode and smaller values for R1,R2. The alternative would be an VBE multiplier set to a voltage in between.
I agree, especially about the VBE multiplier, although I wanted to limit it to 10 transistors. Two diodes would give some crossover distortion, as I've found VBE is higher, than the voltage drop of a diode, such as the 1N4148, but it would probably be acceptable and certainly better than the LM358.

Quote
There is headroom for small resistors (up to a value close to R3) at the emitters of Q3 and Q4 to reduce the demand in coupling / matching  these two.
Yes, some emitter resistors on Q6 and Q6 may also help too.

Quote
The circuit is limited to a differential input voltage of about 5 V. So one might consider protection if needed.
Yes, series or back-to-back diodes would do that.

The output could also benefit from over-current protection.
 

Offline jmelson

  • Super Contributor
  • ***
  • Posts: 2765
  • Country: us
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #23 on: January 20, 2018, 05:36:33 pm »
I don't have any certified brand name transistors (mine could all knock-offs I suppose) I do have Beta testers tho to try and match a few transistors. So I'm wondering how easy/hard it is to get an opamp working with the +20 transistors like in 1/2 of an LM358.



I'd like to try for the fun of it, at least in stages. Or is it to much like trying to balance a pencil on its tip and probably won't work at all ???
Where are you going to get those dual- and triple-collector transistors?  Look at Q19 in your schematic.

Jon
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21681
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: How hard is it a make a transistor opamp like LM358 ? Chances of working ?
« Reply #24 on: January 20, 2018, 06:00:34 pm »
Where are you going to get those dual- and triple-collector transistors?  Look at Q19 in your schematic.

That's IC shorthand for "B and E wired in parallel". :)

Similarly if you see multiple emitters (but you'll never see multiple bases), though those can actually be constructed as a single device, which means you get some hFE between emitters (in a half-inverted configuration, so to speak), whereas you get no hFE from discrete devices wired in that way.  This is probably never used as a feature.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf