Example Code

PLL - Phased Locked Loop

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW Control Design and Simulation Module
  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This collection of VIs demonstrates multiple ways to implement a Phase Lock Loop (PLL) in LabVIEW.

 

 

Description

The examples demonstrate three different options of PLL regulation and control.The simplest form of the PLL examples (PLL_Simple Phase Only.vi) uses the Y-values of two signals and regulates the phase of one signal as long as both are in phase. The 2nd example (PLL_Simple Phase and Frequency.vi) is implemented with waveform datatypes, where the frequency and the phase are regulated. The 3rd example (PLL_Phase and Frequency_PID.vi) uses a PI(D) controller for both frequency and phase.

Description of each VI is included on Block diagram.

 

For more information, visit the following site: http://en.wikipedia.org/wiki/PLL 

 

 

Requirements:

LabVIEW 2012 (or compatible)

LabVIEW Control and Simulation Toolkit 2012

 

 

Steps to Implement or Execute Code:

  1. Open the attached Project "PLL.lvproj" in LabVIEW
  2. Load and run one of the included VIs in the project

 

 

Additional Information or References:

 

     Snippet of PLL_Simple Phase.vi

 BD Simple Phase PLL.PNG

 

     Snippet of PLL_PID.vi

 BD PID PLL.PNG

 

     Snippet of PLL_Simple Phase and Frequency.vi

 

BD Simple Phase and Frequency PLL.PNG

 

 

 

 

 

**This document has been updated to meet the current required format for the NI Code Exchange. **

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
BetaCommunityCo
Member
Member
on

PID toolkit required?

My LabVIEW searching for PID.vi and PID(DBL).vi when I try to open to PLL_PID.vi. I'm assuming this example requires the PID toolkit to run PLL_PID.VI. True?

BetaCommunityCo
Member
Member
on

PID Toolkit

That's true. But I am only using the P and I, so it shouldn't that hard to replace the PID.vi with your own algorithm. Another option would be to use LabVIEW Simulation.

BetaCommunityCo
Member
Member
on

Works great!

Thanks! Works like a charm now, especially the "cheated" equation :)

JLSx
Member
Member
on

Quick note - there's a manage versions feature - check it out, you won't have to manually manage change control!

Best,
JLSx
Sixclear
VI High - LabVIEW Programming Video Blog
tommydemejo
Member
Member
on

Many thanks!

Jcubez
Member
Member
on

Hello,

I came across this example and I think its a really good one. I am trying to closely emulate a 60Hz signal (Electrical Line voltage), but as we know it is not always exactly 60Hz. I want to follow that signal and generate a sine wave of that frequency. Any suggestions?

I was planning to use the PLL_Simple_WithTime.vi for this and modify it.

Thanks in advance.