Author Topic: Make It Better Sine Wave Generator  (Read 793 times)

0 Members and 1 Guest are viewing this topic.

Offline MajorassburnTopic starter

  • Regular Contributor
  • *
  • Posts: 93
  • Country: us
Make It Better Sine Wave Generator
« on: March 15, 2024, 08:54:06 pm »
Attached is a schematic of a 100Hz sine wave generator. Can you suggest ways to make it better?
Must Haves:
1)  0-6VACrms out into 1Meg resistive load.
2)  +/- 12VDC Regulated Power Supply input.
3)  Minimum component count with low-cost off-the-shelf components.
No need for temperature compensation or amplitude stabilization, AGC, etc.
Simply a hobby-grade sine wave generator.

The obsolete but still available 4047 chip is preferred because of its precise square wave generation which will also feed another device, not part of this schematic.

All resistors are 1% metal film, values are hypothetical and up for grabs/suggestions.

Thanks for looking!  :)

« Last Edit: March 15, 2024, 10:15:58 pm by Majorassburn »
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3176
  • Country: es
Re: Make It Better Sine Wave Generator
« Reply #1 on: March 15, 2024, 09:18:54 pm »
I would not call that a "phase shift oscillator". It is a 4047 astable generating a square wave and then a filter to remove the higher frequencies. There is no phase shift feedback.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 
The following users thanked this post: Someone

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 9507
  • Country: gb
Re: Make It Better Sine Wave Generator
« Reply #2 on: March 15, 2024, 09:26:38 pm »
I don't know how much distortion will make it through your filter network, but using an LM358 isn't going to do you any favors.
Best Regards, Chris
 

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 1884
  • Country: us
Re: Make It Better Sine Wave Generator
« Reply #3 on: March 15, 2024, 10:25:44 pm »
There are much better low-pass filter designs, but even using that string of RC sections you aren't getting much filtering.  This is because each 10K resistor loads the previous stage and causes the ultimate rolloff to be much less steep than you probably are assuming.
One simple change is to have the first series resistor be 100 Ohm, followed by a 1K, 10K, 100K resistor, with the capacitor values adjusted appropriately. You don't need that resistor currently connected to the opamp input.
You can do still better with an active-filter design, using (more or less) the same number of Rs and Cs,
As mentioned, the LM358 has significant crossover distortion, but this can be eliminated or at least reduced by putting a load resistor from output to the negative power pin.  This turns it into a class-A amp.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline Ground_Loop

  • Frequent Contributor
  • **
  • Posts: 645
  • Country: us
Re: Make It Better Sine Wave Generator
« Reply #4 on: March 15, 2024, 10:31:13 pm »
This would probably work better and be MUCH simpler.
There's no point getting old if you don't have stories.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1549
  • Country: au
Re: Make It Better Sine Wave Generator
« Reply #5 on: March 15, 2024, 10:33:14 pm »
Attached is a schematic of a 100Hz sine wave phase shift oscillator. Can you suggest ways to make it better?

These are a phase shift oscillators


https://resources.system-analysis.cadence.com/blog/msa2020-rc-phase-shift-oscillator-design-for-sine-wave-generation
You have drawn a low pass filter.

Addit: The Wein bridge oscillator is also a phase shift oscillator, it uses lead/lag cancellation and can use a lower gain than the 3 stage ones above.
No need for temperature compensation or amplitude stabilization, AGC, etc.
All Analog Oscillators need some form of amplitude control, but there are trade off solutions simpler than full analog AGC.
Diodes or LEDs to change the slope gain give 'soft clipping' and easier filtering.   

If you want precise 100Hz, and available, you could look at HC4060 / 74AHC1G42xx parts, with a crystal or ceramic resonator.

Do you want to vary the frequency ?

This paper gives a low cost counter and resistor DAC for sine generation  The Davies Sinusoidal Generator
https://www.ti.com/lit/pdf/sboa550
frequency is CLK/16 and harmonics below the clock can be quite low.

Or, you can go to DDS chips, if you want very wide dynamic range, tho those need more Sw support.

Can you suggest ways to make it better?

If you want just 100Hz, you can make the first opamp an integrator, and tune it for symmetric slight clipping, to give a flat tops triangle wave.
That is much closer to a sine that a raw square wave, so the following filter has a lot less work to do, and a better sine results.

« Last Edit: March 15, 2024, 10:47:25 pm by PCB.Wiz »
 
The following users thanked this post: spostma

Offline MajorassburnTopic starter

  • Regular Contributor
  • *
  • Posts: 93
  • Country: us
Re: Make It Better Sine Wave Generator
« Reply #6 on: March 16, 2024, 12:24:00 am »
What a GREAT forum. The suggestions here are priceless. THANK YOU.

Here's a revision to the original....
Fixed 100Hz is fine. Cap at 4047 output is needed for level shift.
I just realized that I can delete filters and create a second integrator to shape the triangle into a sine wave. What do you think about that vs. the filters?
If anyone can simulate circuits and insert RC values, much appreciated.
Comments & suggestions?  Thanks in advance.
« Last Edit: March 16, 2024, 12:44:17 am by Majorassburn »
 

Online themadhippy

  • Super Contributor
  • ***
  • Posts: 2583
  • Country: gb
Re: Make It Better Sine Wave Generator
« Reply #7 on: March 16, 2024, 01:32:15 am »
Quote
If anyone can simulate circuits and insert RC values,
wot something like this https://tinyurl.com/2ddf3sfh
« Last Edit: March 16, 2024, 01:35:11 am by themadhippy »
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1549
  • Country: au
Re: Make It Better Sine Wave Generator
« Reply #8 on: March 16, 2024, 05:36:14 am »
I just realized that I can delete filters and create a second integrator to shape the triangle into a sine wave. What do you think about that vs. the filters?
The first integrator from square to clamped triangle, buys you a lot as it acts as both a LPF and a shaper, which makes the filters job easier.
Another integrator is a bit wasted as you are better to use that opamp as a peaked filter (as below)

Some spice runs found ( as expected) that there is an ideal clamping width for the triangle to then give best sine from a filter. About 16.29% each flat / period.
330k, 4n7 => -69.555dB
355k.4n7  => -79.074dB  (flat = 1.655ms)
357.5k,4n7 => -79.233dB (flat = 1.629ms)
360k, 4n7 => -77.045dB
365k,4n7 => -74.616dB  (flat = 1.566ms)
390K,4n7 => -66.557dB  (flat = 1.325ms)
410k,4.7n => -63.445dB (flat = 1.145ms)


Because you want a single frequency, you can also make the LPF a little bit peaky, the circuit below has a gain of 22x peaked at 100Hz

See circuit and clipped triangle and the sine resulting. -79dB is close to 0.01%
Caps are all chosen to be the same value, and should be low loss, precision, high stability. 1%, NPO, 30ppm for example.
A crusty LM324 will not clip symmetrically, so you may need a better rail-rail output opamp.
The clipping rails should be clean, as they become part of the signal.
« Last Edit: March 17, 2024, 06:04:53 pm by PCB.Wiz »
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9021
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Make It Better Sine Wave Generator
« Reply #9 on: March 16, 2024, 02:39:46 pm »
Microcontroller programmed to operate as a DDS with output using PWM or internal DAC, filter that and amplify with an opamp.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Online Terry Bites

  • Super Contributor
  • ***
  • Posts: 2393
  • Country: gb
  • Recovering Electrical Engineer
Re: Make It Better Sine Wave Generator
« Reply #10 on: March 16, 2024, 03:23:54 pm »
I smell ancient fusty elektor.
There are far better ways of generating a sine wave but you could improve your circuit.
A single supply version can be made. That's often convenient.
The same number of opamps can be turned into a very effective filter with gain.
Try https://tools.analog.com/en/filterwizard/
 

Offline dobsonr741

  • Frequent Contributor
  • **
  • Posts: 674
  • Country: us
Re: Make It Better Sine Wave Generator
« Reply #11 on: March 16, 2024, 04:44:59 pm »
This is possibly the simplest wien bridge oscillator, with at least a little bit of amplitude control. Without the diodes the startup will be spotty, or goes into distorted sine. Raise your rails from +/- 2.5V to +/- 12V.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf