Maker Pro
Maker Pro

Low distortion sine wave VCO's - state of the art?

B

Ban

Tony said:
The underlying problem there is that rectification
of a single phase (to get a low ripple dc for the agc)
cannot be made fast enough. I have a vague memory in
one of those reader Design Ideas at that time, of
someone resorting to a complicated s/hold on Vpk to
get a fast response dc for the agc.

If you want the "Rolls-Royce" of an analog sin-generator fully modulable and
with instantaneous peak amplitude detection which will even work at lowest
frequencies without transient behaviour, I recommend a state-variable design
with vectormeter to determine the peak amplitude. The design incorporates 4
multipliers and 6 opamps. I am too lazy to draw it up tho.
 
B

Ban

Ban said:
If you want the "Rolls-Royce" of an analog sin-generator fully
modulable and with instantaneous peak amplitude detection which will
even work at lowest frequencies without transient behaviour, I
recommend a state-variable design with vectormeter to determine the
peak amplitude. The design incorporates 4 multipliers and 6 opamps. I
am too lazy to draw it up tho.

I did it in parts:
.---------------------------------------------.
| |
| ___ C|| ___ C|| ___ ___ | out
o-|___|-o---||-o-|___|-o---||-o-|___|-o-|___|-o--o
| R | || | R | || | R1 | R1 |
| | |\ | | |\ | | |\ |
| '-|-\ | .---o-|-\ | '-|-\ |
| | >-o | | >-o | >--o
| .-|+/ | | .-|+/ | .-|+/ |
| | |/ | .-. | |/ | | |/ |
| === | | | === | === |
| GND | | | GND | GND |
| | '-' .-. |
| | '-------->| |pot |
| | 10R | | |
| o '-' |
'--o cos | |
sin '---------------'


Here is the principle. The differential equation of an oscillator
d2/dt^2*Vout + 2*gamma d/dt*Vout + omega^2*Vout = 0
has the solution
Vout(t)= Vout_peak* e^(-gamma*t) * sin(sqrt(omega^2 - gamma^2)*t)
with gamma=0 (pot in the middle) we have an sin-oscillator. with
gamma=positive we have a rising amplitude and with negative a dampened one.

Since it's easier to integrate with opamps we integrate twice:
Vout + 2*gamma S Vout dt + omega2 SS Vout dt^2 (S=integral)
Thats what is implemented above.

Now we can compute the Vout_peak value:
Vout_peak = Vp= sqrt(sin^2 + cos^2)
by arranging the formula a bit this can be done with a single multiplier:
Vp = sin^2/(Vp + cos) + cos
we get a DC voltage from which we can subtract the reference and replace the
pot with another multiplier.

To vary the frequency we can replace the two R with a dual pot or with two
more multipliers.
 
J

John Popelish

Tony said:
2x multipliers squaring Sin and Cos, outputs added
together to produce a fast-response rectification without
the need for a smoothing cap. Vref was subtracted at the
same time to produce the error voltage for the
multiplier that increased/decreased the oscillation
gain.

For slower slewing applications, what is your criticism of using a
pair of inverters to allow simple full wave rectification of the sin
and cos outputs, and either average the sum of those or peak follow
and average as the amplitude feedback. If the frequency changes only
over many cycles, a pair of LED driven photo resistors may match well
enough to replace the other two multipliers, also, and let the AGC
compensate for the mismatch.
 
T

Tony Williams

John Popelish said:
For slower slewing applications, what is your criticism of using
a pair of inverters to allow simple full wave rectification of
the sin and cos outputs, and either average the sum of those or
peak follow and average as the amplitude feedback.

No criticism, except that low THD is difficult
without low ripple on the rectified dc. A.D Ryder
in a Wireless World article in Jan 1981 did a
similar thing with a 3-phase oscillator with fw
rectification. His first stage had a THD of 0.42%,
and the downstream stages reduced that to below 0.1%.
The OP wants 0.01%.

In July 1982 there was another similar article from
a group in Canada where they used a 2-phase oscillator
and resistively generated 8 phases for rectification.
A large mess of opamps, diodes, and resistors, but
under certain circumstances they produced a THD of
less than 0.01%.

There was a 1974 paper that apparently discussed this
use of multiphase rectifiers, with calculations showing
the relationship between the number of phases used
and the resulting THD. I was not able to obtain a copy
of that paper in the early 80's. It was:

"Fast amplitude stabilisation of an RC Oscillator."
E. Vannerson and K.C Smith. IEEE Journal of solid
state circuits, vol 87, SC-9 No.4, pp 176-179.
 
J

John Popelish

Tony said:
John Popelish <[email protected]> wrote:
No criticism, except that low THD is difficult
without low ripple on the rectified dc. A.D Ryder
in a Wireless World article in Jan 1981 did a
similar thing with a 3-phase oscillator with fw
rectification. His first stage had a THD of 0.42%,
and the downstream stages reduced that to below 0.1%.
The OP wants 0.01%.

In July 1982 there was another similar article from
a group in Canada where they used a 2-phase oscillator
and resistively generated 8 phases for rectification.
A large mess of opamps, diodes, and resistors, but
under certain circumstances they produced a THD of
less than 0.01%.

There was a 1974 paper that apparently discussed this
use of multiphase rectifiers, with calculations showing
the relationship between the number of phases used
and the resulting THD. I was not able to obtain a copy
of that paper in the early 80's. It was:

"Fast amplitude stabilisation of an RC Oscillator."
E. Vannerson and K.C Smith. IEEE Journal of solid
state circuits, vol 87, SC-9 No.4, pp 176-179.

Thanks for the discussion, but doesn't the effect of the number of
phases depend strongly on the amplitude response time, in number of
output cycles? If the variable frequency needs to vary only slightly
(as it does in this case and, perhaps slowly (I didn't read how fast
it has to be able to change), it seems that an elliptical filter with
its notch right in the middle of the range of ripple frequency, you
could get a pretty low ripple gain control output.
 
T

Tony Williams

John Popelish said:
Thanks for the discussion, but doesn't the effect of the number
of phases depend strongly on the amplitude response time, in
number of output cycles?

AFAIK the intention is to get a fast-response
rectification, slewing fast in both directions.
This gets a stable control loop.

Multiphase rectification is one way of avoiding
the smoothing capacitor that slugs the negative
slew.
If the variable frequency needs to vary only slightly (as it does
in this case and, perhaps slowly (I didn't read how fast it has
to be able to change), it seems that an elliptical filter with
its notch right in the middle of the range of ripple frequency,
you could get a pretty low ripple gain control output.

If some way can be found of doing a fast single
phase rectification then that may allow new control
methods for all single phase RC oscillators.
 
W

Winfield Hill

Ban wrote...
I did it in parts:
.---------------------------------------------.
| |
| ___ C|| ___ C|| ___ ___ | out
o-|___|-o---||-o-|___|-o---||-o-|___|-o-|___|-o--o
| R | || | R | || | R1 | R1 |
| | |\ | | |\ | | |\ |
| '-|-\ | .---o-|-\ | '-|-\ |
| | >-o | | >-o | >--o
| .-|+/ | | .-|+/ | .-|+/ |
| | |/ | .-. | |/ | | |/ |
| === | | | === | === |
| GND | | | GND | GND |
| | '-' .-. |
| | '-------->| |pot |
| | 10R | | |
| o '-' |
'--o cos | |
sin '---------------'


Here is the principle. The differential equation of an oscillator
d2/dt^2*Vout + 2*gamma d/dt*Vout + omega^2*Vout = 0
has the solution
Vout(t)= Vout_peak* e^(-gamma*t) * sin(sqrt(omega^2 - gamma^2)*t)
with gamma=0 (pot in the middle) we have an sin-oscillator. With
gamma=positive we have a rising amplitude and with negative a
dampened one.

Since it's easier to integrate with opamps we integrate twice:
Vout + 2*gamma S Vout dt + omega2 SS Vout dt^2 (S=integral)
Thats what is implemented above.

Now we can compute the Vout_peak value:
Vout_peak = Vp= sqrt(sin^2 + cos^2)
by arranging the formula a bit this can be done with a single
multiplier: Vp = sin^2/(Vp + cos) + cos
we get a DC voltage from which we can subtract the reference and
replace the pot with another multiplier.

To vary the frequency we can replace the two R with a dual pot or
with two more multipliers.

No amplitude-stabilization feedback loop?
 
B

Ban

Winfield said:
Ban wrote...

No amplitude-stabilization feedback loop?

The stabilisation pot is replaced by a multiplier, which in turn is
calculating gamma x Vout.
I'm gonna draw that part as well later.
 
B

Ban

Ban said:
The stabilisation pot is replaced by a multiplier, which in turn is
calculating gamma x Vout.
I'm gonna draw that part as well later.


.--------------.
.---| multiplier | .-----.
sin | | | | add | Vout_peak
o---o sin^2/(cos+Vout)------| + o----o----o
| | | | add | |
'---| divide in | -- --' |
'--------------' | |
cos | | |
o---o----------)-----------------' |
| | |
| .--o--. |
| | | |
'-------| + |----------------------'
| add |
'-----' to 10R
Vout_peak Vout o
o o |
| ___ ___ || | |
'-|___|-o-|___|-||--. | .----------------. |
R2 | || | '---| multiplier | |
Vref ___ | |\ | | | |
.--|___|-o-|-\ | | Vout x gamma |-----'
| R2 | >------o-------------| |
/-\ .-|+/ gamma | |
( ) | |/ '----------------'
\+/ ===
| GND
===
GND
(created by AACircuit v1.28 beta 10/06/04 www.tech-chat.de)
These are the other parts. the instantaneous peak calculation and the
control loop
 
F

Fred Bartoli

Winfield Hill said:
Ban wrote...

No amplitude-stabilization feedback loop?

Ban didn't say there wasn't.
I find this way of instantly obtaining the amplitude pretty nice since it
relieves you from having an additional very LF pole in the stabilization
loop, just relying on the oscillator's filter amplitude response.
However I wonder how well this could behave for a very low distorsion
oscillator.
 
F

Fred Bloggs

Ban said:
.--------------.
.---| multiplier | .-----.
sin | | | | add | Vout_peak
o---o sin^2/(cos+Vout)------| + o----o----o
| | | | add | |
'---| divide in | -- --' |
'--------------' | |
cos | | |
o---o----------)-----------------' |
| | |
| .--o--. |
| | | |
'-------| + |----------------------'
| add |
'-----' to 10R
Vout_peak Vout o
o o |
| ___ ___ || | |
'-|___|-o-|___|-||--. | .----------------. |
R2 | || | '---| multiplier | |
Vref ___ | |\ | | | |
.--|___|-o-|-\ | | Vout x gamma |-----'
| R2 | >------o-------------| |
/-\ .-|+/ gamma | |
( ) | |/ '----------------'
\+/ ===
| GND
===
GND
(created by AACircuit v1.28 beta 10/06/04 www.tech-chat.de)
These are the other parts. the instantaneous peak calculation and the
control loop

That circuit is largely a wish unless you can show that any particular
amp puts the 3rd harmonic 80dB down. Then the multiplier is being asked
to process a 0/0 type of input which is more wishful thinking.
 
T

Tim Shoppa

Fred Bartoli wrote:
[sin**2 + cos**2]
I find this way of instantly obtaining the amplitude pretty nice since it
relieves you from having an additional very LF pole in the stabilization
loop, just relying on the oscillator's filter amplitude response.
However I wonder how well this could behave for a very low distorsion
oscillator.

Error in typical analog multipliers (MPY634, etc., the $5-$10 variety)
is typically quoted at 2% full scale. When operated as squarers some of
this cancels out and 0.3 (hi-grade) to 1.2% (low-grade) is what I see
in the MPY634. I suspect there will be further cancellation from adding
sin**2 and cos**2 since they are out of phase.

But think what happens if you have a truly constant-amplitude sine
wave, and then some distortion in your squarers. The ripple due to
error in the squarers will only be a percent, and it will be at twice
the frequency of the oscillator under some pessimistic assumptions
about the nature of the distortion, and at four or eight times the
frequency under some more realistic assumptions about distortion. This
is a lot better for developing AGC than a half-wave or even full-wave
rectified sine wave.

Now, Ban doesn't tell us about all the time constants but I will assume
that to get to sub-tenth-percent distortion that you have to average
the resulting sin**2+cos**2 over a period or so (he shows a
peak-measuring circuit so I'm guessing he's averaging over a couple
cycles). His sin and cos oscillators are expressly designed so that as
you slew the frequency, the amplitude will remain constant within the
precision of the multipliers/dividers there so the gain tweaking is
there only to correct for the error in those multipliers.

He doesn't explicitly say so, but I'm assuming that whenever he uses a
multiplier he uses the most linear input to carry the oscillation and
the least linear input to carry the gain factor. In the medium-spec
analog multipliers the more linear input has a "typical" 0.01%
nonlinearlity so this is the right ballpark.

Tim.
 
B

Ban

Tim said:
Fred Bartoli wrote:
[sin**2 + cos**2]
I find this way of instantly obtaining the amplitude pretty nice
since it relieves you from having an additional very LF pole in the
stabilization loop, just relying on the oscillator's filter
amplitude response. However I wonder how well this could behave for
a very low distorsion oscillator.

Error in typical analog multipliers (MPY634, etc., the $5-$10 variety)
is typically quoted at 2% full scale. When operated as squarers some
of this cancels out and 0.3 (hi-grade) to 1.2% (low-grade) is what I
see in the MPY634. I suspect there will be further cancellation from
adding sin**2 and cos**2 since they are out of phase.

But think what happens if you have a truly constant-amplitude sine
wave, and then some distortion in your squarers. The ripple due to
error in the squarers will only be a percent, and it will be at twice
the frequency of the oscillator under some pessimistic assumptions
about the nature of the distortion, and at four or eight times the
frequency under some more realistic assumptions about distortion. This
is a lot better for developing AGC than a half-wave or even full-wave
rectified sine wave.

Now, Ban doesn't tell us about all the time constants but I will
assume that to get to sub-tenth-percent distortion that you have to
average the resulting sin**2+cos**2 over a period or so (he shows a
peak-measuring circuit so I'm guessing he's averaging over a couple
cycles). His sin and cos oscillators are expressly designed so that as
you slew the frequency, the amplitude will remain constant within the
precision of the multipliers/dividers there so the gain tweaking is
there only to correct for the error in those multipliers.

He doesn't explicitly say so, but I'm assuming that whenever he uses a
multiplier he uses the most linear input to carry the oscillation and
the least linear input to carry the gain factor. In the medium-spec
analog multipliers the more linear input has a "typical" 0.01%
nonlinearlity so this is the right ballpark.

Tim.

The way the vector is calculated is very similar to an RMS calculation and
can probably be done with a dedicated RMS chip. It is not a 0/0 devision but
a 1/1, which should be the most accurate. There is no averaging since
sqrt(sin^2+cos^2) gives a DC peak value. It is just a cartesic to polar
transform. The control loop can be very fast, unlike a peak value obtained
by rectifiers.

Since changing the two Rs for a frequency modulation doesn't involve any
energy change in the oscillator it constitudes an almost ideal fm-modulator.
A cheap variable transconductance VCA like SSM2164 could be used for that,
which would give even a logarithmic characteristic for the frequency
control. With the remaining two VCAs a variable lowpass could eventually
reduce higher harmonics at the output.
It should be possible to even cover the entire audio range without changing
caps, but I haven't pondered about that to be sure.
 
T

Tim Shoppa

OK, all the discussion about sin/cos oscillators and a vector voltmeter
for amplitude determination was interesting, but it's not what I
actually implemented. (It does come back to answer a different question
I posed in the past year about starting two oscillators with a known
difference in phase, though.)

Here's what I actually did. I may have cheated by actually using some
elements of DDS but not actually using a numerically controlled
oscillator.

VCO from an HC4046 running at 8 times the output frequency. Output
frequency range was 40-80Hz so the VCO runs at 320-640 Hz.

A divide-by-eight ring counter in HC CMOS.

Ring counter decoded outputs scaled with precision resistors.

Output of ring counter run through 8 poles of VCVS Butterworth low-pass
filtering with breakpoint at 100Hz. In retrospect I could've set the
breakpoint higher I think (but see below about actual THD measurement).

Result looks really good on a scope. One gotcha: passband ripple in the
low-pass filter shows up as variations in output amplitude at the few
percent level as I sweep/step the oscillator frequency.

Has the advantage that a digital phase output is available without
discriminating on the analog level. Whjen I use this with the phase
comparator on the HC4046 to phase-lock to a crystal, I see phase errors
in the 10's of nanoseconds, which is not too shabby for an oscillator
in the low audio frequency range. To get phase noise that low I had to
regulate +5V right at the HC4046. Have not tried a "low-noise"
regulator, it's just a 78L05 at this point.

Of course the digital phase taken off the ring counter is not easily
related to filtered (analog) phase.

I don't know much about discriminating on analog phase in a good way.
The slew rate as the analog signal (say 60Hz at a few volts amplitude)
goes through zero is about 100V/sec, which means 100uV/usec. I'm
guessing that to get 100nsec phase on the the analog signal that I'm
sensitive to noise at the 10 uV level? Is that hard? It doesn't SOUND
easy.

I have NOT officially measured the distortion yet.

Tim.
 
F

Fred Bloggs

Ban said:
The way the vector is calculated is very similar to an RMS
calculation and can probably be done with a dedicated RMS chip. It is
not a 0/0 devision but a 1/1, which should be the most accurate.

It *is* a 0/0 division at the 180o points of the cos. The circuit is
what is called "implicit"- another name for circular justification by
assuming if the output is what we want then output is what we get.
 
B

Ban

Fred said:
It *is* a 0/0 division at the 180o points of the cos. The circuit is
what is called "implicit"- another name for circular justification by
assuming if the output is what we want then output is what we get.

There is a 0/0 division exactly when the output is 0-xing, so it doesn't
matter really. for that short moment we could sample/hold the last exact
value.
 
K

Ken Smith

Tim Shoppa said:
Result looks really good on a scope. One gotcha: passband ripple in the
low-pass filter shows up as variations in output amplitude at the few
percent level as I sweep/step the oscillator frequency.

Measure the output and servo the supply voltage on the shift register
chip. You may need to add a CD4049 buffer in the clock signal if you
swing the Vcc very far.

The servo can be very slow if you only change frequencies very slowly.
 
B

Ban

Fred said:
That circuit is largely a wish unless you can show that any particular
amp puts the 3rd harmonic 80dB down. Then the multiplier is being
asked to process a 0/0 type of input which is more wishful thinking.

After pondering a bit about the principle, it should be possible to just
square the sin and cos and add them, without the root, since we regulate for
constant amplitude.
We could also rectify the cos before to avoid the division by zero. Of
course the oscillator opamps and caps need to be of exeptional quality, but
the Walt Jung article someone quoted makes me confident to get the required
distortion figure even without post-filtering.. Of course the amplitude
servo can be slowed down so there is some averaging over several periods.
Now with 10*R the time to reach e-times the amplitude is 20 periods, this is
only needed for very fast sweep. We could also use a 30*R for adding gamma
and get the amplitude ripple more down.
A similar circuit was used by Neutrik or Bruel&Kjaer back in the analog
days.
Fred, what do you think?
 
Top