2nd Order Type 2 PLL for Tracking Frequency Error
Notation: Incoming carrier frequency : $f_c$ and Local Oscillators synthesized frequency : $f_o$.   A First Order PLL to track a constant phase offset $(\phi)$ in the received carrier sinusoidal is based on the following PLL daigram. In working of the single PLL Loop it is essential that $f_c = f_o$:  (image courtesy : Software Receiver Design by Johnson, Sethares &amp; Klein) Here, $r_p(kT_s) = BPF_{2f_c} \{ r(kT_s)^2 \}$, meaning received signal is squared and then bandpass filtered with BPF's center frequency at twice carrier frequency $2f_c$. This preprocessing is done to emphasize the carrier, since this will boost carrier SNR. So, input to the PLL is basically, $$r_p(kT_s) = cos(4\pi f_c k T_s + 2\phi)$$Now if instead of constant phase offset of $\phi$ if we are having a constant frequency offset of $\Delta f = f_c - f_{o}$ and a constant phase offset of $\phi$ in carrier frequency then, we can extent this single PLL Loop to a combination of 2 PLL loops as follows: (image courtesy : Software Receiver Design by Johnson, Sethares &amp; Klein)  Here, input to this frequency Tracking PLL is as follows: $$r_p(kT_s) = cos(4\pi (f_c - \Delta f)k T_s + 2\phi)$$  Now, if the first Loop processing is worked out, it can be shown that it tracks a ramp:$$\theta_1[k] \rightarrow 2\pi (f_c - f_{o})k + \beta$$, where $\beta$ is the y-intercept of the ramp being tracked by first PLL.This is added to $\theta_2[k]$, which makes it possible for the $2^{nd}$ PLL to track the frequency accurately :$$\theta_2[k] \rightarrow \phi - \beta$$ , which mean, $$\theta_1[k] + \theta_2[k] \rightarrow 2\pi (f_c - f_{o}) + \beta + \phi -\beta$$ $$\theta_1[k] + \theta_2[k] \rightarrow 2\pi (f_c - f_{o}) + \phi$$, And this sum is being used to drive the sinusoid of Local Oscillator, hence the local oscillator is now generating a sinusoid which is synchronized with $r_p(kT_s)$ in both frequency and phase. Basically, top PLL Loop is tracking a ramp and hence generating the correct frequency for the bottom loop, and bottom loop is further correcting the residual phase error.(image courtesy : Software Receiver Design by Johnson, Sethares &amp; Klein)