#60: Basics of Phase Locked Loop Circuits and Frequency Synthesis

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Oh hey PLLs

his demo is on digital PLLs but just in case someone is messing with analog PLLs: (some of the points apply to both cases)

  • the amplitude of the phase detector input signals must be similar, idealy the same. Otherwise, performance is subpar.

  • for a phase detector in general in an analog PLL, there is no need for a loop filter. It's a phase detector, it doesn't output harmonics, just the difference of the phase of the input signals. If the phase detector is implemented using a frequency mixer, then for the "phase detector" to become a phase detector, not just a signal multiplier ("frequency mixer"), a filter is needed.

  • loop filter order is crucial. Significant phase delay inserted by the loop filter deteriorates PLL performance. offsetting the vco phase output accordingly may compensate.

  • when he says monotonic he meant to say "monotonically increasing".

  • in an all-digital pll, you may do without a loop filter completely, if the vco may accept a pwm signal

i welcome any and all responses

👍︎︎ 8 👤︎︎ u/[deleted] 📅︎︎ Jul 18 2014 🗫︎ replies

Excellent!

👍︎︎ 4 👤︎︎ u/lungdart 📅︎︎ Jul 18 2014 🗫︎ replies

good video. felt like a proper, planned lesson and not just some guy futzing around in his lab.

👍︎︎ 4 👤︎︎ u/[deleted] 📅︎︎ Jul 19 2014 🗫︎ replies

I want that nixie tube freq counter!

Excellent video.

👍︎︎ 8 👤︎︎ u/PM_YER_BOOTY 📅︎︎ Jul 18 2014 🗫︎ replies

Just as I was googling PLL fundamentals. Thanks!

👍︎︎ 6 👤︎︎ u/icetalker 📅︎︎ Jul 18 2014 🗫︎ replies

I really enjoy your videos. They are great.

I have a really basic and simple question. I feel I run up against this a lot when thinking about circuits. I just don't understand why certain things are necessary.

In this case for instance, why would I want to generate a new phase locked signal? Can't I just work directly with the original signal? :s

👍︎︎ 3 👤︎︎ u/ickysticky 📅︎︎ Jul 19 2014 🗫︎ replies

For type 1 detectors, since the polarity of the phase difference seems to be lost, how does the VCO determine whether the frequency needs to be adjusted up or down? All I could think of is that the phase of the pulses relative to the VCO's output is used?

👍︎︎ 3 👤︎︎ u/paul_miner 📅︎︎ Jul 18 2014 🗫︎ replies

I just want to commend you on making so many great videos. Thanks!

👍︎︎ 3 👤︎︎ u/petemate 📅︎︎ Jul 18 2014 🗫︎ replies

Dude, you're a boss. Now I finally have an understanding for how this works.

👍︎︎ 3 👤︎︎ u/cvenomz 📅︎︎ Jul 29 2014 🗫︎ replies
Captions
okay here's an out of the video by request this one is uh just talking about the very basics of phase lock loop circuits okay phase locked loops are basically a circuit that allows you to lock two signals together - in frequency and phase ideally and that can be used for a number of purposes for things like FM or AM you can AMD modulation frequency synthesis tuning control clock recovery tone decoders etc and all phase locked loops you know kind of start off with kind of a variation of this very basic block diagram so there's a phase detector whose job it is to compare the phases of the two AC signals that are appearing at the inputs and give you an output whoo basically it's usually pulses who typically the pulse repetition and duty cycle is proportional to the phase difference at the two inputs as a couple of different phase detectors will briefly look at those so those pulses then we're going to go into a low-pass filter a low-pass filters job is to essentially take out all the high frequency components out of that and create essentially a near DC control voltage that is used to adjust the tuned input of a VCO or voltage controlled oscillator the voltage controlled oscillator quite simply is a oscillator circuit whose output frequency is directly proportional to the voltage the control voltage at the tune input okay so the idea here with this loop is that if a phase error is detected between these two or phase offset is detected between the two inputs that's going to create some pulses here that's going to get filtered to ADC control voltage that will adjust or change the frequency and phase of this oscillator and try to close that phase difference that exists between those two so that's how the loop works so it's really not quite simple and the idea typically is you might use this you know and for a lot of these different applications so let's take a look at a couple of these you know these circuits in more detail the loop filter is really nothing more than a simple low-pass filter in many cases it might be a simple RC filter so nothing really much more to say about that and the idea it's job is just to take the pulses out of the phase detector and convert them into a control voltage to control the VCO VCO okay is simply an oscillator whose frequency can be changed by some external voltage and it could have a number of different characteristics you know the control voltage can be moved up or down and then the output frequency can sometimes be perfectly linear it might have some offset - it might even have a curve to it the important thing here is that it needs to be monotonic over the range that where it's going to be used inside the loop meaning that the slope always has to be positive we can't have a thing curl over and come down because that would reverse the feedback in the loop and the loop wouldn't work another way to look at the way a VCO works or its behavior is if the input control input voltage would say it goes up linearly over time and the output frequency would get faster and faster and faster over time okay so that's a simple way to think about a VCO we could actually go take a look at that here on the board on this board I've got one of these guys a CD forty forty six very very popular CMOS integrated phase locked loop circuit okay he's buried under there under all the probes okay so let's go take a look at at the VCO on that so this guy right here is connected to this power supply that I can use to adjust the VCO is output frequency and let's see which one it is on probing here so this let's take let's take this probe right here and put him on the VCO output okay so that's on the VCO PAP output I'm also probing the VCO output on this frequency counter okay so right here on channel one let's just look at just channel one here that the signal right there is the output from this VCO okay I'm also going to take this alligator clip here onto this voltmeter okay so this voltmeter is measuring the voltage that I'm putting in from that power supply okay so if I go grab the power supply by very it's voltage up or down we can kind of see that on the voltmeter okay and I'm going to continue to just kind of do the same kind of slow oscillation of this power supply voltage so you kind of see the effect what it does in the VCO output okay so if you look at the scope okay we can actually see the frequency going up and going down going up and going down and that's going up and going down and proportional to the control voltage I'm applying you look at the counter you can actually see going down going up going down going up so pretty simple that's all the VCO is that's all the VCO is going to do for us and that's that's really what's going on with that so that's what the VCO is that's inside of this loop so the output of the loop filter is going to drive that input and adjust the frequency and phase into the phase detector okay so let's go disconnect some of these guys okay and what we're going to do now is go take a look at these phase detectors and what they are okay so yeah face detector is typically are of two types won't that they're literally called type one and type two type one is where the from a digital standpoint it looks kind of like an XOR gate for RF type applications is typically done with a balanced mixer and the idea is is that this type of face detector gives you an output whose pulse width or duty cycle on the output is proportional to the phase difference so you think about it from an XOR case if these two signals were perfectly lined up the two inputs would never be different and you would in the output always stay at zero whenever the output you know the input voltages are different then we're going to get a pulse out of the output that's why the exclusive-or works we only get a one output when the inputs are not equal to each other so if we take that in this case I've got in one leading in to in terms of phase we're getting this pulse out and if we filter that we'd get some kind of a voltage that looks like this so you can imagine this voltage will vary from ground to VCC okay depending on what the phase difference is I - that's another way to look at it the filtered voltage output will be proportional to the phase difference of the input okay there's some advantages and disadvantages you know to each of these two this particular phase detector let's go see how that works okay so I've got two signals going into here now so what I'm going to do is I'm going to take the probe that was using to look at the VCO output I'm going to look at that signal I've got going into channel 2 to this input here so I've got the signal generator that's generating two signals okay both of the same frequency and phase okay they're going into the two inputs of the phase detector for this CD 4046 PLL and this probe right here is looking at that phase detector one output okay so if I put that up on the screen here and see it's actually that guy right there okay so right now these two signals are in phase okay and I'm out of the generator so I don't really have an output you can just barely see a couple of blips on there if you look carefully right so if I go and adjust the phase okay of this signal and let's move that over here now if I adjust the phase of the signal you look at the signals themselves okay by just the phase we can actually see in this case the lower one is being advanced that's going to come on sooner so now that guy comes on it's kind of expand this out alright that guy comes on first that causes the output to go up and then when the other guy comes on across the output to go out if I adjust the phase back and forth you can kind of see how that works okay so now I'm lined up in phase go back on lined up I'm out of phase I was interesting is that you can see say the duty cycle there I'm about 45 degrees out of phase there okay if I go 45 degrees the other way I get about the same result okay so it really ket doesn't give you too much of an idea of whether you're leading or lagging that's one of the downsides to this particular phase detector design and because of that because it got to have this reverse slope here that the loop Cano you want to you got to be careful about how you set this loop up so it properly locks it also leads to the reason why this this type of phase detector will sometimes lock on a harmonic signal now if we've got a look at what that looks like if we filter it the easy way is that just to put our meter on it because the meter movement will kind of form a low-pass filter okay so if I stick my meter on there so right now these signals are lined up so like a very little pulse is coming out a very little voltage seen on my meter if I adjust my phase again here okay adjust the phase we can see that voltage coming up on the meter because now I'm integrating that voltage like to bring this up even further so I get about 50% duty cycle there when I'm 90 degrees out of phase there I am about half VCC okay if I keep going and phase okay now and get nearly on all the time and nearly there I am nearly up at BCC okay so we can kind of say if I adjust the phase I can actually change you know that voltage and that would be the voltage out of the low-pass filter that drives the VCO okay so let me just set that phase back to zero here oops let's go to zero put that back to zero okay so there we are back to zero got kind of a DC zero output out of that phase detector so I'll pull that guy off okay so the other type of phase detector sometimes both type 2 also known as a phase frequency detector or PFD a little bit more complex there's actually some complex logic that goes on in here we're not going to talk about that but the end of the day the way it works is that whenever whichever signal is leading whichever one comes on first that's going to turn on either this p channel device or this end channel device okay so this one is leading it'll turn on the P channel this one's leading it will turn on the N channel example okay and but when once those and then essentially when the other signal comes along it turns off that device here's a way to think about it so let's say the input on channel one comes up first that's going to turn on the P channel device when the input from two comes along okay at some phase difference it's going to shut off that P channel device okay so once that's off this output is essentially high impedance okay so it's essentially going to dump some charge they be into the capacitor of the loop filter okay but then in the other case if this guy was leading when this guy comes on it will turn on the end device and then when the other guy comes along it will turn on the P device and shut that or Ebay will will shut off the end device so that so in this case we're going to be pushing charge on to this capacitor and in the case where in to is leading we're going to be pulling charge off of that capacitor so you can kind of see how we're going to do this kind of charge pump action okay again this has some good good features and bad features about it as well the good thing particularly is that it it is a frequency detection so it doesn't have that ambiguous quality that the type one phase detector had when it came to detecting frequency and it won't lock on harmonic signals and it doesn't have to have 50 percent duty cycle signals it's not as good at working with noisy signals as type 1 phase detector is so let's look at that output okay so in order to make this work since this this node here is open circuit you know most of the time okay when the signals are in phase I'm adding a little two resistors here from VCC to ground so that I can have a establish voltage here we'll be able to see a positive blip or negative blip depending on which signal is leading or lagging okay so I can take this probe here and take a look at actually I think I've already got a probe on that I do so that probe is actually channel 3 so I'm going to turn channel 3 on ok so I've got these same signals on here that I was looking at before and now they're in phase and we can see I don't really see any voltage going on here on it that the phase detector output because the signals are in phase if I go and adjust the phase of this again okay we're going to see what happens so if I adjust that phase okay so now that lower one is leading and we can see I'm getting positive blips on that phase detector output okay if I adjust the phase such that the top one is leading now I'm getting negative blips so it's nice thing about this we get an indication of whether we're which signal is leading which one is lagging we don't really get that that indication from the first type of phase detector so so this is kind of nice or not standpoint and the same property is what means that it will make this work for a frequency difference we'll actually get an indication in the right direction if we have a large frequency difference between these two signals okay so that's how that phase detector works okay so now we've got enough information here we can go close the loop on this okay so what I'm going to do is disconnect that little test circuit that I had on that phase detector okay so that's disconnected now and I'm going to take this probe that was used to probe that channel to input I'm going to use that and probe the VCO output and I'm going to take now the other input to the VCO to the phase detector and connect it right to the VCO output so now close the loop I've made this though so now I'm looking at kind of my locked condition so let's see channel 2 here which is this guy right here that guy is actually the input signal that I'm coming in from my signal generator here okay and that's what I'm triggering on the upper waveform here is channel 1 that's actually the output of the VCO of this PLL circuit this trace here is the output of the phase detector type 2 and you can see little blips up or down right because as this loop is kind of keeping itself closed sometimes it's give me a little bit of an up sometimes giving a little bit of a down to kind of keep that loop closed and then this guy right here is the output of face detector type 1 okay it's not used in the loop we're just using it here to kind of show if we have anything is different okay so now I take a look at the frequency counter I'm sitting right at 10 kilohertz that's looking at the output of the VCO okay we can see I'm putting a 10 kilohertz signal in so if I adjust this so if I just this down to say 8 kilohertz I look over here I can see I've got 8 kilohertz coming out of the VCO and I can see the signals here i watch the scope as I change frequency and kind of see how the loop is kind of closing and I purposely is you know set the circuit up so that the loop filter takes a while to settle so you can actually see as I change the frequency you see how that the top waveform and the phase detector waveforms have to kind of take some time to settle in I kind of did that so you can kind of see how that loop is kind of pulling itself in there okay so that's how the face detect early the phase lock loop works we're changing essentially the input signal here and we're letting the loop close and adjust the VCO to close that loop and that's what we're getting so one of the things that's very popular to do with phase lock loop circuits is to do what we call frequency synthesis and you can do that by by playing some games with the signals that come into the phase detector if I throw a divider in here for example say I put a divided by 2 in here okay what that means is remember the phase detector is going to want these two things to match in frequency and phase so now if I put 10 kilohertz in here okay it's still going to want to see 10 kilohertz here which means this VCO is going to have to generate 20 kilohertz to make that happen okay so by simply doing that / - I've actually now created a signal that is phase-locked to this reference but isn't white twice the frequency of that reference okay if I put a divider in here that would have the opposite effect now right so if I divided this reference down okay that will cause the VCO to go to a lower voltage so one of them kind of multiplies the output one divides the output and you can kind of think about this and say well I could have any ratio divided ratio here and here so I can sit any output frequency that I want based on setting these dividers to the appropriate ratios and that's how the synthesizers in your synthesized receivers work and things like that okay so let's actually go do that okay let's knock this down save it you know say six six kilohertz here I go six kilohertz they're both those signals are in phase and they're locked I can see I've got a six color it's output on this board this guy right here is a little D flip-flop that I've got wired up as a divided by two so all I need to do is move this wire over to here now I've put that divided by two in circuit right there okay so now they've got a six kilohertz signal here if I look at the output on the frequency counter I'm at twelve kilohertz and if I look over at the waveforms I can actually see the output of my VCO is now at twelve kilohertz it's phase aligned to the six kilohertz input okay and again if I adjust the frequency of the my signal generator I can actually see that I'm always going to be twice that frequency okay so that's one example of how a phase locked loop circuit can be used to do frequency multiplication okay and basically frequency synthesis so wait wait this hope this video was helpful in giving a little bit of an understanding of what phase locked loop circuits are and how they operate again this one that I'm using here is the CD 4046 fact if you look at the block diagram here of this very similar to what we described described there's two phase detectors okay phase comparator one to two that's your type one that's your type 2 okay that puts out you know an output that can go through a low-pass filter or a simple low-pass filter here into the two and input to the VCO okay the output the VCO we can loop back into the phase detector input okay it's a couple of other components that are used to kind of set up the frequency range of the ECL but other than that it's a pretty simple thing the circuits been around a really long time you can find them you know pretty pretty easily back the one I've got on my board here is actually an old Motorola device there's the datasheet for it Motorola puts a little one friend of the part number here so at MC 1446 B in fact the parts that I've got in this board the one sitting in here it's actually got a date code on it from 1979 so these circuits have been around quite a while so but they're fun to play with and they're pretty easy to use the tricky thing is sometimes designing the component values for the loop filter but there's plenty of application notes and books and such that are written that describe you know kind of how you do that but anyway I hope this has given you a little bit of a background of phase-locked loops all right one more little bit of extra credit here we're looking at the these waveforms here from the space lock loop that right now is doing a 2x voltage multiplication and we the phase detector waveforms are not very interesting because this loop is closed and locked but a little extra credit here what I'm going to do is yank a little bit on this voltage here kind of eject a little bit of an offset in the output of the loop filter and what that's going to do is cause the loop to try to compensate for that offset so it's going to basically inject a phase offset okay to compensate for the voltage offset I'm adding here so I've done the same thing I got my little power supply here and I'm driving into the tune input through a resistor okay just a Yank on that voltage a little bit so so right now I'm not really yanking on it at all but as I adjust by yank out it a little bit we can actually see a phase change happen see that phase change happen but also notice that on the face detector outputs that I'm in this case I've caused the my VCO to lead okay so if the VCO is now leading in phase the output phase detector is going to pull down on that voltage to try to bring it back and we could also see the phase change here on phase detector one output by adjust the voltage the other way okay now now I'm basically lined up again I keep going and cause the phase detect the my VCO now to lag okay that's going to cause the phase detector to output to go positive to try to pull that phase back in again and bring it back over okay they still see the face the phase change here in phase detector one up so you very easily see how that loop is compensating for an offset in phase okay this is a way of actually injecting a phase change if you wanted to do like phase shift keying or something like that on an RF signal you can inject a signal here to cause a phase change to happen okay so a little bit of extra credit just to kind of show how that loop kind of tries to close everything and keep the phase as seen it the phase detector inputs close to zero and it can do so by adjusting the phase of things throughout the loop so anyway I hope you enjoyed and comments are welcome thank you
Info
Channel: w2aew
Views: 181,949
Rating: 4.9752321 out of 5
Keywords: W2AEW, Tek, Tektronix, AFG, AFG3000, AFG3252, scope, oscilloscope, 2467, trace, traces, probe, 10x, phase, locked, lock, loop, PLL, synthesizer, frequency, detector, comparator, filter, VCO, PFD, voltage, controlled, oscillator, divider, flip, flop, tutorial, demonstration, counter, 4046, CD4046B, MC14046B
Id: SS7z8WsXPMk
Channel Id: undefined
Length: 22min 12sec (1332 seconds)
Published: Fri Aug 31 2012
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.