Re: [DIYbio] fancy waveform generator?

If you use PWM, with, say, 256 levels, then your maximum frequency will be

the clock frequency divided by 256. For a 20 MHz part that gets you 78,125 Hz.

Using the circuit that 'Jata posted, you get 256 levels, but you can use it up to
the limit of how fast you can put a byte into an output port. That particular program
has a glitch bug (caused by the jump in the loop) which can be solved by adding a
nop in the loop, and making the number of samples odd, at the expense of half
the bandwidth. Still, that should get you well into the megaHertz range.

But that is just frequency at which you can change the level. If you want to paint a
sine wave using 32 or 64 samples, you divide by that much again for either method.

The R2R homebrew DAC still needs an amplifier.

Using a sound card will get you into the 192 kHz range. The hardware that is already
in your computer should get you to 48 kHz if you don't have one of the fancy 192 kHz
cards. And the sound card can do 16 bits (65536 levels instead of 256).


-----
Get a free science project every week! "http://scitoys.com/newsletter.html"




On Fri, Jun 8, 2012 at 1:29 PM, nathan lachenmyer <scottnla@mit.edu> wrote:
What you want is going to depend a lot on your application.

Square and Sawtooth waves are easy to generate, sines are a bit harder but still not bad.  By 'arbitrary' do you mean you want to be able to sum up squares and saws and sines to form a waveform?  Would a, for example, circuit that can sum up 8 channels (so you can use a fourier series to approximate your waveform) work?  Would summing up square waves work?

Or do you literally want to be able to apply arbitrary voltages in series with smooth transitions in between?

Another important consideration: How high of frequency do you need?  Doing arbitrary waveforms (connect-the-dots style) is easy in the 1-10 kHz range; it's MUCH more difficult if you need to do it in the 100 kHz - 10+ MHz range.  Same goes with power -- low (signal-level power) is easy, high power (> 1 amp) is harder.

If you just want a general purposer arbitrary waveform generator (does sines/squares/saws/pulses/etc.) Rigol has an affordable model (Rigol DG1022) for about $400-$500 that goes up to 20 MHz.

If you're looking for something a bit more DIY-style or extensible, the Exar XR2206 is a good chip to start with.  I have never used it myself but have heard good things about it.

If you're looking for connect-the-dots style waveform control, using a microcontroller is a good way to go.  You can digitally put your "dots" together with an Arduino (you can digitalWrite() at ~200 kHz safely) or a LeafLabs Maple to go up faster (I think 10 MHz is doable).  From there on out you can use pulse amplitude modulation and filters to get a smooth analog waveform.  Pulse Width Modulation + filtering can also get you where you want to go depending on your application.

$0.02

nathan lachenmyer


On Fri, 8 Jun 2012, Raymond McCauley wrote:

I'm looking for a waveform generator, one that's not just restricted
to sine/square/sawtooth, but is able to generate a wave of arbitrary
complexity, preferably under computer control. So either a fancy
oscilloscope, or a piece of hardware that interfaces to a computer.
One that works in KHz regimes.

Do you have any ideas? A favorite catalog you could point me to?

--
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To post to this group, send email to diybio@googlegroups.com.
To unsubscribe from this group, send email to diybio+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/diybio?hl=en.



--
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To post to this group, send email to diybio@googlegroups.com.
To unsubscribe from this group, send email to diybio+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/diybio?hl=en.


--
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To post to this group, send email to diybio@googlegroups.com.
To unsubscribe from this group, send email to diybio+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/diybio?hl=en.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comments:

Post a Comment