Sinewave oscillators: 1. The gain control block

Elvee

Member
2006-09-08 2:04 pm
I would like to launch a series of discussions about the design of low-distortion sinewave oscillators.

There are already a number of threads dedicated to the subject, this one being a typical example.

Together, these threads represent a huge amount of information(s), but they tend to be large, messy, and mix up new ideas, old designs, SOTA designs, and revolve about all aspects of such oscillators and sometimes unrelated subjects.

With thousands of posts, any relevant information tends to be drowned in an ocean of "noise".

Here, I will discuss each aspect in turn: gain control will be the first one, but I also intend to discuss topologies, active elements (gain blocks), amplitude acquisition and filtering, passives, etc.

I am not interested in the current state of the art: this can be found on the net, or here, without too much effort.
I would like to see new approaches, and they could be new takes on existing solutions, or completely new solutions.

I am going to illustrate that point, based on the classic jFET VCR example:

attachment.php


First is the classical implementation, with all its known issues.
This basic circuit can be improved by using a more clever summing scheme, to improve the accuracy and speed of response: SOTA.
Both the previous circuits suffer from a residual non-linearity and limited dynamic range.
It would be interesting to find a corrector network, to lower the distortion and improve the dynamic.
Only the last circuit would qualify, because it brings something new.

I am going to prime the discussion by presenting a gain control based on lambda/Early effect.

The Early effect, and its FET counterpart, the channel modulation are non-linear effects.

They are generally seen as a problem, because they increase the THD of amplifiers, but would it be possible to take advantage of them to create novel types of VCA's?

The answer is (apparently) yes. This drawing illustrates the principle:

attachment.php


The output resistance of the transistor can be modulated by the collector current or the Vce.
The dependence on the Vce is what causes the non-linearity in amplifiers, but Ic provides a convenient, direct means of controlling the resistance.
Of course, using a single transistor would be somewhat impractical.
A push-pull configuration seems ideal, since it neatly solves DC issues etc:

attachment.php


Now that there are two active elements, the Vce term disappears, meaning the synthetic resistor becomes linear (assuming the Early law is cast in bronze, which is not exactly the case unfortunately).
Things are not that simple though, mainly because complementary transistors are a fiction that doesn't hold in reality (in silicon at least).
Parameters differ widely, and Vaf (Early voltage) is heavily affected: PNP's have a much lower Vaf than NPN's.

The solution is to go all PNP:

attachment.php


This is a first, half-practical example. I will examine later its shortcomings, and possible remedies.
I will also introduce a figure of merit, to evaluate more objectively the various alternatives.

The simulation shows an amplitude sweep, from 6Vpp to ~0.6Vpp
 

Attachments

  • SWO1.png
    SWO1.png
    12.6 KB · Views: 420
  • SWO2.png
    SWO2.png
    6.7 KB · Views: 400
  • SWO3.png
    SWO3.png
    10.7 KB · Views: 390
  • SWO4.png
    SWO4.png
    69 KB · Views: 397
  • EarlyVCAbip.asc
    3 KB · Views: 10

Elvee

Member
2006-09-08 2:04 pm
The Early-based VCA looks attractive, because of its performances and unusual features: for example, unlike many semiconductor based VCA's (DBM for example), it can directly handle very large amplitudes.
Here, a single 12V supply is used allowing ~6Vpp max, but with +/-18V supplies, it could handle 30Vpp.
With video-output transistors, it could process hundreds of volts.
The THD is not bad either: depending on the attenuation, it is comprised between 0.012 and 0.07% (real, measured), and it is certainly perfectible.

This is of course much too high to be used directly in a low-THD oscillator, but the amplitude-controlled signal will be diluted in the much larger direct, uncontrolled path: depending on the component accuracy and other parameters, the dilution factor could be 1:100 or 1:1000, or even more.

Unfortunately, there are some flies in the ointment: one that is immediately apparent is the need for a good matching: to achieve a good first-order cancellation of the Early non-linearity, the control transistors need to have their Vaf matched.
Not only that, their Hfe also needs to be matched, because the DC balance of the PP depends on it, and the average DC is provided externally, by the input resistor.

Initially, I had hoped that the correlation between Hfe and Vaf for a given process would be sufficient, but that was a false hope: although the correlation is real, it is insufficient, meaning a full matching is required.
This is probably why the given figures are perfectible: I only based my sorting on a dozen samples, and for two-parameter matching, it is a bit short.

There is another, more fundamental limitation: noise.
The BE junction is subjected to a variable forward current, and it generates noise current 2*q*If.
At low currents (large output amplitude), this current develops a certain noise voltage across the input resistor, but at higher currents, the (higher) noise current is applied mainly to the proportionately much larger Ro/2 of the transistors.

This creates a significant noise at high attenuation levels. In fact, the figures I gave comprise THD + noise, and at high attenuation levels, the proportion of the noise becomes dominant.

The presence of this noise means that additional measures are required to make the circuit usable.

This is the actual circuit (used for the measurements):

attachment.php
 

Attachments

  • SWO5.png
    SWO5.png
    16.1 KB · Views: 358

1audio

Member
Paid Member
2004-03-24 5:16 am
SF Bay Area
how much of this is implemented if any in either analog multipliers or the chips like the SSM: https://www.analog.com/media/en/technical-documentation/obsolete-data-sheets/165661290SSM2122.pdf or its "improved" http://www.soundsemiconductor.com/downloads/ssi2164datasheet.pdf . The benefit of monolithic design is matching to a degree that can be difficult with discrete parts. They claim .05% THD at unity gain and 1 V out. The .05% would be attenuated by the mix ratio and necessary gain control range for the oscillator itself.

If you are looking for novel solutions there is the one suggested by Davida, using a SAR ADC to sample the wave at its peak and then use a multiplying DAC for AGC. The combination could be enhanced with a micro in the middle to very quickly stabilize the amplitude very precisely. The multiplying DAC can be very low distortion and it would only be steering the signal, not passing all of it. Add two more multiplying DACs for frequency tuning for a very clean solution.
 

1audio

Member
Paid Member
2004-03-24 5:16 am
SF Bay Area
get one of Victor's anyway. There is so much technique involved at these low distortions his oscillators are a real value. similar types of hand adjusted products (precision dividers, thermal converters) cost thousands. it will still be useful when Elvee gets through his efforts here.
 

Elvee

Member
2006-09-08 2:04 pm
How do you compensate different gain in the output stage? Bottom is a follower, top is an amplifier.
You are probably not interpreting correctly the circuit: there are no followers and amplifiers.
Q1 and Q2 act as current-controlled variable resistors, and the signal source is V2, coupled through C4 and R8 which forms the upper part of a voltage divider.

how much of this is implemented if any in either analog multipliers or the chips like the SSM: https://www.analog.com/media/en/technical-documentation/obsolete-data-sheets/165661290SSM2122.pdf or its "improved" http://www.soundsemiconductor.com/downloads/ssi2164datasheet.pdf . The benefit of monolithic design is matching to a degree that can be difficult with discrete parts. They claim .05% THD at unity gain and 1 V out. The .05% would be attenuated by the mix ratio and necessary gain control range for the oscillator itself.
Analog multipliers generally operate on translinear principles, either explicitly or implicitly.
This works differently, and even with a crude discrete + breadboard implementation it achieves 0.012% (~4x times better) for unity gain and 6V output (it could be 10V or more with identical performance)

If you are looking for novel solutions there is the one suggested by Davida, using a SAR ADC to sample the wave at its peak and then use a multiplying DAC for AGC. The combination could be enhanced with a micro in the middle to very quickly stabilize the amplitude very precisely. The multiplying DAC can be very low distortion and it would only be steering the signal, not passing all of it. Add two more multiplying DACs for frequency tuning for a very clean solution.
Yes, that is one of the solution I considered, but I will come to it in time: I am examining various option one step at a time, and I welcome any input like yours.
I am not in the process of building something (except hardware sanity-checks of theoretical ideas).
A complete oscillator needs a number of different function blocks, and presently I am just scratching the surface of one (admittedly one the most the most critical)

Naaah, come on LV... I've just been thinking about getting me a nice oscillator from Victor, and now you come around the corner with this thread :eek:!


No, keep it going, this is gonna be awesome :cool:! Subscribed.
Just buy your oscillator: it is tried and tested, and a long time will elapse before the ideas I throw into the air come to fruition (if they do).
Victor may even use some of the ideas that will appear in this thread and the subsequent I will launch. I am not the guy who is going to sell PCB's or finished oscillators: I am just interested in concepts.

get one of Victor's anyway. There is so much technique involved at these low distortions his oscillators are a real value. similar types of hand adjusted products (precision dividers, thermal converters) cost thousands. it will still be useful when Elvee gets through his efforts here.
Exactly
 

Elvee

Member
2006-09-08 2:04 pm
Some explanation about the circuit in #2: L1/C1 and L2/C2 combat the noise: the capacitors provide a low impedance shunt path for the input noise in the frequency range of interest, and the inductors degenerate the transistors at frequencies higher than the useful frequency range, but this is far from ideal: it is obviously frequency-specific, which could be OK if you build a single frequency oscillator but is problematic if you need to cover the audio-range.

There is another problem: the capacitors impose a significant response time, which is problematic if this block has to be included in a servo loop.

Here is a figure of merit I intend to use to assess the performance of the various solutions:

attachment.php


Vmax is the maximum absolute voltage that can be processed
Gmax and Gmin are the maximum and minimum gains achievable
S is an arbitrary speed constant: 1 if ~instantaneous, 0.75 if non-intantaneous but fast (compared to the oscillation frequency), 0.5 if the response time is >>1/Fosc
(D,V)max is the distortion x output voltage product where this product reaches the maximum; it indicates the absolute level of "pollution" injected by the gain control for its whole range.
 

Attachments

  • SWO6.png
    SWO6.png
    3.4 KB · Views: 316

Elvee

Member
2006-09-08 2:04 pm
It is possible to use a similar junction modulation effect with jFET transistors: it becomes the lambda-VCA:

attachment.php


In the real-world prototype, I used a U405 dual JFET rather than two matched 2N3819 (this would be tedious considering the huge dispersion of FETs) and the opamp is 1/2 LF353.

This incarnation is somewhat more attractive than its bipolar counterpart: it does not suffer the same kind of noise problem, the time-constants are under control, and the THD remains practically flat for the whole amplitude range at ~0.018% average.
Not a bad proposition all things considered
 

Attachments

  • SWO7.png
    SWO7.png
    72.2 KB · Views: 290
  • LambdaVCA1.asc
    3.1 KB · Views: 6

Elvee

Member
2006-09-08 2:04 pm
The figure of merit for the bipolar version is 120.
The THD surges to 0.045% just below the max level, at 4.5Vpp.
It is probably caused by an imperfect matching of the BF240 driver transistors: at very low currents, the dynamic BE resistance dominates.
At higher currents, the emitter resistors and trimmer dominate, meaning the balance is perfect.
At the maximum amplitude of 6V, there is a residual distortion of 0.012%, certainly caused by the varicap effect of the various junctions.
It is why I changed the BC547 for BF240, because they have a lower absolute capacitance.

For the FET variant, the figure of merit is 333: the distortion at 6Vpp is relatively large, 0.018%, and it is certainly caused also by varicap effect.
The series resistor is 100K, explaining the larger figure.
With FETs having a larger lambda, the series resistor could be reduced, but such FETs would probably have larger capacitances too, because many parameters are correlated.
 

1audio

Member
Paid Member
2004-03-24 5:16 am
SF Bay Area
I just ran across this interesting AGC block for an oscillator in the Amber 3501 I'm about to calibrate. The MPQ6842 is a quad complimentary transistor (probably long obsolete). It would be interesting to copy the circuit into spice and see how it works. The associated oscillator is pretty good, in the .001% range I believe normally. This unit is quite long due for calibration so its not representative.
 

Attachments

  • Amber AGC block.PNG
    Amber AGC block.PNG
    22.4 KB · Views: 182
  • MPQ transistor array.PNG
    MPQ transistor array.PNG
    12.2 KB · Views: 176

1audio

Member
Paid Member
2004-03-24 5:16 am
SF Bay Area
Here is the whole oscillator. Its a good implementation. The H2 null uses an H2 derived partly from the AGC itself and feeds back a proportion on the DC gain signal to null the second harmonic. Getting this right turns out to be not real easy.
 

Attachments

  • Amber Oscillator and AGC circuit.PNG
    Amber Oscillator and AGC circuit.PNG
    179.7 KB · Views: 153

Elvee

Member
2006-09-08 2:04 pm
Here is the whole oscillator.
Thanks. I will need to redraw the circuit with explicit transistors to understand how the gain cell core actually works

Another one is this one from Panasonic VR7721 with a uPC649 which is a S/H switch. It looks pretty nice
This thread is about the gain control only, not the amplitude acquisition or the loop filtering (that will come later), but thanks anyway.

I am trying to treat the different function blocks in an orderly fashion, to avoid replicating the catch-all mess of other threads, but I am aware that it is not possible to completely disentangle the different subjects.
 

Elvee

Member
2006-09-08 2:04 pm
I have revisited an old classic: the light bulb.
Historically, it was the first control device of early oscillators.
It has the advantage of combining the amplitude acquisition, loop filtering and gain control in a single cheap.

For me however, its main disadvantage is the combined amplitude acquisition, loop filtering and gain control: you cannot design a system with arbitrary characteristics, you can at most change the lamp, but that's limited and that's about it.

I am only interested in methods allowing a complete control of each aspect, and this rules out the classic lamp and thermistor.

However, it is possible to use a lamp with an external control: it can be controlled with a DC current:

attachment.php


Such a simple implementation has a number of drawbacks: a variable DC voltage is now mixed to the signal, and the bulb generates a fair amount of H2, because of the asymmetrical operation of the circuit.

Arranging two bulbs in a bridge configuration kills two birds with one stone: it eliminates the DC issue, and the operation becomes symmetrical, eliminating most of the distortion:

attachment.php


I have built a specialized supply to test the principle in reality:

attachment.php


It is overcomplicated and suboptimal in many ways but it does the job.
I needed to add bleeder resistors R9 and R18, because without them the regulators lost the regulation when the control was too low, due to the AC signal exceeding the DC output current (I used a very high drive signal, to be able to see some distortion).
All of this could be improved and rationalized in a real build.
This is the test circuit:

attachment.php


With an input signal sufficient to get 10Vpp output at the minimum attenuation, the THD was flat at 0.0015% between 10 and 4Vpp (the minimum).
The minimum is relatively large, because the signal is sufficient to cause a significant self-heating.

The 0.0015% could be lower in reality, because my THD meter is not in top shape, and that is in fact its own measurement floor.

Note that lamps were not even properly matched: some DC voltage was present in the output.
 

Attachments

  • SWO11.jpg
    SWO11.jpg
    338.2 KB · Views: 183
  • SWO10.png
    SWO10.png
    94.1 KB · Views: 186
  • SWO9.png
    SWO9.png
    114.5 KB · Views: 179
  • SWO8.png
    SWO8.png
    141.8 KB · Views: 186
  • BulbSupp.asc
    5.7 KB · Views: 9

Elvee

Member
2006-09-08 2:04 pm
PWM control

Here is another scheme I tested:

The idea is to use a PWM control to vary the gain. If the carrier frequency is high enough compared to the oscillator frequency, the carrier residue will be attenuated naturally by the Wien (or other) network.
I have used a carrier of 100kHz for the evaluation, but in reality the frequency would be higher.

This is how it could be added to an oscillator (there are other possible options):

attachment.php


Here, two methods are combined to improve the granularity/dynamic range: first, a coarse, "bargraph" D/A converter adding the 220K resistors to the gain as needed, and an interpolator based on PWM to ensure a smooth transition between the discrete steps.

The modulator could look like this:

attachment.php


A ~sawtooth generated by the oscillator on the left is compared to various scaled versions of the amplitude-control signal (V2).
The role of R14, 15, 16 and C2 is just to visualize the combined effect of the three PWM outputs.

Here are the waveforms (n001 is the synthetic output on C2):

attachment.php


This control scheme has the advantage of introducing no THD: the resistance of the CD4053 is negligible compared to the 220K of the resistors.
It does introduce non-harmonic residues, but they can be filtered, implicitly or explicitly.

It might also be possible to generate a signal in antiphase with the PWM, but having no LF content, to cancel the residues
 

Attachments

  • SinePWM1.png
    SinePWM1.png
    17.5 KB · Views: 109
  • SinePWM2.png
    SinePWM2.png
    18.5 KB · Views: 110
  • SinePWM3.png
    SinePWM3.png
    51.9 KB · Views: 120