# Obtaining frequency of 550 Hz from Simple Triangle and Square Waveform Generator Circuit

First time asking a question so sorry if I miss some things. I'll try to be thorough and straightforward.

I'm trying to design a square wave from a triangle wave-square wave generator circuit. The output wave should be running at 550 Hz with a 2 Vpk-pk, and an offset of 1 V, which is why I added a diode network at the output of the second op-amp.

The thing is originally I was having trouble getting the right frequency of the signal. I solved for R1 using the following relationships, setting C1 to 0.1uF:

$$t = R1C1 = \frac{1}{f}$$

Which gave me:

$$R1 = 18.18 k\Omega$$

Also, finding the time using frequency gives me:

$$\tau = 1.82ms$$ My problem is I'm not too sure how R2 and R3 affect the frequency. Basically, I 've been switching out resistor values and found changing R2 affects the frequency the most. 3.42 k, gives me the right tau, but I'm not sure why though. I know that the second op amp acts as a comparator, right? So I'm guessing the voltage between R3 and R2 is the threshold. But I'm still a little lost on how that relates to the frequency of the signal.

• You may find it more useful to take Waveform A from the output of the 2nd op amp, rather than the point you have chosen. – WhatRoughBeast Nov 14 '20 at 20:44

## 1 Answer

I know that the second op amp acts as a comparator, right? So I'm guessing the voltage between R3 and R2 is the threshold. But I'm still a little lost on how that relates to the frequency of the signal.

The right hand LM324 is acting as a comparator with hysteresis and the level of that hysteresis is determined by the resistors R2 and R3. This means that when the op-amp changes state on the triangle waveform voltage hitting the upper hysteresis limit, the new level is made significantly smaller so that the triangle wave has to drop down so far before the op-amp (aka comparator) switches again.

This all means that R2 and R3 do affect the oscillation frequency - more hysteresis means a lower frequency and more hysteresis is caused by R3 lowering in value or R2 rising in value. Both affect the hysteresis and hence the frequency of oscillation.

Look at this diagram to see what I mean regards the op-amp having an upper and a lower threshold: - Note that the output (the square wave changes when the input crosses a threshold.