DIY Function Generator - Page 1
Forum section: electronics / beginners

author: perfect_disturbance
author_rank: Regular Contributor
timestamp: September 27, 2012, 03:19:53 pm
content: OK So I want to try and build a function gen i see there's a couple different ways to go with advantages and disadvantages.Some people are using dedicated function gen chips like a MAX038 or XR2206 these actually seem pretty straigtforward but both of those chips are no longer in production.and the only one I could flnd with a listed price on mouser was 80 bucks (which seems unreasonable hi so I may be looking at the wrong part)http://www.mouser.com/ProductDetail/Exar/XR2206-11-12EB/?qs=sGAEpiMZZMs%252bwIVMMV7AyT%252ba%252bM0aLAJOThe other consept seems to be using a microcontroller (I'd probably use an atmega328) to directly synthesize the signal. to do this I would need some sort of dac I've seen some people getting by with r/2r networks like thishttp://www.mouser.com/ProductDetail/Murata/RGSD8L102G/?qs=sGAEpiMZZMvrmc6UYKmaNYgyMGTqqrwcgSLMHCLOy9Y%3dI thought I could also use a dac ic but I'm not sure what part would work well for that. I'd like something I could wire directly to the microcontroller (preferably parallel) with out a lot of other components.What do people think?

author: M0BSW
author_rank: Frequent Contributor
timestamp: September 27, 2012, 03:32:00 pm
content: Hope you get plenty of replies , because Im looking for a winter project , and this sounds really interesting.Paul

author: madires
author_rank: Super Contributor
timestamp: September 27, 2012, 04:30:37 pm
content: Quote from: perfect_disturbance on September 27, 2012, 03:19:53 pm25 years ago all EE magazines were full of XR2206 circuits :-) Just checked Reichelt, XR 2206CP for EUR 5,20, on stock. Has anyone tested the cheap MCU based DDS signal generators from ebay?

author: kripton2035
author_rank: Super Contributor
timestamp: September 27, 2012, 04:56:31 pm
content: here is the open source AVR DDS signal generator V2.0http://www.scienceprog.com/avr-dds-signal-generator-v20/

author: kripton2035
author_rank: Super Contributor
timestamp: September 27, 2012, 04:59:18 pm
content: max038 on ebay around $15 free shipping...http://www.ebay.com/sch/i.html?_trksid=p3984.m570.l1313&_nkw=max038&_sacat=0xr2206 less than $3 on ebay...free shipping toohttp://www.ebay.com/sch/i.html?_nkw=xr2206&_sacat=0&_odkw=max038&_osacat=0

author: T4P
author_rank: Super Contributor
timestamp: September 27, 2012, 05:42:34 pm
content: Quote from: kripton2035 on September 27, 2012, 04:59:18 pmXR2206 and the MAX038 is old and done for, inaccurate and runs very hot + power hungry

author: crispus
author_rank: Regular Contributor
timestamp: September 27, 2012, 06:04:17 pm
content: What is the alternative to those old chips?

author: T4P
author_rank: Super Contributor
timestamp: September 27, 2012, 06:36:06 pm
content: Quote from: crispus on September 27, 2012, 06:04:17 pmDDS! AD98XX series

author: AndyC_772
author_rank: Super Contributor
timestamp: September 27, 2012, 06:44:43 pm
content: If you wanted, you could do it with a microcontroller, dual port RAM and a DAC. The microcontroller writes a pattern of data corresponding to a sine, square or any other type of wave into one port of the RAM, while on the other port, a programmable counter reads the data out at a predefined rate and presents it to the DAC.Arguably the best way to implement the counter and RAM would be to use an FPGA; depends how steep a learning curve you're in the mood for, unless you've used them before.

author: PA0PBZ
author_rank: Super Contributor
timestamp: September 27, 2012, 06:54:34 pm
content: Or old school: an EPROM (remember those?) with R/2R on the data lines, a counter on a number of address lines and the other address lines to select the waveform

author: kripton2035
author_rank: Super Contributor
timestamp: September 27, 2012, 07:00:34 pm
content: Quote from: PA0PBZ on September 27, 2012, 06:54:34 pmtypically what's inside a dds chip isn't it ?I bought this on ebay :http://www.ebay.com/itm/-/170682095715?item=170682095715a microcontroller, a display and voila...

author: PA0PBZ
author_rank: Super Contributor
timestamp: September 27, 2012, 07:12:27 pm
content: Quote from: kripton2035 on September 27, 2012, 07:00:34 pmOf course, but the EPROM FG can be build on a breadboard on a rainy sunday afternoon.Also, you can put sine, square, triangle and such in it very simple.

author: G7PSK
author_rank: Super Contributor
timestamp: September 27, 2012, 08:31:35 pm
content: You could get one of these and re engineer it. Or just use it as is.http://www.ebay.co.uk/itm/190649700756?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1438.l2649#ht_8352wt_952

author: jerry507
author_rank: Regular Contributor
timestamp: September 27, 2012, 09:10:14 pm
content: As T4P said, just get a dds. Unless the frequency you want is really low or you want insanely high quality outputs, it's the easiest solution and it'll give you some good experience designing relatively high frequency circuits.

author: M0BSW
author_rank: Frequent Contributor
timestamp: September 28, 2012, 07:43:06 pm
content: Quote from: kripton2035 on September 27, 2012, 07:00:34 pm

author: Smokey
author_rank: Super Contributor
timestamp: September 28, 2012, 08:09:21 pm
content: I have that same DDS board from ebay. It's amazing what you can get for 6 bucks USD. The chip itself in 1s is like 15bucks USD. I already built a motherboard for it with uC, control pots, and +/-12V regulator from +5V input. Going to level shift the DDS output so it's centered around 0V and amplitude scale from there. Still need to write the code though. Should be a killer little USB controlled function gen.Those DDS chips are pretty much just a DAC, but the magic happens with the internal filtering and PLL stuff from what I can tell. The data sheets are super dense with info. Generating a nice sine wave is way harder than it appears.

author: Rerouter
author_rank: Super Contributor
timestamp: September 28, 2012, 10:07:21 pm
content: Quote from: jerry507 on September 27, 2012, 09:10:14 pmso what would be the solution for 0-20khz for sine and square if not a conventional dds chip but still digitally controllable?

author: Smokey
author_rank: Super Contributor
timestamp: September 28, 2012, 10:22:33 pm
content: They make these DDSs for different applications. Check out the part matrix at the bottom of the page:http://www.analog.com/en/rfif-components/direct-digital-synthesis-dds/products/index.htmlThe really fast ones are usually for clock generation, so they have parts that go up into the GHz. There are other ones specifically for function gen applications, like the AD9833, that has a frequency output from 0MHz to 12.5Mhz at 0.1Hz steps and outputs sine, square, and triangle wave via software settings. They really are versatile chips.Here is a really interesting use of the AD9833 DDS.http://electronicdesign.com/article/analog-and-mixed-signal/turn-dds-chip-into-low-frequency-arbitrary-signal-generator(edit to add)For only 20khz you can just hook a DAC up to a uC and step through a sine table. 20khz square wave is easy.

author: ejeffrey
author_rank: Super Contributor
timestamp: September 28, 2012, 11:06:13 pm
content: Those analog devices function generator chips are nice, but they aren't very flexible. They can definitely do your basic sin, triangle, square wave, but if you want a nice set of modulation, sweep, burst, and triggering options you have to implement that by manually adjusting the tuning word.If I were designing a lab function generator I would use an FPGA with an external DAC.

author: grenert
author_rank: Frequent Contributor
timestamp: September 29, 2012, 05:53:32 pm
content: If you're interested in going the one-chip route, Jameco sells a kit (no enclosure) based on the XR2206:https://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_20685_-1They also have the bare chip for $6.49:https://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_34972_-1Velleman makes a complete kit that is based on a PIC:https://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_2137262_-1

author: ejeffrey
author_rank: Super Contributor
timestamp: September 30, 2012, 08:31:36 pm
content: Quote from: Rerouter on September 28, 2012, 10:07:21 pmThe problem with using a conventional DDS for low frequency is that you can really see the stair-stepping with a typical 10 bit DAC. If you know you are only going to go to 20 kHz you can just change the output filter cutoff, but it is better to use a high resolution DAC or use an FPGA+DAC and apply dither and noise shaping.

author: jerry507
author_rank: Regular Contributor
timestamp: October 01, 2012, 04:45:02 pm
content: I am always very skeptical of advising people to go with an FPGA for a project if learning to use the FPGA isn't the point. Perhaps this is bias from when I got my butt kicked by an FPGA in college, but it seems like just learning the FPGA can derail the original intent.That said, wanting to build a function generator or similar test equipment is rarely about building the test equipment and more about learning whatever technology you want to use to build it. So the OP should look at his options:1. FPGA w/ DAC2. Microcontroller w/ DAC3. DDS chip with perhaps some switchable output filters to clean up excessive stairstepping4. A fully analog solutionPick a path and then go down that one, so you're focused and have a real goal.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 01, 2012, 05:23:44 pm
content: or switchable among all 1-4? as in "audiophoolery" anything other than 4 is not tolerated? stairstepping will produce highly unwanted harmonics noise.

author: perfect_disturbance
author_rank: Regular Contributor
timestamp: October 02, 2012, 05:06:12 pm
content: OK so I m interested in the AVR DDS I was looking at some of the schematics and had a couple questions.first I noticed in the power supply that after each of the regulators there are 2 caps a 100 and a .01 (I'm assuming uF). In most reference designs I'v seen there is only a .1 cap after the regulator what is the 100 in this on for? Filtering lower frequency noise? Adapting to rapid changes in current drawn buy the rest of the circuit?Next question is about the resistor network would I be better off buying resistor network or building my own?Thanks

author: poptones
author_rank: Frequent Contributor
timestamp: October 02, 2012, 06:57:53 pm
content: You should not get bad stairstepping with "conventional dds" if you use linear interpolation. It's not that hard.If your goal is to make an audio frequency function gen buy a low cost audio i2c DAC and drive it from a microcontroller. Feed it 48ksamples/sec and the built in 8x oversampling feature will take care of a lot of it.Another way, if you just want sines, is to use a mux as a 3 bit dac and a switched capacitor filter. I built one of these years ago and it works pretty well. And you can get all the parts sampled from maxim.

author: T4P
author_rank: Super Contributor
timestamp: October 03, 2012, 08:04:38 pm
content: Improve high frequency filtering.

author: poptones
author_rank: Frequent Contributor
timestamp: October 04, 2012, 04:11:02 am
content: On the above circuit? It's a 6 pole filter and you can change the cutoff frequency. 1st harmonic is going to be some 25db down, by the time you get to 8th it's just noise.

author: ptricks
author_rank: Frequent Contributor
timestamp: October 04, 2012, 07:32:57 pm
content: If you haven't seen it, microchip have a new pic that could greatly reduce the parts needed for a function generator, all you would need is a quality DAC.The pic16f1508 has a numerically controlled oscillator , perfect for generating precise waveforms, configurable logic so you can make your own hardware gates for combining waveforms or triggering, and a complimentary waveform generator.http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en553471

author: poptones
author_rank: Frequent Contributor
timestamp: October 04, 2012, 08:48:02 pm
content: It has a built in DAC but it is only 5 bits. It would be alright for RF but would suck as an audio gen unless you paired it up with something like the above switched cap 6 pole programmable filter.The two together might make a good combo, but only for sines. If you try to generate a 1KHz square but you're filtering from 1KHz it's not going to be much of a square wave.I could not find anything about getting the NCO accumulator signals off the chip via serial.

author: ziplock9000
author_rank: Regular Contributor
timestamp: January 13, 2017, 09:43:01 pm
content: Any updates to this 5 years later? Are there better modules these days as I've outgrown my extremely basic generator?

author: asgard20032
author_rank: Regular Contributor
timestamp: January 14, 2017, 07:44:42 am
content: Quote from: poptones on October 04, 2012, 08:48:02 pmNot sure about that. For RF, we need good quality signal. If not, all the harmonic would cause havoc on on neighbor band... FCC...

author: Kleinstein
author_rank: Super Contributor
timestamp: January 14, 2017, 08:02:27 am
content: The cheap DDS modules you get en Ebay are still essentially the same: AD9850 based with not so well working filter. This gives a reasonable good quality sine up to maybe 20 MHz. You still need amplitude scaling and output amplifier.

author: pandy
author_rank: Contributor
timestamp: January 14, 2017, 01:31:51 pm
content: Quote from: ziplock9000 on January 13, 2017, 09:43:01 pmYou can build your own discrete TTL based DDS - use as a reference design fromhttp://www.epanorama.net/sff/Test_equipment/Generators/Digital%20Sine%20Wave%20Synthesizer.pdf,however nowadays with fast uC available i would rather replace discrete NCO by software and move RAM LUT to separate IC's (there is plenty asynchronous fast SRAM chips - bigger - better), add to this fast DAC and you may have arbitrary waveform generator.

author: Brutte
author_rank: Frequent Contributor
timestamp: January 14, 2017, 02:19:46 pm
content: Quote from: pandy on January 14, 2017, 01:31:51 pmThat was the route I took.I use STM32 microcontroller (STM32L-Discovery) as an arbitrary signal generator.The uC comes with two 12-bit DACs that can go up to ~2Msps each (with external op-amp for gain and offset) so this is a double-channel generator. It is capable of generating 20-point sin(x) at 100kHz on each channel. Can be started externally or it can trigger a scope (good for sweeping frequency).The nice thing is that such signal generator does not use CPU at all so it does not really matter how fast a uC is clocked (32MHz is ok). I just initialize timers and DMA and let it run in background.

author: MarkF
author_rank: Super Contributor
timestamp: January 14, 2017, 08:36:01 pm
content: I built a DDS with an AD9834, a PIC18F2550 and a small OLED display. It has sine, triangle, square, sweep up and sweep down outputs (although the square wave output is on a different pin). There is adjustable amplitude and DC offset.The MCU is under the display as shown on the board section to the right.

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 14, 2017, 08:49:49 pm
content: What about the ISL5314 ?I know it is an expensive IC, but would it fit in a project controlled by a STM32 ?

author: Vtile
author_rank: Super Contributor
timestamp: January 14, 2017, 09:51:56 pm
content: Then there is the OPA route and Discrete route.These cheap arbitrary gens are interesting, I wonder do they suffer from extreme distortion in high frequenzies with full voltage swing as my function generator that is part of my USB oscilloscope (from known oldish brand).Old 555 chip can handle the function gen duties for as first "function gen".

author: Smokey
author_rank: Super Contributor
timestamp: January 15, 2017, 02:18:17 am
content: One thing to watch out for with cheap arbs is the PC software to create the waveforms. Cheap hardware often comes with cheap damn near unusable software.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 15, 2017, 10:24:53 am
content: Those cheap Chinese function generators often use an FPGA and cheap DAC to provide DDS and arb function. In principle this is very viable and the good ones do it the same way. The problem is more the low DAC quality - often just a few resistors to do R2R: this is limited speed and accuracy (e.g. 6-8 Bit). Also the filter is usually not what is should be for a good DDS.The other point is the performance of the output stage - so slew rate limits appear at higher amplitude.

author: Brutte
author_rank: Frequent Contributor
timestamp: January 15, 2017, 11:36:59 am
content: Quote from: MarkF on January 14, 2017, 08:36:01 pmI wanted to tie STM32L to USB and make some GUI for uploading ROM table and tweaking frequency on-the-fly but due to lack of time I prepare that data offline and just flash a uC.

author: ziplock9000
author_rank: Regular Contributor
timestamp: January 15, 2017, 10:58:34 pm
content: Quote from: Brutte on January 14, 2017, 02:19:46 pmAny chance you can share your design mate? Did you use external RAM to buffer the waveform or just generate it real-time?I might do something similar with an arduino although with that I'd need an external DAC.

author: MarkF
author_rank: Super Contributor
timestamp: January 16, 2017, 12:23:51 am
content: Quote from: Brutte on January 15, 2017, 11:36:59 amI started trying to build an arbitrary generator but quickly found that the frequencies that I could generate was very limited by the update rate I could achieve for the DAC. 100KHz in your case . My range is limited to 1Hz to 1Mhz because I only used a 32MHz clock for the AD9834. A DAC with a SPI interface would be even more limiting.

author: Vtile
author_rank: Super Contributor
timestamp: January 16, 2017, 12:43:17 am
content: I kind of return to my previous post... It would be actually interesting to build a function gen from operational amplifiers. I IIRC have seen many old OPA741 based ones floating around.. How good one of those design would be with more modern high stability, high linearity and high speed chips. Hmm... Anyone tried out or can daveCAD the idea as nonsense. The math behind the OPAs should be pretty much the same as in 1968 when 741 did pop out.

author: Brutte
author_rank: Frequent Contributor
timestamp: January 16, 2017, 08:39:12 am
content: Quote from: MarkF on January 16, 2017, 12:23:51 amYou cannot generate an arbitrary function with AD9834 at 32Msps as that would require 32MHz*8bit = 256Mbaud SPI! This chip can go that fast only by using internal memory (sine, square and triangle IIRC, + kind of sweep) so no arbitrary.Arbitrary function generator has to be able to generate absolutely any programmable shape one can imagine. With that AD you are limited to the SPI speed (<3 MB/s for a PIC18F2550 at ~100% cpu load) so in theory you could reach 3Msps and 8-bit resolution max (IMHO).QuoteSure. I'll try to include whole Eclipse project into a zip and attach here later (end of the week).I am not sure how you are going to port that to arduino as it relies solely on the hardware available. I just fill registers (DAC, two TIMs, DMA and GPIO) with config data and press "start", CPU load is exactly 0%. This uC has similar peripherals to popular STM32F103RCif you necessarily need to port that to something else.I did not have to use any external memory because STM32L152RB has 128kiB of internal flash. Even sampling 2Msps there is enough storage for 128k points (1 x 8bit) or 32k points (2 x 12bit) if you need that much. And there is still 16kiB room in SRAM for an application, if one ever needed such.

author: ziplock9000
author_rank: Regular Contributor
timestamp: January 16, 2017, 08:00:37 pm
content: Thanks.I might have a look around to see if there's a DAC + RAM module for the Arduino rather than going with a different uC architecture for the moment. I'd have the Arduino algorithmically populate the RAM and then output it via the DAC.Complete noob question here.Does using a uC->RAM->DAC avoid most (or all) of the filtering issues compared to using a real-time DDS+Crystal?

author: Kleinstein
author_rank: Super Contributor
timestamp: January 16, 2017, 08:28:02 pm
content: Using a µC, RAM and DAC is rather similar to a DDS chip. So you should have analog filtering in both cases.The external RAM can be a little faster than using an µC internal sine table. So this way the AVR (Arduino) might get you up to maybe 3.5 MSPS and thus maybe 1.2 MHz with a good reconstruction filter. Having the the sine table in the AVR limits the speed to about 2 MSPS and thus about 700 kHz usable sine frequency. So if you want to go cheap and soft, one could leave out the RAM. One might need a second µC for the user interface, as the µC would be busy all the time, when doing DDS in software.Since the ready made DDS modules are not that expensive (slightly over 10 EUR / $10) - they are really attractive, as they include the clock and the filter (not really good, but also not that bad and definitely better than no filter). The AD9850 is also way more powerful than you get with µC, RAM and 8 bit DAC, as it includes a 10 Bit DAC and usually uses a 125 MHz clock.

author: ziplock9000
author_rank: Regular Contributor
timestamp: January 16, 2017, 09:10:45 pm
content: Quote from: Kleinstein on January 16, 2017, 08:28:02 pmThing is I'd be using this not just for sine waves but as an arbitrary function generator. I'm from a Software Engineer background so I'd write some nice front end software for the Arduino and PC to drive it with a nice GUI. So are you saying that external RAM would not be sufficient for waveforms beyond 3.5MPS?

author: rstofer
author_rank: Super Contributor
timestamp: January 16, 2017, 09:25:42 pm
content: Quote from: Kleinstein on January 16, 2017, 08:28:02 pmThis dual CPU approach (AVRs) is exactly what is done with the FG085http://cdn.sparkfun.com/datasheets/Tools/Schematic_085G.pdfThis design can sample at 2.5 Msps to generate a 200 kHz sine wave. Performance for other waveforms is MUCH lower:QuoteThis is a neat little FG but it is nowhere near a real AWG.

author: rstofer
author_rank: Super Contributor
timestamp: January 16, 2017, 09:45:17 pm
content: Quote from: ziplock9000 on January 16, 2017, 09:10:45 pmThe Arduino is just about fast enough to blink an LED. Seriously, it is not quick when compared to any of the more advanced ARM chips. Nor does it have the neat internal features like a DAC or DMA.It's pretty easy to think about just incrementing RAM addresses and using a DAC to convert the value to a voltage. The hard part is knowing WHEN to increment the address and this is usually by detecting overflow in a long addition (64 bits?). This phase accumulator, as it is called, decides when to change addresses (when overflow occurs). We had a discussion about phase accumulators within the last couple of months over on the FPGA sub-forum. It might be worth a search.Perhaps Google for 'digital frequency synthesis'.Google also returns a lot of hits for 'op amp signal generator'. In a perfect world, square waves have zero rise time. At worst, a couple of nanoseconds! I'm not sure a garden variety op amp can slew that fast. There is also the problem of 'range'. There will need to be multiple timing capacitors and some method of switching. And scaling, and offset, etc...http://www.ece.ucsb.edu/Faculty/rodwell/Classes/ece218b/notes/DDFS.pdf

author: MarkF
author_rank: Super Contributor
timestamp: January 16, 2017, 11:27:04 pm
content: Quote from: Brutte on January 16, 2017, 08:39:12 amI know. I didn't start looking at the AD9834 until I decided not to bother with the arbitrary waveform. I started with just a PIC16F877 and it's built-in DAC. I was unable to reach the frequency range I was looking for. That's when I turned to just the waveforms available in the AD9834 and the PIC18F2550 to do the GUI. The AD9834 more than meets my current needs.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 17, 2017, 01:12:06 pm
content: External RAM to sample data can be rather fast, but this would need something like an FPGA / CPLD to generate the address sequences. To have a good arb.- generator one might also needs a more or less fine adjustable clock one when to update the clock / data - this is different from an DDS where the clock is fixed.

author: Brutte
author_rank: Frequent Contributor
timestamp: January 17, 2017, 03:26:05 pm
content: Here I attach the "AWG STM32L.c", that includes all the core functionality of an arbitrary waveform generator for STM32L152RB. You need to link that with peripheral library (available from STM).It outputs a content of "sin_lut.c" via DAC2 on PA5, trigger output is on PB10 and MCO is on PA8.I have removed all the USB related stuff as my USB is a mess.

author: eeFearless
author_rank: Contributor
timestamp: January 17, 2017, 04:03:03 pm
content: Here is a DDS design from the AARL archives, complete with reconstruction filter and output leveling:http://www.arrl.org/files/file/QEX_Next_Issue/May-Jun_2013/Fernandes_QEX_5_13.pdf

author: Vtile
author_rank: Super Contributor
timestamp: January 17, 2017, 04:50:31 pm
content: I could have swear that someone replied to the OPA aproach. What I quickly looked up ie. Tektronix CFG280 function generator 0..11MHz (20Vpp) is build around handfull of uA741s. With much more functionality than one needs to get started. Also there is discrete Wien-Bridge sine oscillator designs (from tubes to transistors) with Pot-selectable output from few tens to few kiloherts outputs, such can also be modified to have other wave froms as output with a few extra components (mainly OPAs and comparators).(These are also programmable, but the programming language is hardwiring.)

author: rstofer
author_rank: Super Contributor
timestamp: January 17, 2017, 04:52:51 pm
content: Quote from: eeFearless on January 17, 2017, 04:03:03 pmThat's a great document! It clearly shows that the DDS chip (AD9833) is the least of the problem. The author wraps a barn full of stuff around the outside.Really nice work!

author: MarkF
author_rank: Super Contributor
timestamp: January 17, 2017, 07:07:15 pm
content: Here's my DDS design with only a tenths worth of stuff around it.

author: eeFearless
author_rank: Contributor
timestamp: January 17, 2017, 07:50:56 pm
content: Is VOUTB from the MCP DAC for adjusting DC offset?Wouldn't you want a big honking cap at the 470/100/2.7K junction, so the AC differential gain is symmetric?

author: Kleinstein
author_rank: Super Contributor
timestamp: January 17, 2017, 08:09:20 pm
content: It looks like VoutB is for adjusting the offset. For symmetry one could just use slightly different resistor values (e.g. around 2.78 K in the feedback of the OP) to include the extra resistance. One might even save one ore resistor and possibly the lower OP.However this circuit is still missing two parts: the reconstruction filter is very low grade. Also there is no coarse adjustment for the amplitude (like the relay part) in the other circuit. Also the upper frequency limit and amplitude is rather low. In addition the output impedance is not at 50 Ohms in the simple circuit.So that simpler circuit has some good ideas (like having the offset) and using an DAC to set the amplitude. However there is also a oversimplification in using a slow OP as an filter and the low output amplitude.

author: MarkF
author_rank: Super Contributor
timestamp: January 17, 2017, 08:55:20 pm
content: Yes. VoutB is the offset adjustment and VoutA is the amplitude control. The amplitude gain is set for 2Vpp with a +/- 1V offset control. The op-amp gain could be adjusted for a larger output if desired. I see no reason for a coarse amplitude adjustment with noise prone relay contacts. The coarse/fine adjustment is part of the GUI with finer adjustments achieved with a 12 bit DAC (MCP4822) instead of the 8 bit DAC (MCP4802) I used.As for the reconstruction filter, I found it almost unnecessary with the 1Hz to 1MHz frequency range I limited the DDS to. A FFT shows the DDS output to be very clean without one.The 50 ohm output impedance is a weak point for me. Any suggestion for a fix is welcome.Edit: See the attached application note on the amplitude control for the AD9834. It is a coarse adjustment in itself.

author: ziplock9000
author_rank: Regular Contributor
timestamp: January 17, 2017, 09:42:56 pm
content: Quote from: Kleinstein on January 17, 2017, 01:12:06 pmAh balls. It's looking more and more like even a modest 10Mhz range arb gen is out of range and better to just buy one :/

author: Kleinstein
author_rank: Super Contributor
timestamp: January 17, 2017, 09:53:48 pm
content: Fixing the output to get closer to a 50 Ohms output is easy: replace the 51 Ohms behind the OP with 100 Ohms and adjust the filter to 100 Ohms. These two resistors are effectively in parallel to determine the output impedance. Having the filter at the output is not such a good idea.The output amplitude is also limited by the OPs current limit and the maximum slew rate. For the TLE2081 the slew rate limit is about 10 V_ss at 1 MHz. Which would result in 2.5 V_ss to a 50 Ohms load. So 2 V_ss is already rather close to that limit. There is also a current limit: 1 V at a 50 Ohms load already needs about 30 mA from the OP (with 100 Ohms resistors). So it needs an better OP (or two) to get a higher amplitude.There is some filtering: the one a the output and the limited bandwidth of the OP also acts like a low pass filter. Still only 4th order with low Q and thus a limit to something like 1-2 MHz despite of a limit of about 10 MHz from the DDS chip.The amplitude adjustment via the reference input of the DAC in the DDS chip is good for fine adjustment, but not working well for low amplitudes, as this will increase the DDS internal DAC errors. Having a 12 Bit DAC to control does not help here. It is just that one should not go down below about 10% of the maximum for the ref input.So an additional switchable 20 dB attenuators would really help to extend the amplitude range, without adding to much noise / distortion. For a 50 Ohms signal, relays are not bad and at only 1-5 MHz there is no need for special RF relays. With fine adjustment via the ref input one can get away with just 1 or 2 relays (or maybe just mechanical switches) for steps of 20 dB and maybe another 10 or 20 dB. A passive divider at the output is also the best way to get a really low noise and SWR, at least for the low amplitude setting.

author: rstofer
author_rank: Super Contributor
timestamp: January 17, 2017, 10:02:04 pm
content: Quote from: ziplock9000 on January 17, 2017, 09:42:56 pmAbsolutely!There are some fairly inexpensive AWGs that can produce some very nice results. Something in the Siglent or Rigol lines will be just fine. Even the very cheap FG085 can do something useful. It a very neat gadget up to a 200 kHz (sine).Within its frequency range of 12 MHz at +- 5V, the Digilent Analog Discovery can do some very impressive work. For $279, this device is totally underappreciated.http://store.digilentinc.com/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply/

author: ziplock9000
author_rank: Regular Contributor
timestamp: January 17, 2017, 10:54:10 pm
content: Quote from: rstofer on January 17, 2017, 10:02:04 pmWhat I was hoping to build looks similar to the FG085 but with a PC/Windows based front end for versatility. Thanks

author: Brutte
author_rank: Frequent Contributor
timestamp: January 18, 2017, 09:04:26 am
content: I also like the ideas of a 1Gs 8-channel 14-bit ARB, it would be very interesting to have it on my desk but to be fair I do not have $1000 and anything that sticks beyond 1MHz analog bandwidth is beyond my field of interest. I need a true arbitrary waveform generator (and not sin+square), for embedded, testing and debugging. Current micros are clocked in the range of 50-100MHz, they cannot cope with signals from >1MHz bandwidth (even a stupid PID @ 100kHz is a challenge on a 100MHz micro) so I really have no interest in a 5MHz triangle waveform.Quote from: ziplock9000 on January 17, 2017, 10:54:10 pmFG085 looks too limited in functionality for me but the bandwidth is ok-ish.I need:-a sine sweep, from A to B, in logarithmic scale. Two decades at least. 1Hz:100Hz, 2Hz:200Hz, 5Hz:500Hz,..., 5kHz:~500kHz-random noise generator, with replay (so not that random)-trapezoidal shape (for servo control)-ramp with reset output (for integrating opamp with zeroing)-external output trigger, input trigger and clock (to synchronize that with external gear for debugging, or to cascade/parallel with second arb generator),-incremental encoder/pushbutton emulator with switching noise (for testing noisy encoder/button interfaces)-hardware keyboard and standalone operation not required-USB interface

author: rstofer
author_rank: Super Contributor
timestamp: January 18, 2017, 03:51:59 pm
content: Quote from: ziplock9000 on January 17, 2017, 10:54:10 pmFor $35 and a couple of hours work, you can just buy the FG085 and leave it laying on your workbench. No USB cables, no coupling with the PC, etc.https://www.amazon.com/Function-Generator-DIY-Tech-FG085/dp/B00C5UO8U6If building an AWG is a learning project with value beyond just making signals, great! Building something is good. OTOH, if the goal is to have some kind of signal source for other projects, maybe $35 isn't such a bad idea. Besides, you still get some soldering practice and that isn't all bad.

author: rstofer
author_rank: Super Contributor
timestamp: January 18, 2017, 04:02:43 pm
content: Quote from: Brutte on January 18, 2017, 09:04:26 amYou really should look at the Digilent Analog Discovery. It turns out that your 'sweep' requirement is met by the Network app while the Wavegen app will meet the noise, trapezoid and general signal requirements. External input trigger is probably possible (there are pins for it but I have TESTED it myself). I'm not sure about trigger out...It costs nothing to download the Waveforms software and play around with the demo mode:http://store.digilentinc.com/waveforms-2015-download-only/Here's an overview page with a link to the Reference Manual (among other things):https://reference.digilentinc.com/reference/instrumentation/analog-discovery-2/start?redirect=1

author: AE7OO
author_rank: Regular Contributor
timestamp: April 13, 2019, 04:32:26 am
content: I've got the semi-updated (Meaning it has the 12bit/2048 update, but still has the CH340 serial to USB) MHS-5200A - 25Mhz. Sine wave output to 25Mhz, all other outputs restricted to give or take 6Mhz. It is a ARB with about 200Ms(Closer to 170 according to Sigrok), 12bit with 2048 points and 15 memories.As long as you keep the output to a semi-low level, about 7Vpp above 10Mhz OR 14Vpp below, it works just fine.As far as I can tell the complete serial protocol has been reverse engineered, but the native software I've got is not too bad. It handle outputs of both channels, freq measurements, freq sweeping, and has basic waveform generation.It runs about from about $70 on Amazon(Prime) for the 25Mhz one. Trying to go lower than this price, you'll end up with either a Kit, a reference board design, a analog (aka XR220x) generator or a audio only gen.I know the thread is old but....