Maker Pro
Maker Pro

DIY FunctionGenerator

dssteven

May 9, 2012
47
Joined
May 9, 2012
Messages
47
Hey everyone!

Been a while since my last post but I need some help again. I'm in an upper level electronics course and we're tasked with designing a function generator. I'm not looking exactly for circuit diagrams or anything of the sort but I'm wondering where to start. The function generator criteria is as follows:

  • Frequency Range 100Hz to 1kHz
  • Voltage Amplitude of 0.5V to 10V
  • Sine, Triangle and Square Wave
  • A DC offset must be able to be added

Also, this has to be done using only Op-amps, Capacitors and Resistors. Variable Caps/Resistors work too. Here is what I know:

For the voltage amplitude, i just need to run the output through a simple filter with a voltage divider in parallel with two Zener Diodes. I can handle that part no problem.

I've designed a Schmitt trigger Oscillator to which I can make a square wave with varying frequency and Amplitude (hooray!) but I can't seem to get the Triangle wave to output correctly (using an integrator on the output of the square wave). I also can't figure out a way to make a sine wave out of this setup. Regardless of my schematic, i'm pretty sure i'm going about this the wrong way.

Would it be better to start with a sine wave generator? and if so, how do I do this? I've looked a lot on the internet but can't find much. We've not yet discussed a sine wave generator or even a Schmitt trigger in our lectures yet but I have no problem learning them on my own. Please help me in some suggestions as to where I should begin with this.

Many thanks!

Dan
 

dssteven

May 9, 2012
47
Joined
May 9, 2012
Messages
47
We can't use any ICs... but I realized I can make a sine wave by running the triangle wave through another integrator since it acts as a LPF... what I'm running into now is trying to get the triangle wave to output with the same amplitude as the output of the first op amp stage. So this is what I've got for math...

attachment.php


Now, using these parameters... this is what I have on Multisim:

attachment.php

Please let me know if my math is horribly wrong or if there is something i'm not understanding. This is how we were taught in class as I remember it so this is how I solved. Also, notice the amplitudes on the o-scope are not actually the same, the green is much much smaller...


Thanks!!

EDIT: Apparently my images weren't showing. Hope this solves it! Thanks Harald.
And more clarification: R7 is Rf and R5 is Ri in the math.
Dan
 

Attachments

  • Capture2.JPG
    Capture2.JPG
    15.7 KB · Views: 241
  • Capture.JPG
    Capture.JPG
    124.2 KB · Views: 216
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,752
Joined
Nov 17, 2011
Messages
13,752
The simplest way to adjust the amplitude:
- to lower the amplitude use a resistive divider.
- to increase the amplitude use an amplifier (simple non-inverting OpAmp stage)
Or combine both using an adjustable divider (potentiometer) and a fixed gain OpAmp (e.g. *10).
Thus you can adjust the overall gain from 0 (pot at min) to 10 (pot at max).

Harald

Harald
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,752
Joined
Nov 17, 2011
Messages
13,752
I can make a sine wave by running the triangle wave through another integrator since it acts as a LPF

Not right. Look at the rising edge of the triangle. It can be described by y=a*t where a is a constant describing the slope and t is time. Integrating this gives
int(y) = a/2*t²2 This is far from a sine, it has a concave shape whereas a sine would have a convex shape.

You can convert a triangular waveform into a sine by using a real low pass filter. If designed correctly, this will eliminat the harmonics and leave the fundamental (sine). Your low passs filter will have to track the input frequency since a filter designed for 100 Hz will not let pass 1kHz and a filter designed for 1kHz will not remove the harmonics from a 100 Hz signal sufficiently.

You may want to read up this discussion on the same topic, including a schematic.

Harald
 

dssteven

May 9, 2012
47
Joined
May 9, 2012
Messages
47
Thanks Harald. I ended up reading that discussion, some good stuff. I got everything to work except adding the +/- 5V DC offset. Any ideas on how to do this?

Thanks!
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,752
Joined
Nov 17, 2011
Messages
13,752
Use an operational amplifier in an adder configuration.

Harald
 
Top