Hello everyone,
I'm currently having some trouble over a lab practice in which I was required to build an op-amp based function generator. The primary requirement is to generate square and triangle waves (varying their frequencies through potentiometers) using LM-741 IC's. Initially, our professor provided schematics for a function generator with stable frequency output, but once we tried implementing the circuit, the output voltage was not promising. I then decided to try and design my own circuit, I'm sharing it in the schematics below.

The first sub-circuit works as an astable multivibrator designed using a hysteresis comparator and the charge voltage of a capacitor (C1). The next chunk is supposed to generate the triangle wave by integrating the oscillator output, although as the square wave frequency raises, the integrator gain lowers. To compensate for this gain loss, I had to add a third op-amp acting as a small-signal inverter amplifier. Please note that the input resistor for this third circuit (R7) is half of a double potentiometer, whereas the other end of this component (R3) must be used to change the frequency of the square wave generator (changing the C1 capacitor's charge and discharge time).
Anyways, the circuit works just fine, but the problem is the frequency variance does not add up to my initial design's math, and I can't figure out why. According to my calculations, as R3 varies I should be able to generate square and triangle waves with frequencies from 226Hz up to 41KHz, but in reality the output frequency varies only between 300Hz and 900Hz. This remains true even in Multisim simulations. I've read that LM-741's have an internal 30pF capacitor that lowers this op-amp gain as frequency goes higher so could that be the issue? Also, when implementing the real circuit I noticed an undesired DC offset in the triangle wave. Can someone help me figure out how to fix those issues?
I'm currently having some trouble over a lab practice in which I was required to build an op-amp based function generator. The primary requirement is to generate square and triangle waves (varying their frequencies through potentiometers) using LM-741 IC's. Initially, our professor provided schematics for a function generator with stable frequency output, but once we tried implementing the circuit, the output voltage was not promising. I then decided to try and design my own circuit, I'm sharing it in the schematics below.

The first sub-circuit works as an astable multivibrator designed using a hysteresis comparator and the charge voltage of a capacitor (C1). The next chunk is supposed to generate the triangle wave by integrating the oscillator output, although as the square wave frequency raises, the integrator gain lowers. To compensate for this gain loss, I had to add a third op-amp acting as a small-signal inverter amplifier. Please note that the input resistor for this third circuit (R7) is half of a double potentiometer, whereas the other end of this component (R3) must be used to change the frequency of the square wave generator (changing the C1 capacitor's charge and discharge time).
Anyways, the circuit works just fine, but the problem is the frequency variance does not add up to my initial design's math, and I can't figure out why. According to my calculations, as R3 varies I should be able to generate square and triangle waves with frequencies from 226Hz up to 41KHz, but in reality the output frequency varies only between 300Hz and 900Hz. This remains true even in Multisim simulations. I've read that LM-741's have an internal 30pF capacitor that lowers this op-amp gain as frequency goes higher so could that be the issue? Also, when implementing the real circuit I noticed an undesired DC offset in the triangle wave. Can someone help me figure out how to fix those issues?