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.

Time-domain modeling of all digital PLL

InvokeMeWell

Junior Member level 2
Joined
May 17, 2015
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,472
1698349275130.png

hello,
I am trying to write a matlab code in time domain for ADPLL, but my ADPLL never locks.
I have been searching all over the internet to find an example how to simulate an ADPLL, with no luck, has someone any reference or paper with an actual code or pseudo code how I can
lock an all DPLL.

My train of this for this is simple
for i = 1 :fref_cycles
fcw = ftarget/fref
fcw_int = int(fcw)
fcw_frac = fcw-fcw_int
the Rv pretty much is how many times rising edges of the DCO we have in on fref
the ε[k] = tdc_code(binary_output) * Tdco/tdc_res


the normalized dco I forget it, also the filter




end
 
View attachment 185781
hello,
I am trying to write a matlab code in time domain for ADPLL, but my ADPLL never locks.
I have been searching all over the internet to find an example how to simulate an ADPLL, with no luck, has someone any reference or paper with an actual code or pseudo code how I can
lock an all DPLL.

My train of this for this is simple
for i = 1 :fref_cycles
fcw = ftarget/fref
fcw_int = int(fcw)
fcw_frac = fcw-fcw_int
the Rv pretty much is how many times rising edges of the DCO we have in on fref
the ε[k] = tdc_code(binary_output) * Tdco/tdc_res


the normalized dco I forget it, also the filter




end

I suggest you generate ref and frequency then get error in a feedback loop to be added to Fo value below:

Fo = 12; %target frequency
Fs = 100; %sampling rate
ref = 12.01;

Fref = cos(2*pi*(0:999)*ref/Fs);
Fgen = cos(2*pi*(0:999)*Fo/Fs);
 
thanks for your reply and sorry for delayed answer, I am looking more on how to lock the ADPLL in time domain, e.g the DCO will start in frequency X but my target is Y freq, how vs time will lock I want. something like that in a plot :
1700992702007.png

this code exactly I am looking to create first, here is the output of the ADPLL vs time the target I presume is 1630 and shows the locking procedure.
 
Lock in Time has many variables. VCO gain. Filter gain-BW, phase margin (PM) initial/max error frequency. etc
There is a huge tradeoff for jitter and speed in number of cycles with the above variables.

I made a crude fast PLL that has poor PM and oscillates. Someone may improve. I don't have time now.

I provided a 100 kHz triangle sweep switch for VCO for testing.
Then 3 inputs 1 MHz, 1.46MHz, 2MHz with a 1P3T switch

Feel free to change any RC value then reset to see Lock time and residual phase error.

 
Lock in Time has many variables. VCO gain. Filter gain-BW, phase margin (PM) initial/max error frequency. etc
There is a huge tradeoff for jitter and speed in number of cycles with the above variables.

I made a crude fast PLL that has poor PM and oscillates. Someone may improve. I don't have time now.

I provided a 100 kHz triangle sweep switch for VCO for testing.
Then 3 inputs 1 MHz, 1.46MHz, 2MHz with a 1P3T switch

Feel free to change any RC value then reset to see Lock time and residual phase error.

nice gui!! thanks foro sharing
 
Here's a filter variation of the integrator with a switch on pole and zero ( phase lead compensation)

(Cap too big)

https://tinyurl.com/yuubxask corrected

https://tinyurl.com/yucxcumn clean up
--- Updated ---

Step 1. Find input frequency range and choose VCO to span this range with a little margin for error.
Step 2. Define max jitter % T
Step 3. Define lockup time in cycles.
Step 4 Design integration filter & phase compensation network for critical damping PM ~ 70 deg.
Step 5 Add Frequency Lock FL detect detector (no skip cycle) Add Phase Locked (PL) detector ( < jitter spec in x cycles),
Step 6 USE FL to control dual gain-bandwidth to satisfy 2&3 , fast lock, > low jitter.
 
Last edited:

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top