Faking a Phase-Lock Loop without a Doepfer A196 PLL

Anything modular synth related that is not format specific.

Moderators: Joe., luketeaford, lisa, Kent

User avatar
wsy
Super Deluxe Wiggler
Posts: 2719
Joined: Wed Aug 24, 2011 10:20 pm
Location: near Boston Massachusetts USA

Faking a Phase-Lock Loop without a Doepfer A196 PLL

Post by wsy » Sat Feb 02, 2013 1:52 pm

I wanted to goof with a PLL, but (being an MU-person - EIGHT AND THREE QUARTER
INCHES! :-) ) just buying a Doepfer A196 isn't in the cards.

So, I thought about it really hard, and you CAN create a phaselock loop with nothing but
stock Synthesizers.com modules. Yes, it works. Quite nicely; in fact, the
sounds are better than what I've heard of on the Doepfer.

There are three essential parts of a PLL: the VCO (that's easy, everybodys got a Q106
VCO, right?), a lowpass (a q105 slew limiter is perfect), and the phase comparator.
The phase comparator is the hard part - and had me stumped for a bit, because the
easiest phase comparator that gives good results is the XOR function, and there's no
XOR function in any of the dotcom modules I have (or for that matter, in any module
whatsoever that I have).

So, I made one - by patching one of the XOR inputs into XIN of a Q116 ring modulator,
and the second XOR intput into the bottom half of a Q125 signal processor, and the
switch thrown to "INVERT" with zero offset , and the output of the bottom of the Q125
into the Q116 ring modulator Y input. The result is an XOR - it's +valued if one and
only one input is positive and the other negative, and -valued otherwise.

Now the patching is clear: patch from the tracking source (any audio signal, but for
testing another VCO works well) to XIN of the ring modulator, patch from the
output of the ring modulator to the variable exponential frequency input of the slaved
Q106 VCO, and patch from the sine wave output of the slave Q106 to the bottom
half input of the Q125 thence from bottom-half output to the Yinput of the Q116 ring
modulator.

Take your audio output (and oscilloscope output) from either the output of the ring
modulator or any of the outputs of the Q106 VCO. Both are sonically interesting but
start with the slaved Q106 sawtooth output.

Set your tracking source to (say) 4' range, center on fine. Set the Q106 slave to 2',
centered on fine, and variable exponential frequency input to zero. Then
increase the variable exponential frequency up from zero and you'll hear the PLL "lock" -
the slave VCO output frequency will abruptly drop to the tracking source's frequency.
Turning the slave Q106's frequency over a significant band will do*nothing* - but you'll
get huge timbral effects as you move the exponential frequency
control through the critical region.

Proof that it's a tracking PLL: turning the tracking-source frequency up or down causes
a 1:1 frequency shift on the output; turning the slave VCO frequency does
NOTHING (over a wide band, at least). The timbral variations are interesting too.

Fun things to do - jack the exponential modulation that goes to the slave VCO through a
slew limiter on the way

Yes, this PLL can do both over and under harmonic generation. Watching on a scope
helps but isn't absolutely necessary.

Why this is better than an A196: (1) you don't need to buy anything, (2) you can use
any oscillator with any style output as the slave, not just the pulse from the A196,
and (3) it's MU and of COURSE any MU synth sounds better than any Eurorack :omg:

Give it a try. :-) (yes, I know it's "better" if it's stateful rather than stateless, but "better"
in the EE sense of the word is not necessarily "more musical")
Last edited by wsy on Sat Feb 02, 2013 5:01 pm, edited 1 time in total.
"Life is short. But we can always buy longer patch cords" - Savage

User avatar
bouzoukijoe1
Super Deluxe Wiggler
Posts: 1836
Joined: Thu Nov 03, 2011 11:48 am
Location: NY/NJ

Post by bouzoukijoe1 » Sat Feb 02, 2013 2:33 pm

wow that is a bit of a tongue twisting patch!

User avatar
Savage
Cogito Pro Mundus
Posts: 785
Joined: Thu Jul 26, 2012 11:55 am
Location: Currently visiting Earth

Post by Savage » Sat Feb 02, 2013 4:03 pm

Wow! This is cool! I gotta try this tonight! :yay: :hyper: :yay:

User avatar
wsy
Super Deluxe Wiggler
Posts: 2719
Joined: Wed Aug 24, 2011 10:20 pm
Location: near Boston Massachusetts USA

The inverting....

Post by wsy » Sat Feb 02, 2013 4:58 pm

Thinking about it, I wasn't understanding why I couldn't just (in the algebraic sense) multiply
the two inputs of the ring modulator by -1 and get the same result... so I could get rid
of the Q125 signal processor and the patch should work just the same but with a
180 degree phase shift from the master oscillator.

But when I tried it- it gave a very different timbre and often didn't "lock on" at all.
I'm still trying to puzzle out why.

- Bill
"Life is short. But we can always buy longer patch cords" - Savage

User avatar
sduck
experimental use of gravity
Posts: 13861
Joined: Wed Feb 18, 2009 6:03 pm
Location: Vortepexaion, TN, USA

Post by sduck » Sat Feb 02, 2013 5:32 pm

Hmmm, this is something I've heard about but never experimented with. Yet. I had to look up the diagram that's on the a196 web page to visualize this.

Image

I've got some CGS logic stuff here - I guess the XOR would work for the phase comparator?
flickr cloud of sound touyube NOT A MODERATOR ANYMORE

User avatar
wsy
Super Deluxe Wiggler
Posts: 2719
Joined: Wed Aug 24, 2011 10:20 pm
Location: near Boston Massachusetts USA

yes, XOR should work

Post by wsy » Sat Feb 02, 2013 6:31 pm

Yes, XOR should work for the phase comparator.

(and the Doepfer block diagram is the most confusing way to express a PLL
that I have *ever* seen. It's correct; it's just.... so hard to understand that way)

Turns out I mispatched taking out the inverter; it works just fine without it.
I must have done it backwards or something.

- Bill
"Life is short. But we can always buy longer patch cords" - Savage

User avatar
rockthomas
Wiggling with Experience
Posts: 348
Joined: Wed Aug 25, 2010 9:02 pm
Location: CT

Post by rockthomas » Sun Feb 03, 2013 4:00 am

This is really cool. I like the possibility of making it out of modules because you can experiment with the structure that you can't with a single module. Thanks.

User avatar
wsy
Super Deluxe Wiggler
Posts: 2719
Joined: Wed Aug 24, 2011 10:20 pm
Location: near Boston Massachusetts USA

Post by wsy » Sun Feb 03, 2013 7:31 am

rockthomas wrote:This is really cool. I like the possibility of making it out of modules because you can experiment with the structure that you can't with a single module. Thanks.
You're welcome!

Well, the Doepfer isn't bad that way; you have insert points everywhere it matters,
and you do get more than a simple XOR for the phase discriminator (yes, I am thinking
about how to do that better as well; I got a mixer to act like a Schmidt trigger so
it's not impossible, just darn hard)....

But there's no PLL "module" available in MU; given the relative ease of how to make one
just by patching, maybe there's no need for an A196 in MU.

On the other other hand, what would I change? First off, it's better to use a regular
VCO, with all of the nice modulations and alternate waveforms, so don't put that in
the module. Second, a better phase discriminator (something with state, so it can
track wider input frequencies. Third...hmmm... voltage conditioning (gain and threshold)
for the input signals? And maybe a slew limiter? How about an S/H triggered by
exceeding a threshold on the incoming master signal, so the PLL tracks to the
incoming frequency and then can hold the frequency even if the master signal goes
away?

I gotta stop lusting after Serge hardware, that's the truth of the matter.

- Bill
"Life is short. But we can always buy longer patch cords" - Savage

User avatar
VortexRanger
reticulating splines
Posts: 2454
Joined: Fri Mar 04, 2011 12:13 pm
Location: North Carolina

Post by VortexRanger » Sun Feb 03, 2013 9:22 am

This is clever and certainly doable in any format - plenty of Euro users who don't have an a196 for example.

The 196 PC2 is an RS Flip Flop - I don't know if there's a flip flop available in MU but euro users could conceivably patch it up with intellijel options. PC3: "more complex digital network." Hmmm, anyone know more details on that?
:hobbes:

User avatar
KnobHell
Super Deluxe Wiggler
Posts: 1129
Joined: Sat Jan 28, 2012 3:00 pm
Location: SLC

Post by KnobHell » Sun Feb 03, 2013 10:19 am

Bill, why not build some thing using the phase comparator from a cd4046?

Even cooler would be to make it a module with a frequency divider on the same panel.

Len

User avatar
Navs
Super Deluxe Wiggler
Posts: 4193
Joined: Fri Sep 18, 2009 3:49 am
Location: Berlin, Germany

Post by Navs » Tue Feb 05, 2013 4:40 am

Nice one, wsy :yay: This is what patching is all about - finding creative solutions.

I did something similar with Doepfer's A-172 min/max replacing the phase comparator:

viewtopic.php?t=53142

If you haven't got any pre-made logic blocks, even the XOR can be faked with a VCA, mixer and polarizing mixer.

User avatar
odecahedron
Super Deluxe Wiggler
Posts: 2489
Joined: Sat Feb 04, 2012 10:32 pm
Location: Wellington NZ

Post by odecahedron » Tue Feb 05, 2013 8:13 am

i still dont understand it - but i like it!

User avatar
paperCUT
Veteran Wiggler
Posts: 700
Joined: Sat Mar 12, 2011 11:13 pm
Location: Stockholm

Post by paperCUT » Tue Feb 05, 2013 8:29 am

sduck wrote:Hmmm, this is something I've heard about but never experimented with. Yet. I had to look up the diagram that's on the a196 web page to visualize this.

Image

I've got some CGS logic stuff here - I guess the XOR would work for the phase comparator?
I don't think this will work if the VCF is not DC coupled, a slew limiter might work better. Gonna test it tonight 8_)

User avatar
Bob Borries
Veteran Wiggler
Posts: 720
Joined: Sun Jul 11, 2010 11:41 pm
Location: L.A.

Re: Faking a Phase-Lock Loop without a Doepfer A196 PLL

Post by Bob Borries » Tue Feb 05, 2013 8:05 pm

wsy wrote:patch from the tracking source (any audio signal, but for
testing another VCO works well) to XIN of the ring modulator, patch from the
output of the ring modulator to the variable exponential frequency input of the slaved
Q106 VCO, and patch from the sine wave output of the slave Q106 to the bottom
half input of the Q125 thence from bottom-half output to the Yinput of the Q116 ring
modulator.
I made a diagram of the circuit, but is it correct?

Image

User avatar
wsy
Super Deluxe Wiggler
Posts: 2719
Joined: Wed Aug 24, 2011 10:20 pm
Location: near Boston Massachusetts USA

Re: Faking a Phase-Lock Loop without a Doepfer A196 PLL

Post by wsy » Tue Feb 05, 2013 9:23 pm

Bob Borries wrote:
wsy wrote:patch from the tracking source (any audio signal, but for
testing another VCO works well) to XIN of the ring modulator, patch from the
output of the ring modulator to the variable exponential frequency input of the slaved
Q106 VCO, and patch from the sine wave output of the slave Q106 to the bottom
half input of the Q125 thence from bottom-half output to the Yinput of the Q116 ring
modulator.
I made a diagram of the circuit, but is it correct?

Image
Yes, that's exactly correct!!!

Something I've been playing with lately: take a third Q106 VCO, set it for a very low
frequency (about 1-2 Hz) and run the pulse output into the slew limiter. Set the slew
limiter to "both" and 2. The result is a PLL that glitches on a very nice beat. It's
not dubstep but it's got good rhythm.

- Bill
"Life is short. But we can always buy longer patch cords" - Savage

User avatar
KnobHell
Super Deluxe Wiggler
Posts: 1129
Joined: Sat Jan 28, 2012 3:00 pm
Location: SLC

Post by KnobHell » Tue Feb 05, 2013 10:39 pm

But I want a real pll. I'm encouraging you to design a module around a 4046.

:bacon:

User avatar
wsy
Super Deluxe Wiggler
Posts: 2719
Joined: Wed Aug 24, 2011 10:20 pm
Location: near Boston Massachusetts USA

Post by wsy » Tue Feb 05, 2013 11:52 pm

KnobHell wrote:But I want a real pll. I'm encouraging you to design a module around a 4046.

:bacon:
The problem is that I'm currently unconvinced that a "conventional" PLL is actually
musically useful! That's why I'm hacking around with this patch-it-together; the
parts where it sounds good are when the PLL is NOT tracking perfectly, but
rather going into semi-chaotic cycles.

If I had to state it now, a good PLL is *not* musically useful as a slaved oscillator
in a pure modular. If you're processing an external signal, it might be useful; and a
bad (i.e. not tight tracking) PLL might be interesting to hear too.

Let me think on this...

- Bill
"Life is short. But we can always buy longer patch cords" - Savage

wmonk
Common Wiggler
Posts: 241
Joined: Thu Jun 03, 2010 1:01 pm
Location: Utrecht, The Netherlands

Post by wmonk » Wed Feb 06, 2013 6:35 am

This is a great example of patching the MU/5U way. One doesn't need exotic stuff to accomplish specific tasks. I just tried it on my DIY modular and it works. The ringmod I used (VC Ringmod designed by Fonik) needed some knob tweaking to get a proper XOR.
Quite a lot of sonic good stuff available. Thanks Bill :-)
My Website: kits in Europe
My Weblog

User avatar
KnobHell
Super Deluxe Wiggler
Posts: 1129
Joined: Sat Jan 28, 2012 3:00 pm
Location: SLC

Post by KnobHell » Wed Feb 06, 2013 9:24 am

Here in an interesting reference that includes a pll with divider. Let's you feed back different harmonics.

Pll

User avatar
wsy
Super Deluxe Wiggler
Posts: 2719
Joined: Wed Aug 24, 2011 10:20 pm
Location: near Boston Massachusetts USA

Post by wsy » Wed Feb 06, 2013 10:03 am

KnobHell wrote:Here in an interesting reference that includes a pll with divider. Let's you feed back different harmonics.

Pll
Ahhh- yes. THAT makes some sense. Putting a divider (or two dividers!) into the
PLL would let you resynthesize non-harmonics.

But what would that *really* get you? Different harmonics are just a constant
CV offset away in a 1V/octave synth (IIRC, some of the Paia synths were V/Hz,
so you couldn't go up an octave by adding 1 volt, or up a fifth by adding 0.498 volts.

I was trying to come up with *some* processing that one could insert into the PLL
loop that would make a result that isn't more easily achieved by mucking with the
control voltage, but I haven't been successful yet.

Yet. Other than dynamically changing the slew rate limiter and the slave's servoing
CV injection, at least.

But my theremin arrives today, maybe that will give me an idea. :)

- Bill
"Life is short. But we can always buy longer patch cords" - Savage

User avatar
VortexRanger
reticulating splines
Posts: 2454
Joined: Fri Mar 04, 2011 12:13 pm
Location: North Carolina

Post by VortexRanger » Wed Feb 06, 2013 10:16 am

wmonk wrote:This is a great example of patching the MU/5U way. One doesn't need exotic stuff to accomplish specific tasks.
Loving this thread, and all creative threads like it. But I'm going to have to take exception to the notion that this "way" of patching is in any way exclusive to 5U. Thoughtfulness pays off in any format! :party:
:hobbes:

defenestration
Veteran Wiggler
Posts: 611
Joined: Tue Dec 06, 2011 4:21 am
Location: chicago

Post by defenestration » Wed Feb 06, 2013 1:41 pm

thank you very much for sharing! I will definitely be coming back to this thread

curious what the WMD guy would say about 'musically useful PLL' and whatnot - his Synchrodyne design gets my rocks off on a regular basis, but obviously that's not just a PLL (although it's really the heart of the module)

jonah
searching for "switch nipples"
Posts: 1420
Joined: Mon Oct 25, 2010 6:05 am

Post by jonah » Wed Feb 06, 2013 4:28 pm

wsy wrote:
KnobHell wrote:But I want a real pll. I'm encouraging you to design a module around a 4046.

:bacon:
The problem is that I'm currently unconvinced that a "conventional" PLL is actually
musically useful! That's why I'm hacking around with this patch-it-together; the
parts where it sounds good are when the PLL is NOT tracking perfectly, but
rather going into semi-chaotic cycles.

If I had to state it now, a good PLL is *not* musically useful as a slaved oscillator
in a pure modular. If you're processing an external signal, it might be useful; and a
bad (i.e. not tight tracking) PLL might be interesting to hear too.

Let me think on this...

- Bill
Speaking about the Doepfer, it's probably more conventionally useful for generating control signals, if you treat it as a pitch follower rather than an audio source.

Sonically, they are either raw or minimally filtered square waves, so it generally requires just as much processing as any other squares to sound musical, I think.

It does interesting things with AM'd or FM'd signals....

Long story short, a PLL sounds great with a fuzz. :lol:
[video][/video]

It's funny how much these go for when you can get all the functionality (and in my opinion more interesting sound) out of a small Doepfer setup. Love that color scheme though. :lol:

User avatar
dslocum
darwin's nemesis
Posts: 1962
Joined: Sat Aug 29, 2009 6:58 am
Location: "Exit 89", NJ USA
Contact:

Post by dslocum » Fri Feb 08, 2013 1:21 pm

Unless I missed something, I very surprised that no one has mentioned adding a frequency divider in the feedback loop to make a frequency multiplier!
Doug Slocum
Synthetic Sound Labs
www.steamsynth.com
------------
"I guess all the Forest Mims Radio Shack books I read finally paid off!"
"I ordered twice as many _______ as I thought I'd need, only to find out that I'm still less than half way to having enough."
"...this whole thing was started by a dream and a mouse." - Walt Disney
"Flatulence sounds aren't just for brass and reed instruments anymore, thanks in large part to Dr Moog." - Ockeghem

User avatar
wsy
Super Deluxe Wiggler
Posts: 2719
Joined: Wed Aug 24, 2011 10:20 pm
Location: near Boston Massachusetts USA

Post by wsy » Fri Feb 08, 2013 3:15 pm

dslocum wrote:Unless I missed something, I very surprised that no one has mentioned adding a frequency divider in the feedback loop to make a frequency multiplier!
I think it got mentioned in passing a while up.

A (minor) issue is that this is a completely -analog- PLL; with no thresholds other than
zero crossings. Doesn't mean we can't make it work with a divider in each chain, just
means it's a little twitchier (go look up Logan's theorem - it's the poorer cousin to
Fourier's theorem).

Fourier's theorem says "you can recreate ANY wave with sine waves" (*)

Logan's theorem says "you can recreate ANY wave with just knowing the
zero crossings"(**)... and that's what we know in most PLL chips.

The problem is the * and **. For Fourier, it's "any -infinitely long- wave".

For Logan, the problem is "as long as the signal stays in one octave." That's the problem
with a wideband PLL - if the signal is mixed (i.e. the chords from the video above) then
tracking goes to heck and you get basically distorted noise. The "note-y" stuff works
better, because it has a single dominant first harmonic and the PLL can lock to that.

Anyway - Doug: if you want me to come up with the "PLL Core Module" proposal,
say the word and I'll get on the case.

- Bill
"Life is short. But we can always buy longer patch cords" - Savage

Post Reply

Return to “Modular Synth General Discussion”