# Adjustable frequency & amplitude function generator

#### GodsmacK

Joined Jun 18, 2016
14
Hello, I have to build a function generator with three waveforms using op amps. Well I need the bandwidth to be from ~1Hz to ~110KHz, and an amplitude of 1-10V.
BACKGROUND:
Based on the theory of derivators and integrators with op amps, I know how to transform one signal into another, so I simulated some circuits using the LM741; however, I got high distortion on 10KHz+ and a 50kHz maximum bandwidth.

My questions are: how should I build the variable frecuency generator? and which op amps should I use in order to handle such bandwidth?

I'd be glad if you can give any advice to achieve this project.

#### dl324

Joined Mar 30, 2015
15,117
Welcome to AAC!

Is this project for school?

#### Alec_t

Joined Sep 17, 2013
13,153
Have you been given any restrictions regarding power supply voltages and whether a single-polarity or dual-polarity supply should be used?
Have you read the datasheet for the 741 opamp and understood why the 741 is a bad choice for this project?
What tolerances (voltage, frequency, linearity, distortion) have been specified?
Are the three waveforms entirely your choice?

#### DickCappels

Joined Aug 21, 2008
9,320
While at it, what is the third waveform?

#### Kermit2

Joined Feb 5, 2010
4,162
If you must use a 741 then pay attention to gain. You have to sacrifice gain in the 741 to reach your target range.
You could add a transistor amp to your output to make up for the gain restrictions.

#### WBahn

Joined Mar 31, 2012
27,415
What do YOU mean (or the project specs mean) when it says you need the "bandwidth" to go up to 110 kHz? Does it really mean the waveform bandwidth or does it mean the waveform frequency? Except for a sine wave, the waveform bandwidth is considerably higher than the waveform frequency and that is especially true for a square wave.

What are the three waveforms you are planning to provide?

#### GodsmacK

Joined Jun 18, 2016
14
Have you been given any restrictions regarding power supply voltages and whether a single-polarity or dual-polarity supply should be used?
Have you read the datasheet for the 741 opamp and understood why the 741 is a bad choice for this project?
What tolerances (voltage, frequency, linearity, distortion) have been specified?
Are the three waveforms entirely your choice?
Hello, everyone!
-I need three waveforms: sine, square and triangle. Each one must have a tunable frecuency from 0Hz to 110KHz, as well as a tunable amplitude from 0V to 10V.

- I'm not restricted to use the 741. I can use any op amp. However, I must not use 555 or other ICs.

The main problem I have it's on generating the main waveform. I have been trying a lot of oscillators, but their are not amplitude-stable. What kind of oscillator should I use?. So, I can have a stable amplitude no matter which frequency I tune.

Last edited:

#### shteii01

Joined Feb 19, 2010
4,644
Thanks!. But the problem is that I need a frequency tunable waveform generator.
The obvious answer is to use 555 to generate square wave, use pot for the resistor to vary the frequency. BAM! You have square wave generator.
http://www.electronics-tutorials.ws/waveforms/555_oscillator.html

Then you take square wave and run it through op amp configured as integrator. BAM! You have triangle/sawtooth wave generator.

Somewhere you can put another op amp configured as amplifier, again use pot in the feedback to adjust the voltage gain.

#### GodsmacK

Joined Jun 18, 2016
14
Have you been given any restrictions regarding power supply voltages and whether a single-polarity or dual-polarity supply should be used?
Have you read the datasheet for the 741 opamp and understood why the 741 is a bad choice for this project?
What tolerances (voltage, frequency, linearity, distortion) have been specified?
Are the three waveforms entirely your choice?
The obvious answer is to use 555 to generate square wave, use pot for the resistor to vary the frequency. BAM! You have square wave generator.
http://www.electronics-tutorials.ws/waveforms/555_oscillator.html

Then you take square wave and run it through op amp configured as integrator. BAM! You have triangle/sawtooth wave generator.

Somewhere you can put another op amp configured as amplifier, again use pot in the feedback to adjust the voltage gain.
Well I also thought about that, but I'm not allowed to use sophisticated ICs. Only Op. Amps, transistors, resistors, coils and so...

#### shteii01

Joined Feb 19, 2010
4,644
Well I also thought about that, but I'm not allowed to use sophisticated ICs. Only Op. Amps, transistors, resistors, coils and so...
Then Hartley or Colpitts or Wien Bridge oscillator to generate sine wave.

Last edited:

#### GodsmacK

Joined Jun 18, 2016
14
Then Hartley or Colpitts oscillator to generate sine wave.[/QUOT
Then Hartley or Colpitts or Wien Bridge oscillator to generate sine wave.
I just tried all three. In fact, I get the frequencies I need, but the amplitude is very unstable.

#### shteii01

Joined Feb 19, 2010
4,644
but the amplitude is very unstable.
Either you get a nice clean sine wave or you don't. You can not have it both ways.

#### Alec_t

Joined Sep 17, 2013
13,153
What tolerances (voltage, frequency, linearity, distortion) have been specified? The sine wave is the biggest challenge. The greater the allowable distortion the easier it will be to generate to meet the requirements: but 0Hz is unrealistic!

#### MrAl

Joined Jun 17, 2014
9,549
Hi,

The old sine/square/triangle IC's used a square/triangle generator and a non linear circuit to produce a pseudo sine. I dont know if you can have some distortion in your sine or need a super clear sine. The max frequency for the old designs was about 1Mhz, for the newer design about 20MHz. The accuracy and stability was only about as good as a typical RC oscillator.

The more modern IC's use digital signal processing techniques to generate accurate and fairly clean sines. The top end on these is about 40Mhz typical, but the accuracy matches that of the base frequency crystal, and the frequency set resolution is on the order of less than 1 Hz.

#### GodsmacK

Joined Jun 18, 2016
14
What tolerances (voltage, frequency, linearity, distortion) have been specified? The sine wave is the biggest challenge. The greater the allowable distortion the easier it will be to generate to meet the requirements: but 0Hz is unrealistic!
Hello!
I wasn't given any tolerance specifications. The waveforms don't have to be perfect, but they must be as clear as posible... Also, it doesnt have to be 0Hz, <10Hz is good.
So yeah, I have a good allowable distortion.

#### AnalogKid

Joined Aug 1, 2013
10,126
I hope you are not trying to get 10 Hz to 110 kHz in a single potentiometer range. An 11,000:1 adjustment range is not practical. Also, that is too great a change in network impedance to assure oscillation. A single- or dual-gang pot with a bank of capacitors and a selector switch gets you the coverage you want.

Following the internal layout of the 8038 function generator chip, start with the triangle wave formed by an integrator and comparator in a loop. The integrator resistor and capacitor set the operating frequency. This also gives you the square wave, and both are at constant amplitude regardless of frequency. The sine converter is tricky because the rate of change of the waveform varies by 11,000:1 across all ranges. A breakpoint converter using either a bunch of diodes or some fast transistor junctions can get the distortion below 5%. TI and LT have app notes on sine conversion circuits. Note that all output amplitude adjustments come after the conversion circuits, so the breakpoints always are at fixed voltages in the waveform amplitude.

ak

Last edited:

#### AnalogKid

Joined Aug 1, 2013
10,126
This circuit will not work. There is no feedback from the triangle wave converter (integrator) back to the square wave oscillator. Circuit tolerances and opamp errors cause the integrator to drift over time, saturating its output. Also, the output amplitudes are incorrect.

ak

Last edited:

#### GodsmacK

Joined Jun 18, 2016
14
Hello, guys...

I have achieved to get two of the waveforms(square and triangle) I need, amplitude stable over frequency. However, when I integrate the triangle to get the sine, this sine changes its amplitude as I change the frequency. How could I fix this?
I have attached the design. Hope you can help me out...