Accurate sine wave in terms of amplitude - Page 1
Forum section: electronics / projects

author: sw_guy
author_rank: Regular Contributor
timestamp: April 28, 2024, 08:05:26 am
content: I am iterating options to generate accurate sine wave in terms of amplitude. Absolute frequency is not critical in this application.There are few options and the first in my mind was AGC controlled wien oscillator. The main factor is temperature. Since the AGC is based on diodes, the "accuracy" of the circuit below is not even on the right map.Another option is to use AD9833 (or equivalent) waveform generator chip. There might be better options in terms of amplitude accuracy, but the chip in question looks like be able to keep amplitude within 0.3% between 25 and 50C.In practice, generating square wave accurately (still talking about amplitude) might be the easiest. Then it is matter of filtering to get sine wave. (and this time taken into consideration temperature impact to resistors and capacitors).The target is to have 0.1% accuracy. To get there I am expecting to have stable enough generator + calibration.sw guy

author: moffy
author_rank: Super Contributor
timestamp: April 28, 2024, 08:17:36 am
content: In the application note:https://www.analog.com/media/en/technical-documentation/application-notes/an43f.pdffrom page 30 onwards a number of precision Wein Bridge cicuits are suggested with temperature compensated amplitude, they use a pair of matched diodes or two diodes in close contact.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: April 28, 2024, 09:38:51 am
content: What is the target distortion ?If you only need a fixed frequency, a filtered square wave will be simplest.

author: sw_guy
author_rank: Regular Contributor
timestamp: April 28, 2024, 11:19:16 am
content: >What is the target distortion ?I do not know yet.One option is that: do not care. I can measure what the amplitude is and then do the math one way or another.

author: xvr
author_rank: Frequent Contributor
timestamp: April 28, 2024, 02:00:29 pm
content: > One option is that: do not care.Than use square waves. They can be considered as sinus with a lot of distortion.

author: Alex Nikitin
author_rank: Super Contributor
timestamp: April 28, 2024, 02:38:18 pm
content: Have a look at how it is done in the Fluke 510A AC Reference circuit, it compares the amplitude to the level of a DC reference (easily set with a good DC voltmeter) and provides a ppm-level of amplitude accuracy and stability on AC.CheersAlex

author: mawyatt
author_rank: Super Contributor
timestamp: April 28, 2024, 02:40:53 pm
content: Generating a precise & stable amplitude (and frequency) square-wave isn't difficult, see below.https://www.eevblog.com/forum/testgear/ac-rms-dmm-tests/However extracting a precise & stable sine-wave from this square-wave may be more difficult than expected.Since a waveform's rms value is the sum of all the individual components that make up the waveform, extracting the fundamental from a squarewave requires removing all the harmonics to a level sufficient to guarantee the "precision" of the leftover sinusoidal like waveform relative to a pure sine-wave.Removing these harmonics entails utilizing a Low Pass filter, which must attenuate the harmonics to sufficient levels to meet the desired precision and stability of the desired resultant waveform but not attenuate the fundamental to effect the desired result.This may become a tall task if one seeks a high level of precision, and even more so if one demands temperature and time stability. Sure one can "calibrate" the LPF and squarewave but then the circuitry must maintain an acceptable level of temp and time stability after calibration. As shown in the link above, creating a precise low frequency squarewave that is stable in frequency and amplitude over temp and time isn't difficult, converting to an acceptable precision sinusoidal waveform may be another story!!Best,

author: sw_guy
author_rank: Regular Contributor
timestamp: April 28, 2024, 03:29:54 pm
content: Quote from: mawyatt on April 28, 2024, 02:40:53 pmFully agree and I am aware of that. Since the frequency is fixed as well as the amplitude, that might be doable well enough. I have to do some testing and thank you for everyone about ideas and considerations.What could be a proved single opamp for a wien oscillator?

author: tggzzz
author_rank: Super Contributor
timestamp: April 28, 2024, 03:51:46 pm
content: Quote from: sw_guy on April 28, 2024, 03:29:54 pmAnything with sufficient frequency response, and output voltage swing, and drive capability.Since youstill haven't bothered to tell usthose parameters, how do you expect us to help you?In addition, ponder thesecond paragraph here.

author: sw_guy
author_rank: Regular Contributor
timestamp: April 28, 2024, 04:25:16 pm
content: I have never understood replies like tggzzz. Nothing valuable to say, full of negative load. Waiting for missing parameters. Oh well...Suggested reply for the next time:"It depends on the frequency response, output voltage and drive capability. Please give us more detailed specifications in order to give exact opamp examples. However, in general, I can say that typical opamps used for low-frequency applications, which are the common use cases for wien oscillators, are for example LT1632, LT1013, LT1001".or.... just ignore the question.br,sw guy

author: tggzzz
author_rank: Super Contributor
timestamp: April 28, 2024, 05:31:32 pm
content: Quote from: sw_guy on April 28, 2024, 04:25:16 pmBizarre response. Why spend time and energyavoidinggiving the informationnecessarybefore people can help you!Do you actuallywantto be helped?

author: TimFox
author_rank: Super Contributor
timestamp: April 28, 2024, 06:12:45 pm
content: Depending on your (apparently secret) requirements, another approach for stabilizing amplitude is to use a “quadrature oscillator”, with a sample-hold triggered by the zero-crossing of the “cosine” output to sample the peak magnitude of the “sine” output.This was used by Krohn-Hite in some of their older generators (I believe).More recent units, including the 4402 ultra-low distortion generator, used a fancy peak-to-peak detector.

author: IanB
author_rank: Super Contributor
timestamp: April 28, 2024, 06:51:38 pm
content: Quote from: sw_guy on April 28, 2024, 04:25:16 pmBut you didn't say anything about what frequency you are interested in, at all. It could be 1 Hz, 10 Hz, 100 Hz, 1 kHz, 10 kHz, 100 kHz, 1 MHz, 10 MHz, ...You see the problem? Apparently that is still a secret.Also you did not say what amplitude you might be interested in? 1 mV, 10 mV, 100 mV, 1 V, ... ?And the drive current also matters. An oscillator might perform perfectly until you put a load on it, and then it might stop working.Do you have any spec for THD?

author: sw_guy
author_rank: Regular Contributor
timestamp: April 28, 2024, 08:08:28 pm
content: >Depending on your (apparently secret) requirements...Or I simply don't know yet. Pretty much all the requirements (=the rest of the circuit) depend on what kind of signal I can generate. The frequency can be between 1-10kHz. Amplitude can be between 200mV and 5V. I don't know how much THD (or any other parameter) affects to the device. I need to finish the design, build the device and test. And then probably, re-design the circuit, build another device and test again. Maybe at this point I actually know all the key parameters, including if THD matters or not.But I do know today that I am iterating options how to generate sine wave - as clarified in the initial message including an example circuit.Quadrature oscillator might be "the fresh idea I was looking for". Just that none of the first examples I tried to simulate on LTspice didn't work. Like this one:Probably a simulation related issue - I need to analyze it further...sw guy

author: PCB.Wiz
author_rank: Super Contributor
timestamp: April 28, 2024, 08:25:42 pm
content: Quote from: sw_guy on April 28, 2024, 11:19:16 amIt seems there is a lot you do not know. The frequency and amplitude are important info, even ballparks ?What is the intended purpose of this signal, you must know at least that ?eg is it to calibrate meters ?Quote from: sw_guy on April 28, 2024, 11:19:16 amThen you need a precision rectifier. Also non trivial, but easier at low frequencies.You can assist the LPF design, by using a shaped stepped sine generated digitally, using simple CMOS counters/gates and resistors.Or a small MCU with a DAC, can do most of the work, at lower frequencies. This is why the parameters matter.

author: IanB
author_rank: Super Contributor
timestamp: April 28, 2024, 08:55:54 pm
content: Quote from: sw_guy on April 28, 2024, 08:08:28 pmAh. Seems familiar. Do you develop software by any chance?

author: PCB.Wiz
author_rank: Super Contributor
timestamp: April 28, 2024, 09:03:35 pm
content: Quote from: sw_guy on April 28, 2024, 08:08:28 pmDo you need to adjust this generator across 1-10kHz and 200mV-5V ?QuoteThen you are probably best to get a simple, low cost MCU based DDS function generator module from AliExpress, that can easily and quickly cover your range while you determine what you really do need.One example :https://www.aliexpress.us/item/1005005520278651.html

author: tggzzz
author_rank: Super Contributor
timestamp: April 28, 2024, 09:43:21 pm
content: Quote from: sw_guy on April 28, 2024, 08:08:28 pmNow why couldn't you have simply said that earlier? A lot of time would have been saved.Your first task is system modelling, to calculate what should work.Your second task is system design and simulation, to determine allowable tolerances.Your third task is detailed design, simulation, to verify you can implement the system.Your fourth task is to build and test.You are asking us about task 3, without having done tasks 1 and 2. That is bound to fail, slowly and messily.You are doing the equivalent of jumping straight into coding, without having requirements nor architecture. See the problem?Once you have a successfulsystemsimulation, e.g. using a spice sine wave voltage source, you can build a lab prototype using an off the shelf function generator. Only after the lab prototype is.working does it become worth considering implementing your own generator.

author: Majorassburn
author_rank: Regular Contributor
timestamp: April 28, 2024, 11:17:46 pm
content: Quote from: tggzzz on April 28, 2024, 03:51:46 pmMore thread-choking negativity and useless crap from tggzzz.He's a real thread-killer if I ever saw one!Your question about op amps? I use T.I. OP07's with excellent results in my low frequency sine wave oscillators.Data Sheet link:https://www.ti.com/lit/ds/symlink/op07c.pdf?ts=1714331934514&ref_url=https%253A%252F%252Fwww.google.com%252FAlso, check out the numerous TI App Notes for oscillator designs with sample circuitry you might use as starting points. Best Regards.

author: tggzzz
author_rank: Super Contributor
timestamp: April 29, 2024, 12:22:12 am
content: Quote from: Majorassburn on April 28, 2024, 11:17:46 pmThe context is these threads from MajorAssBurn:https://www.eevblog.com/forum/buysellwanted/fs-affordable-dmm-checkers-ac-reference-dc-reference-ohms-reference-etc/msg5463700/#msg5463700https://www.eevblog.com/forum/metrology/affordable-useful-ac-dc-references/msg5438690/#msg5438690Anybody with too much time on their hands can read those. They will, no doubt, notice thatmany peoplehave made negative comments about MajorAssBurn's claims in those threads.BTW, it isn't good practice to read the first couple of posts in a thread and then jump to conclusions without reading the rest of the thread.

author: David Hess
author_rank: Super Contributor
timestamp: April 29, 2024, 12:29:34 am
content: Quote from: moffy on April 28, 2024, 08:17:36 amThat is how a sine source is leveled. Detection can be done in many ways including a temperature compensated diode rectifier, RMS detector, or at lower frequencies even a precision rectifier. I am sure I have seen a design where a sampler was used to synchronously detect the peak of the sine wave.

author: moffy
author_rank: Super Contributor
timestamp: April 29, 2024, 12:47:10 am
content: Quote from: David Hess on April 29, 2024, 12:29:34 amDid that previously when our lab had to add a noise source to the dither signal of laser gyro, did a cycle by cycle comparison, a bit more complex but low ripple and delay.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: April 29, 2024, 01:01:49 am
content: Quote from: sw_guy on April 28, 2024, 08:08:28 pmWhilst that circuit has two waveform at 90', it also has 3 RC elements, so it is less suited to a knob controlled oscillator.When simulating such oscillators, you need to adjust the idealized gain, to account for real opamp effects.You then find a trade off between oscillator startup time and clipping of one node when stable.

author: Majorassburn
author_rank: Regular Contributor
timestamp: April 29, 2024, 02:05:21 pm
content: Quote from: tggzzz on April 29, 2024, 12:22:12 amI have this mental image of tggzzz sitting in his week-old undies and moth-eaten robe, in the corner of his tiny, gloomy, cold-water flat, in a poverty-stricken slum section of Birmingham, pecking away at his twenty-year-old Pentium computer while desperately searching forums and threads for topics wherein he can spew out his unwelcome drivel and negativity and display his legendary (in his own mind) philosophical and technical superiority as compared to the woefully ignorant and uninformed commoners who participate in these threads looking for useful suggestions from fellow members, as he, the self-ordained master of thread imposition, reflects within himself how utterly failed as a human being he is, as he seeks out these thread-killing opportunities so as to feel somewhat compensated for his lifelong worthlessness and complete failure to achieve anything noteworthy or meaningful.Now, with those facts in mind, I will ignore all further written diarrhea that tggzzz dumps in various discussions from now on.

author: tggzzz
author_rank: Super Contributor
timestamp: April 29, 2024, 02:36:37 pm
content: Quote from: Majorassburn on April 29, 2024, 02:05:21 pmThat's an excellent response focussed on the technical aspects of the threads. Good to see you've avoided ad-hominem attacks.Hint: to ignore me, simply add my moniker to your Profile->Modify Profile->Buddies/Ignore list.

author: Terry Bites
author_rank: Super Contributor
timestamp: April 29, 2024, 03:39:24 pm
content: That DDS chip has an output stabilty quoted as "200 ppm/°C" not great, but then DDS is aimed at RF where no one cares much about precise amplitudes.Brew up your own DDS, you don't need all that parameter register nonsense or a micro doodad to control it.Back in the day, before low cost microcontroller platforms had been dreamt of, I made a sine source for an LVDT sensor using a lookup table on a M27C1024 eprom (still to be found on ebay and in my 90's junk box). I used a TCXO and some counters to create the address lines, 74LS590s but dont quote me on that. Driving an AD669 bolted to a REF01 10v reference. A fat buffer amp on the end and I had a 16 bit rock solid 10v pp waveform. It was overkill for my LVDT but fun to make. There's none of that control loop rubbish to worry about here. A proud day in Terryland, no pay riase though. Of course, you can easily tune it using the counter's clocks. Add your own precsion attenuators and gain. A very simple antialias filter might be needed to polish off remaining clock residue.Calculate a Sine LUT herewww.daycounter.com/Calculators/Sine-Generator-Calculator.phtml

author: TimFox
author_rank: Super Contributor
timestamp: April 29, 2024, 04:24:01 pm
content: Quote from: PCB.Wiz on April 29, 2024, 01:01:49 amLab instruments (such as the Krohn-Hites) using quadrature oscillators require precision resistors on decade switches and precision capacitors on the range switch.The OP's requirement is for a fixed, non-critical frequency, so matching resistors and capacitors using reasonable meters can give an acceptable solution for non-tunable frequency.

author: sw_guy
author_rank: Regular Contributor
timestamp: April 29, 2024, 07:10:48 pm
content: Thank you everyone who gave me ideas to start putting everything together. Based on preliminary simulations quadrature oscillator does exactly what I need. I also registered a few new circuits I can use in the future. One of them is precision rectifier.Answers:IanB>Do you develop software by any chance?Yes.PCB.Wiz>Do you need to adjust this generator across 1-10kHz and 200mV-5V ?No. Fixed frequency and fixed amplitude.xvr>Than use square waves. They can be considered as sinus with a lot of distortion.I assume this was not a joke because square wave works, but in the final design there are (component level) limitations to use square waves.Quadrature circuits started to oscillate on LTspice after enabling the "Skip initial operation point solution".sw guy

author: tggzzz
author_rank: Super Contributor
timestamp: April 29, 2024, 07:21:42 pm
content: Quote from: sw_guy on April 29, 2024, 07:10:48 pmRealise that a frequency stable oscillator will have a high Q and take many cycles to stabilise. If your system requires frequency stability, that can be a simulation problem.For system simulation, just use a spice voltage source set to output a sine wave. Only after the system works as desired with ideal signal, is it worth simulating with non-ideal signals.

author: soldar
author_rank: Super Contributor
timestamp: April 30, 2024, 05:41:02 pm
content: Quote from: sw_guy on April 28, 2024, 04:25:16 pmNot referring to this specific OP but in general I am with tggzzz. I hate it when someone asks a question and is not even trying to be helpful or show interest. You have to extract information little by little, with much asking and effort. Yes, I can give it a pass but it is still rude on their part..