I would like to generate a 30 kHz & 60 kHz sawtooth waveform using an LM358P operational amplifier per the following schematic.
Theoretically, and in the simulation, the circuit should work perfectly, generating a ~30 kHz or ~60 kHz signal depending on the switch position. In reality, the signal is distorted and varies between 6 & 8 kHz respectively.
Resistors/capacitor values were calculated based on the equations from the LM741 lab exercise which I am linking below.
What can be causing the issue?
Falstad Simulation: Link
LM358P Datasheet: Link
Lab Details: Link
Calculations
I haven't taken the slew rate of a device into the account initially, but here are my calculations for the 30 & 60 kHZ sawtooth generator.
1. Biasing
Generator is driven from a single 24V power supply, virtual ground is derived from the voltage divider - two 1k resistors in parallel with 220nF capacitors, and saturation voltage is chosen to be 1V & 23V respectively.
Note: Saturation voltage was chosen without consulting the datasheet, so that was the first mistake.
2. Amplitude
Chosen amplitude of a signal was 22V, so the following resistors were chosen.
3. Duty Cycle
As I wanted to generate a sawtooth wave, chosen duty cycle was 10%.
4. Frequency
To keep resistor values small, 10nF capacitor was chosen for the integrator, and for the 30kHz frequency resistor was calculated with the equation from the attached lab.
Note: The frequency had to be appropriately increased to take into the account selected duty cycle.
4. Slew Rate
The slew rate of the LM358 is only 0.3 V/μ - which I didn't take into the account. For the 30 kHZ triangle wave generator minimum required slew rate is 4.14 V/μ, and for the 30kHZ sawtooth wave generator 6.9 V/μ.













