Maker Pro
Maker Pro

Oscillator basics

R

Ryan

Jan 1, 1970
0
I'm trying to repair my first high power car audio amplifier, and then
hopefully two or three more.

I've been told left and right that I need a sine wave generator in order
to deduce anything. I'll elaborate on the amp's condition later.

So, I'm off to build my first sine wave generator. I tried with a
helper a few weeks ago and gave up, so now I want to hit it from
scratch.

At my disposal, I have the following:
A couple of solderless prototype boards
Dual OP AMP, DC 9039
NE556 - Dual Timer
Dead computer power supplies for parts, I can get 1 or 2 of these per
week.

I think I want to make a generator based on an op amp, and then a
resistor and capacitor for the timing. Already, I don't understand and
my lack of understanding is why I gave up.

From the beginning, if I have a battery, and a capacitor what is the
result? I'd get some flow of current and then none, right? If I added
a resistor it would be slower, right?

The resistor and capacitor with an op amp outputs a triangular wave, is
that correct? Is it a square wave instead?

My understanding is that once I get a square wave produced, I can then
calculate a resistor and capacitor filter to permit only the fundamental
and then end up with a pretty looking sine wave.

So I guess what I want to do, is from the ground up, build a square wave
(or whatever cyclical repeating thing), filter it, filter it again, and
get it looking like a sine wave. After that, put a voltage follower on
it so that a connected device won't change it.



==

About the amp, it is an Alpine MRV-T757. When I picked it up, all the
power supply outputs were scorched. I replaced those, and now that part
works. The rail voltage is +-40 volts. One output channel works fine,
the other does not. With the bad channel put together, it blows a fuse
right away. I've checked all transistors/mosfets. On the bad side, one
of each of the two output fets were shorted gate to drain. It should
work with half of them in place as the working channel does. With the
output transistor removed, the amp does not blow anything. I put on a
square wave generator and scoped the driver transitors. The form is
funky looking, I'd have to email you pictures of it. A few folks told
me I'd have to put in a sine wave rather than a square one to make any
sense of it.

-Ryan
 
K

Keith R. Williams

Jan 1, 1970
0
This is a mystery to me. Any audio signal can be used to learn about
an amplifier, and only detailed measurements like noise or distortion
require specific waveforms, like a sine.

A sine wave certainly makes the analysis simpler. Superposition
and all...
You can make a fair triangle and square wave generator with just half
of the 556. You can use an opamp as a buffer (to strengthen the
signal and make it more immune to loading from whatever you connect
to, but for your purpose, I doubt this is needed. The data sheet for
the 556 shows some typical circuits:

When I did this stuff I preferred a quadrature oscillator using a
couple of op-amps/integrators to solve the diff-eqs and a couple
of diodes for limiting. With the proper gain I could get
remarkable THD. It gets harder for a wide frequency variation
though.
Right, capacitors only pass current when the voltage across them is
changing. Once a stable voltage is reached, current goes to zero.


Right. The capacitor voltage would approach the battery voltage on
what is called an exponential approach curve. R*C (ohms times farads)
is the time constant. During the first R*C seconds, the capacitor
voltage will get to 63 percent of the battery voltage. During the
next R*C seconds, the capacitor voltage will get to 63% of the
remaining way to the battery voltage, etc.


You need several resistors connected along with the capacitor to make
both a rough triangle and square wave. The square wave comes out of
the opamp, while the triangle wave is across the capacitor, and needs
another opamp to copy that voltage before you can load it with any
other connections.

See pages 7 and 8 of:
http://www.national.com/an/AN/AN-31.pdf
for all sorts of sine wave and other signal generator circuits.


Better to just make a sine wave to begin with if that is what you have
your heart set on.

Agreed. It makes the analysis simpler too.
It looks like a plan. At least, you will learn a lot about
electronics by the time you get there.

I'd start with the sine wave. Filtering a square wave sounds
like more of a PITA to me. Then a gain, depending on the
frequency a uC could generate any arbitrary waveform. ;-)
Any non uniformity on the frequency response (like you get with base
or treble boost or cut) will show up as distortions of the square
wave. If you understand what those distortions are telling you, they
contain more information than you can get from any single frequency of
sine wave. But if you scan through a range of sine waves, you can
extract the same information in easier to understand bits.

Exactly. A square wave (I found "impulses" easier) can be used
along with forier analysis to do all the work of a swept sine
wave. Square/impluse stimulants are a little harder to convert
to the frequency domain though. Sine waves aren't that difficult
to generate and may make things rather simpler.
 
R

Ryan

Jan 1, 1970
0
When I did this stuff I preferred a quadrature oscillator using a
couple of op-amps/integrators to solve the diff-eqs and a couple
of diodes for limiting. With the proper gain I could get
remarkable THD. It gets harder for a wide frequency variation
though.


I didn't realize that I could just generate a sine wave to begin with
without knowing a whole slew of stuff. What does "quadrature" mean? I
see on the link that John provided, on page 7
http://www.national.com/an/AN/AN-31.pdf there is a diagram of a
quadrature generator. I have no frame of reference, so that seems as
good a starting point as anything. Perhaps I can build it. The
diagram looks daunting to me.

Question: I don't have an LM108 but I do have an MC33078P
http://www.intusoft.com/onsemipdfs/MC33078-D.PDF
will this work? Should I get out there and find an LM108? Should I
find the exact capacitors and resistors or might I improvise by finding
simliar R*C products as John has mentioned to me in the past? In doing
so, do I risk throwing off the rest of the circuit?


I'll mention that I was thinking 60hz would be a good frequency to
generate because low pitches don't grate my nerves as much as higher
frequencies. I'd like to use a computer power supply as my power
source. Either the 12v or 5v leg, whichever makes sense.


Agreed. It makes the analysis simpler too.

Do you mean it makes the analysis of the faulty amplifier easier?


Thank You.
 
R

Roger Johansson

Jan 1, 1970
0
Ryan said:
Should I get out there and find an LM108?

The LM108 is a very old general op amp, you can replace it with any
modern op amp.
I'll mention that I was thinking 60hz would be a good frequency to

If you want a very simple to build 60Hz sine wave generator you can
use a transformer from the mains voltage, add a pot and you have a
0-6Volt sine generator (if you choose a 6Volt transformer).
 
R

Rich Grise

Jan 1, 1970
0
Ryan said:
output transistor removed, the amp does not blow anything. I put on a
square wave generator and scoped the driver transitors. The form is
funky looking, I'd have to email you pictures of it. A few folks told
me I'd have to put in a sine wave rather than a square one to make any
sense of it.

-Ryan

Actually, a square wave can tell you a lot about the condition of an
amp. I'd like to see the waveforms, but don't use the email in the
"from" header - excise the adjacent letters a, r, and d to make an
email address that I'll actually read. [email protected] is just
a spam dump.

(BTW, I agree with everybody else on how to get a sine wave. :) )

Cheers!
Rich
 
R

Roger Johansson

Jan 1, 1970
0
Not true. A function generator has a wider frequency range, lower
distortion, and an adjustable DC offset.

A PC with a sound card is just a low quality programmable waveform
generator, not a function generator. If you can get 15 MHz, or .001 Hz
with a 5 volt offset, THEN you have a function generator.

The classical function generator does not have to reach 15 MHz, more
like 1 MHz maximum and often lower.

The typical function generator gives 3 types of waveforms, sinus,
square and triangle.

A classical function generator IC is the 2206 (XR2206) which reaches
close to 1 MHz (800kHz typically).

A soundcard is a fairly good replacement for a low standard function
generator. And a low standard audio frequency oscilloscope.

You are describing a very sophisticated high end function generator,
and it was probably very expensive when it was new.
 
R

Ryan

Jan 1, 1970
0
other. For your purposes, either output could do fine. There is a
simpler 1 opamp sine oscillator called a Wien bridge oscillator in
that section, also.

In the Wein Bridge Oscillator diagram, on the left, there is a picture
of a circle with an oval inside of it. What is that? Nearby, what does
"L*" mean? Regarding the capacitors of ".01" is uF assumed unless
otherwise specified?

If 60 Hz is all you need ot start troubleshooting, then set the
oscillator project aside for now, and just get a little step down
transformer (5 or 6 volts out) and just use the AC line frequency as a
signal source. You can connect a potentiometer across the secondary
and turn the amplitude down as low as needed.


This would be a device with primary and secondary windings where the
input is the wall voltage and the output is determined by the number of
windings, correct?

Is this the type of thing that I could find on the shelf at a Radio
Shack? Does it look like the standard transformer case (like a tiny
overpacked suitcase) or might it be in the form of a universal plug
adapter for small appliance which outputs AC in addition to DC?

I presume that once I get it, the potentiometer is used to vary the
amplitude (voltage) of the output? I would just put the pot inline with
one of the output wires?

-Ryan
 
N

N. Thornton

Jan 1, 1970
0
Dear OP,

You have no need for a sine wave generator or any other generator, so
most of this thread is irrelevant to you.

I dont understand why folks havent just told you that.

Regards, NT
 
J

John Popelish

Jan 1, 1970
0
Ryan said:
In the Wein Bridge Oscillator diagram, on the left, there is a picture
of a circle with an oval inside of it. What is that?

Look for the asterisk below. It is a low current light bulb used as a
temperature dependent resistor that stabilizes the output voltage. as
the oscillator output gets larger, the bulb heats up, raises its
resistance, and increases the net negative feedback, which reduces
gain enough to make the amplitude quit growing. If you search the
oscillator name on Google, you will find many variations on this
oscillator that use diodes or other schemes to perform this function.
If you replace the bulb with a variable resistor, you can set it at a
point that gives slightly clipped sine wave output (using the
limitations of the output stage to determine the amplitude). This
produces more distortion in the wave, but for testing, this is not so
bad.
Nearby, what does
"L*" mean?

That is L1*, L1 being the designation for the first lamp that appears
on the schematic. The asterisk leads you to the note at the bottom.
Regarding the capacitors of ".01" is uF assumed unless
otherwise specified?
Yes.


This would be a device with primary and secondary windings where the
input is the wall voltage and the output is determined by the number of
windings, correct?
Yes.

Is this the type of thing that I could find on the shelf at a Radio
Shack? Does it look like the standard transformer case (like a tiny
overpacked suitcase) or might it be in the form of a universal plug
adapter for small appliance which outputs AC in addition to DC?

Either. If you get one built into a plug, make sure it has an AC
output, not DC.
I presume that once I get it, the potentiometer is used to vary the
amplitude (voltage) of the output? I would just put the pot inline with
one of the output wires?

A more effective way is to connect the ends of the resistive element
across the transformer, and use one end and the wiper as the output.
You might also want to add a series resistor (say, 1k) to the wiper,
to limit the current into any low resistance node, and a capacitor to
keep your signal injection from disturbing any DC bias voltage at that
node.
 
M

Michael A. Terrell

Jan 1, 1970
0
Roger said:
The classical function generator does not have to reach 15 MHz, more
like 1 MHz maximum and often lower.

The typical function generator gives 3 types of waveforms, sinus,
square and triangle.

A classical function generator IC is the 2206 (XR2206) which reaches
close to 1 MHz (800kHz typically).

A soundcard is a fairly good replacement for a low standard function
generator. And a low standard audio frequency oscilloscope.

You are describing a very sophisticated high end function generator,
and it was probably very expensive when it was new.

I was pointing out that using a sound card does not replace a
function generator. You need a low output impedance and DC coupling for
a true function generator. The coupling capacitor in the output will
change its reactance as the frequency changes and that will change the
output level. It will also cause distortion unless you drive a high
impedance load.

There are millions of good used function generators floating around
at low prices.

On the other hand, the H-P 3325B function generator I had on my bench
WAS expensive. It was digitally controlled from a front panel keypad, or
a IEEE-488 computer interface on the rear panel. You programmed the
frequency, waveform type, DC offset, and you could set the output level
in either voltage or dBm. It went to .001 Hz to 30 MHz on the front
panel, and had a .001 to 60 MHz output on the rear panel, less the
programmable level and DC offset.

Yes, sometimes you can work on the ultra cheap, but you need to be
aware of the limitations of the test setup before you accept bad data,
or look for problems caused by your equipment.
 
J

John Popelish

Jan 1, 1970
0
Ryan said:
I bought some parts for both projects.

I started with the Wein Bridge Oscillator.

I could not find a 750 ohm resistor, so I improvised with a 680 and a
100 = 780. I could not get 200K, so I used 220K's instead. I did not
find a 14mA bulb, so I got an LED rated at 15mA.

Sorry, you cannot substitute an LEd for the lamp. The part is not
there to produce light, but to have a changing resistance with
current, and the LED changes its resistance in an entirely different
way than a tungsten filament lamp. I would just try some fixed
resistor values that are around 1/4 of the resistance of the feedback
resistor (your 780 ohm).
http://www.geocities.com/newsgrouppictures/wein.htm

Here is a photo of the prototype. My camera isn't very great.

Results:

I double checked the circuit and I think I did it right. Nothing is
touching that shouldn't be. I'm feeding it with 12V from an AT
computer power supply.

Plus 12 should be connected to pin 8, -5 to pin 4. This circuit
diagram assumes that the opamp has supply voltages both more positive
and more negative than the ground connection (which has to connect
back to the common for both the +12 and -5 busses).
I put 12V to pin 4 on the op-amp. I also put 12v into pin 3.

I put the scope to it, but I don't understand the result.

With the scope ground connected to the ground of the power supply and
the probe on pin #1, I got a flat line of 1.5 volts. With the scope
ground connected to nothing at all, and the probe on pin #1, I got a
nice looking sine wave varying from +12v to -12v with a period of 6
milliseconds. This is 166 hz, right?

I assume that the scope alters the circuit enough to goof it up?
Perhaps I am mistaken and all this data is inconclusive.

You just don't have it working, yet. Your opamp has different pin
numbers than the LM107 in the diagram. You have to substitute the
pins that have the same function. For now, just leave the spare opamp
unconnected.
 
R

Roger Johansson

Jan 1, 1970
0
Michael A. Terrell said:
I was pointing out that using a sound card does not replace a
function generator. You need a low output impedance and DC coupling for
a true function generator.

It all depends on what level of technical standard we are talking
about. You obviously are talking about a high standard professional
equipment, I talk about a lower standard, which amateurs and hobbyists
may have use for or build themselves.

Everything is relative in this field, and I try to fit into the scope
of this newsgroup, where I think the lower standard is better suited.

If you look at the projects in electronics magazines about building a
function generator, or when such generators are mentioned in amateur
radio literature, you will hardly find a function generator that goes
over 1 MHz, everything over that are signal generators, and use only
sinus wave form.

But the need for faster equipment drives the development, so these
classical definitions may have changed in later years, so I keep the
door open, as time goes we may need to move the limits upwards.
 
R

Roger Johansson

Jan 1, 1970
0
John Popelish said:
Sorry, you cannot substitute an LEd for the lamp. The part is not
there to produce light, but to have a changing resistance with
current, and the LED changes its resistance in an entirely different
way than a tungsten filament lamp. I would just try some fixed
resistor values that are around 1/4 of the resistance of the feedback
resistor (your 780 ohm).

Isn't it better to use normal diodes, a string of them to replace a
lamp with a certain voltage rating.

A lamp could maybe be replaced by 2-4 diodes and a suitable resistor
in series if there is a need to limit the current.

I don't have the circuit diagram you are discussing but I think I have
seen such a lamp replaced by diodes before.
After all, the function we need is a soft clipping of the
oscillations.

If we want better symmetry we can use the same number of diodes in
anti-parallell, but that is probably not necessary as it is enough to
limit the oscillations in one direction.
 
J

John Popelish

Jan 1, 1970
0
Roger said:
Isn't it better to use normal diodes, a string of them to replace a
lamp with a certain voltage rating.

A lamp could maybe be replaced by 2-4 diodes and a suitable resistor
in series if there is a need to limit the current.

I don't have the circuit diagram you are discussing but I think I have
seen such a lamp replaced by diodes before.
After all, the function we need is a soft clipping of the
oscillations.

If we want better symmetry we can use the same number of diodes in
anti-parallell, but that is probably not necessary as it is enough to
limit the oscillations in one direction.
If you use diodes, instead of a lamp, you have to parallel them across
the feedback resistor, and replace the lamp with a fixed resistor.
 
R

Roger Johansson

Jan 1, 1970
0
John Popelish said:
You can use a pair of
diodes (or leds) to do something similar, except that you have to
parallel them with the negative feedback resistor (one turned each
way), with a fixed resistor taking the place of the lamp. That way,
as the oscillator amplitude gets big enough to begin to turn the
diodes on at each peak of the waveform, the diode conducting in
parallel with the feedback resistor will increase the net negative
feedback and cancel the excess positive feedback somewhat like the
lamp would have. The only difference is that the effect works only at
the peaks, so there is a little flattening of the wave that does not
show up with the lamp method.

Well, the diodes do not work "only at the peaks", diodes are
logaritmic devices and start conducting at a voltage very close to
zero, and conduct more and more the higher the voltage is over it.
Around 0.6 Volt we reach milliampere currents and that is usually the
kind of currents we count as substantial. That is the reason why we
often hear that the diode forward voltage is 0.6-0.7 Volt.

(I am explaining this to the other readers, you, John, of course know
this already)

With a good combination of diodes and serial and parallell resistance,
and source impedance, we can achieve a suitable soft damping effect.

The basic principle behind the Wien-bridge oscillator is that a small
imbalance at the start is amplified and the oscillations become bigger
and bigger.

In the Wien-bridge oscillator the oscillations are soft, rounded wave
forms, because of the time constants in the feedback circuitry, and
there is a parasitic non-linear device which starts to steal energy
from the oscillations when they get bigger, which stabilizes the
oscillations at a certain level.

This non-linear parasitic device can be a lamp or diodes, for example.

The lamp takes more time to regulate the oscillator, the diodes are
faster but distorts the waveform a little more.
A lamp regulated oscillator may have a long term stability problem, it
takes minutes to become stable and reacts to temperatures and
ventilation changes, a diode regulated oscillator gives the same wave
form for every cycle, because it regulates at every cycle.

Depending on the purpose one might prefer one or the other solution.

Please correct me if I am wrong, John, these are just my guesses and I
know you have a lot more knowledge in electronics than me.
 
M

Michael A. Terrell

Jan 1, 1970
0
A said:
Yeah, I used the wrong terminology. The OP wants to test audio amps, I think a
PC sound card is amply sufficient.


In the context of testing car audio amplifiers, I suspect that 1-20Hz is all
that's needed, if I go by the cars that go by my house. :)

Does your sound card go down to 1 Hz and still have a clean signal?
The output coupling cap will be too small to have a good low frequency
response. Most of the specs I have found for sound cards stop at 10 Hz,
not 1 Hz. Just find and buy a "Test CD" made to test car amps. They
have a number of different frequencies recorded on different tracks, and
a sweep. MCM used to car it, but any place that sells and installs the
amps should have a source.
 
A

A E

Jan 1, 1970
0
Michael A. Terrell said:
A E wrote:

Does your sound card go down to 1 Hz and still have a clean signal?

No, that was a joke. I don't think 1Hz is relevant to audio, quite frankly.
The output coupling cap will be too small to have a good low frequency
response. Most of the specs I have found for sound cards stop at 10 Hz,

If it's that important, Michael, use a SPDIF digital output and plug that to your
outboard DAC suitably modified. I still say 1Hz is not relelvant to audio, and that
a computer with audio out is good enough for testing a audio amplifier.
not 1 Hz. Just find and buy a "Test CD" made to test car amps. They
have a number of different frequencies recorded on different tracks, and
a sweep. MCM used to car it, but any place that sells and installs the
amps should have a source.

Oh, do they go down to 1Hz? :)
 
R

Roger Johansson

Jan 1, 1970
0
John Popelish said:
The only difference is that the effect works only at
the peaks, so there is a little flattening of the wave that does not
show up with the lamp method.

I have been playing with a wien-bridge oscillator in Electronics
Workbench now.

It was an example circuit I think from EWB, with two zener diodes.

There was no flattening of the top of the waveform, but a kind of
leaning of each wave, like the rising flank was faster than the
falling flank.
I managed to get a much better waveform by introducing a series
resistor (the 10k below) to the zener diodes.

The waveform is now so close to a perfect sinus wave I cannot see any
faults on the oscilloscope picture. I would need a harmonic analyzer
to tweak the circuit for better purity.

I can describe the circuit:

There is an op amp, LF157, and a wien bridge consisting of 10nF and
20kOhm. The bridge is grounded at the bottom, the middle point is
connected to the + input to the op amp, the top of the bridge
connected to the output of LF157.

The output is also connected to the zener net, consisting of two 30V
at 1mA zeners, 10k in series with the zeners and 20k in parallel with
the zeners plus the series resistor.

The other end of the zener net is connected to a 50k trimpot to
ground, where the wiper is set to 40% and goes to the - input to
LF157.

The introduction of a series resistor inside the zener net makes the
influence of the zeners a lot softer, as I thought, and this makes the
waveform into a very beautiful sinus wave.
Some further tweaking might produce a high quality sinus generator.

The quality is probably rather independent from the frequency, if a
2-gang pot is used in the wien-bridge to change the frequency.
 
M

Michael A. Terrell

Jan 1, 1970
0
A said:
No, that was a joke. I don't think 1Hz is relevant to audio, quite frankly.


If it's that important, Michael, use a SPDIF digital output and plug that to your
outboard DAC suitably modified. I still say 1Hz is not relelvant to audio, and that
a computer with audio out is good enough for testing a audio amplifier.


Oh, do they go down to 1Hz? :)

I'm sure they get closer than a sound card.

I have seen good used function generators for less than $20, and have
had people give me ones that have died. They are definitely not lab
grade, but would work ok to test a sound system. I owned and ran a
commercial sound business years ago and I would love to have had a
portable function generator, rather than the 65 pound H-P unit at the
shop so I could carry it a tool box, rather than strap the H-P to a hand
truck when I worked on sound systems in large churches or stadiums.
 
R

Ryan

Jan 1, 1970
0
I think so. you would have to connect all points that have a ground
symbol on the schematic to the +5 line, then. The point being that
the ground symbol on the diagram represents some voltage that is about
in the middle between two supply rails. you could also connect two 9

Your point about 9 volts in series noted for future reference.

With no load on the supply and a meter reading, I get the positive and
negative voltages I was hoping for.


After I wrote last, I took apart the project and began again. I
realized my folly of using 200 ohm resistors instead of 200K ohm.
Drat! I improvised using some pots and dialing them to within 10 points
of 200,000 ohms using my meter. (I knew the K was there, but I missed
it anyway)

So, I played around with that and still got a flat line around 7 volts.

Next, I took it all apart again and assembled it a 3rd time.


Referring back to the schematic
http://www.geocities.com/newsgrouppictures/wein.htm

Perhaps I have made some incorrect assumptions in the construction.
I've had to formal teaching on reading these diagrams. On the input
side of the op-amp, the only things feeding the + and the - is a [lamp]
resistor to the reference and a 200K ohm resistor to reference for the
other one. Does one of the inputs need to tap into a power supply
voltage somewhere? Since I don't have a lamp, I connected a 1Kohm
potentiometer in it's place and tried wiping it to its extremes. I
never saw any oscillation.

I understand that the op amp is powered by pins 4 and 8, but op-amps
compare the inputs (without drawing from them) and then do something
with that difference, right? Is the + input supposed to have a voltage
applied to it? If I follow correctly, I don't see and have not applied
any power to this circuit.

===

In the mean time, I also hooked up a 120vac to 12.5vac transformer and
with a 10Mohm potentiometer was able to reduce it's 7 volt output down
to about + and -2 volts. This feels like I'm cheating though. I think
I'll need to understand the principles of the other project for future
use.

Thank You.

-Ryan
 
Top