Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

The Phase-Locked Loop

Status
Not open for further replies.

Euler's Identity

Advanced Member level 4
Joined
Jul 31, 2006
Messages
108
Helped
11
Reputation
22
Reaction score
4
Trophy points
1,298
Activity points
2,771
Granted this isn't quite an elementary electronics question, but in asking it I do feel quite elementary, but...

A PLL consists of
1. Phase detector (PD)
2. Loop filter and a
3. Voltage-controlled oscillator

The PD outputs V/rad, the average DC voltage of the phase difference between two signals.

The loop filter determines the response time (the damping) of the PLL and it establishes the PLL's bandwidth.

The VCO outputs rad/V, the output frequency fed back to the PD. (Even though it's a phase detector, it's actually receiving two frequencies from which the phases are compared.)

These things I know. Likewise, I've now successfully designed and built a well-working PLL, thanks to another thread in this forum (one of the forums) that directed me to a TI app note that gave me two equations and two unknowns for designng the loop flter.

However, thoughout all of this, I still haven't seen the math of it all actually come together.

I am familiar with the Laplace transform and I'm no stranger to Calculus; although, my ODE knowledge is rather rusty now. But figuring out the math of this PLL is naggng on me.

The way I've used the Laplace transform in the past was to solve for Vo(s)/Vin(s)=F(s). Then I've rearranged it and inverted it to get Vo(t). But how do I get anythng out of this PLL? Every book I've read or note I've read, for some reason, does not take the Laplace transform of all the blocks, only the loop filter and the VCO. Yet, the PD's equation looks like

Vc=Kd(Φo-Φi)

right?

Hence, taking Laplace of this we get

L[Vc] = L[Kd(Φo-Φi)]

Vc(s) = Kd(Φo(s)-Φi(s))

right?

That's what ΔΦ means, right?

Also, as another question about this, I keep seeing

Δω = KoVc

for the VCO. Thn the substitution is made that, since ω=dΦ/dt, we can say

dΦ/dt = KoVc,

but it doesn't say ω; rather, it says Δω. How does Δω become ω?? The one is the radian frequency output of the VCO, and the other is the change between the previous radian frequency output and this one. What am I missing? I agree that both Δω and ω have the same units, rads/s, but I'm not seeing them as the same thing such that one can substitute for the other. Can you explain this to me?

As I said in the beginning, true, this isn't elementary electronics, but I do feel pretty elementary for asking it.

One last thing, I'm not getting the ω=dΦ/dt thing either, unless dΦ/dt is actually the constant I'm seeing it as. Yeah, the rotating radius is changing phase as time increases, but it's changing at a constant rate, right? Hence, dΦ/dt is a constant, yes?

Oh well. Hopefully someone out there can clue me in to getting this derivation of the PLL equation that I used to get the time constants for my design so that it worked the first time. As I see it, it's still not my design, when I'm using another's equations, even though the circuit works and even though I did calculate the resistor and capacitor values. I don't know if you can relate, but it's just not my design yet, not until I can derive this loop equation on my own.

Added after 2 hours 50 minutes:

Ah :-(

I was hoping someone out there online could clue me in on this PLL design thing.

What I'm asking about is how do I create the loop equation.

It's block1 times block2 times block3 equals something, and then from that equatoin you can get equations for ωn and ωf, depending on what kind of loop filter is used in block2, where the ratio of ωf/ωn determnes the damping of the system and, therefore, the component values of the filter.

I'm pretty sure I'm trying to see somethng that looks like

Φo(s)/Φi(s) = X(s)

But, from where I come from, a transfer functon had an output, like Vo(s) = X(s)Vin(s)

So, does the PLL equation look like Φo(s)=X(s)Φi(s)?

But I thought the output of a PLL was a frequency, as in the VCO spits out a frequency based on its control voltage, Vc?

I'm just not getting it. :-(

Where is Vo(f) = a square wave at some fundamental frequency?? ....will it spit out the fourier series? Or is it just a generic thing? A frequency and, therefore, an assumed-to-be sine wave?

A PLL can lock onto a harmonic. A harmonic frequency is not the fundamental frequency. Therefore, phase and frequency aren't the same thing. But yet this X(s), however it comes about, only speaks of phase??

Then there's, of course, this Δω=ω???

[chuckle] This the point where people I've spoken with thus far ask, you don't have a television, do you?

I just want to get this, want to see why my "design" worked, mathematically.

With an op amp, I can put in 1v and get out roughly 10v because I designed it to work that way. I can prove it works that way because I can use Vo=A(v+ - v-) and the voltage divder rule as necessary to derive Vo/Vin, but with this PLL, I don't mathematically understand how an output of ωo=ωin. ...even with the math classes I've, quite frankly, aced: Pre-Calc, U. Calc I, U Calc II, ODE, and MVCalc.
Should I have had PDE or something?

Laplace is wonderful, but it's useless if you can't write the loop equation and, therefore, don't understand, at least mathematically, how it relates to the design that works, where that output frequency's value came from. It's hard for me to believe that this simple circut I created* can't possibly run afoul just because it works beautifully right now. It'd be good to know I didn't miss something, for I'm usnig someone else's equations. It's not my design! If it breaks, how will I fix it, aside from fiddling here or there?

* "My design" is four resistors, two capacitors, a five volt supply, and an MC14046. Setting the damping (per Excel's crunching) at approx 0.7 it locked so fast that I thought I had a short from Vin to Vo, until I changed Vin's f and saw Vc change as Vo's f changed. I said "Eureka!" ...but then I said why? If I can answer why, THEN I can answer why not if and when it breaks. It's a quite elementary concept as I see it.
 

Ok, I've got some of it

Phase Detector (PD)
-----------------------

1) Vd = KΦΔΦ

where:
Vd is the average DC voltage developed from comparing ΔΦ
KΦ is the PD conversion gain (V/rad), and
ΔΦ = Φin - Φout ...not the other way around ;-)


Loop Filter
------------

2) Vc = VdF(s)

where:

Vc is the control voltage to the VCO (the output voltage of the filter), and
F(s) is the Laplace Transform of th filter chosen for the PLL (no dimension)


Voltage Controlled Oscillator (VCO)
----------------------------------------

3) ωout = KoVc

where:

ωout is the output radian frequency from the VCO (rad/s), and
Ko is the conversion gain of the VCO ((rad/s)/V)



Now take the Laplace Transform of each equation

L(eq 1) = L[Vd = KΦΔΦ] = L[Vd = KΦ(Φin - Φout)]
eq 1': Vd(s) = KΦ(Φin(s) - Φout(s))

L(eq 2) = L[Vc = VdF(s)]
eq 2': Vc(s) = Vd(s)F(s)

L(eq 3) = L[ωout = KoVc]

but!

ωout = dΦout/dt therefore

L(eq 3) = L[dΦout/dt = KoVc]
Φo(s)s - Φ(0) = KoVc(s) ...here out's been changed to a simple o

and assume Φ(0) = 0, so you get

eq 3': Φo(s)s = KoVc(s)


Now, do a bunch of substitution to get Φo(s)/Φi(s)

Sub eq 2' into eq 3'

Φo(s)s = KoVc(s) = Ko[ Vd(s)F(s) ]

Then, sub in eq 1'

Φo(s)s = Ko[ Vd(s)F(s) ] = Ko[ [ KΦ(Φin(s) - Φout(s)) ]F(s) ]

Now pull out KoKΦF(s) ...remember out and in s o and i now

Φo(s)s = KoKΦF(s)(Φi(s) - Φo(s))

and then flip KoKΦF(s) left and Φo(s) right (easier seen in two pieces)

s
----
KoKΦF(s)

=

Φi(s) - Φo(s)
---------------
Φo(s)

which becomes

s
----
KoKΦF(s)

=

Φi(s)
------- - 1
Φo(s)

Now send the 1 to the left which gives

s
----------- + 1
KoKΦF(s)

=

Φi(s)
-------
Φo(s)

Then the left side changes

s + KoKΦF(s)
----------------
KoKΦF(s)

=

Φi(s)
-------
Φo(s)

Finally invert and swap sides

Φo(s)
-------
Φi(s)

=

KoKΦF(s)
----------------
s + KoKΦF(s)


This is now the Laplace Transform of the transfer function of the PLL, and we'll call it PLL(s).


The things that screwed me up were:

1. Δω changng to ω. However, the VCO is outputting ωo, not Δω, so why not say that? ...authors...

2. Then, after that hurdle, I still found my signs wrong until I realized ΔΦ was NOT Φo - Φi but, rather, Φi - Φo

3. Finally, the Laplace Transform of a derivative is the function in s multiplied by s minus the function at 0. Somewhere along the line, without telling me, it was assumed that the phase at 0 was 0. Stupid me... And I thought a VCO started out to lunch until it got a control voltage to bring the phases in line. Apparently I was to assume that the phases were already in line, making Φo(0)=0.

Now that I have the transfer function PLL(s), what do I do with it?

Since that Laplace of the derivative in the VCO block was assumed to be taken when Φo(0)=0, and Φi is assumed to be 0 (you always assume the input is at 0 deg = 0 rad), the transfer function PLL(s) is the loop when locked, or Φo(s)=Φi(s).

Therefore, it seems reasonable to set PLL(s) = 1?? And then, from there, somehow solve for ωn, ωf, and τ??

For the lag filter (I mistakenly said lead-lag before)

F(s)

=

s + 1/τ2
----------
s + 1/(τ1 + τ2)

where τ1=R1C, τ2=R2C, and s=jω.

But the standard form of the equation for a second order system is

s^2 + s2ζωn + ωn^2

so somehow we have to manipulate PLL(s) into that after sub of F(s).

But it'll have to wait, because I'm not there yet. :-(

(I'm not going to review, so sorry for any typoes.)

Added after 21 minutes:

Oops! I think F(s) is wrong.

This is the filter:


Vin --- R1 ---- Vo --- R2 ---- C ---- Vref (usually ground)


Gotta go!
 

Continung, the loop filter looks like:

Vin --- R1 ---- Vo --- R2 ---- C ---- Vref (usually ground)

But it should be understood (and this goes for the above derivations too) that all V's are functions of time, so technically that should've been

Vin(t) --- R1 ---- Vo(t) --- R2 ---- C ---- Vref(t) (usually ground)

Now, to make the use of the Voltage Divider Rule less cumbersome, make Vref(t)=0 for all t (make it ground), giving

Vin --- R1 ---- Vo --- R2 ---- C ---- ground

Next, take the Laplace Transform and name V's appropriately

Vd(s) --- R1 ---- Vc(s) --- R2 ---- 1/(sC) ---- Vref (usually ground)

and create the VDR eq

Vx=(Rx/Rt)Vt

so (breaking it up again)

Vc(s)

=

(R2 + 1/(sC))Vd(s)
-----------------------
R1 + R2 + 1/(sC)

Moving flipping Vd(s) and multplying right by sC/sC=1

Vc(s)
-------
Vd(s)

=

sCR2 + 1
--------------------
sCR1 + sCR2 + 1

Using τ1=R1C, τ2=R2C, and factoring

Vc(s)
-------
Vd(s)

=

sτ2 + 1
-----------------
s(τ1 + τ2) + 1

But since this is going to be sub'd into PLL(s), we don't want Vc(s)/Vd(s) but, rather, F(s) = Vc(s)/Vd(s)

So now we have what we need:

F(s)

=

sτ2 + 1
-----------------
s(τ1 + τ2) + 1


and this will be stuffed in

PLL(s)

=

KoKΦF(s)
----------------
s + KoKΦF(s)


But this will have to come later as I haven't the time now.



P.S. I'm going through this, answering my own question here, because I don't want others out there to have to go through what I went through to create a PLL design and, also, so that when I get stuck others who've followed can help me. The goal is to get to TI's two eq's and two unknowns, the eq's I used to get "my design" to work the first time, which will then make "my design" my design. ;-)

P.P.S. As a former (formally, but I'm always learning) student, it used to irk me that "easy" explanations/derivatons always left one hanging somewhere. With this PLL derivation I intend this NOT to be the case.
 

hi , just a silly question r u explaining here or asking or what?
 

It started as an ask, but it got no answers, only reads.

So, it's now become an ask and answer thread. Although I have more stuff to add to the thread, more answer, I haven't much time to post right now.

At this point, I now have the eq for ωn, which I will add later, but I still haven't gotten the eq for ωf. (See TI's hct4046/7046 app note ...50 pages... for the details.)

(I'm at the |f(jω)|^2 = 0.5 point which spits out ωf somehow. Would f(jω) be PLL(jω)? I think it is, but I'm not sure. Somehow I can get ωf...)

The design required ωf/ωn, so I still need ωf before I can call it "my design."

Hence, in short, if you have somethng to add to add to this thread, feel free. Give answers, ask questions, or just relay your experience with PLL's.
 

So we left off here:

----------- begn ------------
So now we have what we need:

F(s)

=

sτ2 + 1
-----------------
s(τ1 + τ2) + 1


and this will be stuffed in

PLL(s)

=

KoKΦF(s)
----------------
s + KoKΦF(s)

-------------- end -------------

So stuff!

PLL(s)

=

KoKΦ(sτ2 + 1)
-----------------
s(τ1 + τ2) + 1
------------------------------------------------ (to make it obvious)
s[s(τ1 + τ2) + 1 ] + KoKΦ(sτ2 + 1)
------------------------------------------
s(τ1 + τ2) + 1

where the denominator was tweaked a little.

Then dump the common denominators to get

PLL(s)

=

KoKΦ(sτ2 + 1)
------------------------------------------------
s[s(τ1 + τ2) + 1 ] + KoKΦ(sτ2 + 1)

Then expand the denominator

PLL(s)

=

KoKΦ(sτ2 + 1)
------------------------------------------------
s^2(τ1 + τ2) + s + sKoKΦτ2 + KoKΦ

and then group, giving

PLL(s)

=

KoKΦ(sτ2 + 1)
------------------------------------------------
s^2(τ1 + τ2) + s(1 + KoKΦτ2) + KoKΦ


Now, we're trying to put this in terms of ωn and ζ, loop natural frequency (in radians) and damping (dimensionless), respectively. Also, since this is a second order denominator (and the numerator is of lower order) we need the denominator to look like the characteristic eq of a second order system:

s^2 + s2ωnζ + ωn^2

Hence, we need to lose the coefficient from the s^2 term, giving

PLL(s)

=

KoKΦ(sτ2 + 1)
------------------
(τ1 + τ2)
----------------------------------------------------------
s^2 + s(1 + KoKΦτ2)/(τ1 + τ2) + KoKΦ/(τ1 + τ2)

Now we have ωn, because

ωn^2 = KoKΦ/(τ1 + τ2)

so

ωn = [KoKΦ/(τ1 + τ2)]^0.5

This is the first TI eq I used.


Next, we can sub in ωn^2 to get

PLL(s)

=

ωn^2(sτ2 + 1)
----------------------------------------------------------
s^2 + s[1/(τ1 + τ2) + τ2(ωn^2)] + ωn^2

and then get ζ via

2ζωn

=

1/(τ1 + τ2) + τ2(ωn^2)

so

ζ

=

1/(τ1 + τ2) + τ2(ωn^2)
----------------------------
2ωn

which is

ζ

=

ωn
----
2

1
----------------- + τ2
ωn^2(τ1 + τ2)

leaving

ζ

=

ωn
----
2

1
------- + τ2
KoKΦ



This is also TI's ζ solution.

However, this is where things go hokie, for my PLL(s) is not TI's H2(s), and that's where they're getting ωf, I think.

Also, notice the typo in their denominator? ...they left out an s.

Somehow I need |f(jω)|^2=0.5, but I'm not sure what they used for f(jω).

Likewise, why =0.5?

Half power? 0.707? Something like that in some way?

(I'm hoping someone is readng all this and can help me now. It's probably obvious, but I'm still pondering.)

Once again, please pardon typoes...
 

Ok, I think I've figured out some more.

The significance of |f(jω)|^2=0.5 is all about 0.707.

If we had a complex number a+jb, in rectangular notation, and we wanted to speak of its magnitude, a convenient way of saying it is |a+jb|. (Note that |a+jb|=(a^2 + b^2)^0.5.) Likewise, were a+jb a function of jω, and we wanted to describe its magnitude, we'd call it |f(jω)|.

But in this case, we're talking about the Laplace Transform, a function of t (f(t)) transformed to a function of s (F(s)). (We're talking about the filter's transfer function incidentally, not the entire loop.) Were s=jω, we'd be talking about the complex response of the filter at ω. However, this guy (this TI PLL author) was only concerned with the magnitude of f(jω), so he refers to it as |f(jω)|.

Next, with filters, we're concerned with cutoff frequency, the frequency where the magnitude of the output is 0.707 of the inout. For example, for the usual simple RC filter, the cutoff frequency is found like so:

Circuit
---------

vin ----- R ------ vo ------- C ------ GND


Transfer function
--------------------

f(jω)

=

vo
----
vin

=

1/(jωC)
------------
R+ 1/(jωC)


Cutoff frequency
---------------------

The cutoff frequency is where vo=0.707vin, so where vo/vin=0.707

To find this, we take the magnitude of f(jω) and set it equal to 0.707, and this gives us the equation

|f(jω)|

=

[(1/(ωC))^2]^0.5
----------------------------
[R^2 + (1/(ωC))^2]^0.5

=

0.707

Now, we must solve this thing for ω.

Aha! The first thing we'll do is square both sides to eliminate the radical. Squaring both sides gives

(1/(ωC))^2
----------------------
R^2 + (1/(ωC))^2

=

0.5

or, in other words,

|f(jω)|^2=0.5

(Look familiar? Now why didn't the guy just say "the cutoff frequency in radians"? It'd've been too clear I'd suspect. ...authors... akin to professors...)

So, solving it we have

(1/(ωC))^2
----------------------
R^2 + (1/(jω))^2

=

0.5

so

2[(1/(ωC))^2]
----------------------
R^2 + (1/(ωC))^2

=

1

and so

R^2 + (1/(ωC))^2 = 2[(1/(ωC))^2]

Multplying both sides by (ωC)^2 gives

(ωRC)^2 + 1 = 2

which is

(ωRC)^2 = 1

so

ωRC = 1

giving

ω = 1/(RC)

= 2Πf (goofy looking pi)

and then the familiar

f(cutoff)

=

1
----
2ΠRC


This is the cutoff frequency. But we actually wanted ω, so just keep the boldfaced equation.

That's all this guy is doing, but he's doing it with the lead-lag filter; whereas, above we used the familiar RC filter.

I guess this guy just figured the reader would know this. Oh well, now that I've figured this out maybe I'll get the last equation, the equation for ωf, the cutoff frequency (in radians) of the filter.
 

Well it's official. This thread is now an answer thread. Why? Because I have the last equation now.

Here it is:

Using our F(s)

F(s)

=

sτ2 + 1
-----------------
s(τ1 + τ2) + 1

change it to f(jω)

f(jω)

=

jωτ2 + 1
-----------------
jω(τ1 + τ2) + 1

Next find |f(jω)|

|f(jω)|

=

[(ωτ2)^2 + 1]^0.5
-------------------------------
[ [ω(τ1 + τ2)]^2 + 1]^0.5

Then make it |f(jω)|^2

|f(jω)|^2

=

(ωτ2)^2 + 1
------------------------
[ω(τ1 + τ2)]^2 + 1

Then set |f(jω)|^2=0.5

(ωτ2)^2 + 1
------------------------
[ω(τ1 + τ2)]^2 + 1

=

0.5

Now remember that ω is actually ωf and solve for ω.

First, multiply by two on each side to get a one on the right.

2[(ωτ2)^2 + 1]
------------------------
[ω(τ1 + τ2)]^2 + 1

=

1

This allows us to equate the top and bottom of the left side.

2[(ωτ2)^2 + 1] = [ω(τ1 + τ2)]^2 + 1

Now multiply out

2(ω^2)τ2^2 + 2 = ω^2(τ1 + τ2)^2 + 1

Then make constant=function

1 = ω^2(τ1 + τ2)^2 - 2(ω^2)τ2^2

Factor the right

1 = ω^2 [(τ1 + τ2)^2 - 2τ2^2]

Swap sides and get ω^2 by itself

ω^2

=

1
---------------------------
[(τ1 + τ2)^2 - 2τ2^2]

Then expand the left side.

ω^2

=

1
--------------------------------------
[(τ1^2 + 2τ1τ2 + τ2^2) - 2τ2^2]

Simplify

ω^2

=

1
-------------------------
τ1^2 + 2τ1τ2 - τ2^2

and then solve for ω

ω

=

1
-------------------------------
(τ1^2 + 2τ1τ2 - τ2^2)^0.5


This is the other TI equation I used.


Wow! It's now my design! :D :D :D


However, it's occurred to me that this thread has become rather long, but it'd be very valuable information for the person who, like me, came to this thread looking for help with designing a PLL. Therefore, I will create a post that is a summary of the entire design. That way the thread's meat can be easily c&p'd. ...without the typoes, hopefully ;-) (Did you catch that jω goof? I didn't fix it, as the next step corrected it.)

This has been fun! But the summary comes later, as I'm busy again.


P.S. I know people have been reading this, because I've seen the numbers increase over the days. This is why I continued, largely, here, even though no one spoke. How about checking in folks? Did you like? Did you not like? Are you confused? I can't say I'm much more knowledgeable after all this, concerning PLL's, but I have learned, so maybe I can help if you don't get something? Nevertheless, whatever the case, I'd just like to hear from you lurkers out there.

P.P.S. Once again, please pardon the typoes.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top