5 MHz function generator output stage design - Page 1
Forum section: electronics / projects

author: Yansi
author_rank: Super Contributor
timestamp: January 16, 2015, 05:33:00 pm
content: HelloI'd like to build a small function generator, based on DDS principle. Because I have very little experience with designing these, I have a trouble with the output stage.I have got multiplying DAC, AD5445. To control output amplitude, I will simply regulate the voltage at the DAC reference input.To shift the offset level, I thought to do it in the output stage, by simply adding the offset control voltage together with the signal from the filter.What are your reccomendations for designing the analog part please? The holy grail should be to keep it as low cost as posible, so I am not afraid of using more components (like for discrete buffer).Lets start with the current2voltage part: What output amplitude should it produce? The output of the whole generator should be 10Vpp. It seems to be nonsense to make the I/V part generate full swing signal, because it would require very fast and expensive opamp. The I/V output amplitude should be therefore a compromise of the opamp speed. Considering the 6dB voltage loss in the filter, I would prefer to have the output amplitude of about 2 to 4Vpp out of the I/V stage. Is it fine or did I miss any other drawbacks? With such an amplitude and the filter input impedance of about 200ohms, it does not require any highcurrent OPamp.Output buffer: Here comes the trouble. Very fast opamps capable of 30V supply voltage and 50ohm output are very expensive. I'd like to avoid using them. I'd like to build discrete or semi-discrete output buffer. The output stage must have some gain, not only pure buffer. Output voltage from filter woud be around volt to two, so the buffer should have gain at least of about 5 (14dB) to produce teh desired 10Vpp. I really don't know, if there is some simple discrete solution for this (obviously not), but using a standard OPamp with current gain stages seems like a more souitable way to do it. But the opamp must therefore be capable of working at 30V supply voltage and be fast enough to produce any usable quality of signal, at a gain of about 5 to 10. Are there some affordable "high" voltage and high speed opamps, or is there any other way how to make such a buffer with some voltage gain?I tried to find some "function gen. output design" application notes, maybe I searched wrong but found almost nothing to this topic. It would help me also to get some tips for some cheaper-end opamps or suitable parts for this design. Sure I can find something, but with no warranties it is suitable for this purpose. Also advicing to use stuff like ADA4870 is not a solution. I design only a small and cheap DDS arb generator for myself and maybe others, without a bugdet of NASA. The purpose of this design is more educative compromise, than trying to build ideal waveform generator.I already got an advice to use norton amplifier for the output stage. I only know they exist, what are the pros and cons using these?What do you think about my ideas for building the analog output circuitry?Thank you,Y

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 16, 2015, 06:11:40 pm
content: This wasn't too bad,Use like any voltage mode op-amp. It could be modified for higher voltage, power output, current limiting, etc. I make no guarantees on distortion, but probably not bad (for gain < 10, better than 8 bits ENOB I would think).Higher power transistors will be needed for much drive (say, into 50 ohms (a short circuit at the FG output), +/-10V is 200mA and 2W square wave), but this won't be a problem, as for your 5MHz bandwidth, transistors of fT >= 100MHz will be more than sufficient.BTW, most FGs have output attenuators (50 ohm in/out matched, pi or tee style), as this keeps noise floor and distortion proportional to the signal. Your DAC probably has minimum specs on error depending on VREF, so it gets worse for shrinking voltage range. For highest precision, you always want to maximize output. You could do variable attenuation (1x, 2x, maybe even 5x or 10x, and vernier easily too) at that point, but large steps (say 20dB at a time, up to a total of usually 60-100dB) should be done by fixed attenuators.Ed: niiiice, typo that's been waiting for three years: double R13's.Tim

author: Yansi
author_rank: Super Contributor
timestamp: January 16, 2015, 07:29:12 pm
content: I'e alredy thought of using discrete OPamp. But I got suspiction, that it will be too slow. The specs written in the schematic look too good to be trueI will build it and measure it, but now I'm a bit skeptical. What would you suggest using as the output pair, for around 1-2W output? Something like SOT89 package, which could be somewhat better heatsinked. Do you think it will retain enough BW and SR when configured with gain of 10? I think that will become a trouble.As I've said already, I'll definitely try your circuit. I'll only modify that a little bit, for +-15V operation.As I've mentioned in my filter-related thread, the first design will be only for testing end debug, I will not use any output attenuators. I though of using only single 20dB pad for the final version, but haven't considered it thoroughly yet, if it will be enough. I will make the test design more for toying, than for use.Or any semi-discrete solution like opamp with complementary pair for extra current gain will be appreciated, if the price of the OPA will be no more than $2 or thereabout.So let's make a board for the discrete amp.

author: nfmax
author_rank: Super Contributor
timestamp: January 16, 2015, 10:08:12 pm
content: My advice is to cheat! Take a look at the output amplifier circuit from a commercial function generator, from back in the day when you couldn't get IC opamps fast enough, and the service manuals included schematics. The 13MHz HP 3312A is a good example. Scans of the manual are available from the Keysight web site.

author: Yansi
author_rank: Super Contributor
timestamp: January 16, 2015, 11:07:03 pm
content: Got that!http://literature.cdn.keysight.com/litweb/pdf/03312-90004.pdfPage 62. As a standard, people just can't scan documents, it is very very badly unreadable. Only good for inspiring urself for the topology. But it shouldn't be so complicated to calculate those missing values.As I talked about the board... here you are. A board (with a crap layout, so we'll see, how idiotproof the circuit is), made very fast, without much thought. Bottom leayer is a copper "groundplane".A little trouble came when modifying the circuit for higher supply voltage. I've only changed the R8 (numbering referenced to my diagram), to retain about a miliamp current through the diode reference. I calculated the approximate current in the circuit and checked the power loss on each transistor -> T4, 5, 8, 9 are likely overloaded. I will use BC847/857 (bcs we are here in Europe, we don't use 2N3904/6 and just bcs I have them :-) ) They can't take much power, I think up to 150mW is safe (250mW datasheet Ptot). SO I should lower the bias current. How much should I decrease it (maybe half that?) and how much will it change the circuit's performance?

author: tszaboo
author_rank: Super Contributor
timestamp: January 16, 2015, 11:28:29 pm
content: And there is the TPA6120A2 which can drive anything* with 10 Ohm output impedance,Power Supply Range: ±5V to ±15V128dB of dynamic range.• 1300V/?s Slew RateTwo bucks, and if you dont like it, you can always turn it to a headphone amp.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 16, 2015, 11:45:36 pm
content: Lower bias is okay, it's mainly there to give the amp something to chew on, for small signals and to reduce crossover distortion. It'll also have a tempco (because the diodes and output transistors aren't well matched, thermally, electrically or geometrically), which hopefully won't cause runaway (but with the somewhat generous parts values here, it should be fine).If you left solid copper on the back side, cutting in some vias to the top side will help with shielding and bypass. It shouldn't be running so steaming hot that it oscillates on its own, as it needs to be stable in the overall feedback loop -- so it should be fairly tolerant of layout. Adjust the R+C compensation as needed. If you don't have an RF probe, a finger test should be sufficient: check if it does weird things (or stops doing them!) when you hold a finger near or on various nodes.Tim

author: Yansi
author_rank: Super Contributor
timestamp: January 17, 2015, 12:02:41 am
content: Yea, exactly, I made it on doublesided to have easier decoupling and toying with that sucker.RF probe... At home I gotta 2ch 200MHz scope with adequate probes. Sometimes I use my "RF sniffer", which consists of a microwave diode and a small 100uA analog meter. Easy for debugging simple RF/HAM circuits, especially oscillators or frequency multipliers.I'll lower the bias probably in half. Now soldering comes.... Be ready back... if I won't sleep on my bench, bcause here it is 1AM now.NANDBlog: Where did you get the price tag? I smell an error. About $6 mouser, >$3 chinese supplies. Ineed only up to 5 pcs, not 5 hundred thousand.

author: Yansi
author_rank: Super Contributor
timestamp: January 17, 2015, 12:53:52 am
content: Again, shit happens, murphy got me again. As I rushed the board, I made it mirrored. Usualy, I make only single sided THT, which does not require any flipping in the process, but TOP layer must be flipped.Fortunately, solution was easy - mount the SOT23 dead bug style.Board finished, I probably leave the testing in the afternoon. (1:53AM here, tired and I must get up early)Good night and thanx 4 helpY

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: January 17, 2015, 03:16:12 am
content: Hi group,I have built a LTspice model of the amplifier:I have added feedback to give a gain of 5 (14 dB).I have attached a zipfile with the model.If you want to find out how this amplifier works download LTspice (free download)from:http://www.linear.com/designtools/software/#LTspiceRegards,Jay_Diddy_B

author: TerraHertz
author_rank: Super Contributor
timestamp: January 17, 2015, 09:43:46 am
content: Quote from: Yansi on January 16, 2015, 11:07:03 pmAmazing isn't it. And that is on HP/Agilent/Keysight's own website.Has anyone ever found a service manual for old HP gear on the company's site that wasn't borderline unusable? So far every one I ever got there was terrible. I generally don't even bother trying them any more.It wouldn't surprise me if they do that deliberately. Well poisoning - trying to eliminate all memory of the days when the company produced high quality, complete service manuals. Because such things make them (as they are now) look like a bunch of arseholes.The kind of behavior you'd expect from a person/entity that keeps changing its name.Edit:Here's pdf service manual for a KRohn-Hite 5200A function generator, that goes up to 5MHz.http://www.davmar.org/pdf/Krohn-Hite5400A.pdfThe schematic is quite readable.

author: KM4FER
author_rank: Regular Contributor
timestamp: January 17, 2015, 02:35:04 pm
content: I don't mean to hijack this thread but the topic is right for my question and may help the OP. (I'm pretty new to this design stuff so don't hit me too hard.)How do signal generators maintain a 50 ohm output impedance with varying frequency? Or do they?Let's take a square wave as an example. If the output impedance is 50 ohm at the repetition rate of the square wave then I would expect it to be quite different at the harmonics which would result in distortion of the output signal. Or can you actually design a circuit that would maintain the 50 ohm impedance over a broad range of frequencies?From watching videos of signal generator teardowns it seems to me like the output stages can get really complex, even more so than the signal generation stages.Thanks...earl...

author: Yansi
author_rank: Super Contributor
timestamp: January 17, 2015, 03:10:36 pm
content: KM4FER: Designing a constant output impedance amplifier, is almost the easiest part of this kind of design. Just only use amplifier with a few orders of magnitude lower output impedance and slap 50 ohm resistor on the output of that amplifier.Hi there! Already back home, prepared for testing the discrete OPamp.

author: Yansi
author_rank: Super Contributor
timestamp: January 17, 2015, 03:19:26 pm
content: Mechatrommer: Sure, doing arbitrary waveforms in analog is easer and cheaper. :-DYou just can't simply beat the price of $1.5 PLD, $1.5 SRAM, $4 DAC and a few other components, which you would also need for your analog one. I have no problem with that.And if you don't like that I learn stuff this way, well.. nobody didn't urged you to read it or anything. Sure, slap there AD9850 chinese ultracrap module (which produces heavily distorted output), connect it to ur arduino and puke there awful crap code library, that makes life a lot easier. I am NOT a fan of this kind of diy. That's not diy, thats simply what it is - a pile of turd.

author: TerraHertz
author_rank: Super Contributor
timestamp: January 17, 2015, 03:25:50 pm
content: Quote from: KM4FER on January 17, 2015, 02:35:04 pmWhat? Err... I'm going to assume you're not trolling, and just have some basic misconceptions.Points:* The impedance of the output, ideally, is purely resistive. It's supposed to be equivalent to a zero-impedance signal source, with a 50 ohm resistor in series. In reality, it will be very close.* So the signal shape, repetition frequency and 'harmonics' (energy spectrum) have no relationship to the impedance. The attenuation is very flat across the applicable spectrum, so there's very little distortion of even a square wave.* Some signal generators have selectable output impedance. Typically one option will be 'approximately zero'.See pic.The German word 'ausgang' sounds really funny to an Australian.

author: Kalvin
author_rank: Super Contributor
timestamp: January 17, 2015, 03:30:31 pm
content: Quote from: Yansi on January 17, 2015, 03:19:26 pmIf the chinese design is crap, you can still salvage the AD9850 and possible some other useful components, and you can do a better design which performs better. Sometimes it is just easier to buy something cheap with useful components, rip the components off from the original PCB, and reuse them in more suitable and improved design.

author: Yansi
author_rank: Super Contributor
timestamp: January 17, 2015, 03:35:32 pm
content: Does AD9850 make arbitrary waveforms? No? That is also no for your suggestions. And also I make this "not-one-chip" DDS for education purpose. Any objections? Yes? Don't tell me. I don't care.This is not about what performs better, but where you can get some experience. Using singlechip solution wired exactly as in datasheet, is sure very eductional, compared to what I am trying to do.If you want good performance waveform generator, buy one.//EDIT: By the way, the chinese AD9850 gizmo costs almost equal amount as my conception of PLD, RAM and DAC.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 17, 2015, 03:53:32 pm
content: Ugh, all these people pushing ICs! Begone, Satan! Do they not know the value of the humble transistor?!Tim

author: KM4FER
author_rank: Regular Contributor
timestamp: January 17, 2015, 04:02:47 pm
content: Yansi, Thanks for the explanation.TerraHertz, I'm not a troll, just ignorant. But trying to learn.Now that I've got some direction I'll go to LTSpice and see if I can get some more understanding on this.Thanks again.earl...

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 17, 2015, 04:14:26 pm
content: Quote from: TerraHertz on January 17, 2015, 03:25:50 pmNo, it's a valid question. If the output impedance varies, then the gain into 50 ohms varies, and therefore the frequency response; if it goes reactive, it starts ringing; if it goes negative (enough), it starts oscillating!A typical op-amp (open loop) has an impedance that rises somewhat with frequency, maybe starting around a few ohms in the DC-kHz range, then rising into the 10s of ohms by 100k-1M and maybe into the 100s in the megs. This is due to the emitter (or source) follower equivalent output stage, bypassed at the input/base end with the internal gain node capacitance (usually also the site of the dominant pole / miller compensation capacitor). You'd expect it to fall with frequency because of the reflected capacitance, but "slop" across the several transistors in the signal path tends to add up and make a somewhat "squishy" or inductive characteristic. (This is required when the gain node is carrying microamperes, and additional current gain is necessary to bring the signal to the outside world in the ~10mA range. There is also often level shifting and current limiting circuitry as well.)Rail-to-rail types lack the voltage follower design and typically have even higher open-loop output impedances. Same as LDOs, they are more like current sources (transconductance amps) with feedback to save them. Compensation is more difficult, especially if a capacitive load is required.The output impedance under feedback is considerably reduced, but only in proportion to the loop gain. So it's mohm or even uohm at DC, but it rises sharply with frequency, until at fT, it's the same as the open loop condition (actually, it will be worse, because phase margin won't be exactly 180 degrees -- the difference will manifest as an inductive output, hence the sensitivity to capacitive loads that's characteristic of most amp designs).So you can see, an op-amp of fT = 5MHz would be very poorly chosen for the present subject. But that's probably quite obvious. What may not be obvious is, it's probably desirable to use one that's about triple the bandwidth, or fT >= 60MHz, so that the phase margin at harmonic frequencies is still useable.There is also some virtue in having an output impedance maintained well beyond the bandwidth of the instrument itself, as it could be connected to some equipment that's generating poorly filtered junk at much higher frequencies, which if allowed to reflect, could disturb itself. (An example: a 100MHz oscillator coupled to a one-transistor mixer. The mixer input port will then have a lot of 100MHz on it... For just a quick try, you might lash it up without the necessary filters. But if the FG is reflecting 100MHz plus phase shift due to its poor output impedance, the phase shift goes back to the oscillator and shifts its frequency. Maybe it doesn't want to oscillate at all, at some frequencies, due to magic lengths of the cable and stuff!)There are many ways to skin this problem; another good one is intentionally building a transconductance amplifier, and driving its current output into a shorting resistor of 50 ohms: thus making a Norton current source, which is of course equivalent to the Thevenin voltage source we have currently in this thread. The nice thing about transconductance is, that's what transistors are, so give or take some compensation, you can get about all the gain that they're good for (a modest current gain of just a few will get you within fT of the transistor -- for 2N3904, that's in the 100MHz range!), and the output impedance will simply be 50 ohms plus a little capacitance (which can be kept minimal using the smallest, fastest power transistors possible). If you were really serious, you could partially cancel that capacitance with some inductance (Tektronix' famous T-coils), or build a distributed amplifier even (which they did, many times, because it was absolutely necessary with vacuum tubes!).Tim

author: Kalvin
author_rank: Super Contributor
timestamp: January 17, 2015, 04:21:15 pm
content: Quote from: Yansi on January 17, 2015, 03:35:32 pmI didn't suggest using AD9850 for your design. It was just mere comment on reusing the parts from crappy chinese design. Point being, although the cheap chinese board may not be usable, one can still use the compnents for something useful and/or create improved design.Your project is very interesting and challenging, and designing a buffer amplifier using discrete components is very educational. T3sl4co1l seem to have very nice amplifier designs.

author: Yansi
author_rank: Super Contributor
timestamp: January 17, 2015, 04:34:08 pm
content: In that case, I wouldn't salvage anything, if it could be bought for I think under $2 (instead od the about $7 module).

author: Kalvin
author_rank: Super Contributor
timestamp: January 17, 2015, 05:13:09 pm
content: Quote from: Yansi on January 17, 2015, 04:34:08 pmThat is correct, although the $7 module may be cheaper than the $2 component after all shipping&handling + VAT. For example, a Digikey may charge 18 euros for shipping & handling for small orders, and orders over 65 euros will be shipped for free. When the package enters the country, you need to pay the VAT 25% (which is calculated including the shipping&handling or any other postage, btw), if the VAT exceeds 5 euros. One could also order from the local component dealers, but quite often than not they don't stock the component you need, so they need to order it from their dealer, and typically they will have their own shipping&handling and minimum order limits applied. So, the $2 part may not seem too tempting any more. And finally, quite often the cheap and crappy $7 module can be used for quick prototyping, evaluation and used as a basis for the software/hardware development.

author: bdivi
author_rank: Regular Contributor
timestamp: January 17, 2015, 07:51:00 pm
content: I built a MAX038 based 20MHz function generator with AD811 output buffer - current feedback, 2700V/us slew rate, drives 20Vpp into 50ohm with ±15V supply.

author: Yansi
author_rank: Super Contributor
timestamp: January 17, 2015, 09:14:36 pm
content: bdivi: wow, that opamp is a badass for its price. Thanx very much for the tip. $1 per piece with these parametrs is something I like. And that MAX038.. that ain't cheap, but veeery interesting part. I've already bookmarked it. The price seems worth it.But wait a moment: How well does the AD811 package cool itself? It seems to be plastic only, no heat-pad beneath.Kalvin: That is also true... But check some chinese stores out, they sometimes send them as "free shipping" and the price is still lower, the the module. But not much.AcHmed99: That is a neat DAC. Maybe for some future model of my DDS generator

author: nfmax
author_rank: Super Contributor
timestamp: January 18, 2015, 08:56:20 pm
content: Yansi - FYI I've made a better scan of the 3312A output amplifier stage, hopefully it is more readable than the one on the Keysight web site

author: Yansi
author_rank: Super Contributor
timestamp: January 18, 2015, 09:43:03 pm
content: A little update:I've tested the discrete opamp. The beast worked on first try, but oscillates slightly at around 60MHz. I've tested ad decreased voltage (+-6V) but that might not be the issue. Configured as simple voltage follower (unity gain). I still haven't got some time to fiddle with the compensations or to find the issue, but I'd like to make it working to take some measurements on that.But the AD811 whichbdivisuggested is (I expect) better solution. Its price is very good, already ordered some for the prototype. (Still need to choose suitable OPamp for the I/V).About power supply design for the DDS waveform generatorToday, I was thinking about how should I design the power supply for the whole thing. The prototype will be PSU-less, because it can be simply hooked up to a bench power supplies.The final DDS shoud be equipped with USB FS for "remote" operation or arbitrary waveforms load/store functionality from a PC, it would be nice if it could be powered from the USB bus. I think, it should fit into the USB power spec of 2.5 watt, but we'll see. Standalone operation should be possible from an external supply. Therefore it looks the whole design should be based around 5V supply - from USB or external (wall wart).The DDS design will need for sure: 5V and 3V supplies for logic, +-15V for the output stage. 3V can be easily derived with a LDO (AMS1117-3.3), there wouldn't be any huge amount of consumption there (only small ARM MCU, CPLD and a SRAM).The symmetrical 15V supplies will need a DC/DC convertor. I searched throughout the web with my friend and we came to a conclusion, MP1542 fits our requirements the best (for the positive rail).+15V supply is easy to get with teh MP1542. The -15V rail is a bit more problematic. Does anybody know any similar el-cheapo ($0.5 or thereabout) switcher which would complement the MP1542 for the negative rail?Datasheet MP1542:http://www.monolithicpower.com/DesktopModules/DocumentManage/API/Document/getDocument?id=873Thanks for suggestions,Y//nfmax: Could you please upload the schematic of the output stage (p 62 I think)?//EDIT: Power supply problem with getting negative 15V was solved today.

author: bdivi
author_rank: Regular Contributor
timestamp: January 22, 2015, 09:50:45 am
content: Quote from: Yansi on January 17, 2015, 09:14:36 pmNo need for additional cooling. 20V p-p is 7V RMS, which into 100ohm (50 output R and 50 load) is less than 0.5W. The opamp under these conditions will be at similar 0.5W. I never had heat issues with the device anyway but you can stick a small heatsink on top of it if it will make you feel betterCheers

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 22, 2015, 11:47:10 am
content: Quote from: bdivi on January 22, 2015, 09:50:45 amSo the user is never going to short the output?Tim

author: Yansi
author_rank: Super Contributor
timestamp: January 22, 2015, 12:43:27 pm
content: Never going to. The fixed output impedance will limit the maximum dissipation to 795mW maximum in the IC, which seems to be fine, for ambient temperature under 65°C. (Sticking a small heatsink on top of the IC will be considered after some tests. I haven't got capabilities, to simulate heat spreading on a PCB)And yes, I have lowered the maximum output swing to 10Vpp, to achieve this, before you did warn me. Hope I haven't made mistake in the calculations.I think, 10Vpp will be right enough, for this small generator. 20Vpp requirement was just.. ill-judged.

author: dardosordi
author_rank: Regular Contributor
timestamp: October 09, 2017, 02:20:44 am
content: Hi Yansi, I know its breen a while but I was wondering if you completed it and would be willing to share a schematic. I'm doing research to build a similar one.Thanks!

author: Krisztián
author_rank: Contributor
timestamp: March 13, 2024, 04:27:42 am
content: Quote from: bdivi on January 17, 2015, 07:51:00 pmAre you sure? The short circuit current of the AD811 is typically 150mA.20Vpp -> 10V positive peak and 10V negative peak.Ipeak=Upeak/R=10V/50Ohm=200mA

author: dobsonr741
author_rank: Frequent Contributor
timestamp: March 13, 2024, 11:50:29 am
content: My fav output part is BUF634.https://www.ti.com/lit/ds/symlink/buf634a.pdf

author: Vovk_Z
author_rank: Super Contributor
timestamp: March 13, 2024, 12:14:14 pm
content: My favorite was LM6172 until it became too rare and expensive.TS may be suited with AD8066, two channels in parallel (with 50 R or 100 R resistors in series with each). It seems it is still produced and still not expensive.I still have an LM6172-based headlamp made a long time ago, it is as simple as this photo, where a regulated power supply takes a main space in a case.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: March 13, 2024, 06:50:54 pm
content: Note Most of this thread is from 2015.I think it popped onto page 1 via a spam-bot, which exposes a bug where the forum sw keeps the ghost date alive, after the offending post is killed.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 14, 2024, 10:40:10 am
content: An OP-amp with a +-15 V supply will not be able to drive 20 Vpp into a 50 ohm load. It may get you the 20 Vpp into a high impedance load and when loading with 50 ohms this will drop to half.In this case the amplifier would "only" need to drive 100 mA as 10 V to a 100 ohm load. So the 150 mA from an AD811 would not be the problem. One can however get a problem with the power dissipation, in case of a short. So a single OP-amp in a SO8 or similar case would run rather hot alread under normal load and may fail from overtemperature with a longer time short.