[ ? ] Continuously variable phase LFO?

Started by moosapotamus, December 06, 2008, 02:34:58 PM

Previous topic - Next topic

Eb7+9

#80
Quote from: R.G. on December 17, 2008, 07:30:45 PM
That's why I was haring off down PLL rabbit holes, verifying for myself that phase detectors work the way I think they do.

your understanding of PD's is in need of revision ... or vision

Quote
We have the following ways:
- microcontroller; does exactly what Charlie wanted, completely independent, etc., etc. and suffers only from its output being stepped digital by one of several methods and needing smoothing, and needing (simple) programming.

needing simple programming ... right ...

Quote
- various forms of digital synthesis in the form of counters; getting phase shifts set into the counters is hard, as it the interface from knobs.

- quadrature sine oscillators which are then mixed to a variable phase output using VCAs and trig identies.

adding sines and cosines won't give you constant amplitude

Quote
- PLLs with offsets applied to their phase detectors; doesn't work because phase detectors (with the possible exception of that patented thingie) lock at fixed positions plus or minus an error term. The error term is small and deliberately so in all PLL work I can find, and driven that way by the feedback that makes a loop lock.

ask yourself what gets "equalized" when the PLL (NFB phase/frequency loop) is in lock and you'll see where your thinking is wrong in this case ...

Quote
- sine oscillator followed by phase shift network to shift the result in an analog fashion; works fine, but phase shift and frequency are interrelated and it's a two-knob exercise to get a new setting.

the most obvious nay case ... for same reason adding a fixed delay in a PLL PD doesn't apply to the variable frequency case ...

Quote
- your magic solution which you won't reveal.

All of these have their issues, yes?

nope ... the magic one spreads love of good design all over the place and does what it's supposed to

Quote
But I did come up with one that seems to work. I did come up with a workable solution that's phase sensitive, not frequency sensitive, with a PLL.

right, your usual strategy, make my solution look like it's yours after you said it couldn't be done ...
old hat

my bet is you'd be fired by now ... "phase sensitive, not frequency sensitive" would raise serious eye-brows at an engineering meeting ...

Quote
It occurred to me that since PDs want to lock at a fixed place, let them. You're looking in the wrong place for introducing phase shift trying to inject it in the middle of the PD. Take the original sine wave, run it into a comparator against a variable reference voltage. Us the edge of the comparator output, which reliably is offset X degrees into the sine, as the reference signal to a PLL. Do it outside the loop.

you're getting lost again, this doesn't work for the same reason applying a delay line to the sine wave won't ... PD's don't do anything on their own, it's the loop you should be talking about

there are two place where offsets are deliberately introduced/corrected in Mixed-Mode PLL's ... in the PD as a delay block - routinely done to trim the delay offset caused by the D (delay) flip-flop as I said above - but this only works/designed in fixed frequency PLL's (some design approaches make it variable [adaptive] to use in combatting jitter) ... or it's done in the charge pump, as I've been advocating ... or even again, by adding a small (enough) DC current to the averaging node ... but the second case may introduce some jitter ... offset in the Charge Pump is my choice at this point ...

Quote
Sine waves are deterministic. A given number of degrees will always result in the same voltage on a normalized sine wave. So as you vary the comparator reference, its output is a variable-duty cycle square wave depending on the reference voltage. The leading (or trailing!) edge is at a position in the reference sine wave's phase that is fixed by the relationship of the sine voltage to the reference. For the resulting offset sine, take the sine wave out of a waveform generator chip and run THAT into a comparator, too, or just use the square wave output from the chip if it's available at the same time.

Now you can whip in a PLL, use the PD to lock the leading edge of the square wave output of the waveform generator chip to the edge of the output of the reference comparator. If you've used something good - one of those Hogge or other edge detecting PDs works - your PLL will lock to the leading edge +/- jitter and loop error, which the world is busy trying to make small. And since that involves dragging along the sine wave from the waveform generator chip, you now have a single knob phase adjustment which tracks phase, and remains locked to the desired phase in the face of the frequency being moved around.

So the net is - generate a reference signal from the reference sine wave which tracks at a phase offset, then lock to that. Worked first time.

as if you can fathom the nature of determinism ...

you're *very* lost

the net is, you have two "fairly matched" sine wave oscillators - take 'em from our good old friend the Univibe (yes we could use better ones) ... make one your reference, manually controlled with a dual pot, the other opto-coupler controlled - the later being part of what I'm calling an Opto PLL ... by nature their signal ampltudes will track if frequencies do ... convert the outputs of both sine waves to square via comparators set halfway on the DC amplitude scale ... 'adapt' a (digital) Hogge PD using appropriate level shifting, biasing, yada yada, to control the usual current/charge pump into a lead/lag or averaging filter (impedance) ... then introduce a voltage to resistance converter reading the voltage on the cap and setting the photo-cell resistors in inverse proportion to complete the PLL loop ... you can probably draw my schematic now

at startup, say, reference oscillator is running faster than PLL sine wave oscillator and PD sends predominant amounts of UP signal to the Charge Pump till cap voltage charges up to level where PLL sinewaver starts to exceed frequency of ref sinewavre ... at which point PD starts sending predominant amounts of DN signal to the Charge Pump and cap voltage starts dropping - PLL sinewaver slows down ... this switches back and forth until loop is phase locked (ie. no more cycle slips take place) through NFB equalizing process ...

at this point you need to look carefully at how the Hogge detector and Charge Pump interact to understand how a Static Phase offset can take place WHILE the loop is still locked and jitter free - answer to question above is contained in this explanation ...

I'm already designing a guitar frequency tracker that uses the same blocks, except with a current controlled oscillator and a jFET V/I converter instead of optos - obviosuly optical coupling is too slow for instrument tracking but perfect for our mysterious LFO chasing application here ... I always wanted to DIY a mixed-mode PLL with discrete components, I'm just not sure if the Charge Pump switches will work very well with jFETs instead of MOS but at this point I can't see why it wouldn't work if the gates are protected from forward bias using reverse diodes (Spice is obviously lousy here) ...  I just need to find me a couple of J177's and J309's to verify before I whip out this fine looking pup ... or go with a couple of CMOS devices ...

I wish I could say it's not rocket science but I think it is ...

R.G.

Quote from: Eb7+9 on December 18, 2008, 03:45:44 AM
your understanding of PD's is in need of revision ... or vision
All knowledge is always in need of enhancement.

Quoteneeding simple programming ... right ...
It depends on your background, I guess.

Quoteadding sines and cosines won't give you constant amplitude
Done properly, it does. You get to adjust the amplitudes with the VCAs.

Quoteask yourself what gets "equalized" when the PLL (NFB phase/frequency loop) is in lock and you'll see where your thinking is wrong in this case ...
Sorry. I've done a whole lot of reading on PLLs recently. I can always be wrong, but in this case, the reading reinforces my views. What gets locked is phase. It's a phase locked loop. Go read the literature. If you need it, I can provide starting places for you.
Quote
the most obvious nay case ... for same reason adding a fixed delay in a PLL PD doesn't apply to the variable frequency case ...
I'm not sure what you mean here at all.

Quotenope ... the magic one spreads love of good design all over the place and does what it's supposed to
Well, golly, isn't this the Age of Aquarius? Only - I haven't seen the magic one. And like all magic, it can be said to do anything at all as long as it never gets looked at. In the techie world we call this believing your own press releases.  :icon_biggrin:

Quoteright, your usual strategy, make my solution look like it's yours after you said it couldn't be done ...
old hat
I might say the same thing, since your solution was never revealed, eh? Seems like it could cut both ways.  :icon_biggrin:

But I won't, as you were arguing for inserting offset voltages into a PD to cause a static phase offset in the PD, so I'm guessing that you had some scheme for doing this. That's quite different from deriving a static phase offset from the original square wave first, then locking to that edge with no dinking inside the PD needed, and allowing the PD to lock where it wants.
Quote
my bet is you'd be fired by now ... "phase sensitive, not frequency sensitive" would raise serious eye-brows at an engineering meeting ...
It would raise eyebrows. I'd be asked to explain. Been there, done that, got the T shirt. But you can "fire" me if it makes you feel better.

Quote
Quote
It occurred to me that since PDs want to lock at a fixed place, let them. You're looking in the wrong place for introducing phase shift trying to inject it in the middle of the PD. Take the original sine wave, run it into a comparator against a variable reference voltage. Us the edge of the comparator output, which reliably is offset X degrees into the sine, as the reference signal to a PLL. Do it outside the loop.
you're getting lost again, this doesn't work for the same reason applying a delay line to the sine wave won't ... PD's don't do anything on their own, it's the loop you should be talking about
You do it your way, I'll do it mine. I've now breadboarded my version. It works. However, your note that "PD's [sic] don't do anything on their own, it's the loop you should be talking about" is correct. Let the PD - and the loop do what it wants to.

Quoteas if you can fathom the nature of determinism ... you're *very* lost
We all are, JC, we all are.  :icon_biggrin:

Quote
Quote
the net is, you have two "fairly matched" sine wave oscillators ... make one your reference, manually controlled with a dual pot, the other opto-coupler controlled - the later being part of what I'm calling an Opto PLL ...  yada yada,  ... you can probably draw my schematic now
...
I wish I could say it's not rocket science but I think it is ...
I await your design with bated breath. It's always possible that I just can't discern the true meaning in your words. I can always be wrong.

And I've always wanted to know a rocket scientist!

:icon_biggrin:
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.

R.G.

OK, JC. I found out what you're on about.

A non-edge triggered PD, like an analog multiplier, when fed from a 50% duty cycle signal from both reference and output waveforms, and with a low total loop gain, can be made to respond to an external push or pull on the loop filter and change the static phase between in and out. It's touchy as all get out, and changing either the attempted phase offset or the frequency of the main loop makes it lose lock, but it can be made to work in some situations if you're really, really careful.

I found this by following the line of reasoning that says the error residual in a feedback circuit is always what drives the output to match the input, so I wondered what could make the error residual be as large as the input signals. the only was was with a forward gain that was low enough to need input offsets as large as the input signals themselves. And sure enough, when you dial back the loop gain to make it low enough, you can force the loop error residual to look like a static offset.

In the PLL setup, it seems to mess up the loop filtering if you change it very much, but maybe you could dink with the filter to get more immunity from this perturbance.

And so, in keeping with my practice of admitting mistakes. I do. JC, I salute you. There is part of this you're right about, and part that I had not pursued far enough.

I think there are big practical problems with inserting offsets in the PD from what I can see, and I believe that is why it was so hard for me to find this, but it's at least not impossible.  :icon_biggrin:

Kudos, JC. Good one.  :icon_biggrin:

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.

puretube

Quote from: R.G. on December 17, 2008, 01:00:26 PM
Quote from: puretube on December 17, 2008, 12:46:45 PM
The 2stage-shifter theory works perfect...
It absolutely does. The only thing wrong with that is that you must change the phase shift stage at the same time and by the same amount as you change frequency, or the phase shift of the two LFOs changes with settings of the frequency pot as well.

If Charlie's application is OK with adjusting the phase pot each time the frequency is changed, it is fine.

Since both the (base-)LFO and the SHIFTer are voltage controlled (single pot each), one could "servo"-assist the shifter,
by simply adding part of the Frequency-Control-Voltage to the Phase-Displacement-Control-Voltage
as an "error-voltage", and thus make up for the frequency-dependance of the

SHIFTER... :



as mentioned in reply#73

(_ :icon_wink: _)



Aaahh - those were the days, when the rate of a tremolo was either 3-positions-switchable
or continuously variable, from 3Hz to 11Hz...  :icon_razz:

slacker

Quote from: R.G. on December 17, 2008, 01:00:26 PM
Quote from: puretube on December 17, 2008, 12:46:45 PM
The 2stage-shifter theory works perfect...
It absolutely does. The only thing wrong with that is that you must change the phase shift stage at the same time and by the same amount as you change frequency, or the phase shift of the two LFOs changes with settings of the frequency pot as well.

If Charlie's application is OK with adjusting the phase pot each time the frequency is changed, it is fine.

Given that both the LFO and the phase shifter are voltage controlled shouldn't it be possible to have the CV for the LFO also adjust the phase shifter so that the phase relationship stays the same at different speeds. Maybe by adding some sort of variable offset to the voltage dialled in by the phase pot.
Probably end up with a CV generator that was bigger than the rest of the circuit though :)

puretube

#85
Quote from: slacker on December 18, 2008, 01:44:14 PM...
Given that both the LFO and the phase shifter are voltage controlled shouldn't it be possible to have the CV for the LFO also adjust the phase shifter so that the phase relationship stays the same at different speeds. Maybe by adding some sort of variable offset to the voltage dialled in by the phase pot.
Probably end up with a CV generator that was bigger than the rest of the circuit though :)

See reply#83...  :icon_smile:

slacker

#86
Doh, you'd posted that while I was asking the question, I looked at the schemo but didn't notice the writing.

How do you think that variable phase LFO would sound with your Modzky?

puretube

#87
Quote from: slacker on December 18, 2008, 01:56:16 PM
Doh, you'd posted that while I was asking the question, I looked at the schemo but didn't notice the writing.
That`s what I figured - hence the smiley...  :icon_biggrin:

QuoteHow do you think that variable phase LFO would sound with your Modzky?

Since the MODZKY
originally expected to be driven by a sinewave generator, it will not sound any different when used with this LFO.

The one thing that needs to be observed however, is how to control the "depth", since both phases (mod+ and mod-)
need to be attenuated simultaneously... *



...aahh: while writing this, it comes to mind, that you probably meant the fact that this LFO has 90 degrees phaseoffset
instead of the supposed 180 degrees in the original "Modzky" ?
ouff - either it will sound a little more (or less) "phasey", or less (or more) "throbby" - my last experiments about that 90°/180°configuration were > 9 years ago...
(or only use the 0° output, and invert it for getting 180°)
(or invert the 0° and the 90°, and drive 2 modulators for True Stereo...  :icon_wink:)

and all that "Modzky" stuff was on breadboard - maybe I can find it & test ?


*good application for the pending LM13700 "BALMOD"  :icon_question:

gez

#88
Following on from Ian's comments about stepped LFOs, how about something along the lines of the sequenced LFO at Geo?

http://geofex.com/Article_Folders/LFOs/psuedorandom.htm#An Analog Sequenced LFO

Two 1-of-16 switches could be clocked.  One chip could have fixed resistors wired from V+ to each of the selected 16 pins.  A single resistor from in/out to ground would form a divider with the selected pin.  Resistor values could be chosen for a fixed-phase sinewave (calculations are covered in one of Owen Bishop's books, IIR).  The other switching chip would select one of 16 sliders sequentially for a second, 'graphic' LFO.  Although that's a hell of a lot of sliders, with appropriate filtering for smoothness you could pretty much get any phase shift within 360 degrees.  Not only that, but you could custom-shape the 2nd wave form to whatever you like.

If an up-down counter were used, you'd only need to deal with half a cycle at a time (graphically, that is) and would end up with a 32 step waveform.  Would that be smooth enough with filtering, RG? 

Apart from the sliders, the circuit has a relatively low parts count and would be very versatile.  Bleedin' hell, I might even build that myself!
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

R.G.

Well, it will certainly work for the arbitrary-waveform case. Shaping the waveform by retouching the pots for a phase shift would be a PITA (for me at least) after the first few times, though.  In this case, I'd prefer the two-stage phase shifter. But then, if you do the arbitrary-waveform thing as the first waveform, the two-stage phaser gives you a phase shifted LFO on an arbitrary waveform.

The filtering may be easy enough. There are some switched-capacitor filters now that come in eight pin dips that are *eighth* order lowpasses with no extra parts except an external clock pulse at 100x the cutoff frequency. Put that just above the LFO's highest frequency and you probably get some pretty clean LFO stuff.

Give it a try!
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.

puretube

How about ye good ole analog beat mixing way:



or a la H.A. Norby ?
(where "audio input" would be the basic LFO, and "oscillator" be any fixed freq. help-oscillator)?

gez

Quote from: R.G. on December 19, 2008, 10:44:55 AMGive it a try!

I'm missing some of the parts, but I could cobble together some 1-of-8 switches to work as 1-of-16 switches.  Just need to use a little logic to get it to work (litterally and metaphorically!)  :icon_smile:

I like the idea of this.  Will do some serious work in the New Year, but should have some time to toy around with the basics over Xmas...
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

gez

#92
Hmm, posted earlier today in this thread and it's vanished without trace in the interim.

It was along the lines of RG's idea, using a 4060 with a 1-of-16 switch (4067).  The binary code from the 4060 is also sent to a 4008 binary adder and the other 4-bit input of the 4008 is wired to a 16 position binary rotary switch.  The result from the 4008 goes to another 4067.  This gives a 16 position phase-shift from the pot (max shift 360 degrees).

The 4067s could either 'sample' the same dividers/sliders (if variable waveform required) to give the same waveform phase-shifted, or both chips could have their own set of resistors from the 16 pins to V+ and a resistor to ground from each of the chips' in/out pins.  This would allow for different waveforms (and consume less current).  That would be my preferred choice as what suits tremolo doesn't necessarily suit a filter.

Have yet to use a 4008, but I think what I've outlined would work.  Same for the binary rotary switch, but they seem freely available on eBay.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

R.G.

Hey, gez, that's downright clever. Modulo 16 addition does amount to a one-of-sixteen phase shift if you make waves from the outputs.

Back at the sine-square-comparator-PLL dealey, I was not happy with the fact that the phase shift on the resulting waveform was nonlinear, a result of the slope of a sine wave being nonlinear. Then I did another forehead slap. If you use a waveform generator which generates sine and triangle at the same time, then you use the sine output for the LFO, but use the triangle for the comparator/lock business. This lets the knob for phase angle be perfectly linear.

The XR2206 is not found everywhere, so I came up with an opamps-only solution. It's reasonable, if a bit touchy, to make a shaper to make sine waves out of triangle waves, so it's possible to make a stock integrator/Schmitt trigger LFO produce a reasonable approximation to a sine ( a clipper, dual JFET, etc) and so this isn't all that impossible.
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.

R.G.

I finally got around to looking up some waveform generator chips. The MAX038 is clearly the winner.

It puts out simultaneous sine, square, and triangle waves, and contains on the chip a sync output for synching to external waveforms, as well as a phase detector for making up a phase locked loop.

So two MAX038's, a comparator, and either a CD4046 or two 555s give the desired result: a sine LFO with a second sine LFO which can be moved back and forth in phase from the first LFO by a single knob.
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.

R.G.

... only, Maxim has now discontinued the MAX038, I find.  :icon_frown:
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.


R.G.

I was hoping that the reference would tell me that it wasn't discontinued. No luck.

I did some experimentation with some simulation runs that convince me that you can shape a triangle wave into a sine wave with lowish (about 3%) distortion with only a couple of clipping diodes if you're willing to trimpot-adjust the size of the triangle going in.

That would let you use the voltage controlled LFO design at GEO as the basis of both "sine" generators and also let you have a voltage controlled oscillator to run in the PLL at a cost of one dual opamp per sine generator, two sine trimpots, and a PLL chip for the phase detector.
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.

gez

Well, I messed around with a 16-step sine today and was pleasantly surprised.  Only had a solitary 4051 "1-of-8" switch, but managed to make the wave 16 step by using the 4th bit of a 4516 counter (in conjunction with an inverter) to flip the resistors' rails during the zero-crossing (the first 8 steps are set up to cover the first 180 degrees of a sine only).  End result looked like a 'barbedwire sine' (probably due to capacitance - wave was higher frequency than needed in order to see it properly on the scope), but with a simple cap to ground it smoothed right out (albeit with a reduction in amplitude).

Although I have some switched cap chips, I'm not running the clock anywhere near high enough to make them effective (need to check the data sheet, so don't quote me on that).  Going to rig up half a LM13700 as the clock and use the other half as an 'integrator follower' to do the filtering chores.

With the right parts (chips) to lower the parts count, this could be a nasty circuit!  :icon_twisted:
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

puretube

#99
Why not roll our own Function Generator, and implement a voltage control into the linked schemos  :icon_razz: for replacing the max038  :icon_question:

fun aside, the XR2206 can be had for a reasonable price (RoHS!)... (even  NTE seems to offer a clone).


or go Trigonometric...       ...
   AD639-like? - hmm-unobtainable, too  :icon_mad:



Funnily enough, my distributor offers the AD9833
as a "functional replacement" for the MAX038... at least it is smaller, and has less pins  :icon_razz: