Function Generator Design

Thread Starter

bgm298

Joined Oct 18, 2024
22
Hello,
I am supposed to design a function generator using a schmitt trigger for square, integrator for triangle and breakpoint method for sine wave. I have achieved this to some extent however I cannot get the right amplitude or frequency values out of my circuit in LTspice.
The frequency should be adjustable from 0.5kHz to 10kHz and I planned to have that by changing the resistor in series with the integrator. However, when I change this resistor's value the triangle's amplitude also changes. The triangle waveform should have 5V amplitude and only depend on the threshold of the schmitt trigger as far as I have seen from Sedra Smith's book.
I also have trouble changing the sine wave's amplitude. I do not understand how to decide the resistors' values in the diode circuit.
If anyone could help and maybe even recommend some sources I could learn from I would be very grateful as our prof has left us to study the topic on our own.
 

Attachments

Thread Starter

bgm298

Joined Oct 18, 2024
22
I have tried that but unfortunately the changes in the capacitance or the resistance also change the amplitude of the triangle waveform which is not something i want. What could I do to prevent that? I tried adding a limitier circuit with two diodes at the output of the integrator but that led to clippings at some frequencies.
 

ericgibbs

Joined Jan 29, 2010
21,391
hi bgm,
As this is Homework I cannot give a final answer, but study this circuit option for the Sine.

Work out your own values and post your asc file.
E
EG57_ 2844.gif
 

Thread Starter

bgm298

Joined Oct 18, 2024
22
That's because the 'square wave' isn't square. Its sides are nowhere near vertical because the op-amps used are too slow.
Unfortunately I have to use these op-amps in the lab. Is there any other way I could improve them?
 

Ian0

Joined Aug 7, 2020
13,097
@ericgibbs has given you the clue about the triangle wave amplitude in his circuit. That's much more useful to know that his method of generating a sinewave, although it works for a fixed frequency.
 

Thread Starter

bgm298

Joined Oct 18, 2024
22
hi bgm,
As this is Homework I cannot give a final answer, but study this circuit option for the Sine.

Work out your own values and post your asc file.
E
View attachment 347848
I have figured out that I can use an amplifier to amplify the triangular waveform before feeding it into the breakpoint circuit to get the right sine amplitudes.

However I do not understand how this circuit is supposed to help me.

I can see that there is no limiter in this one but i need the limiter to maintain a sqr wave of 5V. Also, as i have stated in the original ask I am only supposed to use the diode circuit for the sine wave generation. Though it was nice seeing this version too thank you @ericgibbs. This works better than the breakpoint method
 

ericgibbs

Joined Jan 29, 2010
21,391
hi bgm,
Use this debug method for your Sine converter input/output,
E

Note R13 is NOT connected in your original asc circuit???

EG57_ 2845.gif
 

Thread Starter

bgm298

Joined Oct 18, 2024
22
I have also debugged the other stages on their own by supplying pulse waveforms. Then I looked at just the 2 stages together and found that when I dont use the limitter of 2 Zener diodes I obtain a stable 5 V with the resistors in the Schmitt trigger set to 5k and 14k as I found the saturation voltage as 14V.
Now that I found that the limitter is the problem how can I solve this? What could this stem from as in Sedra Smith's book it states that the triangle wave's amplitude is only dependent on threshold voltages of the Schmitt trigger? I have attached the file where I controlled the Schmitt trigger and integrator together.
 

Attachments

Alec_t

Joined Sep 17, 2013
15,103
in Sedra Smith's book it states that the triangle wave's amplitude is only dependent on threshold voltages of the Schmitt trigger
That is only true if the square wave is truly square, i.e. has just two voltage levels. Using the 741 (or other slow op-amp) gives a trapezoidal waveform, not a true square wave.
 

Thread Starter

bgm298

Joined Oct 18, 2024
22
That is only true if the square wave is truly square, i.e. has just two voltage levels. Using the 741 (or other slow op-amp) gives a trapezoidal waveform, not a true square wave.
I asked a TA of the course and he said that it should be working with the LM741. He did also say my technique was correct, the circuit should be working and to just keep trying values so now I am very confused.
 

WBahn

Joined Mar 31, 2012
32,704
I asked a TA of the course and he said that it should be working with the LM741. He did also say my technique was correct, the circuit should be working and to just keep trying values so now I am very confused.
As others have said repeatedly, you are using a very old and slow opamp. Let's look at the numbers from the datasheet.

1745635098379.png

You are trying to generate a squarewave that goes from -15 V to +15, though you aren't going to come very close to those limits because you are driving a 1 kΩ load (actually, somewhat less than that):

1745635317304.png

So, you can probably expect something more like ±12 V, so let's just go with that.

For a 10 kΩ output, what is the total time for one period of the waveform?

With a slew rate of 0.5 V/µs, how long will it take the output to swing from -12 V to +12 V?

What fraction of each period is spent transitioning between levels?

Now let's turn this around. If you want a 10 kHz square wave in which the edges constitute no more than 5% of the time for a ±15 V output, what is the minimum slew rate that would be considered acceptable?

EDIT: Typo corrected.
 
Last edited:

ericgibbs

Joined Jan 29, 2010
21,391
hi bgm,
An example showing it can create an acceptable Sine wave.
I have left some component values visible, in order to give you a starting point and deleted the remainder, which you will have to work out.;)

E
EG57_ 2846.gif
 

tonyStewart

Joined May 8, 2012
231
Eric shows the valid R-CR ladder non-linear compression circuit which converts triangle to sin.

Another method used was the quadratic Vbe vs Ic with negative feedback to reduce peak gain with Vbe using a small Vpp input tuned to the current mirror level.

I added a Pot to change f 200:1 and 3 caps every 2 decades to span ~1 Hz to 1MHz fixed +/-5V using matched NPN's and R2R in/out OA's

1746395701322.png
 
Top