Using a PID Controller to Generate Frequency Modulation (FM) Signals

February 20, 2025 by Danyang Liu

Introduction

Frequency modulation (FM) and amplitude modulation (AM) signals are useful for many applications; for example, non-linear dynamics of NEMS sensors and NV ensemble-based magnetometry for quantum sensing. With the MOD option on Zurich Instruments' lock-in amplifiers, we can generate AM signals and narrow band FM signals with modulation index \(h < 0.2\). In this blog, taking the UHFLI Lock-in Amplifier as an example, we introduce a method to generate a wideband FM signal with the PID controller option available on all Zurich Instruments' lock-in amplifiers.

To understand how this works, it's important to first understand the concept of frequency modulation, which refers to the modulation of an oscillating signal \(s(t) = A\cos(ω_ct+\phi)\), the so-called carrier signal. \(A\) and  \(ω_ct+\phi\) are the amplitude and phase of the signal. In the case of frequency modulation, the frequency (\(f_c = \omega_c /2\pi\)) of this carrier signal is modulated by a sinusoidal signal with the frequency \(f_m= \omega_m/2\pi\). Thus, the instantaneous frequency of FM signal is \(f(t) = f_c + \Delta{f}*sin(ω_mt)\), where \(\Delta{f}\) is the maximum variation of the frequency around the carrier frequency. This equation of \(f(t)\) follows the same manner as the proportional term \(K_p*e(t)\) in the PID control, as shown below.

Similar format of the equations

Therefore, if we feed a sinusoidal signal to the PID input \(e(t)\), we will be able to generate the instantaneous frequency of the FM signal through the PID output by applying a proportional coefficient \(K_p\).

To set up the frequency modulation with a PID controller, we exploit the advanced flexibility of LabOne, the user interface to control Zurich Instruments' lock-in amplifiers. Here are the modules you will need: 

  • PID option
  • MF option (recommended)

FM Signal Generation With a PID Controller in 3 Steps:

  1. Produce a sinusoidal signal with frequency \(f_m\) using a demodulator.
  2. Feed this sinusoidal signal into the PID input and output a modulated frequency.
  3. Use Signal output to generate the FM signal and route to Signal input for display on Scope.

Now, let’s look at each step in detail.

Step 1

A sinusoidal signal is needed as a PID input, since the PID input can be either a demodulated signal or an Aux signal. Here, we use the method described in this blog to generate a sinusoidal signal by demodulating a DC voltage. As shown in Figure 1, Demodulator 8 is used to demodulate a 1 V DC signal from Aux Out 1 at \(f_m\) = 1 kHz with a broadband lowpass filter; thus, Demod 8 X is a sinusoidal signal with a frequency of 1 kHz, and amplitude \(A = \sqrt{2}\) V, as displayed in the Scope tab. Keep in mind that the frequency of the sinusoidal signal \(f_m\) generated in this way is limited by the demodulator bandwidth, which is in the MHz range for the UHFLI.

Figure 1: Generate a sinusoidal signal from Demod 8 X channel

Figure 1: Generate a sinusoidal signal from Demod 8 X channel

Step 2

We select the sinusoidal signal generated in Step 1 as the PID input (Demod X 8). The PID output is the instantaneous frequency of the FM signal that is mapped to Oscillator 1. One can define the carrier frequency \(f_c\) of the FM signal by setting the Center value of the PID output. Here, we set \(f_c\) to be 20 MHz. One can define the modulation index \(h\) of FM signal by adjusting the proportional gain \(P\) of the PID controller. It follows the relation below:

The maximum frequency deviation \(\Delta{f} = P*A\) , where \(A\) is the amplitude of the sinusoid in Step 1. The modulation index is  \(h=\Delta{f}/f_m\).

In Figure 2, we set the proportional gain \(P\) to be 200 kHz/V. Then \(\Delta{f}\) can be calculated by \(\Delta{f} = P*A\) = 282 kHz, and the modulation index of this FM signal is \(h=\Delta{f}/f_m\)= 28.2, which is indeed a wideband FM signal.

Figure 2: PID settings to output a modulated frequency

Figure 2: PID settings to output a modulated frequency

Step 3

We use Signal Output 1 to generate the FM signal with the frequency from Oscillator 1, which is dynamically modulated by the PID output in Step 2.

Figure 3: Generate FM signal on Signal Output 1

Figure 3: Generate FM signal on Signal Output 1

We can display the FM signal by routing back Signal Output 1 to Signal Input 1 and view it in the Scope tab of the LabOne user interface. Figure 4 shows the frequency spectrum of the FM signal with carrier frequency \(f_c\) = 20 MHz, modulation frequency \(f_m\) = 10 kHz and modulation index \(h\) around 28.2. Given the amplitude of the output signal is 100 mV, the amplitude distribution among carrier and sideband frequencies are defined by Bessel functions. 

Figure 4: FM signal on scope

Figure 4: FM signal with carrier frequency \(f_c =\) 20 MHz, modulation frequency \(f_m =\) 10 kHz and modulation index \(h =\) 28.2.

Summary

The flexibility offered by all Zurich Instruments' lock-in amplifiers – with their digital signal processing and feedback loops – enables the ability to generate a wideband FM signal with a PID controller. With the step-by-step setup of the LabOne user interface described in this blog post, one can customize the carrier frequency, modulation frequency, and the modulation index for the wideband FM signal generation based on their experimental needs.

If you'd like to know more, please get in touch to set up a demo.

Acknowledgements

I would like to thank Dr. Romain Stomp and Dr. Mehdi Alem for their original idea of utilizing a PID controller to generate wideband FM signals, and their valuable feedback on the content.