# Measuring PLL/PID Bandwidths Under Real Experimental Conditions

With the merging of the PLL and PID tab in LabOne for the MFLI and the UHFLI, the PID Advisor section is now identical for both types of feedback loops, and various system models can be tested. After all, a phase-locked-loop (PLL) is nothing more than a PID feedback on the resonant phase, acting on the actuator drive frequency. For the case of mechanical resonator model, a few parameters need to first be determined and for the best response, it is important to make sure that the actual measured response corresponds indeed to the model that was applied, otherwise some further PID adjustment or better understanding of the device under test (DUT) needs to be investigated. It is therefore crucial to compare the Advisor model with the actual transfer function measured from the DUT under real experimental conditions.

Let's focus here on a quartz resonator with a high Q-factor (low loss) to cover realistic cases that can be found in SPM or MEMS applications. All LabOne users can perform similar tests on their own setup (the xml setting file is provided at the end of this post) with the following options:

Please note that transfer function measurements (see the last section) works similarly on the HF2LI but all other screenshots and settings may differ and are intended for MFLI and UHFLI users only.

## Choice of DUT Model and Measured Parameters

For mechanical resonators, there are two transfer function models of interest, called resonator frequency (for feedback on the phase) and resonator amplitude (for feedback on the amplitude). The PID Advisor section of the PID tab will provide a simulated response for a given set of PID value, as shown in the figure below. Of course, some realistic values for the model need to be entered, and in the case of a mechanical resonator three important parameters have to be considered:

- Resonance frequency: \(f_0\), as determined from a frequency sweep of R and Theta.
- Quality factor: \(Q\), as determined from the frequency sweep or the ring-down method.
- Gain of (measured) amplitude vs (drive) excitation: g, as determined from the slope of demod R vs drive output.

When no feedback loop is applied, the resonator will relax from any perturbation due to an external force to a new steady state at a 'natural' pace which is often referred to as its 'natural bandwidth' or decay time \(t_c=Q/pi f_0\). This however can be very slow especially with high Q resonator, the aim of a PLL is therefore to speed up this relaxation process by adjusting the frequency to a value already close to the (new) steady state. This active control over the resonator dynamics is determined from the slope of the phase and react with a linear gain (P, I and D values) proportional to the phase error as compared to the set-point at the resonance. In this way, the resonator will relax faster than with no feedback, at a speed determined by the target bandwidth (BW). This control loop can improve the response time but only within certain boundaries still dictated by the resonator itself. It is therefore important to provide good and realistic input values for the model in order to expect the best possible response. All DUT transfer functions are already present in the instrument's user manual, and it may be useful to reproduce some of them here (from Table 4.49 of the MFLI User Manual) with the corresponding PID Advisor tab:

Please note that the internal PLL model is intended to be used only to adapt the internal frequency to an external oscillators frequency changes, but not to control it. It shall therefore not be used with mechanical resonator as this would provide the wrong effective bandwidth.

## Closing Phase and Amplitude Feedback Loops

Once the proper parameters are feed into the PID Advisor and a reasonable bandwidth is picked for the desired feedback loop speed, the calculated value can be transferred to the PID. When closing the loop, it is useful to monitor the feedback value (phase, amplitude, frequency and drive) in the Plotter. From the Math tab, Histogram and Cursor Area will provide quantitative noise figures that look like this (in a 1 kHz PLL bandwidth):

Please note that such noise will depend on the PLL bandwidth and drive amplitude in the case of a mechanical resonator. For fine tuning the PI value, a Tuner is available and described in an earlier blog post.

Another useful tool available in the Tuner sub-tab is Setpoint Toggling, which allows for step response monitoring:

It is particularly relevant for the amplitude feedback loops (usually PID2), where the amplitude set-point can be changed and the actual step response captured in the Plotter and, even better, in the SW trigger:

All these tools provide good insights into the noise figures but for really comparing the measured transfer function with the simulated one (Bode plot from the Advisor menu), frequency modulation (FM) needs to be added on top of the PLL carrier frequency.

## FM on PLL Carrier Frequency for Transfer Function Measurements

A transfer function measurement, sometime also referred to as modulation transfer function (MTF), consists in introducing a small perturbation, at a given modulation frequency (f_m) , while measuring the amplitude response of this perturbation as a function of (f_m). At low modulation frequency, the PLL or PID feedback loop will easily track this modulation providing maximum amplitude response while above a certain cut-off frequency, the perturbation will be too fast to be tracked and the measured perturbation amplitude will eventually vanish. At -3vdB attenuation, this will corresponds to the actual feedback loop bandwidth. Schematically, this can be represented as a modulation of the input phase and monitoring of the frequency response from the PLL:

In case of a PLL, the input set-point is a phase, it is therefore a phase modulation that needs to be introduced with a perturbation set by the FM modulation index**. **This is fairly straightforward to do from the** **MOD tab, choosing FM mode for the carrier frequency which is also the frequency tracked by the PLL and oscillator 2 for the modulation frequency (f_m). This modulation will translate into an AC modulation in the frequency shift from the PLL output, the amplitude of which can be measured by demodulator 4. For simplicity, the frequency shift value (PID Shift 1) was output to Aux Output 1 and used as Demodulator Input for Demod 4, as shown in this screen shot:

Now that the induced modulation can be measured, we can use the Sweeper module to sweep this modulation frequency (oscillator 2) for a given PLL bandwidth and monitor Demod 4. Here are some results for 300 Hz, 500 Hz, 2 kHz, 5 kHz and 10 kHz as set in the PID advisor target BW:

Measured transfer function response as a function of PLL bandwidth (click to enlarge)

In the case of our simple 1.84 MHz quartz resonator, the measured transfer function matches well the PID Advisor simulation curve and the higher the target PLL bandwidth is, the higher the loop can track the modulation frequency.

## Conclusions

This blog post shows how to measure the actual bandwidth of the PLL by introducing a small FM modulation inside the closed loop. Real transfer functions can thus be compared not only with simulations from the PID Advisor but also with other resonators or other setups for a more quantitative understanding of the dynamic response of resonators.

The LabOne settings file used to measure the PLL transfer function can be downloaded here.