7 ms·
I designed and built my own function generator
- helsinkiandrew 6y agoI'd suggest linking to the github page https://github.com/Cushychicken/bfunc https://github.com/Cushychicken/bfunc and/or call for users http://cushychicken.github.io/bfunc-call-for-users/ http://cushychicken.github.io/bfunc-call-for-users/ Personally as a product I'd be likely to buy it struggles without amplitude control
- generatorguy 6y agoI want to build a 60.0000 Hz source at 110V, only needs to be 5VA, so I can use a synchroscope to watch the grid frequency wobble around. I wasn't sure where to start so this will be very helpful. I'll still need some kind of an amplifier or transformer to get the voltage up from an IC at 5V to 110V. Also not sure if the synchroscope will work on square waves or if I have to generate sine waves
- pjc50 6y ago5VA is still quite a lot. If you're outputting that through a transformer you'll be needing to put about an amp in. And for maximum transformer efficiency you'll want to make it sinusodial. There are easier ways to watch grid frequency.
- generatorguy 6y agoI was thinking of mounting this old synchroscope like a clock, except of course it doesn't tell time just how much faster or slower the grid frequency is to 60 Hz. What easier ways do you suggest for kind of a grid frequency display other than a multi-meter in Hz mode?
- whatshisface 6y agoFor one thing, it is a lot easier to get the wall socket voltage and current down than it is to get the signal generator up to wall socket level.
- pjc50 6y agoSo, synchroscopes are phase detectors, and only work when you're fairly close to the correct phase. They don't actually report frequency per se. People have built mains frequency counters: https://fowkc.wordpress.com/2013/12/10/mains-frequency-display/ https://fowkc.wordpress.com/2013/12/10/mains-frequency-displ... (via https://hackaday.com/2013/12/12/mains-frequency-display/ https://hackaday.com/2013/12/12/mains-frequency-display/ ) The core problem is getting an accurate enough reference. That project uses an RTC IC; you might want to try building something that uses a PLL on a GPS pulse-per-second output. The second problem is cleanly spotting where the zero-crossing is. You can take a mains feed from a current transformer or a regular transformer and low-pass filter it appropriately. It is then easy enough to use an op-amp to spot the zero-crossing.
- generatorguy 6y agoThanks for the links. Indeed if the synchroscope needle is turning clockwise I know the grid frequency is greater than 60 and if counter clockwise then less than 60 and exactly 60 no movement of the needle at all. To me there is something about watching the inertia of the entire system change and it controlling itself to stop frequency excursions and then AGC or other human interventions to restore the balance. Thanks for the ideas and links.
- dfox 6y agoOne variant how to do that involves something like UCC3750 (ie. telco ringer waveform generator), another is just using sufficiently high powered audio power amplifier.
- at_a_remove 6y agoDecades ago, in college, they made us build and calibrate our own function generator, oscilloscope, and so forth from various boards and parts, as well as painstakingly document the creation and testing of these devices. I still have the rather thick lab book. I can only imagine how much more complex the situation is now!
- aDfbrtVt 6y agoIt's not really a function generator without DC offset and proper amplitude control. I don't want to be overly negative, it's a cool project. I think there's definitely something to be said about having polished interface to a low end function generator. However, there needs to be more information on specification such as ENOB, sample rate, max Vpp, max offset and bandwidth.
- polishdude20 6y agoWouldn't that be pretty easy to do as well? The most crude way to have a DC offset is to just pipe the output through a voltage divider with a potentiometer no? As for amplitude control, an op amp can be used again with a potentiometer to control the resistors needed for a specific gain right?
- jmwilson 6y agoSure, the voltage divider works ... if the load impedance is high. Not a good idea for a 50 Ω load. Op amp needs a dual-rail power supply, so it needs some auxiliary power, then power electronics to get both rails. Stuff starts to get complicated, and now that $1500 Keysight box starts to looks worth its price...
- glitchc 6y agoThis. A function generator is not a trivial piece of digital electronics. It's a complex, highly analog beast, where the digital component of the circuit is actually rather small. Nowadays a dedicated IC (such as the XR2206) is the starting point for a home-made FG. Here's one kit: http://electronics-diy.com/electronic_schematic.php?id=128 http://electronics-diy.com/electronic_schematic.php?id=128
- cushychicken 6y agoI'd even argue that the XR2206 is pretty obsolete when it comes to function generation methodologies. For one thing, it's very limited in frequency - 1MHz max, and dependent on analog components to generate it. For another thing, it's really limited in waveform types. Practically, you can only generate sine, triangle, and square waves. Modulation is possible, but requires extra hardware to pull off. The advantage I see of the DDS is that, once the signal generation portion of the product is software based, you can push upgrades to functionality via software updates. Not something any XR2206 can do!
- mhb 6y agoRelated: $23 AD9850 Signal Generator Module 0-40MHz Sine Wave and 2 Square Wave Output: https://www.amazon.com/HiLetgo-AD9850-Generator-0-40MHz-Equipment/dp/B01J7XPWNU/ https://www.amazon.com/HiLetgo-AD9850-Generator-0-40MHz-Equi...
- unwind 6y agoIs there an image of the board somewhere on the public internet? I've been reading about this on and off for 30-40 minutes now and it sounds cool. But I really just want to know what it looks like! Edit: Finally browsing this on an actual computer, and of course there's a big honking image of the board right there on the first page. Did not see that on mobile (Android, Chrome).
- mNovak 6y agoLong post about wanting to sell function generators.. but no link to buy?
- ballooney 6y agoIt’s not a function generator. It’s a software person having a first stab at what they think a function generator is, and then discovering that it’s more complicated and harder than they realised. It’s a first step in a learning project, not a product. They say as much in the article.
- stagger87 6y agoWell... it is a function generator by definition, and they are attempting to sell it, so it is also a product. I'm going to go ahead and also say that this person has had some hardware development experience as well. Not very many people could put all this together in a couple months without any HW background.
- cushychicken 6y agoNot very many people could put all this together in a couple months without any HW background. You are correct! I'm a professional EE by trade during the day. I've had a lot of fun on this first pass learning about direct digital synthesis, STM32 microcontrollers, and serial consoles. The next revision, which I'm just beginning to work on, will feature a whole nother batch of electronic concepts I'm interested in. Small sampling of what I expect to learn about next inlcudes: chebyshev filters, error budgets, and multistaged opamp design.
- deleted 6y ago[deleted]
- TomVDB 6y agoAs far as I can see, the article has no links at all to the actual product? Adding some might help with goal nr 5. :-)
- cushychicken 6y agoAs far as I can see, the article has no links at all to the actual product? A very stupid oversight of mine. Will be fixed once I spend some time getting a wordpress page set up this weekend.
- waiquoo 6y agoXR2206 chips are pretty useful as cheap function generators for analog projects.
- dfox 6y agoExcept the fact that XR2206 and all similar analog sig-gen-on-a-chip devices are obsolete and essentially unobtainable as raw parts. Ok, you can buy cheap chinese "arduino-like" module that purportedly is built around such chip....
- cushychicken 6y agoYeah! I've actually wondered how far you can get doing this same project by adding digital control to an XR2206.
- woofie11 6y agoI made something very similar in college many years ago too. It's a fun project, but it's not really a business, unless you can make something unique and clearly express what it is. As a visitor to your web page, I can't tell that. That's not a reason to stop -- we all had failed businesses at some point and you learn a lot -- but you do need to clearly articulate the value and what you're going for.
- yummypaint 6y agoAnother (free) option: If you are doing things that only require audio bandwidth, you can construct any arbitrary function generator in VCVrack and send it through the audio output. You can trivially do fm modulation, wavetable synthesis, frequency domain and phase shift synthesis, etc. A push/pull follower made from 2 transistors, an opamp, and a pot for adjustable gain would probably be a good addition. You can also use standard midi (see rs232) messages and audio inputs to control modulation etc. Edit: also wanted to mention the python-rtmidi library, which can construct virtual midi interfaces. It synergizes nicely when used as a control interface.
- Tade0 6y agoOne issue with your standard phone or laptop audio output is that its clock is not overly precise. I learned this when I tried to combine the output of multiple sources generating a sawtooth wave from the same file - any two sources would sweep at around 1-2Hz. It's still usable, just not in scenarios where you have many of them.
- yummypaint 6y agoThat's interesting. Were these two hardware outputs from the same audio device, or two different computers? It's true built in audio on most mobos is notoriously bad, and most musicians and podcasters use an external audio interface. I would imagine those don't suffer the same problems (plus they usually support higher bandwidth), though at that point the cost becomes non-negligible.
- Tade0 6y agoTwo different devices - phones, laptops. I didn't think of using an audio interface, since mine was, ahem, "consumer grade". Also I didn't have a second one to confirm that both have a good, steady sample rate.
- yummypaint 6y agoSome amount of relative drift in inevitable when the sources are independent, but yeah this suggests that the precision is only on the order of 1/48k. I cant imagine the hardware oscillator being that imprecise; crystals and mems are both better than 1/1M. I wonder if it's somehow software related. Ive seen some mysterious stuff with built in audio like variable input latency. if the output latency fluctuated similarly it might effectively introduce a low frequency modulation.
- cushychicken 6y agoHiya. Author here. Hit me up with questions.
- nickff 6y agoThe subtitle is "do you want to get one to try?", but I can't figure out how I would do that. I might be missing a link or something, but you might want to make the funnel more obvious. I also have no idea what the specs are; bandwidth, drive, interface, etc., so I am not really sure whether I'd be interested. I would suggest adding a brief summary of the device's capabilities to the top. edit: just realized that you're suggesting people e-mail you to express interest at the end, but I'm probably not going to go to the trouble of writing an e-mail for the faint prospect of maybe getting a board.
- cushychicken 6y agoThe subtitle is "do you want to get one to try?", but I can't figure out how I would do that. I might be missing a link or something, but you might want to make the funnel more obvious. Yeah, I borked that one. Shoot me an email at the blog contact link if you want one. I plan on making a little wordpress page to migrate specs and sales info onto this weekend. I also have no idea what the specs are; bandwidth, drive, interface, etc., so I am not really sure whether I'd be interested. I would suggest adding a brief summary of the device's capabilities to the top. Believe it or not - when it comes to specs, neither do I at this point. I've mostly been focused on implementing the serial console and UI features. I've got a vision for the next rev that I hope to complete in the next month or two.