LM13700 Sine VCO help

Started by DWBH, January 28, 2014, 05:33:40 PM

Previous topic - Next topic

DWBH

I've been messing around with a LM13700 on the TINA simulator. The long term idea is to built a Ring Modulator around an AD633, and I wanted to use an LM13700 for oscillator duties.
Clean sine wave is priority, and I've read that the Sinusoidal VCO (figure 38 on TI's datasheet) should produce a very clean sine output.

1 - Is it possible to get a square wave from this circuit? There's a square wave on the inverter's output, but it's output is very low (about ~10 times lower than the sine wave). The very crude way I've done is to feed the sine wave into a Schmitt Trigger, to obtain a square wave output.

2 - Voltage Control - I've been controlling it from 0-5v, sometimes 0-9v. Simple potentiometer voltage divider setup. Is it the best way to do it though? Should I buffer it?
Or is it a current control - should I then use something like a current source? (like in here: http://ericarcher.net/wp-content/uploads/2011/03/9v-analog-diy-lpf.pdf
or
http://www.diystompboxes.com/smfforum/index.php?topic=99820.0).

3 - Range: a range from 0.5Hz to 2kHz would be great. Obviously changing the capacitor values will alter the frequency. To some point, I think, the feedback resistors will affect volume and frequency, but I'm not sure how that would affect the creation or not of extra harmonics - distortion, compromising the main pursuit of clean sine wave output.
Besides, frequency adjustment of 2kHz with one potentiometer would be ridiculous. How would one change from a range to the other? Clearly there must be a different way of changing the frequency than changing 3 caps simultaneously. Maybe limiting the CV in? Which brings me back to point 2.

Please chime in, any opinions and suggestions are welcome!

knutolai

This thread might be of interest. The circuits discussed run on +/-12volt supply. Maybe you could get by with doubling your voltage supply (using a MAX1044)
http://electro-music.com/forum/viewtopic.php?highlight=quadrature+oscillator&t=19841

I would imagine using a schmitt trigger to obtain the squarewave is effective, as long as your signal is strong enough. Just remember to ground the input of the unused schmitts. If your Vpp does not exceed the hysteresis of the schmitt you could probably use a comparator instead.

Would love to see what you come up with.

PRR

> possible to get a square wave

If you have a good square-wave *inside* a sine oscillator, you get glitchy sines.

Fig 38 is interesting. A1 input is semi-clipped, and its output in 30 ohm (!) load is maybe 30mV. This just puts A2 to its limits. You could try another 3K between A1 out and the 30 ohms to develop a 3V peak square. However it may be far from flat-topped.

The universal way to do this (even high-class gear) is a Schmitt in a far corner of the board/box fed from the sine. Actually two B-type CMOS inverters will make a pretty solid square out of any clean source.

There's another approach used in ARP VCOs, in fact function generators generally. Schmitt and integrator make a square and a triangle. (ARP had a tracking half-rate integrator for the Ramp.) Then any of the approximate ways to make a Triangle into a Sine by rounding the peaks. (In LFO work the residual glitches are sometimes obnoxious.)

> controlling it from 0-5v

The LM13700's Iabc pin needs to come up to 1.2V before anything happens. With simple divider control, that gives a dead-zone for the first 25% of the pot. In some manual applications it is quite acceptable to put a stopper resistor from the bottom of the pot, so the lowest pot voltage is maybe 1.0V. However this turn-on voltage also varies with temperature, and your definition of "turn on" (i.e. the lowest rate you want). See Fig 13. A couple diodes will approximate this. Though you probably want to run the diodes at quite high current (to swamp pot-current) and then divide-down from maybe 1.3V of two diodes to 1.0V @25C of Iabc at low rates.

ICL8083 and XR2206 function generators are VERY handy ways to get VCO with square and triangle and a "sine" which works for many purposes, though not as low-glitch as an optimized Fig 38 circuit. While these chips are old and out of style, they can be found. (They used to be cheap but a 10-second search found prices from $3 (OK) to $8 (gasp!)).

> a range from 0.5Hz to 2kHz would be great.

On one knob, no range-switch? (Did we discuss this elsewhere?)

A basic Linear pot can easily be set to 10%, but not to 1%. Given 2,000Hz at the top, 200Hz is easy ("1" on a 0-10 dial) but not 20Hz ("0.1" on a 0-10 dial).

An Audio pot runs around 10% at "5" and the lower half is really linear. Same thing. 10% of 10% (1%) is pretty easy ("0.5" on dial) and that is 20Hz. Still a long way from 0.5Hz.

Another approach is exponential VCO as used for synthesis of musical pitch. Good (pitch accurate) ones are very fussy, and normally hand-calibrated then sealed in tar. Even then, ARP only did nominal 20Hz-20KHz in one range, with a switch to put the range sub-sonic. I honestly forget what the lower range was (and I sure used to know!!). However your 2KHz top with this (expensive) technology suggests a 2Hz bottom, so you are still 2 octave short.
  • SUPPORTER

dwmorrin

#3
For wide range CV control, I think the only option is to use an exponential CV circuit.
I recently picked up Thomas Henry's "Making Music With The 3080 OTA."  The ideas apply to 13700 OTAs.
Great book, and it takes you through designs, step-by-step from simple pot controls to a precision expo current source.
If it's not a tuned circuit (1V/Oct, etc) then you'll be able hit your range pretty easily, I think.

And CV range control is usually achieved with a CV summing amp (similar to your basic op amp audio mixer circuit).
Your pot is just 1 input into the summing mixer.
Then you might have a switch that has 1V, 2V, 3V, etc "on tap" to throw into another mixer input to kick the total CV up or down.
The voltages just add, so if you're pot is feeding 3V, and you switch on an extra 2V, the CV sums and becomes 5V.  Pretty simple and easy to do.  That stuff is also in the Thomas Henry book.

DWBH

Quote from: PRR on January 29, 2014, 01:42:06 AM
> a range from 0.5Hz to 2kHz would be great.

On one knob, no range-switch? (Did we discuss this elsewhere?)

No, not at all!
I'd like to have at least two ranges. One for slower rates, like up to 20/50 Hz, and the other one from 20/50 Hz to the 2kHz figure.
The thing is: should I change the RC values of the oscillator, or should I instead implement the range switch by controlling the CV pot range?

knutolai

Quote> a range from 0.5Hz to 2kHz would be great.

On one knob, no range-switch? (Did we discuss this elsewhere?)

Haha yeah that was my thread a few months back :P

R.G.

Getting good sines has classically be a difficult problem. In the analog realm, it's only possible with either good gain control and feedback of level, or very tight filtering.

Hewlett Packard - the whole company - was started based on the graduate work of one of the partners in using the varying resistance of an incandescent bulb for gain control of a sine oscillator to make it (mostly) a pure sine.

This is one reason that I like digitally-generated sine waves. There's no fussy gain control, and the frequency control is easy. The simplest hacker's way to understand is using a walking-ring shift register to make sine approximations that are remarkably good for being generated from a non-tuned circuit; no fiddling except for the 1% resistors in the summers. Frequency is set by the clock feeding the shift register, and can be voltage controlled easily.

What's done mostly today is using a uC to implement a numerically controlled oscillator with the output waveform being whatever is stored in a lookup table for the waveform.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

ElectricDruid

Quote from: DWBH on January 28, 2014, 05:33:40 PM
1 - Is it possible to get a square wave from this circuit? There's a square wave on the inverter's output, but it's output is very low (about ~10 times lower than the sine wave). The very crude way I've done is to feed the sine wave into a Schmitt Trigger, to obtain a square wave output.

Nothing crude about it. That's the right way to do it. As mentioned already, keep it away from your sine if you want it clean.

Quote
2 - Voltage Control - I've been controlling it from 0-5v, sometimes 0-9v. Simple potentiometer voltage divider setup. Is it the best way to do it though? Should I buffer it?
Or is it a current control - should I then use something like a current source? (like in here: http://ericarcher.net/wp-content/uploads/2011/03/9v-analog-diy-lpf.pdf
or
http://www.diystompboxes.com/smfforum/index.php?topic=99820.0).

Yes, it's a current control. Feeding it a voltage via a resistor (the most basic V-to-I convertor) is acceptable, but not ideal. A current source would be a good bet. Max Iabc is 2mA if I remember correctly - but don't quote me.

Quote
3 - Range: a range from 0.5Hz to 2kHz would be great. Obviously changing the capacitor values will alter the frequency. To some point, I think, the feedback resistors will affect volume and frequency, but I'm not sure how that would affect the creation or not of extra harmonics - distortion, compromising the main pursuit of clean sine wave output.
Besides, frequency adjustment of 2kHz with one potentiometer would be ridiculous. How would one change from a range to the other? Clearly there must be a different way of changing the frequency than changing 3 caps simultaneously. Maybe limiting the CV in? Which brings me back to point 2.

As PRR said, an exponential V/Oct response would be helpful, since you'd get more useful range on the pot. But you don't have to get as complicated as a full synth VCO - just steal a basic exponential convertor circuit from some simple VCO or VCF design.  For example:

http://www.birthofasynth.com/Thomas_Henry/Pages/VCF-1.html

You're not going to be feeding it pitch control voltages, so you don't have to worry about the tracking, which is the hardest part to get right in a synth VCO. You just need a basic octave-based response, so that you get a range of 6 or 7 octaves or so across your knob rotation. That'd give you 0.5Hz to 64Hz (7 octaves) and 32Hz-2000Hz (6 octaves) in two ranges. Adjust cap values to taste once you've got the expo convertor working.

Good luck!
Tom

DWBH

I am having a real time tuning the oscillator to lower frequencies. The one in the datasheet goes down to 5 Hz, with C=300pF. I'm already at 10nF and I can barely get it to 6 Hz.
I've tried simulating this (http://www.birthofasynth.com/Thomas_Henry/pdf/VCF-1/Sheet_0001.pdf) but had unconclusive results. Not sure if it's the simulator (really crappy, btw), or just how I'm setting things up.

DWBH

Ha!
Finally got the LM13700 model working on LTSpice. Finally. So much easier to work on this simulator.

ElectricDruid

Quote from: DWBH on January 30, 2014, 07:18:49 AM
Ha!
Finally got the LM13700 model working on LTSpice. Finally. So much easier to work on this simulator.

Excellent. That VCF pg1 expo convertor looks like just the ticket, doesn't it? Replace the fancy matched pair with 2 x 2N3906 like it suggests, and ignore the temperature compensation resistor too, and it'll be fine. It's even set up to drive a LM13700, so it should be good to go.

Good luck with it.

T.

PRR

> 0.5Hz to 2kHz would be great.
> at least two ranges. One for slower rates, like up to 20/50 Hz, and the other one from 20/50 Hz


So take the geometric mean. 2000/0.5= 4000:1 ratio. Square-root to find equal split, 63:1 ratio. Times 0.5Hz bottom is 32Hz. 2KHz top down by 63 is 32Hz, check.

63:1 is "maybe" do-able on a audio-taper pot. Depends how precisely you need to set it.

Since you now have a switch, use it. 4000:1 in three ranges is only 16:1 per range. 0.5-8, 8-125, 125-2K.

> change the RC values of the oscillator, or should I instead implement the range switch by controlling the CV pot range?

The CV just reduces the OTA current. The current can get so small that it is swamped by leakage in chip, PCB, caps. You "always" make big changes in R-C oscillators by changing the caps and leaving the resistors alone. In this case the OTA is your resistor-like object, so leave it alone, change the caps. Since all three poles are active, cap-value scales directly with inverse frequency (2X bigger cap is 1/2 frequency).

By a very flawed computation I get 300pFd makes 37KHz waves at max OTA current. Running 18X lower current for 2KHz is perhaps reasonable, but 1,000X smaller for 32Hz is probably impractical. Therefore we make the caps 18X and 1,000X bigger. About 5nFd for hi range and 0.3uFd for lo range. Those are not the right answers but they have about the right number of zeros/nanos/micros in them.
  • SUPPORTER

DWBH

Been trying this (http://www.birthofasynth.com/Thomas_Henry/pdf/VCF-1/Sheet_0001.pdf) out with the lm13700 oscillator.

Scaling the capacitors results in a direct scaling of the frequency. 1nF gives me 430Hz to 2.5kHz. 10nF gives 4Hz to 25Hz and 100nF gives 0.4Hz to 2.5Hz.
That's with R11 at 33k instead of 2k (using 2k increases the highest frequency to 3.8kHz).
I ditched R6 (V/Oct Trim) - it changed results very very slightly, so now I only have the 390 ohm resistor to ground.

However, the range is too small. Maybe I'm not using the whole current range in the Iabc pin?

PRR

> trying this

Counting on thumbs, I get 0.1mA to 10mA out of Q2.

The OTAs are known to die instantly if you exceed their 2mA rating.

At least put enough resistance in series with Q2 collector that it can't pass more than 2mA.

Raising R21 to maybe 500K shifts the range to 0.02mA-2mA. (Still use a 6K8 in Q2 collector, especially when breadboarding.)

You should be getting range like 20:1 or 100:1, which is way more than the 6:1 you observe.
  • SUPPORTER

DWBH

Thanks PRR, that R21 tip was it! I increased it to 1Meg now.
Low range is 0.5Hz to 37Hz and High range is 24Hz to 1.8kHz.
The thing is... on the frequency pot, I can't connect it to V+ and V-. If there's anything less than 0v on the wiper, I have no output waveform, it simply 'shuts down'. Is it a model/simulation error? Should I be really getting a 150:1 range instead of the current 75:1 range (by using V+ and V- on the potentiometer)?

Regarding the current limiting on Q2... there's a 15k and 30k resistor in series with the Iabc pin (as per the schematic). Do you think an extra resistor on Q2's collector is needed?

PRR

Do you get how the IC4 circuit works?

-15V into R21 forces IC4 output positive enough to make Q1 flow the same current back to R21.

Q1 base is grounded. If Q2 base is also ground (and Q1 Q2 are identical), then Q2 flows the same current as Q1, which was set by -15V in R21.

But Q2 base is adjustable. Now we need to know how transistor current changes with different base voltage.

Roughly: collector current will double for every 20mV of change.

Or 10X for each 60mV of change.

And assuming +/-10V at J1, 100K:2K gain in IC3d, we have +/-200mV at the R6 R7 divider string.

So (correcting an earlier mis-read), 200mV/60mV is about three 10X factors, or 1,000:1, *either way* (increase or decrease). Million to one overall.

So assuming Q1 runs 0.15mA, it can go 150mA(!!) or 0.000,15mA (0.15uA).

Or assuming Q1 runs 0.015mA, it can go 15mA(!) or 0.000,015mA (0.015uA).

Alternatively: the "1V/Oct" notation suggests that +/-10V should cover 10 octaves up or down from zero input. Which is a million to one of frequency. (You will surely run into trouble before then. 150 or even 15mA burns the OTA. 0.015uA is swamped by stray leakage.)

Use a dumb resistor to set a fixed *known* Iabc (you may need three). I suggest 1mA. Trim the caps to get your 2KHz. You asked for a 1000:1 range (0.5Hz-2KHz) so the current source's center current should be 31.6 times less, 0.0316mA. With -15V reference that is a 474.3K ohm resistor at R21. *Zero* voltage in and out of IC3d should give 0.0316mA out of Q2 and 63Hz. + and - 10V should give about 2KHz and 0.5Hz.
  • SUPPORTER

PRR

Another issue: you can't strap three Iabc pins together and expect perfect tracking. Series resistors will encourage tracking for small change of current, but not at very low-low current. For very wide range you just might have to have three Q2s, one per Iabc.

A problem is that IIRC the plan runs one Iabc at half (twice?) the current of the others. So get even more "Q2"s and double-up the ones that have to flow double current.
  • SUPPORTER

DWBH

#17
(delete this post)