<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://AY2021S2.qt5201.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Victor+Avalos</id>
	<title>QT5201U wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://AY2021S2.qt5201.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Victor+Avalos"/>
	<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php/Special:Contributions/Victor_Avalos"/>
	<updated>2026-08-09T12:03:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1352</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1352"/>
		<updated>2021-04-30T07:17:36Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. We will be locking to the D2 transition &amp;lt;math&amp;gt;F=2\rightarrow 3&amp;lt;/math&amp;gt; which corresponds to 780.246 nm, where &amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; is the total angular momentum of the atom.&lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Experimental Setup==&lt;br /&gt;
====ECDL====&lt;br /&gt;
[[File:ecdl2.png|thumb|340px|Figure 3. ECDL enclosure. On the left current, temperature controllers and piezoelectric connectors. On the center the diode pointing to the right, grating making approximately 45°. It cannot be seen in the picture but the grating directs the light into a mirror that reflects the light back to the left to right direction. On the right, the mount screw and the piezoelectric.]]&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating mount (Figure 3), with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
===Optical Setup===&lt;br /&gt;
We show an schematic of our experimental setup in Figure 4. After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
====Monitoring====&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
====SAS + FM ====&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
====Lockbox====&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can see 3 slopes, the one on the left is the transition to which we want to lock &amp;lt;math&amp;gt;F=2\rightarrow3&amp;lt;/math&amp;gt;, the other two correspond to crossover frequencies with another transition lines (&amp;lt;math&amp;gt;F=2\rightarrow[1,3]&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F=2\rightarrow[2,3]&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 4. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 5. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 6. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 7. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 7), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OpAmp sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 8), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OpAmps (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 9) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OpAmps (Figure 10) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. So the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 8. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 9. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 10. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both controller: OPAMPs  and controlled system: ECDL responses to different frequencies. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 11. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 11). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 12. Gain and phase measurements for the Piezo + ECDL (controlled system) gain.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
====PID parameters====&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 12 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520\text{Hz}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520 Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was &amp;lt;math&amp;gt;152 \text{Hz}&amp;lt;/math&amp;gt;.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 16).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Lock button (Figure 18). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 16. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 17. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 18. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage. The red dot signals the trigger point we selected. Once we press the lock button, the PID will start working at that trigger point.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 19. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|450px|Figure 20. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 20 we use the same voltage scale as in Figure 17-19.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Future work===&lt;br /&gt;
* As mentioned before, the PID controller built here is a slow one, that can only deal with small frequencies. This was a good start, but ideally we would also need control over bigger frequencies. For this purpose we will also add a current controller to the setup. This will also be possible with the Red Pitaya because it has 2 PID incorporated.&lt;br /&gt;
* Additionally, we would like to replace a Signal Generator, that gives us the Fabry Perot etalon scanning frequency and amplitude, by an Integrated Circuit chip Intersil ICL8038. Although this chip has been discontinued, it offers just what we need. This could go along the Red Pitaya&#039;s enclosure. Saving space and giving us a free Signal Generator.&lt;br /&gt;
 &lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1306</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1306"/>
		<updated>2021-04-30T04:21:03Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. We will be locking to the D2 transition &amp;lt;math&amp;gt;F=2\rightarrow 3&amp;lt;/math&amp;gt; which corresponds to 780.246 nm&lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Experimental Setup==&lt;br /&gt;
====ECDL====&lt;br /&gt;
[[File:ecdl2.png|thumb|340px|Figure 3. ECDL enclosure. On the left current, temperature controllers and piezoelectric connectors. On the center the diode pointing to the right, grating making approximately 45°. It cannot be seen in the picture but the grating directs the light into a mirror that reflects the light back to the left to right direction. On the right, the mount screw and the piezoelectric.]]&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating mount (Figure 3), with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
===Optical Setup===&lt;br /&gt;
We show an schematic of our experimental setup in Figure 4. After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
====Monitoring====&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
====SAS + FM ====&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
====Lockbox====&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can see 3 slopes, the one on the left is the transition to which we want to lock &amp;lt;math&amp;gt;F=2\rightarrow3&amp;lt;/math&amp;gt;, the other two correspond to crossover frequencies with another transition lines (&amp;lt;math&amp;gt;F=2\rightarrow[1,3]&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F=2\rightarrow[2,3]&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 4. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 5. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 6. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 7. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 7), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OpAmp sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 8), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OpAmps (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 9) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OpAmps (Figure 10) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. So the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 8. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 9. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 10. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both controller: OPAMPs  and controlled system: ECDL responses to different frequencies. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 11. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 11). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 12. Gain and phase measurements for the Piezo + ECDL (controlled system) gain.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
====PID parameters====&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 12 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520\text{Hz}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520 Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was &amp;lt;math&amp;gt;152 \text{Hz}&amp;lt;/math&amp;gt;.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 16).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Lock button (Figure 18). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 16. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 17. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 18. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage. The red dot signals the trigger point we selected. Once we press the lock button, the PID will start working at that trigger point.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 19. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|450px|Figure 20. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 20 we use the same voltage scale as in Figure 17-19.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Future work===&lt;br /&gt;
* As mentioned before, the PID controller built here is a slow one, that can only deal with small frequencies. This was a good start, but ideally we would also need control over bigger frequencies. For this purpose we will also add a current controller to the setup. This will also be possible with the Red Pitaya because it has 2 PID incorporated.&lt;br /&gt;
* Additionally, we would like to replace a Signal Generator, that gives us the Fabry Perot etalon scanning frequency and amplitude, by an Integrated Circuit chip Intersil ICL8038. Although this chip has been discontinued, it offers just what we need. This could go along the Red Pitaya&#039;s enclosure. Saving space and giving us a free Signal Generator.&lt;br /&gt;
 &lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1305</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1305"/>
		<updated>2021-04-30T04:20:42Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. We will be locking to the D2 transition &amp;lt;math&amp;gt;F=2\rightarrow 3&amp;lt;/math&amp;gt; which corresponds to 780.246 nm&lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Experimental Setup==&lt;br /&gt;
====ECDL====&lt;br /&gt;
[[File:ecdl2.png|thumb|340px|Figure 3. ECDL enclosure. On the left current, temperature controllers and piezoelectric connectors. On the center the diode pointing to the right, grating making approximately 45°. It cannot be seen in the picture but the grating directs the light into a mirror that reflects the light back to the left to right direction. On the right, the mount screw and the piezoelectric.]]&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating mount (Figure 3), with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
===Optical Setup===&lt;br /&gt;
We show an schematic of our experimental setup in Figure 4. After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
====Monitoring====&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
====SAS + FM ====&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
====Lockbox====&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can see 3 slopes, the one on the left is the transition to which we want to lock &amp;lt;math&amp;gt;F=2\rightarrow3&amp;lt;/math&amp;gt;, the other two correspond to crossover frequencies with another transition lines (&amp;lt;math&amp;gt;F=2\rightarrow[1,3]&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F=2\rightarrow[2,3]&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 4. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 5. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 6. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 7. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 7), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OpAmp sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 8), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OpAmps (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 9) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OpAmps (Figure 10) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. So the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 8. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 9. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 10. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both controller: OPAMPs  and controlled system: ECDL responses to different frequencies. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 11. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 11). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 12. Gain and phase measurements for the Piezo + ECDL (controlled system) gain.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
====PID parameters====&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 12 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520\text{Hz}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520 Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was &amp;lt;math&amp;gt;152 \text{Hz}&amp;lt;/math&amp;gt;.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 16).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Lock button (Figure 18). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 16. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 17. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 18. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage. The red dot signals the trigger point we selected. Once we press the lock button, the PID will start working at that trigger point.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 19. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|450px|Figure 20. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 20 we use the same voltage scale as in Figure 17-19.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Future work===&lt;br /&gt;
* As mentioned before, the PID controller built here is a slow one, that can only deal with small frequencies. This was a good start, but ideally we would also need control over bigger frequencies. For this purpose we will also add a current controller to the setup. This will also be possible with the Red Pitaya because it has 2 PID incorporated.&lt;br /&gt;
* Additionally, we would like to replace a Signal Generator, that gives us the Fabry Perot etalon scanning frequency and amplitude, by an Integrated Circuit chip Intersil ICL8038. Although this chip has been discontinued, it offers just what we need. This could go inside the Red Pitaya&#039;s enclosure. Saving space and giving us a free Signal Generator.&lt;br /&gt;
 &lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1304</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1304"/>
		<updated>2021-04-30T04:07:39Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. We will be locking to the D2 transition &amp;lt;math&amp;gt;F=2\rightarrow 3&amp;lt;/math&amp;gt; which corresponds to 780.246 nm&lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Experimental Setup==&lt;br /&gt;
====ECDL====&lt;br /&gt;
[[File:ecdl2.png|thumb|340px|Figure 3. ECDL enclosure. On the left current, temperature controllers and piezoelectric connectors. On the center the diode pointing to the right, grating making approximately 45°. It cannot be seen in the picture but the grating directs the light into a mirror that reflects the light back to the left to right direction. On the right, the mount screw and the piezoelectric.]]&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating mount (Figure 3), with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
===Optical Setup===&lt;br /&gt;
We show an schematic of our experimental setup in Figure 4. After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
====Monitoring====&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
====SAS + FM ====&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
====Lockbox====&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can see 3 slopes, the one on the left is the transition to which we want to lock &amp;lt;math&amp;gt;F=2\rightarrow3&amp;lt;/math&amp;gt;, the other two correspond to crossover frequencies with another transition lines (&amp;lt;math&amp;gt;F=2\rightarrow[1,3]&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F=2\rightarrow[2,3]&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 4. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 5. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 6. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 7. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 7), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OpAmp sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 8), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OpAmps (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 9) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OpAmps (Figure 10) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. So the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 8. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 9. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 10. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both controller: OPAMPs  and controlled system: ECDL responses to different frequencies. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 11. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 11). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 12. Gain and phase measurements for the Piezo + ECDL (controlled system) gain.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
====PID parameters====&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 12 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520\text{Hz}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520 Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was &amp;lt;math&amp;gt;152 \text{Hz}&amp;lt;/math&amp;gt;.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 16).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Lock button (Figure 18). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 16. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 17. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 18. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage. The red dot signals the trigger point we selected. Once we press the lock button, the PID will start working at that trigger point.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 19. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|450px|Figure 20. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 20 we use the same voltage scale as in Figure 17-19.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1303</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1303"/>
		<updated>2021-04-30T04:04:20Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. We will be locking to the D2 transition &amp;lt;math&amp;gt;F=2\rightarrow 3&amp;lt;/math&amp;gt; which corresponds to 780.246 nm&lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Experimental Setup==&lt;br /&gt;
====ECDL====&lt;br /&gt;
[[File:ecdl2.png|thumb|340px|Figure 3. ECDL enclosure. On the left current, temperature controllers and piezoelectric connectors. On the center the diode pointing to the right, grating making approximately 45°. It cannot be seen in the picture but the grating directs the light into a mirror that reflects the light back to the left to right direction. On the right, the mount screw and the piezoelectric.]]&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating mount (Figure 3), with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
===Optical Setup===&lt;br /&gt;
We show an schematic of our experimental setup in Figure 4. After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
====Monitoring====&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
====SAS + FM ====&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
====Lockbox====&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines (F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;[1,3] and F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;[2,3]).&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 4. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 5. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 6. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 7. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 7), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OpAmp sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 8), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OpAmps (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 9) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OpAmps (Figure 10) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. So the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 8. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 9. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 10. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both controller: OPAMPs  and controlled system: ECDL responses to different frequencies. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 11. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 11). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 12. Gain and phase measurements for the Piezo + ECDL (controlled system) gain.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
====PID parameters====&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 12 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520\text{Hz}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520 Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was &amp;lt;math&amp;gt;152 \text{Hz}&amp;lt;/math&amp;gt;.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 16).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Lock button (Figure 18). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 16. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 17. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 18. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage. The red dot signals the trigger point we selected. Once we press the lock button, the PID will start working at that trigger point.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 19. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|450px|Figure 20. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 20 we use the same voltage scale as in Figure 17-19.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1302</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1302"/>
		<updated>2021-04-30T04:00:58Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. We will be locking to the D2 transition &amp;lt;math&amp;gt;F=2\rightarrow 3&amp;lt;/math&amp;gt; which corresponds to 780.246 nm&lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Experimental Setup==&lt;br /&gt;
====ECDL====&lt;br /&gt;
[[File:ecdl2.png|thumb|340px|Figure 3. ECDL enclosure. On the left current, temperature controllers and piezoelectric connectors. On the center the diode pointing to the right, grating making approximately 45°. It cannot be seen in the picture but the grating directs the light into a mirror that reflects the light back to the left to right direction. On the right, the mount screw and the piezoelectric.]]&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating mount (Figure 3), with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
===Optical Setup===&lt;br /&gt;
We show an schematic of our experimental setup in Figure 4. After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
====Monitoring====&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
====SAS + FM ====&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
====Lockbox====&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines (F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;[1,3] and F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;[2,3]).&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 4. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 5. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 6. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 7. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 7), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OpAmp sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 8), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OpAmps (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 9) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OpAmps (Figure 10) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. So the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 8. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 9. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 10. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both controller: OPAMPs  and controlled system: ECDL responses to different frequencies. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 11. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 11). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 12. Gain and phase measurements for the Piezo + ECDL (controlled system) gain.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
====PID parameters====&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 12 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 16).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Lock button (Figure 18). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 16. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 17. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 18. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage. The red dot signals the trigger point we selected. Once we press the lock button, the PID will start working at that trigger point.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 19. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|450px|Figure 20. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 20 we use the same voltage scale as in Figure 17-19.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1301</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1301"/>
		<updated>2021-04-30T03:52:43Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. We will be locking to the D2 transition &amp;lt;math&amp;gt;F=2\rightarrow 3&amp;lt;/math&amp;gt; which corresponds to 780.246 nm&lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Experimental Setup==&lt;br /&gt;
====ECDL====&lt;br /&gt;
[[File:ecdl2.png|thumb|340px|Figure 3. ECDL enclosure. On the left current, temperature controllers and piezoelectric connectors. On the center the diode pointing to the right, grating making approximately 45°. It cannot be seen in the picture but the grating directs the light into a mirror that reflects the light back to the left to right direction. On the right, the mount screw and the piezoelectric.]]&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating mount (Figure 3), with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
===Optical Setup===&lt;br /&gt;
We show an schematic of our experimental setup in Figure 4. After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
====Monitoring====&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
====SAS + FM ====&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
====Lockbox====&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines (F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;[1,3] and F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;[2,3]).&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 4. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 5. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 6. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 7. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 7), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 8), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 9) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 10) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. &lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. &lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 8. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 9. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 10. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both controller: OPAMPs  and controlled system: ECDL responses to different frequencies. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 11. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 11). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 12. Gain and phase measurements for the Piezo + ECDL (controlled system) gain.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
====PID parameters====&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 12 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 16).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Lock button (Figure 18). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 16. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 17. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 18. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage. The red dot signals the trigger point we selected. Once we press the lock button, the PID will start working at that trigger point.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 19. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|450px|Figure 20. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 20 we use the same voltage scale as in Figure 17-19.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=File:Capture7.PNG&amp;diff=1300</id>
		<title>File:Capture7.PNG</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=File:Capture7.PNG&amp;diff=1300"/>
		<updated>2021-04-30T03:50:52Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: Victor Avalos reverted File:Capture7.PNG to an old version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=File:Capture7.PNG&amp;diff=1299</id>
		<title>File:Capture7.PNG</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=File:Capture7.PNG&amp;diff=1299"/>
		<updated>2021-04-30T03:50:47Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: Victor Avalos reverted File:Capture7.PNG to an old version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1298</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1298"/>
		<updated>2021-04-30T03:48:59Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. We will be locking to the D2 transition &amp;lt;math&amp;gt;F=2\rightarrow 3&amp;lt;/math&amp;gt; which corresponds to 780.246 nm&lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Experimental Setup==&lt;br /&gt;
====ECDL====&lt;br /&gt;
[[File:ecdl2.png|thumb|340px|Figure 3. ECDL enclosure. On the left current, temperature controllers and piezoelectric connectors. On the center the diode pointing to the right, grating making approximately 45°. It cannot be seen in the picture but the grating directs the light into a mirror that reflects the light back to the left to right direction. On the right, the mount screw and the piezoelectric.]]&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating mount (Figure 3), with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
===Optical Setup===&lt;br /&gt;
We show an schematic of our experimental setup in Figure 4. After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
====Monitoring====&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
====SAS + FM ====&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
====Lockbox====&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines (F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;[1,3] and F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;[2,3]).&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 4. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 5. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 6. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 7. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 7), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 8), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 9) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 10) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. &lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. &lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 8. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 9. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 10. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both controller: OPAMPs  and controlled system: ECDL responses to different frequencies. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 11. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 11). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 12. Gain and phase measurements for the Piezo + ECDL (controlled system) gain.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 12 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 16).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Lock button (Figure 18). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 16. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 17. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 18. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage. The red dot signals the trigger point we selected. Once we press the lock button, the PID will start working at that trigger point.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 19. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|450px|Figure 20. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 20 we use the same voltage scale as in Figure 17-19.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=File:Capture7.PNG&amp;diff=1297</id>
		<title>File:Capture7.PNG</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=File:Capture7.PNG&amp;diff=1297"/>
		<updated>2021-04-30T03:44:03Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: Victor Avalos uploaded a new version of File:Capture7.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1296</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1296"/>
		<updated>2021-04-30T03:40:56Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. We will be locking to the D2 transition F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;3 which corresponds to 780.246 nm&lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Experimental Setup==&lt;br /&gt;
====ECDL====&lt;br /&gt;
[[File:ecdl2.png|thumb|340px|Figure 3. ECDL enclosure. On the left current, temperature controllers and piezoelectric connectors. On the center the diode pointing to the right, grating making approximately 45°. It cannot be seen in the picture but the grating directs the light into a mirror that reflects the light back to the left to right direction. On the right, the mount screw and the piezoelectric.]]&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating mount (Figure 3), with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
===Optical Setup===&lt;br /&gt;
We show an schematic of our experimental setup in Figure 4. After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
====Monitoring====&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
====SAS + FM ====&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
====Lockbox====&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines (F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;[1,3] and F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;[2,3]).&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 4. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 5. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. &lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. &lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Lock button (Figure 18). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 16. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 17. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 18. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage. The red dot signals the trigger point we selected. Once we press the lock button, the PID will start working at that trigger point.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 19. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 20. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 20 we use the same voltage scale as in Figure 17-19.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Main_Page&amp;diff=1295</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Main_Page&amp;diff=1295"/>
		<updated>2021-04-30T03:31:03Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: /* Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rb 87 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Project wiki for the Module QT5201U (Quantum control technology) - AY20/21S2&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Welcome to the wiki project page. This will be the place for documenting projects. To be able to write something to this wiki, we need to create a user login manually. If you have not yet created an account, do let me know - Christian.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Deadline for the reports will be 30 April 23:59SGT!&amp;lt;/strong&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project proposals==&lt;br /&gt;
===[[Wavemeter based on interferometer]]===&lt;br /&gt;
Basically, we are now trying to build a wavemeter based on Michelson interferometer. The goal is to measure laser with a wavelength from 1200nm to 1800nm which can be used for these lasers in our lab. This project consists of work about optics and electronic control. The control system is mainly implemented by using a Arduino UNO board and some basic circuits.&lt;br /&gt;
&lt;br /&gt;
===[[Coincidence Time Measurement of Pulsed Lasers &amp;amp; &amp;quot;Useful&amp;quot; Applications]]===&lt;br /&gt;
Proof-of-concept experiment to show how one may use commonly-available materials to measure difference in laser path lengths to sub-millimeter precision with a copper target (TBC). This experiment is done using a 355nm, 120 MHz, 10ps pulsed laser. Upon showing that such a measurement is possible, we shall go on to explore some for-fun applications of this &amp;quot;technology&amp;quot; and see how far and precise we can get.&lt;br /&gt;
&lt;br /&gt;
===[[Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87]]===&lt;br /&gt;
With a combination of the Saturation Spectroscopy and Frequency Modulation techniques, we aim at stabilizing the wavelength of a Diode Laser at approximately 780.246 nm which corresponds to the transition &amp;lt;math&amp;gt;5S_{1/2},F=2 \rightarrow 5P_{3/2},F=3&amp;lt;/math&amp;gt; of &amp;lt;sup&amp;gt;87&amp;lt;/sup&amp;gt;Rb. Additionally we will implement in the experiment a Red Pitaya, which is a minicomputer capable of replacing things like an Oscilloscope, Function Generator and PID controller. Therefore reducing the space needed for the experiment.&lt;br /&gt;
&lt;br /&gt;
===[[Control over the atomic spins within certain molecules by NMR technique]]===&lt;br /&gt;
NMR has been the workhorse for the experimental implementation of quantum protocols, allowing exquisite control of systems up to seven qubits in size. However, there exists some experimental limitations in terms of the cross-talk, coupled evolution, instrumental errors and so on. &lt;br /&gt;
Thanks to the current advanced pulse techniques, we can reduce these influences and extend this technique to a new stage that the experimental limits can be neglected. In this experiment, we try to use composite pulses to compensate RF field strength variations and frequency offsets.&lt;br /&gt;
&lt;br /&gt;
===[[Optical control of TMDCs valley pseudospin qubits]]===&lt;br /&gt;
Quantum dots or single electron transistors, allow for individual control of single charge or spin. In addition, some semiconductor monolayers possess a sizeable direct bandgap of ≈1.5–2 eV in the optical range allowing electrostatic confinement and optical manipulation of carriers. Therefore, we try to adopt the method of this theoretical paper, and see if we can control single qubit or couple 2 qubits optically.&lt;br /&gt;
&lt;br /&gt;
===[[A temperature-tunable etalon for optical telecommunication wavelength]]===&lt;br /&gt;
This project aims to build a Fabry-perot interferometer (also called Etalon) that works at the optical telecommunication wavelengths (1260nm-1625nm). This depicted etalon is made out of a single piece of polished silicon wafer with a thickness of about 100μm. The free spectral range (FSR) of the etalon can be adjusted by changing its thickness through temperature tuning. We will also explore the possibility of applying highly reflective (HR) coatings to the silicon wafer to achieve a high cavity finesse and a narrow transmission line-width.&lt;br /&gt;
&lt;br /&gt;
===[[Microwave control of superconducting cavity and qubit]]===&lt;br /&gt;
This project aims to perform a trial pre-experiment based on the cQED architecture including simulation, calibration, microwave control pulse programming, and so on.  The 3D superconducting cavity sample is anchored to the MXC flange inside the Bluefors dilution refrigerator to reach a temperature of around 10mK. On the other hand, the generation of microwave control pulses and the acquisition of output signals are handled by a QM quantum control device, connecting the sample via the control lines and the output lines accordingly. Hence, we can realize several bosonic states via cavity driving and qubit control.&lt;br /&gt;
&lt;br /&gt;
===[[A Nanosecond Pulse Generator based on the Reconfigurable Phase-Locked Loop (PLL) Module in Field Programmable Gate Arrays (FPGAs)]]===&lt;br /&gt;
Field Programmable Gate Arrays (FPGAs) are digital integrated circuits (ICs) that contain blocks of logic and interconnects which can be configured and reconfigured even after it is being deployed &amp;quot;in the field&amp;quot;. This enables flexible tunability in the function of FPGA-based devices. We seek to emulate (with tweaks) the works of Zhu &amp;amp; Wang (2015) to utilise the Phase-Locked Loop (PLL) module in FPGA to implement a nanosecond pulse generator with adjustable frequency and pulse width. Our circuit was designed with Quartus Prime.&lt;br /&gt;
&lt;br /&gt;
==Material requests==&lt;br /&gt;
Please add stuff we should organize one way or the other here:&lt;br /&gt;
* more space&lt;br /&gt;
* cookies...&lt;br /&gt;
&lt;br /&gt;
==Stuff to be covered in the lecture slots on Mondays (sometimes Tuesdays as well)==&lt;br /&gt;
Feel free to add topics or aspects to this list. At the moment, this is just a copy of the tentative syllabus:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date !! Topic !! Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 18.1.2021&lt;br /&gt;
|[https://youtu.be/vDIOn2SHLJE Paraxial optics, part 1] &lt;br /&gt;
| rowspan = &amp;quot;2&amp;quot; | Optical systems often work with Gaussian beams. We cover practical design techniques like the ABCD matrix formalism for simple optical systems.&lt;br /&gt;
|-&lt;br /&gt;
| 19.1.2021&lt;br /&gt;
|[https://youtu.be/yO3JcuCOVoc Paraxial optics, part 2] (only first part of lecture)&lt;br /&gt;
|-&lt;br /&gt;
| 25.1.2021||[https://youtu.be/nNU1eEOaPdY Optical cavities, part 1] || Many optical techniques require to work with optical cavities. We cover how to design them, and how to couple light into very basic devices. This lecture covered some theory basics.&lt;br /&gt;
|-&lt;br /&gt;
| 26.1.2021||[https://youtu.be/ekfhUi2JjFM Optical cavities, part 2]|| Some more aspects of optical cavities, and dielectric coatings for mirrors and such&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1.2.2021||[https://youtu.be/h2LeznCpPTk Optical fiber technology] || Some properties of optical fibers as the most common optical waveguide are covered, including optical mode spectrum, dispersion and transmission properties.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 8.2.2021||[https://youtu.be/xblN-KzMz0Y  Optical modulators, part 1]&lt;br /&gt;
| rowspan = &amp;quot;2&amp;quot; | Many optical modulation techniques require rely on devices or materials where optical properties can be changed electrically; we cover accousto-optical and electro-optical devices, as well as liquid crystal systems.&lt;br /&gt;
|-&lt;br /&gt;
| 9.2.2021||[https://youtu.be/WfP5mahZrWU  Optical modulators, part 2]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 15.2.2021&lt;br /&gt;
|[https://youtu.be/m_F4DOHMNeU Homodyne detection techniques] || Measurement of optical fields in many continuous variable scenarios require knowledge of optical homodyning and heterodyning techniques. These techniques, similar to their radiofrequency counterparts, rely on multiplying field amplitudes.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1.3.2021&lt;br /&gt;
|[https://youtu.be/YkVlxxucLuA Frequency control of laser systems, part 1]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Many laser systems in quantum technologies require to have a well-defined frequency relationship with atomic transitions or solid state qubits. We cover typical techniques how laser systems can be controlled to a high enough accuracy, utilizing spectroscopy techniques and control systems.&lt;br /&gt;
|-&lt;br /&gt;
| 2.3.2021&lt;br /&gt;
|[https://youtu.be/72aVZwI4BHU Frequency control of laser systems, part 2]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 8.3.2021&lt;br /&gt;
|[https://youtu.be/jolUa_EGZEs Interface to computers]&lt;br /&gt;
| High level interfacing between computers and electronic hardware: Standard device languages; some serial protocols, some aspects of microcontrollers and FPGAs&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 15.3.2021&lt;br /&gt;
|[https://youtu.be/1S0EAnooQMc Pulses in quantum control]&lt;br /&gt;
| Many quantum systems require short control pulses, either in form of optical pulses or radiofrequency pulses. This covers how they are used, and present a few techniques to generate such control pulses&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 22.3.2021&lt;br /&gt;
|[https://youtu.be/PHx-da7RLE8 High voltage techniques]&lt;br /&gt;
| Working with high voltages requires a spectrum of techniques that is differing from more conventional electronics. A few aspects (field emission, dielectric strength, specific components) are covered.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|12.4.2021&lt;br /&gt;
|[https://youtu.be/K0U9ySRyvjs Control loops]&lt;br /&gt;
| Many experimental activities in controlling quantum systems require the control of classical systems, like the temperature stabilization of some device, or the frequency stabilization of a laser. This lecture gives a brief overview of some simple control concepts.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| ||Practical aspects of superconducting systems || We cover different materials, transition temperatures, temperature measurement techniques and thermal insulation / conduction techniques.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* Math can be entered in LaTeX style: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;r^2=\sqrt{x^2+y^2}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; renders as &amp;lt;math&amp;gt;r^2=\sqrt{x^2+y^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
* Should you miss any module or functionality of this wiki, please contact me (Christian Kurtsiefer).&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Main_Page&amp;diff=1293</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Main_Page&amp;diff=1293"/>
		<updated>2021-04-30T03:22:49Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: /* Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of 87Rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Project wiki for the Module QT5201U (Quantum control technology) - AY20/21S2&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Welcome to the wiki project page. This will be the place for documenting projects. To be able to write something to this wiki, we need to create a user login manually. If you have not yet created an account, do let me know - Christian.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Deadline for the reports will be 30 April 23:59SGT!&amp;lt;/strong&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project proposals==&lt;br /&gt;
===[[Wavemeter based on interferometer]]===&lt;br /&gt;
Basically, we are now trying to build a wavemeter based on Michelson interferometer. The goal is to measure laser with a wavelength from 1200nm to 1800nm which can be used for these lasers in our lab. This project consists of work about optics and electronic control. The control system is mainly implemented by using a Arduino UNO board and some basic circuits.&lt;br /&gt;
&lt;br /&gt;
===[[Coincidence Time Measurement of Pulsed Lasers &amp;amp; &amp;quot;Useful&amp;quot; Applications]]===&lt;br /&gt;
Proof-of-concept experiment to show how one may use commonly-available materials to measure difference in laser path lengths to sub-millimeter precision with a copper target (TBC). This experiment is done using a 355nm, 120 MHz, 10ps pulsed laser. Upon showing that such a measurement is possible, we shall go on to explore some for-fun applications of this &amp;quot;technology&amp;quot; and see how far and precise we can get.&lt;br /&gt;
&lt;br /&gt;
===[[Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rb 87]]===&lt;br /&gt;
With a combination of the Saturation Spectroscopy and Frequency Modulation techniques, we aim at stabilizing the wavelength of a Diode Laser at approximately 780.246 nm which corresponds to the transition &amp;lt;math&amp;gt;5S_{1/2},F=2 \rightarrow 5P_{3/2},F=3&amp;lt;/math&amp;gt; of &amp;lt;sup&amp;gt;87&amp;lt;/sup&amp;gt;Rb. Additionally we will implement in the experiment a Red Pitaya, which is a minicomputer capable of replacing things like an Oscilloscope, Function Generator and PID controller. Therefore reducing the space needed for the experiment.&lt;br /&gt;
&lt;br /&gt;
===[[Control over the atomic spins within certain molecules by NMR technique]]===&lt;br /&gt;
NMR has been the workhorse for the experimental implementation of quantum protocols, allowing exquisite control of systems up to seven qubits in size. However, there exists some experimental limitations in terms of the cross-talk, coupled evolution, instrumental errors and so on. &lt;br /&gt;
Thanks to the current advanced pulse techniques, we can reduce these influences and extend this technique to a new stage that the experimental limits can be neglected. In this experiment, we try to use composite pulses to compensate RF field strength variations and frequency offsets.&lt;br /&gt;
&lt;br /&gt;
===[[Optical control of TMDCs valley pseudospin qubits]]===&lt;br /&gt;
Quantum dots or single electron transistors, allow for individual control of single charge or spin. In addition, some semiconductor monolayers possess a sizeable direct bandgap of ≈1.5–2 eV in the optical range allowing electrostatic confinement and optical manipulation of carriers. Therefore, we try to adopt the method of this theoretical paper, and see if we can control single qubit or couple 2 qubits optically.&lt;br /&gt;
&lt;br /&gt;
===[[A temperature-tunable etalon for optical telecommunication wavelength]]===&lt;br /&gt;
This project aims to build a Fabry-perot interferometer (also called Etalon) that works at the optical telecommunication wavelengths (1260nm-1625nm). This depicted etalon is made out of a single piece of polished silicon wafer with a thickness of about 100μm. The free spectral range (FSR) of the etalon can be adjusted by changing its thickness through temperature tuning. We will also explore the possibility of applying highly reflective (HR) coatings to the silicon wafer to achieve a high cavity finesse and a narrow transmission line-width.&lt;br /&gt;
&lt;br /&gt;
===[[Microwave control of superconducting cavity and qubit]]===&lt;br /&gt;
This project aims to perform a trial pre-experiment based on the cQED architecture including simulation, calibration, microwave control pulse programming, and so on.  The 3D superconducting cavity sample is anchored to the MXC flange inside the Bluefors dilution refrigerator to reach a temperature of around 10mK. On the other hand, the generation of microwave control pulses and the acquisition of output signals are handled by a QM quantum control device, connecting the sample via the control lines and the output lines accordingly. Hence, we can realize several bosonic states via cavity driving and qubit control.&lt;br /&gt;
&lt;br /&gt;
===[[A Nanosecond Pulse Generator based on the Reconfigurable Phase-Locked Loop (PLL) Module in Field Programmable Gate Arrays (FPGAs)]]===&lt;br /&gt;
Field Programmable Gate Arrays (FPGAs) are digital integrated circuits (ICs) that contain blocks of logic and interconnects which can be configured and reconfigured even after it is being deployed &amp;quot;in the field&amp;quot;. This enables flexible tunability in the function of FPGA-based devices. We seek to emulate (with tweaks) the works of Zhu &amp;amp; Wang (2015) to utilise the Phase-Locked Loop (PLL) module in FPGA to implement a nanosecond pulse generator with adjustable frequency and pulse width. Our circuit was designed with Quartus Prime.&lt;br /&gt;
&lt;br /&gt;
==Material requests==&lt;br /&gt;
Please add stuff we should organize one way or the other here:&lt;br /&gt;
* more space&lt;br /&gt;
* cookies...&lt;br /&gt;
&lt;br /&gt;
==Stuff to be covered in the lecture slots on Mondays (sometimes Tuesdays as well)==&lt;br /&gt;
Feel free to add topics or aspects to this list. At the moment, this is just a copy of the tentative syllabus:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date !! Topic !! Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 18.1.2021&lt;br /&gt;
|[https://youtu.be/vDIOn2SHLJE Paraxial optics, part 1] &lt;br /&gt;
| rowspan = &amp;quot;2&amp;quot; | Optical systems often work with Gaussian beams. We cover practical design techniques like the ABCD matrix formalism for simple optical systems.&lt;br /&gt;
|-&lt;br /&gt;
| 19.1.2021&lt;br /&gt;
|[https://youtu.be/yO3JcuCOVoc Paraxial optics, part 2] (only first part of lecture)&lt;br /&gt;
|-&lt;br /&gt;
| 25.1.2021||[https://youtu.be/nNU1eEOaPdY Optical cavities, part 1] || Many optical techniques require to work with optical cavities. We cover how to design them, and how to couple light into very basic devices. This lecture covered some theory basics.&lt;br /&gt;
|-&lt;br /&gt;
| 26.1.2021||[https://youtu.be/ekfhUi2JjFM Optical cavities, part 2]|| Some more aspects of optical cavities, and dielectric coatings for mirrors and such&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1.2.2021||[https://youtu.be/h2LeznCpPTk Optical fiber technology] || Some properties of optical fibers as the most common optical waveguide are covered, including optical mode spectrum, dispersion and transmission properties.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 8.2.2021||[https://youtu.be/xblN-KzMz0Y  Optical modulators, part 1]&lt;br /&gt;
| rowspan = &amp;quot;2&amp;quot; | Many optical modulation techniques require rely on devices or materials where optical properties can be changed electrically; we cover accousto-optical and electro-optical devices, as well as liquid crystal systems.&lt;br /&gt;
|-&lt;br /&gt;
| 9.2.2021||[https://youtu.be/WfP5mahZrWU  Optical modulators, part 2]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 15.2.2021&lt;br /&gt;
|[https://youtu.be/m_F4DOHMNeU Homodyne detection techniques] || Measurement of optical fields in many continuous variable scenarios require knowledge of optical homodyning and heterodyning techniques. These techniques, similar to their radiofrequency counterparts, rely on multiplying field amplitudes.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1.3.2021&lt;br /&gt;
|[https://youtu.be/YkVlxxucLuA Frequency control of laser systems, part 1]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Many laser systems in quantum technologies require to have a well-defined frequency relationship with atomic transitions or solid state qubits. We cover typical techniques how laser systems can be controlled to a high enough accuracy, utilizing spectroscopy techniques and control systems.&lt;br /&gt;
|-&lt;br /&gt;
| 2.3.2021&lt;br /&gt;
|[https://youtu.be/72aVZwI4BHU Frequency control of laser systems, part 2]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 8.3.2021&lt;br /&gt;
|[https://youtu.be/jolUa_EGZEs Interface to computers]&lt;br /&gt;
| High level interfacing between computers and electronic hardware: Standard device languages; some serial protocols, some aspects of microcontrollers and FPGAs&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 15.3.2021&lt;br /&gt;
|[https://youtu.be/1S0EAnooQMc Pulses in quantum control]&lt;br /&gt;
| Many quantum systems require short control pulses, either in form of optical pulses or radiofrequency pulses. This covers how they are used, and present a few techniques to generate such control pulses&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 22.3.2021&lt;br /&gt;
|[https://youtu.be/PHx-da7RLE8 High voltage techniques]&lt;br /&gt;
| Working with high voltages requires a spectrum of techniques that is differing from more conventional electronics. A few aspects (field emission, dielectric strength, specific components) are covered.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|12.4.2021&lt;br /&gt;
|[https://youtu.be/K0U9ySRyvjs Control loops]&lt;br /&gt;
| Many experimental activities in controlling quantum systems require the control of classical systems, like the temperature stabilization of some device, or the frequency stabilization of a laser. This lecture gives a brief overview of some simple control concepts.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| ||Practical aspects of superconducting systems || We cover different materials, transition temperatures, temperature measurement techniques and thermal insulation / conduction techniques.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* Math can be entered in LaTeX style: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;r^2=\sqrt{x^2+y^2}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; renders as &amp;lt;math&amp;gt;r^2=\sqrt{x^2+y^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
* Should you miss any module or functionality of this wiki, please contact me (Christian Kurtsiefer).&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Main_Page&amp;diff=1292</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Main_Page&amp;diff=1292"/>
		<updated>2021-04-30T03:20:30Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: /* Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of 87Rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Project wiki for the Module QT5201U (Quantum control technology) - AY20/21S2&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Welcome to the wiki project page. This will be the place for documenting projects. To be able to write something to this wiki, we need to create a user login manually. If you have not yet created an account, do let me know - Christian.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Deadline for the reports will be 30 April 23:59SGT!&amp;lt;/strong&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project proposals==&lt;br /&gt;
===[[Wavemeter based on interferometer]]===&lt;br /&gt;
Basically, we are now trying to build a wavemeter based on Michelson interferometer. The goal is to measure laser with a wavelength from 1200nm to 1800nm which can be used for these lasers in our lab. This project consists of work about optics and electronic control. The control system is mainly implemented by using a Arduino UNO board and some basic circuits.&lt;br /&gt;
&lt;br /&gt;
===[[Coincidence Time Measurement of Pulsed Lasers &amp;amp; &amp;quot;Useful&amp;quot; Applications]]===&lt;br /&gt;
Proof-of-concept experiment to show how one may use commonly-available materials to measure difference in laser path lengths to sub-millimeter precision with a copper target (TBC). This experiment is done using a 355nm, 120 MHz, 10ps pulsed laser. Upon showing that such a measurement is possible, we shall go on to explore some for-fun applications of this &amp;quot;technology&amp;quot; and see how far and precise we can get.&lt;br /&gt;
&lt;br /&gt;
===Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of &amp;lt;sup&amp;gt;87&amp;lt;/sup&amp;gt;Rb===&lt;br /&gt;
With a combination of the Saturation Spectroscopy and Frequency Modulation techniques, we aim at stabilizing the wavelength of a Diode Laser at approximately 780.246 nm which corresponds to the transition &amp;lt;math&amp;gt;5S_{1/2},F=2 \rightarrow 5P_{3/2},F=3&amp;lt;/math&amp;gt; of &amp;lt;sup&amp;gt;87&amp;lt;/sup&amp;gt;Rb. Additionally we will implement in the experiment a Red Pitaya, which is a minicomputer capable of replacing things like an Oscilloscope, Function Generator and PID controller. Therefore reducing the space needed for the experiment.&lt;br /&gt;
&lt;br /&gt;
===[[Control over the atomic spins within certain molecules by NMR technique]]===&lt;br /&gt;
NMR has been the workhorse for the experimental implementation of quantum protocols, allowing exquisite control of systems up to seven qubits in size. However, there exists some experimental limitations in terms of the cross-talk, coupled evolution, instrumental errors and so on. &lt;br /&gt;
Thanks to the current advanced pulse techniques, we can reduce these influences and extend this technique to a new stage that the experimental limits can be neglected. In this experiment, we try to use composite pulses to compensate RF field strength variations and frequency offsets.&lt;br /&gt;
&lt;br /&gt;
===[[Optical control of TMDCs valley pseudospin qubits]]===&lt;br /&gt;
Quantum dots or single electron transistors, allow for individual control of single charge or spin. In addition, some semiconductor monolayers possess a sizeable direct bandgap of ≈1.5–2 eV in the optical range allowing electrostatic confinement and optical manipulation of carriers. Therefore, we try to adopt the method of this theoretical paper, and see if we can control single qubit or couple 2 qubits optically.&lt;br /&gt;
&lt;br /&gt;
===[[A temperature-tunable etalon for optical telecommunication wavelength]]===&lt;br /&gt;
This project aims to build a Fabry-perot interferometer (also called Etalon) that works at the optical telecommunication wavelengths (1260nm-1625nm). This depicted etalon is made out of a single piece of polished silicon wafer with a thickness of about 100μm. The free spectral range (FSR) of the etalon can be adjusted by changing its thickness through temperature tuning. We will also explore the possibility of applying highly reflective (HR) coatings to the silicon wafer to achieve a high cavity finesse and a narrow transmission line-width.&lt;br /&gt;
&lt;br /&gt;
===[[Microwave control of superconducting cavity and qubit]]===&lt;br /&gt;
This project aims to perform a trial pre-experiment based on the cQED architecture including simulation, calibration, microwave control pulse programming, and so on.  The 3D superconducting cavity sample is anchored to the MXC flange inside the Bluefors dilution refrigerator to reach a temperature of around 10mK. On the other hand, the generation of microwave control pulses and the acquisition of output signals are handled by a QM quantum control device, connecting the sample via the control lines and the output lines accordingly. Hence, we can realize several bosonic states via cavity driving and qubit control.&lt;br /&gt;
&lt;br /&gt;
===[[A Nanosecond Pulse Generator based on the Reconfigurable Phase-Locked Loop (PLL) Module in Field Programmable Gate Arrays (FPGAs)]]===&lt;br /&gt;
Field Programmable Gate Arrays (FPGAs) are digital integrated circuits (ICs) that contain blocks of logic and interconnects which can be configured and reconfigured even after it is being deployed &amp;quot;in the field&amp;quot;. This enables flexible tunability in the function of FPGA-based devices. We seek to emulate (with tweaks) the works of Zhu &amp;amp; Wang (2015) to utilise the Phase-Locked Loop (PLL) module in FPGA to implement a nanosecond pulse generator with adjustable frequency and pulse width. Our circuit was designed with Quartus Prime.&lt;br /&gt;
&lt;br /&gt;
==Material requests==&lt;br /&gt;
Please add stuff we should organize one way or the other here:&lt;br /&gt;
* more space&lt;br /&gt;
* cookies...&lt;br /&gt;
&lt;br /&gt;
==Stuff to be covered in the lecture slots on Mondays (sometimes Tuesdays as well)==&lt;br /&gt;
Feel free to add topics or aspects to this list. At the moment, this is just a copy of the tentative syllabus:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date !! Topic !! Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 18.1.2021&lt;br /&gt;
|[https://youtu.be/vDIOn2SHLJE Paraxial optics, part 1] &lt;br /&gt;
| rowspan = &amp;quot;2&amp;quot; | Optical systems often work with Gaussian beams. We cover practical design techniques like the ABCD matrix formalism for simple optical systems.&lt;br /&gt;
|-&lt;br /&gt;
| 19.1.2021&lt;br /&gt;
|[https://youtu.be/yO3JcuCOVoc Paraxial optics, part 2] (only first part of lecture)&lt;br /&gt;
|-&lt;br /&gt;
| 25.1.2021||[https://youtu.be/nNU1eEOaPdY Optical cavities, part 1] || Many optical techniques require to work with optical cavities. We cover how to design them, and how to couple light into very basic devices. This lecture covered some theory basics.&lt;br /&gt;
|-&lt;br /&gt;
| 26.1.2021||[https://youtu.be/ekfhUi2JjFM Optical cavities, part 2]|| Some more aspects of optical cavities, and dielectric coatings for mirrors and such&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1.2.2021||[https://youtu.be/h2LeznCpPTk Optical fiber technology] || Some properties of optical fibers as the most common optical waveguide are covered, including optical mode spectrum, dispersion and transmission properties.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 8.2.2021||[https://youtu.be/xblN-KzMz0Y  Optical modulators, part 1]&lt;br /&gt;
| rowspan = &amp;quot;2&amp;quot; | Many optical modulation techniques require rely on devices or materials where optical properties can be changed electrically; we cover accousto-optical and electro-optical devices, as well as liquid crystal systems.&lt;br /&gt;
|-&lt;br /&gt;
| 9.2.2021||[https://youtu.be/WfP5mahZrWU  Optical modulators, part 2]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 15.2.2021&lt;br /&gt;
|[https://youtu.be/m_F4DOHMNeU Homodyne detection techniques] || Measurement of optical fields in many continuous variable scenarios require knowledge of optical homodyning and heterodyning techniques. These techniques, similar to their radiofrequency counterparts, rely on multiplying field amplitudes.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1.3.2021&lt;br /&gt;
|[https://youtu.be/YkVlxxucLuA Frequency control of laser systems, part 1]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Many laser systems in quantum technologies require to have a well-defined frequency relationship with atomic transitions or solid state qubits. We cover typical techniques how laser systems can be controlled to a high enough accuracy, utilizing spectroscopy techniques and control systems.&lt;br /&gt;
|-&lt;br /&gt;
| 2.3.2021&lt;br /&gt;
|[https://youtu.be/72aVZwI4BHU Frequency control of laser systems, part 2]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 8.3.2021&lt;br /&gt;
|[https://youtu.be/jolUa_EGZEs Interface to computers]&lt;br /&gt;
| High level interfacing between computers and electronic hardware: Standard device languages; some serial protocols, some aspects of microcontrollers and FPGAs&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 15.3.2021&lt;br /&gt;
|[https://youtu.be/1S0EAnooQMc Pulses in quantum control]&lt;br /&gt;
| Many quantum systems require short control pulses, either in form of optical pulses or radiofrequency pulses. This covers how they are used, and present a few techniques to generate such control pulses&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 22.3.2021&lt;br /&gt;
|[https://youtu.be/PHx-da7RLE8 High voltage techniques]&lt;br /&gt;
| Working with high voltages requires a spectrum of techniques that is differing from more conventional electronics. A few aspects (field emission, dielectric strength, specific components) are covered.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|12.4.2021&lt;br /&gt;
|[https://youtu.be/K0U9ySRyvjs Control loops]&lt;br /&gt;
| Many experimental activities in controlling quantum systems require the control of classical systems, like the temperature stabilization of some device, or the frequency stabilization of a laser. This lecture gives a brief overview of some simple control concepts.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| ||Practical aspects of superconducting systems || We cover different materials, transition temperatures, temperature measurement techniques and thermal insulation / conduction techniques.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* Math can be entered in LaTeX style: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;r^2=\sqrt{x^2+y^2}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; renders as &amp;lt;math&amp;gt;r^2=\sqrt{x^2+y^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
* Should you miss any module or functionality of this wiki, please contact me (Christian Kurtsiefer).&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Main_Page&amp;diff=1291</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Main_Page&amp;diff=1291"/>
		<updated>2021-04-30T03:19:38Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: /* Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Project wiki for the Module QT5201U (Quantum control technology) - AY20/21S2&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Welcome to the wiki project page. This will be the place for documenting projects. To be able to write something to this wiki, we need to create a user login manually. If you have not yet created an account, do let me know - Christian.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Deadline for the reports will be 30 April 23:59SGT!&amp;lt;/strong&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project proposals==&lt;br /&gt;
===[[Wavemeter based on interferometer]]===&lt;br /&gt;
Basically, we are now trying to build a wavemeter based on Michelson interferometer. The goal is to measure laser with a wavelength from 1200nm to 1800nm which can be used for these lasers in our lab. This project consists of work about optics and electronic control. The control system is mainly implemented by using a Arduino UNO board and some basic circuits.&lt;br /&gt;
&lt;br /&gt;
===[[Coincidence Time Measurement of Pulsed Lasers &amp;amp; &amp;quot;Useful&amp;quot; Applications]]===&lt;br /&gt;
Proof-of-concept experiment to show how one may use commonly-available materials to measure difference in laser path lengths to sub-millimeter precision with a copper target (TBC). This experiment is done using a 355nm, 120 MHz, 10ps pulsed laser. Upon showing that such a measurement is possible, we shall go on to explore some for-fun applications of this &amp;quot;technology&amp;quot; and see how far and precise we can get.&lt;br /&gt;
&lt;br /&gt;
===[[Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of &amp;lt;sup&amp;gt;87&amp;lt;/sup&amp;gt;Rb]]===&lt;br /&gt;
With a combination of the Saturation Spectroscopy and Frequency Modulation techniques, we aim at stabilizing the wavelength of a Diode Laser at approximately 780.246 nm which corresponds to the transition &amp;lt;math&amp;gt;5S_{1/2},F=2 \rightarrow 5P_{3/2},F=3&amp;lt;/math&amp;gt; of &amp;lt;sup&amp;gt;87&amp;lt;/sup&amp;gt;Rb. Additionally we will implement in the experiment a Red Pitaya, which is a minicomputer capable of replacing things like an Oscilloscope, Function Generator and PID controller. Therefore reducing the space needed for the experiment.&lt;br /&gt;
&lt;br /&gt;
===[[Control over the atomic spins within certain molecules by NMR technique]]===&lt;br /&gt;
NMR has been the workhorse for the experimental implementation of quantum protocols, allowing exquisite control of systems up to seven qubits in size. However, there exists some experimental limitations in terms of the cross-talk, coupled evolution, instrumental errors and so on. &lt;br /&gt;
Thanks to the current advanced pulse techniques, we can reduce these influences and extend this technique to a new stage that the experimental limits can be neglected. In this experiment, we try to use composite pulses to compensate RF field strength variations and frequency offsets.&lt;br /&gt;
&lt;br /&gt;
===[[Optical control of TMDCs valley pseudospin qubits]]===&lt;br /&gt;
Quantum dots or single electron transistors, allow for individual control of single charge or spin. In addition, some semiconductor monolayers possess a sizeable direct bandgap of ≈1.5–2 eV in the optical range allowing electrostatic confinement and optical manipulation of carriers. Therefore, we try to adopt the method of this theoretical paper, and see if we can control single qubit or couple 2 qubits optically.&lt;br /&gt;
&lt;br /&gt;
===[[A temperature-tunable etalon for optical telecommunication wavelength]]===&lt;br /&gt;
This project aims to build a Fabry-perot interferometer (also called Etalon) that works at the optical telecommunication wavelengths (1260nm-1625nm). This depicted etalon is made out of a single piece of polished silicon wafer with a thickness of about 100μm. The free spectral range (FSR) of the etalon can be adjusted by changing its thickness through temperature tuning. We will also explore the possibility of applying highly reflective (HR) coatings to the silicon wafer to achieve a high cavity finesse and a narrow transmission line-width.&lt;br /&gt;
&lt;br /&gt;
===[[Microwave control of superconducting cavity and qubit]]===&lt;br /&gt;
This project aims to perform a trial pre-experiment based on the cQED architecture including simulation, calibration, microwave control pulse programming, and so on.  The 3D superconducting cavity sample is anchored to the MXC flange inside the Bluefors dilution refrigerator to reach a temperature of around 10mK. On the other hand, the generation of microwave control pulses and the acquisition of output signals are handled by a QM quantum control device, connecting the sample via the control lines and the output lines accordingly. Hence, we can realize several bosonic states via cavity driving and qubit control.&lt;br /&gt;
&lt;br /&gt;
===[[A Nanosecond Pulse Generator based on the Reconfigurable Phase-Locked Loop (PLL) Module in Field Programmable Gate Arrays (FPGAs)]]===&lt;br /&gt;
Field Programmable Gate Arrays (FPGAs) are digital integrated circuits (ICs) that contain blocks of logic and interconnects which can be configured and reconfigured even after it is being deployed &amp;quot;in the field&amp;quot;. This enables flexible tunability in the function of FPGA-based devices. We seek to emulate (with tweaks) the works of Zhu &amp;amp; Wang (2015) to utilise the Phase-Locked Loop (PLL) module in FPGA to implement a nanosecond pulse generator with adjustable frequency and pulse width. Our circuit was designed with Quartus Prime.&lt;br /&gt;
&lt;br /&gt;
==Material requests==&lt;br /&gt;
Please add stuff we should organize one way or the other here:&lt;br /&gt;
* more space&lt;br /&gt;
* cookies...&lt;br /&gt;
&lt;br /&gt;
==Stuff to be covered in the lecture slots on Mondays (sometimes Tuesdays as well)==&lt;br /&gt;
Feel free to add topics or aspects to this list. At the moment, this is just a copy of the tentative syllabus:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Date !! Topic !! Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 18.1.2021&lt;br /&gt;
|[https://youtu.be/vDIOn2SHLJE Paraxial optics, part 1] &lt;br /&gt;
| rowspan = &amp;quot;2&amp;quot; | Optical systems often work with Gaussian beams. We cover practical design techniques like the ABCD matrix formalism for simple optical systems.&lt;br /&gt;
|-&lt;br /&gt;
| 19.1.2021&lt;br /&gt;
|[https://youtu.be/yO3JcuCOVoc Paraxial optics, part 2] (only first part of lecture)&lt;br /&gt;
|-&lt;br /&gt;
| 25.1.2021||[https://youtu.be/nNU1eEOaPdY Optical cavities, part 1] || Many optical techniques require to work with optical cavities. We cover how to design them, and how to couple light into very basic devices. This lecture covered some theory basics.&lt;br /&gt;
|-&lt;br /&gt;
| 26.1.2021||[https://youtu.be/ekfhUi2JjFM Optical cavities, part 2]|| Some more aspects of optical cavities, and dielectric coatings for mirrors and such&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1.2.2021||[https://youtu.be/h2LeznCpPTk Optical fiber technology] || Some properties of optical fibers as the most common optical waveguide are covered, including optical mode spectrum, dispersion and transmission properties.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 8.2.2021||[https://youtu.be/xblN-KzMz0Y  Optical modulators, part 1]&lt;br /&gt;
| rowspan = &amp;quot;2&amp;quot; | Many optical modulation techniques require rely on devices or materials where optical properties can be changed electrically; we cover accousto-optical and electro-optical devices, as well as liquid crystal systems.&lt;br /&gt;
|-&lt;br /&gt;
| 9.2.2021||[https://youtu.be/WfP5mahZrWU  Optical modulators, part 2]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 15.2.2021&lt;br /&gt;
|[https://youtu.be/m_F4DOHMNeU Homodyne detection techniques] || Measurement of optical fields in many continuous variable scenarios require knowledge of optical homodyning and heterodyning techniques. These techniques, similar to their radiofrequency counterparts, rely on multiplying field amplitudes.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1.3.2021&lt;br /&gt;
|[https://youtu.be/YkVlxxucLuA Frequency control of laser systems, part 1]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Many laser systems in quantum technologies require to have a well-defined frequency relationship with atomic transitions or solid state qubits. We cover typical techniques how laser systems can be controlled to a high enough accuracy, utilizing spectroscopy techniques and control systems.&lt;br /&gt;
|-&lt;br /&gt;
| 2.3.2021&lt;br /&gt;
|[https://youtu.be/72aVZwI4BHU Frequency control of laser systems, part 2]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 8.3.2021&lt;br /&gt;
|[https://youtu.be/jolUa_EGZEs Interface to computers]&lt;br /&gt;
| High level interfacing between computers and electronic hardware: Standard device languages; some serial protocols, some aspects of microcontrollers and FPGAs&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 15.3.2021&lt;br /&gt;
|[https://youtu.be/1S0EAnooQMc Pulses in quantum control]&lt;br /&gt;
| Many quantum systems require short control pulses, either in form of optical pulses or radiofrequency pulses. This covers how they are used, and present a few techniques to generate such control pulses&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 22.3.2021&lt;br /&gt;
|[https://youtu.be/PHx-da7RLE8 High voltage techniques]&lt;br /&gt;
| Working with high voltages requires a spectrum of techniques that is differing from more conventional electronics. A few aspects (field emission, dielectric strength, specific components) are covered.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|12.4.2021&lt;br /&gt;
|[https://youtu.be/K0U9ySRyvjs Control loops]&lt;br /&gt;
| Many experimental activities in controlling quantum systems require the control of classical systems, like the temperature stabilization of some device, or the frequency stabilization of a laser. This lecture gives a brief overview of some simple control concepts.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| ||Practical aspects of superconducting systems || We cover different materials, transition temperatures, temperature measurement techniques and thermal insulation / conduction techniques.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* Math can be entered in LaTeX style: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;r^2=\sqrt{x^2+y^2}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; renders as &amp;lt;math&amp;gt;r^2=\sqrt{x^2+y^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
* Should you miss any module or functionality of this wiki, please contact me (Christian Kurtsiefer).&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1290</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1290"/>
		<updated>2021-04-30T03:04:22Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. We will be locking to the D2 transition F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;3 which corresponds to 780.246 nm&lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Experimental Setup==&lt;br /&gt;
====ECDL====&lt;br /&gt;
[[File:ecdl2.png|thumb|340px|Figure 3. ECDL enclosure. On the left current, temperature controllers and piezoelectric connectors. On the center the diode pointing to the right, grating making approximately 45°. It cannot be seen in the picture but the grating directs the light into a mirror that reflects the light back to the left to right direction. On the right, the mount screw and the piezoelectric.]]&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating mount (Figure 3), with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
===Optical Setup===&lt;br /&gt;
We show an schematic of our experimental setup in Figure 4. After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
====Monitoring====&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
====SAS + FM ====&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
====Lockbox====&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines (F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;[1,3] and F=2&amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt;[2,3]).&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 4. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 5. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. &lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. &lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1279</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1279"/>
		<updated>2021-04-30T02:03:41Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
[[File:ecdl2.png|thumb|340px|Figure 3. ECDL enclosure. On the left current, temperature controllers and piezoelectric connectors. On the center the diode pointing to the right, grating making approximately 45°. It cannot be seen in the picture but the grating directs the light into a mirror that reflects the light back to the left to right direction. On the right, the mount screw and the piezoelectric.]]&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
&lt;br /&gt;
We show an schematic of our experimental setup in Figure 3. After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
===SAS + FM ===&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
===Lockbox===&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 4. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 5. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. &lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. &lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1278</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1278"/>
		<updated>2021-04-30T02:01:51Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
[[File:ecdl2.png|thum|Figure 3. ECDL enclosure. On the left current, temperature controllers and piezoelectric connectors. On the center the diode pointing to the right, grating making approximately 45°. It cannot be seen in the picture but the grating directs the light into a mirror that reflects the light back to the left to right direction. On the right, the mount screw and the piezoelectric.]]&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
&lt;br /&gt;
We show an schematic of our experimental setup in Figure 3. After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
===SAS + FM ===&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
===Lockbox===&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 4. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 5. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. &lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. &lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=File:Ecdl2.png&amp;diff=1277</id>
		<title>File:Ecdl2.png</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=File:Ecdl2.png&amp;diff=1277"/>
		<updated>2021-04-30T01:55:34Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1205</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1205"/>
		<updated>2021-04-29T06:03:58Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
We show an schematic of our experimental setup in Figure 3. At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
===SAS + FM ===&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
===Lockbox===&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. &lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. &lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. In the port that goes into the piezo, we include a 4.7&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor, with which the piezo&#039;s capacitance forms a 191KHZ low pass filter.&lt;br /&gt;
&lt;br /&gt;
Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1203</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1203"/>
		<updated>2021-04-29T05:58:01Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
We show an schematic of our experimental setup in Figure 3. At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
===SAS + FM ===&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
===Lockbox===&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
====Regulators==== &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 1==== &lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance. The 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor is used as load impedance for the error signal voltage coming from the optical setup. In the same way, 50 &amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistor are used for impedance termination match.&lt;br /&gt;
&lt;br /&gt;
====OPAMP&#039;s set 2==== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. &lt;br /&gt;
&lt;br /&gt;
LT1236-10 is a voltage reference that gives +10V to the potentiometer. By moving the knob of the potentiometer we cover 0 to +10V voltage range from the set pad of the potentiometer: &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;. Then this voltage passes through a 10Hz low pass filter (&amp;lt;math&amp;gt;R_6 C_3&amp;lt;/math&amp;gt;). By using voltage divider configurations, we get amplification and substract the offset value from the piezo voltage. &lt;br /&gt;
&lt;br /&gt;
A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope. &lt;br /&gt;
&lt;br /&gt;
Same as in set 1, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; and 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; resistances are added in the input and output ports respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1 (OPA1602). &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2 (OPA1604). The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Piezo&#039;s bandwidth ===&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1184</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1184"/>
		<updated>2021-04-29T04:09:43Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
We show an schematic of our experimental setup in Figure 3. At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. &lt;br /&gt;
&lt;br /&gt;
Apart from the screws that control the grating angle and displacement, a piezoelectric was put behind the grating mirror. This will be used later for the locking stage.&lt;br /&gt;
&lt;br /&gt;
Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). After many tries, we could get the wavelength we were looking for (780.246nm), with current at around 120mA and the temperature at 20°C. Small tweaks of current are necessary every time we on/off the current controller. The temperature controller is never turned off because the actuator takes too much time to reach the set point temperature.&lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
===SAS + FM ===&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
===Lockbox===&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1181</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1181"/>
		<updated>2021-04-29T03:55:41Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
Once the optical setup to get the error signal was completed, we had as goal to incorporate a Red Pitaya mini-computer as PID controller of the diode&#039;s wavelength. The Red Pitaya has voltage limitations in its outputs so we had to use an additional set of electronics to amplify and offset it before sending the output signal to the piezoelectric, the actuator of the diode&#039;s wavelength.&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has an absolute accuracy of 0.00075nm and measurement rate of 10Hz, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
===SAS + FM ===&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands. We use &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency, because the natural linewidth of the object transition is 5MHz and the nearest crossover frequency is at around 500MHz afar. The light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP@90° (Quarter wave plate) and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
===Lockbox===&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does that by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1179</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1179"/>
		<updated>2021-04-29T03:40:30Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot etalon and a Wavemeter (Bristol 621 series) allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. The Wavemeter used, according to its data sheet, has a 15 % accuracy, so it is only used as reference and not as absolute measurement.&lt;br /&gt;
&lt;br /&gt;
===SAS + FM ===&lt;br /&gt;
Secondly we have the part where we get the error signal. It consists of a combination of Saturated Absorption Spectroscopy (SAS) using a Rubidium cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer where we use the modulation frequency &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we use as error signal. &lt;br /&gt;
&lt;br /&gt;
===Lockbox===&lt;br /&gt;
The error signal is then sent into a Lockbox, which in operation tries to reduce the error signal to 0. It does this by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. The way the Lockbox responds to the error signal, and modulates the piezo&#039;s voltage, is determined by the PID parameters. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained from the scanning of the piezo&#039;s voltage with a Signal Generator. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace an analog &amp;quot;Old&amp;quot; Lockbox we currently use, by a minicomputer type FPGA system called Red Pitaya. This new system can be controlled remotely through LAN connection and will also occupy less space in the bench by replacing things like an oscilloscope, signal generator and Lockbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1178</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1178"/>
		<updated>2021-04-29T03:15:56Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. &lt;br /&gt;
&lt;br /&gt;
===SAS + FM ===&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with the &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. We can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
The final goal of this project is to replace this analog &amp;quot;Old&amp;quot; Lockbox by a minicomputer type FPGA system called Red Pitaya. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1175</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1175"/>
		<updated>2021-04-29T03:07:29Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are RG-316 which have the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1174</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1174"/>
		<updated>2021-04-29T02:50:20Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode wavelength. Current was used for fine tuning of the wavelength, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1165</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1165"/>
		<updated>2021-04-29T02:20:27Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central wavelength of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s wavelength. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central wavelength, bandwidth and stability of our ECDL&#039;s wavelength. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. ECDL&#039;s wavelength is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control System===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Absorption Spectroscopy + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were added before and after the Red Pitaya to amplify its output voltage before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PiezoMechanik PSt150/4/5). The piezo is put behind the Grating mirror, so by applying voltages to it we change the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;. Since the external cavity length has a linear relation to the ECDL&#039;s wavelength, indirectly we have a linear relation with the piezo&#039;s voltage too.&lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s IP address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC. &lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + Offset===&lt;br /&gt;
In our lab, we usually do a previous search of the setpoint before applying the lock on to the system. The search is done by sweeping the voltage sent to the piezoelectric. Then we add a DC voltage offset to the sweeping range, which can be thought as fine tuning of the ECDL&#039;s wavelength. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. &lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the ECDL&#039;s wavelength range covered. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant wavelength. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring crossover frequencies (Figure 15).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1159</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1159"/>
		<updated>2021-04-29T02:01:57Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Controlled system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\Delta L/\Delta\lambda \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs (controller) that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, we see a constant 20dB gain through out all the frequency range measured. For the phase, we don&#039;t have any delay up until around 30kHz, where it starts increasing. According to its datasheet, the bandwidth of the OPAMPs used is 35MHz. But for our application we will not be using that full range.&lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL (controlled system) gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using in the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. We need to have in mind that at -180° phase delay, the negative feedback of the PID becomes a positive feedback (when looking at the transfer function of the system). We call unit loop-gain, the point where the gain of the loop is 0dB. Our system will be stable while the unit loop-gain is reached at larger phase delays than -180° (more positive).&lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as the unit loop-gain frequency &amp;lt;math&amp;gt;f_c&amp;lt;/math&amp;gt; (also called critical frequency), the point where the phase delay is -120°. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{c}}=1520&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the total system gain at the critical frequency, we determine how much P gain we need to make that gain 0dB. In our bode plots, at the critical frequency 1520&amp;lt;/math&amp;gt;Hz, we have piezo + ECDL (controlled system) gain of around -20dB, and from the OPAMPs (controller) we have a +20dB gain. So in total we have a loop gain of 0dB already. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{c}}}{10}&amp;lt;/math&amp;gt;. So, for us the integral cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring resonant frequencies (Figure 13).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1133</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1133"/>
		<updated>2021-04-28T08:09:44Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\Delta L/\Delta\lambda \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer (Agilent E5061B). We measured both OPAMPs and ECDL response to the Piezo. &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when there is -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the CQT&#039;s rack panel we can get voltages like: -15, -5, +5 and +15V. For now, we are using a Power supply instead of putting it into the rack panel.  Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for the RG-316 cables go up to 6GHz, more than enough for our slow PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring resonant frequencies (Figure 13).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 15. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 16. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 17. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 18. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 19. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 19 we use the same voltage scale as in Figure 16-18.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1132</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1132"/>
		<updated>2021-04-28T08:02:10Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\Delta L/\Delta\lambda \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
We made Gain and phase measurements using a Vector Network Analyzer. It may seem like &lt;br /&gt;
&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring resonant frequencies (Figure 13).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 13. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 14. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 15. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 16. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1131</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1131"/>
		<updated>2021-04-28T07:48:05Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode (GH07P28A1C: 780 center wavelength) in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\Delta L/\Delta\lambda \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:Redpitashafp.png|thumb|350px|Figure 12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel. On the right a DIN type C connector.&lt;br /&gt;
File:Frontpanel.png|thumb|300px|Figure 13. Front panel with the BNC, ethernet and supply connectors and the potentiometer knob for the voltage offset.&lt;br /&gt;
File:Rpsetup.png|thumb|350px|Figure 14. Control setup. On the top part of the trolley, a monitor scope, 15V power supply and the Red Pitaya + PCB enclosure. On the bottom part, a Wavemeter (Bristol 621 Series) an a laptop to monitor the wavelength.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring resonant frequencies (Figure 13).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 13. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 14. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 15. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 16. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1130</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1130"/>
		<updated>2021-04-28T07:32:29Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\Delta L/\Delta\lambda \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity is the capacity of a material to store charge because of mechanical stress, and vice versa. Our Piezoelectric (PSt150/4/5) has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, with max peak to peak voltages of around &amp;lt;math&amp;gt;V_{\text{p-p}}=5V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=142.045\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring resonant frequencies (Figure 13).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 13. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 14. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 15. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 16. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1129</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1129"/>
		<updated>2021-04-28T07:16:59Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\Delta L/\Delta\lambda \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity&lt;br /&gt;
Our Piezoelectric has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, wih peak to peak voltage &amp;lt;math&amp;gt;V_{\text{p-p}}=2V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=36.511\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring resonant frequencies (Figure 13).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 13. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 14. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 15. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 16. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1128</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1128"/>
		<updated>2021-04-28T07:15:26Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (green) and Fabry Perot signal (yellow) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. Signed with a blue arrow, the slope of the desired wavelength 780.246nm &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\Delta L/\Delta\lambda \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity&lt;br /&gt;
Our Piezoelectric has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, wih peak to peak voltage &amp;lt;math&amp;gt;V_{\text{p-p}}=2V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=36.511\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring resonant frequencies (Figure 13).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 13. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 14. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 15. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 16. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=File:Es.jpg&amp;diff=1127</id>
		<title>File:Es.jpg</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=File:Es.jpg&amp;diff=1127"/>
		<updated>2021-04-28T07:13:54Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: Victor Avalos uploaded a new version of File:Es.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1126</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1126"/>
		<updated>2021-04-28T07:01:23Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (orange) and Fabry Perot signal (blue) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\Delta L/\Delta\lambda \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity&lt;br /&gt;
Our Piezoelectric has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, wih peak to peak voltage &amp;lt;math&amp;gt;V_{\text{p-p}}=2V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=36.511\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring resonant frequencies (Figure 13).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring crossover frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 13. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 14. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 15. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 16. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1124</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1124"/>
		<updated>2021-04-28T06:57:11Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (orange) and Fabry Perot signal (blue) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\Delta L/\Delta\lambda \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity&lt;br /&gt;
Our Piezoelectric has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, wih peak to peak voltage &amp;lt;math&amp;gt;V_{\text{p-p}}=2V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=36.511\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring resonant frequencies (Figure 13).&lt;br /&gt;
# We set the PID parameters chosen with the Bode Plots. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring resonant frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 13. Blue: Error signal, Red: Piezo Voltage. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition.  &lt;br /&gt;
File:Capture0.PNG|300px|Figure 14. 2.5V peak to peak scan, half period shown. Now centered at the 780.246 transition (between 4 and 5 ms).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 15. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 16. Locked mode. We show the error signal&#039;s  mean and standard deviation values in mV.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1122</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1122"/>
		<updated>2021-04-28T06:48:37Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (orange) and Fabry Perot signal (blue) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\Delta L/\Delta\lambda \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity&lt;br /&gt;
Our Piezoelectric has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, wih peak to peak voltage &amp;lt;math&amp;gt;V_{\text{p-p}}=2V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=36.511\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring resonant frequencies (Figure 13).&lt;br /&gt;
# We set the PID parameters. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring resonant frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 13. 4V peak to peak scan, half period shown. On the right, signed by an arrow, the slope of the 780.246nm transition. On the left, the slopes of crossover frequencies. &lt;br /&gt;
File:Capture0.PNG|300px|Figure 14. 2.5V peak to peak scan, half period shown. Now we are centered around the point where we want to lock. The transition slope is between 4 and 5 ms.&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 15. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 16. Locked mode. We show the error signal&#039;s  mean and standard deviation values.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=File:Capture7.PNG&amp;diff=1119</id>
		<title>File:Capture7.PNG</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=File:Capture7.PNG&amp;diff=1119"/>
		<updated>2021-04-28T06:43:20Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: Victor Avalos uploaded a new version of File:Capture7.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1117</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1117"/>
		<updated>2021-04-28T06:41:57Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, the other two correspond to crossover frequencies with another transition lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (orange) and Fabry Perot signal (blue) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|380px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|320px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\Delta L/\Delta\lambda \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give (0 to +2V output), we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (set 1: OPA1602 and set 2:OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have high input impedance and low output impedance, so we prevent any voltage loss because of the load mismatch impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt;, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer (BUF634) is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwidth ====&lt;br /&gt;
Piezoelectricity&lt;br /&gt;
Our Piezoelectric has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, wih peak to peak voltage &amp;lt;math&amp;gt;V_{\text{p-p}}=2V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=36.511\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;\lambda=780.246&amp;lt;/math&amp;gt;nm has a distinguishable shape from the neighboring resonant frequencies (Figure 13).&lt;br /&gt;
# We set the PID parameters. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring resonant frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture7.PNG|300px|Figure 13. 2V peak to peak scan, on the right the slope of the 780.246nm transition and on the left crossover frequencies. &lt;br /&gt;
File:Capture0.PNG|300px|Figure 14. 1V peak to peak scan, now we are centered around the point where we want to lock. The slope is beween 4 and 5 ms.&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 15. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 16. Locked mode. We show the error signal&#039;s  mean and standard deviation values.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=File:Capture9.PNG&amp;diff=1112</id>
		<title>File:Capture9.PNG</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=File:Capture9.PNG&amp;diff=1112"/>
		<updated>2021-04-28T06:18:43Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=File:Capture7.PNG&amp;diff=1111</id>
		<title>File:Capture7.PNG</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=File:Capture7.PNG&amp;diff=1111"/>
		<updated>2021-04-28T06:17:09Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1110</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1110"/>
		<updated>2021-04-28T06:16:50Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, another corresponds to a close transition and the last is the crossover frequency between them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (orange) and Fabry Perot signal (blue) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|400px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|300px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\frac{\Delta L}{\Delta\lambda} \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give, we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (OPA1602 and OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have low impedance in the output, so we prevent any voltage loss because of the load impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt; is the output voltage from the Red Pitaya and &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an osciloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwith ====&lt;br /&gt;
&lt;br /&gt;
Our Piezoelectric has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, wih peak to peak voltage &amp;lt;math&amp;gt;V_{\text{p-p}}=2V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=36.511\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
#* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
#* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;f\lambda=780.246&amp;lt;/math&amp;gt; has a distinguishable shape from the neighboring resonant frequencies (Figure ?????).&lt;br /&gt;
# We set the PID parameters. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring resonant frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture0.PNG|300px|Figure 13. We show half period of the frequency scanning. From 4 to 5 ms we have the slope to which we want to lock the frequency. Channel 1: Error signal. Channel 2: Vrp_out (voltage output from the Red Pitaya).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 14. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 15. Locked mode. We show the error signal&#039;s  mean and standard deviation values&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1109</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1109"/>
		<updated>2021-04-28T06:15:29Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, another corresponds to a close transition and the last is the crossover frequency between them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (orange) and Fabry Perot signal (blue) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|400px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|300px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\frac{\Delta L}{\Delta\lambda} \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give, we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (OPA1602 and OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have low impedance in the output, so we prevent any voltage loss because of the load impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt; is the output voltage from the Red Pitaya and &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an osciloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwith ====&lt;br /&gt;
&lt;br /&gt;
Our Piezoelectric has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, wih peak to peak voltage &amp;lt;math&amp;gt;V_{\text{p-p}}=2V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=36.511\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
* Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
* Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;f\lambda=780.246&amp;lt;/math&amp;gt; has a distinguishable shape from the neighboring resonant frequencies (Figure ?????).&lt;br /&gt;
# We set the PID parameters. &lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring resonant frequencies that we mentioned before.&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture0.PNG|300px|Figure 13. We show half period of the frequency scanning. From 4 to 5 ms we have the slope to which we want to lock the frequency. Channel 1: Error signal. Channel 2: Vrp_out (voltage output from the Red Pitaya).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 14. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 15. Locked mode. We show the error signal&#039;s  mean and standard deviation values&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1108</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1108"/>
		<updated>2021-04-28T06:03:50Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, another corresponds to a close transition and the last is the crossover frequency between them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (orange) and Fabry Perot signal (blue) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|400px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|300px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\frac{\Delta L}{\Delta\lambda} \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give, we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (OPA1602 and OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have low impedance in the output, so we prevent any voltage loss because of the load impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt; is the output voltage from the Red Pitaya and &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an osciloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwith ====&lt;br /&gt;
&lt;br /&gt;
Our Piezoelectric has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, wih peak to peak voltage &amp;lt;math&amp;gt;V_{\text{p-p}}=2V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=36.511\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
# We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
&lt;br /&gt;
*:- Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
*:- Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
&lt;br /&gt;
# During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;f\lambda=780.246&amp;lt;/math&amp;gt; has a distinguishable shape from the neighboring resonant frequencies (Figure ?????).&lt;br /&gt;
&lt;br /&gt;
# We set the PID parameters. &lt;br /&gt;
&lt;br /&gt;
# With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring resonant frequencies that we mentioned before.&lt;br /&gt;
&lt;br /&gt;
# Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture0.PNG|300px|Figure 13. We show half period of the frequency scanning. From 4 to 5 ms we have the slope to which we want to lock the frequency. Channel 1: Error signal. Channel 2: Vrp_out (voltage output from the Red Pitaya).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 14. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 15. Locked mode. We show the error signal&#039;s  mean and standard deviation values&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1107</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1107"/>
		<updated>2021-04-28T06:02:01Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, another corresponds to a close transition and the last is the crossover frequency between them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (orange) and Fabry Perot signal (blue) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|400px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|300px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\frac{\Delta L}{\Delta\lambda} \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give, we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (OPA1602 and OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have low impedance in the output, so we prevent any voltage loss because of the load impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt; is the output voltage from the Red Pitaya and &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an osciloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwith ====&lt;br /&gt;
&lt;br /&gt;
Our Piezoelectric has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, wih peak to peak voltage &amp;lt;math&amp;gt;V_{\text{p-p}}=2V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=36.511\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
1. We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
    *:- Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
    *:- Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
2. During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;f\lambda=780.246&amp;lt;/math&amp;gt; has a distinguishable shape from the neighboring resonant frequencies (Figure ?????).&lt;br /&gt;
&lt;br /&gt;
3. We set the PID parameters. &lt;br /&gt;
&lt;br /&gt;
4. With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring resonant frequencies that we mentioned before.&lt;br /&gt;
&lt;br /&gt;
5. Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture0.PNG|300px|Figure 13. We show half period of the frequency scanning. From 4 to 5 ms we have the slope to which we want to lock the frequency. Channel 1: Error signal. Channel 2: Vrp_out (voltage output from the Red Pitaya).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 14. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 15. Locked mode. We show the error signal&#039;s  mean and standard deviation values&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1106</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1106"/>
		<updated>2021-04-28T06:00:25Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, another corresponds to a close transition and the last is the crossover frequency between them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (orange) and Fabry Perot signal (blue) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|400px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
* 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
* Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
* Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|300px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\frac{\Delta L}{\Delta\lambda} \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give, we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (OPA1602 and OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have low impedance in the output, so we prevent any voltage loss because of the load impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt; is the output voltage from the Red Pitaya and &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an osciloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwith ====&lt;br /&gt;
&lt;br /&gt;
Our Piezoelectric has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, wih peak to peak voltage &amp;lt;math&amp;gt;V_{\text{p-p}}=2V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=36.511\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
# P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
&lt;br /&gt;
# I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
&lt;br /&gt;
# D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
1. We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
    - Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
    - Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
&lt;br /&gt;
2. During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;f\lambda=780.246&amp;lt;/math&amp;gt; has a distinguishable shape from the neighboring resonant frequencies (Figure ?????).&lt;br /&gt;
&lt;br /&gt;
3. We set the PID parameters. &lt;br /&gt;
&lt;br /&gt;
4. With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring resonant frequencies that we mentioned before.&lt;br /&gt;
&lt;br /&gt;
5. Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture0.PNG|300px|Figure 13. We show half period of the frequency scanning. From 4 to 5 ms we have the slope to which we want to lock the frequency. Channel 1: Error signal. Channel 2: Vrp_out (voltage output from the Red Pitaya).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 14. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 15. Locked mode. We show the error signal&#039;s  mean and standard deviation values&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
	<entry>
		<id>https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1105</id>
		<title>Saturated Absorption Spectroscopy + Frequency Modulation Locking on the D2 line of Rubidium 87</title>
		<link rel="alternate" type="text/html" href="https://AY2021S2.qt5201.org/index.php?title=Saturated_Absorption_Spectroscopy_%2B_Frequency_Modulation_Locking_on_the_D2_line_of_Rubidium_87&amp;diff=1105"/>
		<updated>2021-04-28T05:58:39Z</updated>

		<summary type="html">&lt;p&gt;Victor Avalos: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Diode Laser is a semiconductor based tool capable of generating laser light at wavelengths which are useful for atomic physics. Nevertheless there are 2 things we need to improve before using them for atomic applications. First the bandwidth needs to be small enough not to promote transitions neighboring our desired transition. Secondly, the central frequency of the diode is susceptible to mechanical and electrical noise. The first problem is solved by putting the diode laser in an external cavity, the second problem requires more attention and demands various steps, but it is basically obtaining  an error signal by comparing our frequency to a reference value, and then sending this error signal into a PID controller to correct the error through actuators in the Diode. The reference value can be obtained by various techniques, we will be using a Saturated Absorption Spectroscopy from a cell of Rubidium atoms. &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===External Cavity Diode Laser (ECDL)===&lt;br /&gt;
Per se the diode laser is inside a cavity (which we call internal cavity), formed by a high reflective mirror on one side and a semi-transparent mirror on the emitting end. But since the bandwidth is not small enough for our application, we need to put the diode in front of a [[Blazed Grating]] to form an external cavity. Blazed gratings separate the incident beam into different directions, which angles of diffraction are governed by the grating parameters and the order &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of the diffraction.&lt;br /&gt;
&lt;br /&gt;
[[File:grating.png|thumb|600px|Figure 1. External Cavity Diode Laser (ECDL) using the Littrow configuration. a)The grating is mounted in a support with screws that let us control the incidence angle  &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the displacement in the  &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; direction. b)Littrow configuration: The +1 order is reflected back to the diode only when the incidence angle is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Littrow configuration====&lt;br /&gt;
We will be using the Littrow configuration (Fig.1), where the key part is to reflect back the +1 order into the diode. This back reflection or grating feedback is possible only when the angle of incidence &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; is the same as the grating angle &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; (which is characteristic of the grating used). So an external cavity is formed between the high reflective mirror of the internal cavity of the diode and the grating. The distance between this two gives us the length of the external cavity &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; which is an important parameter for the determination of the central frequency of our ECDL. &lt;br /&gt;
&lt;br /&gt;
In the experiment the grating is mounted in a support with screws that allow us to move and rotate the grating [[Media:gmount.png|Mount]], with which we control &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt;. As we notice in Figure 1b, if the alignment is correct the 0 and -1 orders should overlap, this gives us a rough certainty that our alignment is correct. A more precise way we used to verify that our grating feedback was correct is using the fact that the threshold current of our diode should decrease when in an external cavity. This is due to the fact that the feedback of the +1 order into the diode, makes it need less current to start lasing . Since this is very sensible to the angle of incidence, we can use small rotations of the grating to test the feedback. If we are below the threshold current of the free running diode,  the laser will start lasing only when the alignment is correct. For example, our free running diode´s threshold current was 36 m&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, so we decreased the injection current to 33m&amp;lt;math&amp;gt; A&amp;lt;/math&amp;gt; and did small touches on one of the grating screws to test the feedback. Since the laser light started blinking we could be sure that we achieved the grating feedback or Littrow configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Laser Frequency Stabilization===&lt;br /&gt;
====Doppler Broadening====&lt;br /&gt;
[[File:sas.png|thumb|300px|Figure 2. Probe signal at the photodiode. Top: without the pump beam, we see a big bandwidth &amp;lt;math&amp;gt;\Delta \omega_D&amp;lt;/math&amp;gt; (in the order of GHz) due to the Doppler effect. Bottom: with the pump beam we get a dip with an smaller bandwidth (in the order of the natural bandwidth, tens of MHz)&amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 158&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
We use the fact that in an atomic cloud at room temperature, atoms are moving with velocity different than 0 following Maxwell distribution. So if our laser is at frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, because of the Doppler effect the actual frequency that interact with the atoms is &amp;lt;math&amp;gt;w&#039;=w_0+\vec{k}.\vec{v}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\vec{v}&amp;lt;/math&amp;gt; is the atomic velocity and &amp;lt;math&amp;gt;\vec{k}&amp;lt;/math&amp;gt; is the wavenumber vector of the beam. Since now the absorption of the laser light depends on the atomic velocities, the Lorentzian absorption spectrum will broaden, and the new bandwidth (called Doppler bandwidth) would be &amp;lt;math&amp;gt;2w_0\sqrt{2 k_B T\ln2/M}&amp;lt;/math&amp;gt; &amp;lt;ref&amp;gt;Atomic Physics, Christopher J. Foot, Oxford University Press, 2005, page 152&amp;lt;/ref&amp;gt;, where &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;  is the temperature and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is the atom mass. Naturally each atomic transition has a broadening that depends on the spontaneous emission rate, the broadening that we are introducing here is a bigger broadening that we should be able to overcome with the following technique (SAS).&lt;br /&gt;
====Saturated Absorption Spectroscopy (SAS)====&lt;br /&gt;
We use 2 counterpropagating beams of light at the same frequency &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, the first beam we will call &amp;quot;pump beam&amp;quot;, and the second one &amp;quot;probe beam&amp;quot;. The pump beam will be much more intense that the probe. Since they are counterpropagating, they will interact with moving atoms at different frequencies: &amp;lt;math&amp;gt;w&#039;=w_0+k.v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;w&#039;&#039;=w_0-k.v&amp;lt;/math&amp;gt;. Having in mind, that these beams are overlapped in a region of the atomic cloud. They will excite the same atoms only when &amp;lt;math&amp;gt;w&#039;=w&#039;&#039;=w_0&amp;lt;/math&amp;gt;, which means that the mentioned atoms with which they interact are at rest. Since the pump beam is more intense, it will saturate the transition, leaving almost no atoms for the probe to interact with. If we measure the transmission profile for the probe beam with a photodiode, we will see the usual Lorentzian distribution but with an additional peak at w0. (Figure 2)&lt;br /&gt;
&lt;br /&gt;
====Frequency Modulation (FM)====&lt;br /&gt;
SAS lets us get a reference signal with a peak at the desired frequency (Figure 2), but it can&#039;t be used as an error signal for the  servo controller. The reason is that the probe signal is symmetrical around &amp;lt;math&amp;gt;w_0&amp;lt;/math&amp;gt;, so it doesn´t carry any information for the servo to distinguish between bigger or smaller frequencies. The solution to this is to use as an error signal the derivative of the probe intensity detection. We can achieve this by modulating the light before a Rubidium cell and then demodulating it again before the servo controller.&lt;br /&gt;
&lt;br /&gt;
First, we use an EOM to do phase modulation on the laser which indirectly modulates its frequency. So we get a carrier frequency with sidebands. We can express our signal after modulation as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(t)=E_0\left(e^{iwt}+Me^{i(w+w_m)t}-Me^{i(w-w_m)t}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;w_m&amp;lt;/math&amp;gt; is our modulation frequency and &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; the modulation amplitude. We have considered any other modulation order, besides the ones written in the last equation, as negligible.&lt;br /&gt;
&lt;br /&gt;
Then, our modulated beam passes through a cell with atoms resonant to our desired wavelength. The absorption of the light depends on its frequency: &amp;lt;math&amp;gt;\alpha=\alpha(w)&amp;lt;/math&amp;gt;. We can express the beam after passing through the cell as &amp;lt;ref&amp;gt;G. Hall et al., Transient Laser Frequency Modulation Spectroscopy, Annu. Rev. Phys. Chem. 2000, 51:243-73&amp;lt;/ref&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_0e^{iwt}\left[e^{-\alpha_0}-Me^{-iw_mt-\alpha_{-1}}+Me^{iw_mt-\alpha_{+1}}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the indices on the absorption function refer to each sideband (-1 and +1) and the central frequency (0).&lt;br /&gt;
&lt;br /&gt;
For computing the beam intensity after the Rb cell, we make the assumption that &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt; is too small so all the &amp;lt;math&amp;gt;M^2&amp;lt;/math&amp;gt; terms are neglected, and also that the modulation frequency is small so the difference between the absorptions of the central frequency and the sidebands is negligible. So our beam transmission will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;e^{-2\alpha_0}|E_0|^2\left[1+M\cos w_m t\left(\alpha_{+1}(w)-\alpha_{-1}(w)\right)\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we demodulate this last signal with a mixer and a Low Pass Filter, we can recover only the term &amp;lt;math&amp;gt;\alpha_{+1}(w)-\alpha_{-1}(w)&amp;lt;/math&amp;gt; which is proportional to the derivate of the absorption function. This is the signal we used as error signal for the servo controller.&lt;br /&gt;
&lt;br /&gt;
We have to be careful with choosing the adequate modulation frequency. It has to be smaller than the probe signal bandwidth, but bigger than the natural bandwidth of the transition. &lt;br /&gt;
==Optical Setup==&lt;br /&gt;
&lt;br /&gt;
Our stabilization setup is divided in 3 parts (Figure 3). At the beginning we have the diode in the external cavity (ECDL) from which we obtain the light at the desired wavelength. As explained before we control the incidence angle &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; and the external cavity length &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; in the Littrow config (Figure 1). With an iteration of changes on &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\theta_i&amp;lt;/math&amp;gt; we were able to obtain the desired central wavelength without losing the grating feedback. Additionally, we had a Current and Temperature Controllers, which are used as additional degrees of freedom for controlling the wavelength of our laser. Current changes the carrier density which changes the refraction index  of the semiconductor material, and also affects the temperature. Changes in temperature, affect the length of the internal cavity which results in a shift of the cavity mode frequency. Current was used for fine tuning of the frequency, whereas temperature for coarse tuning (0.3nm/ºC). &lt;br /&gt;
&lt;br /&gt;
After the ECDL, we use a couple of mirrors for correcting any misalignment coming from the tuning of the ECDL&#039;s frequency. Following them, an Optical Isolator that prevents any reflection back into the diode that could be detrimental for its correct operation. Then a half wave plate (HWP) and polarizing beam splitter (PBS) were used to distribute light into the different parts of our setup. The distribution proportion is controlled by the HWP angle. &lt;br /&gt;
&lt;br /&gt;
In the first part of the setup we have the monitoring side where a Fabry Perot and a Wavemeter allowed us to check the central frequency, bandwidth and stability of our ECDL&#039;s frequency. &lt;br /&gt;
&lt;br /&gt;
Secondly we have the part where we get the error signal from a combination of Saturated Absorption Spectroscopy using a Rb cell and Frequency Modulation. An EOM modulates the incoming light, so we have a carrier frequency with sidebands with &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as modulation frequency. This light is horizontally polarized so will be transmitted through the PBS after the EOM. Goes into the Rb cell as &amp;quot;pump beam&amp;quot; and on the way back becomes the &amp;quot;probe beam&amp;quot;. The QWP and mirror combination is just to change the polarization to vertical so the &amp;quot;probe beam&amp;quot; when passing through the PBS is reflected into the photodiode. The photodiode signal is demodulated with a mixer and the same &amp;lt;math&amp;gt;w_m=20&amp;lt;/math&amp;gt;MHz as Local Oscillator.  This produces a signal proportional to the derivative of the absorption spectrum which we used as error signal and send into a LockBox which then tries to reduce the error to 0, by sending a voltage to the actuator in the ECDL. The actuator in this experiment is a Piezoelectric in the grating mirror, which changes &amp;lt;math&amp;gt;L_{\text{ext}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Thirdly, we have the bench where are all the controllers, Frequency Generator, Scope and PID; one of the goals of the project is to use a Red Pitaya to replace some of these equipment that occupy a lot of space. &lt;br /&gt;
&lt;br /&gt;
In Figure 4  we show the Error Signal obtained with an &amp;quot;Old Lockbox&amp;quot;, from which we controlled amplitude and frequency for the scanning and also the PI parameters of the control PID. The final goal of this project is to replace this analog Lockbox by a minicomputer type FPGA system called Red Pitaya.  &lt;br /&gt;
&lt;br /&gt;
From Figure 4 we can also see 3 slopes, one is the one to which we want to lock, another corresponds to a close transition and the last is the crossover frequency between them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
File:setup.png|thumb|600px|Figure 3. Optical setup for the stabilization of the ECDL frequency.&lt;br /&gt;
File:Es.jpg|thumb|600px|Figure 4. Error signal (orange) and Fabry Perot signal (blue) obtained from the experimental setup with the &amp;quot;Old&amp;quot; Lockbox. Frequency is scanned with a 50 Hz signal and by using a piezoelectric that controls the external cavity length &amp;lt;math&amp;gt;L_{ext}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Red Pitaya: PID control==&lt;br /&gt;
Red Pitaya is a single board mini-computer. It includes a microprocessor, RAM, USB, micro-USB ports, Analog and Digital inputs/outputs. It has inbuilt software for functions as Oscilloscope, Function Generator, PID controller, Network Analyzer.&lt;br /&gt;
[[File:redpitasha.jpg|thumb|right|400px|Figure 5. Red Pitaya]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Main characteristics that we will be using are: &lt;br /&gt;
&lt;br /&gt;
- 2 Analog inputs: -1 to +1 V range, 1M&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
- 2 Analog outputs: 0 to 2 V (to get this range we made a modification in the Red Pitaya circuit &amp;lt;ref&amp;gt;https://ln1985blog.wordpress.com/2016/02/07/red-pitaya-dac-performance/&amp;lt;/ref&amp;gt;), 50&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; impedance, 125MS/s sample rate, 10 bit ADC resolution.&lt;br /&gt;
&lt;br /&gt;
- Bandwidth: DC to 50 MHz&lt;br /&gt;
&lt;br /&gt;
- Power consumption: 5V, 1A max+&lt;br /&gt;
&lt;br /&gt;
- Ethernet connection: 1Gbit/s&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Control system===&lt;br /&gt;
&lt;br /&gt;
[[File:control2.png|thumb|right|300px|Figure 6. Control system]]&lt;br /&gt;
&lt;br /&gt;
In our control system (Figure 6), we have the following parts:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Physical system: our optical setup where the variable we want to control is the External cavity Diode Laser&#039;s (ECDL) wavelength.&lt;br /&gt;
&lt;br /&gt;
* Sensor: in the last section we showed the Saturated Absorption + Frequency Modulation technique to measure the error signal.&lt;br /&gt;
&lt;br /&gt;
* Controller: Red Pitaya&#039;s PID. OPAMP sets were were added before and after the Red Pitaya to amplify its output before the actuator. &lt;br /&gt;
&lt;br /&gt;
* Actuator:  We use a piezoelectric (PSt150/4/5) for which we can achieve some linearity in its relation to the error signal &amp;lt;math&amp;gt;\left(\frac{\Delta L}{\Delta\lambda} \approx \text{constant}\right)&amp;lt;/math&amp;gt;, at least in some voltage range around the desired set point. &lt;br /&gt;
&lt;br /&gt;
The Red Pitaya functions can be controlled from a PC by just putting the Red Pitaya&#039;s MAC address on the web browser&#039;s address bar. For this, the Red Pitaya must be connected via LAN to the same network as the PC.&lt;br /&gt;
&lt;br /&gt;
===OPAMPs: Piezo&#039;s voltage amplification + offset===&lt;br /&gt;
In our lab, we usually do a preview search of the setpoint before applying the lock on to the system. This is important because near the Rb line where we want to lock, there exist two other resonant frequencies at around 1GHz afar. The search is done by sweeping the voltage sent to the piezoelectric and also adding a DC voltage offset to the sweeping range.&lt;br /&gt;
 &lt;br /&gt;
Because of the limited voltage that our Red Pitaya can give, we provide an additional  PCB circuit that extends the voltage capabilities of the Red Pitaya &amp;lt;ref&amp;gt;T. Preuschoff et al., Digital laser frequency and intensity stabilization based on the STEMlab platform (originally Red Pitaya), Review of Scientific Instruments 91, 083001 (2020)&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this additional PCB (Figure 7), we include 2 regulators LT3045 and LT3094 that provide +12 and -12 V respectively to supply two sets of OPAMPs (OPA1602 and OPA1604), and a +10V reference LT1236-10 for a 10k&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; potentiometer.&lt;br /&gt;
&lt;br /&gt;
The 1st set of OPAMPs (Figure 8) are just 2 followers for the error signal coming from the optical setup; one goes to be monitored in a scope and the other goes as input to the Red Pitaya. By using the OPAMPs as voltage followers we have low impedance in the output, so we prevent any voltage loss because of the load impedance.&lt;br /&gt;
&lt;br /&gt;
The second set of OPAMPs (Figure 9) serves to modify the output voltage of the Red Pitaya, so the voltage going into the piezo will be: &amp;lt;math&amp;gt;V_{\text{piezo}}=10V\text{rp}_{\text{out}}-2V_{\text{set}}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;V\text{rp}_{\text{out}}&amp;lt;/math&amp;gt; is the output voltage from the Red Pitaya and &amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt; is the offset voltage from the potentiometer. A buffer is included to produce enough current to drive our piezoelectric. Another output port is included to monitor the piezo voltage in an osciloscope.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:RedPitaya_Lockbox.png|Figure 7. PCB circuit adjusted to fit into a CQT&#039;s 19 inch rack mount. Connections in and out of the PCB are made through SMA connectors. &lt;br /&gt;
File:Set1.PNG|thumb|600px|Figure 8. OPAMPs Set 1. &amp;lt;math&amp;gt;V_{\text{error}}&amp;lt;/math&amp;gt; is the error signal coming from the optical setup. OPAMPs work just as followers. One of the outputs goes into the Red Pitaya (&amp;lt;math&amp;gt;V\text{rp}_{\text{in}}&amp;lt;/math&amp;gt;) and the other can be monitored in an additional scope.&lt;br /&gt;
File:Set2.PNG|thumb|600px|Figure 9. OPAMPs Set 2. The function of the OPAMPs here is to amplify x10 the voltage coming from the Red Pitaya, and then substract the set voltage  (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;)  coming from a 10k potentiometer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Piezo&#039;s bandwith ====&lt;br /&gt;
&lt;br /&gt;
Our Piezoelectric has a Capacitance of &amp;lt;math&amp;gt;C=176&amp;lt;/math&amp;gt;nF and  unloaded resonance frequency of &amp;lt;math&amp;gt;f_0=486 &amp;lt;/math&amp;gt;kHz. We will be driving it directly from the Red Pitaya prior the OPAMPs, wih peak to peak voltage &amp;lt;math&amp;gt;V_{\text{p-p}}=2V&amp;lt;/math&amp;gt; . Additionally we added a buffer before the piezo, which has as function giving enough current to the Piezo (&amp;lt;math&amp;gt;I_{\text{max}}=250&amp;lt;/math&amp;gt;mA). Considering that we will be sweeping the piezo&#039;s voltage with a triangular wave, we can calculate the maximum frequency to which our piezo can respond. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{I_{\text{max}}}{C}=\frac{dV}{dt}=2\text{V}_{\text{p-p}}f_{\text{max}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for our piezo, we have a maximum frequency of &amp;lt;math&amp;gt;f_{\text{max}}=36.511\text{kHz}&amp;lt;/math&amp;gt;. This gives us a cap up to which our piezo would be able to respond as part of the PID controller. In other words, we can refer to our PID controller as a slow one, or one that can manage low frequency disturbances.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Blode plots===&lt;br /&gt;
====OPAMPs====&lt;br /&gt;
[[File:Bodeplotc.png|thumb|left|400px|Figure 10. Gain and phase measurements for the OPAMPs that amplify and offset the voltage for the piezo.]]&lt;br /&gt;
We measured the OPAMPs set N°2 response to different frequencies (Figure 10). For this plot, we suppressed the offset effect.  &lt;br /&gt;
&lt;br /&gt;
As mentioned before since the voltage is amplified x10, which is equivalent to a 20dB gain. We are interested in in the tens of kHz order because as mentioned before the piezo won&#039;t be able to respond to frequencies greater than 36kHz. In this range, the OPAMPs gain and phase are pretty much constant. &lt;br /&gt;
&lt;br /&gt;
====Piezo + ECDL====&lt;br /&gt;
[[File:Bodeplotd.png|thumb|left|400px|Figure 11. Gain and phase measurements for the Piezo + ECDL System gain: &amp;lt;math&amp;gt;\frac{V_{\text{piezo}}}{V_{\text{error}}}&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Making a bode plot for the piezo system is not as easy. A PID control is possible only when the physical variable to be controlled has a LINEAR response to the actuator. In our case we can achieve this only for a small range, where our error signal slope can be approximated to a line. The problem is then that when unlocked, the error signal can drift and we may need a different offset voltage to achieve this linearity. So we have to make this bode plot measurement with extra care not to disturb the piezo with sounds or mechanical vibrations. &lt;br /&gt;
&lt;br /&gt;
The goal of making this bode plot is to determine the PID parameters that we will be using the Control Stage &amp;lt;ref&amp;gt;Electronic Circuits, U. Tietze and Ch. Schenk, Springer, 2nd Edition, page 1106-1107&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
As recommended in our reference, we choose as critical frequency the one when the phase margin (phase to reach -180° delay) is about 60°, or in other words when the critical frequency has -120° phase delay. From Figure 11 , our critical frequency is &amp;lt;math&amp;gt;f_{crit}=1520&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
1. P gain: Depending in the system + control gain at the critical frequency, we determine how much P gain we need. In our bode plots, at the critical frequency &amp;lt;math&amp;gt;f_{\text{crit}}=1520&amp;lt;/math&amp;gt;Hz, we have system gain of around -20dB, and from the OPAMPs we have a +20dB gain. So in total we have the so called unity gain, which in dB units is 0. This means we don&#039;t actually need a P-gain from the PID controller.&lt;br /&gt;
&lt;br /&gt;
2. I gain: Our controller main objective is to deal with the low frequency disturbances, for this the I gain is extremely important. In order to avoid the I controller reducing the phase margin value, is it advised to choose the integral cut-off frequency lower than the critical frequency. Optimally, we can choose &amp;lt;math&amp;gt;f_I=\frac{f_{\text{crit}}}{10}&amp;lt;/math&amp;gt;. So, for us the integra cut-off frequency chosen was 152 Hz.&lt;br /&gt;
&lt;br /&gt;
3. D gain: Since we are not interested in big frequencies, we don&#039;t need a D gain in this controller.&lt;br /&gt;
&lt;br /&gt;
===Final setup===&lt;br /&gt;
[[File:Redpitashafp.png|thumb|350px|Figure12. Complete Red Pitaya + OPAMPs setup. On the left, the front panel with the potentiometer knob, ethernet, USB and BNC connectors. On the right a DIN type C connector.]]&lt;br /&gt;
&lt;br /&gt;
To make the control setup more compact and robust, we made a front panel (Figure 11) for the Red Pitaya + PCB board. In the front panel we have the potentiometer knob, BNC connectors for the error signal, piezo signal and two additional ones to monitor them. At the end of the day, we want this to go into a 19 inch rack panel. That is why on the rear side we put a DIN connector. From the rack panel we can get voltages like: -15, -5, +5 and +15V. Inside our setup the connections are made through SMA-SMA and SMA-BNC cables assemblies. The cables are made of RG-316 which has the benefit of being thinner and more flexible than the usual RG-58. Usual max frequencies for these cables are up to 6GHz, more than enough for our low frequency PID control.&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
====Locking sequence====&lt;br /&gt;
1. We set the scanning parameters in the Red Pitaya software: &lt;br /&gt;
    - Amplitude: will determine the frequency range we cover. We need to have in mind that we will be amplifying it by 10 from the OPAMPs.&lt;br /&gt;
    - Frequency: we usually set this to 50Hz which is the same as the electrical supply.&lt;br /&gt;
&lt;br /&gt;
2. During the scanning we look for the desired setpoint. We do this by coarse tuning using the ECDL&#039;s current controller and  finer tunings by the potentiometer knob (&amp;lt;math&amp;gt;V_{\text{set}}&amp;lt;/math&amp;gt;). With the help of a wavemeter we can make sure we are in the correct resonant frequency. Our desired setpoint &amp;lt;math&amp;gt;f\lambda=780.246&amp;lt;/math&amp;gt; has a distinguishable shape from the neighboring resonant frequencies (Figure ?????).&lt;br /&gt;
&lt;br /&gt;
3. We set the PID parameters. &lt;br /&gt;
&lt;br /&gt;
4. With the Red Pitaya software we can select a time trigger from which onwards the PID will start its function. We do this to avoid locking into the neighboring resonant frequencies that we mentioned before.&lt;br /&gt;
&lt;br /&gt;
5. Press the Trigger Lock button. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;traditional&amp;quot; widths=350px heights=170px &amp;gt;&lt;br /&gt;
File:Capture0.PNG|300px|Figure 13. We show half period of the frequency scanning. From 4 to 5 ms we have the slope to which we want to lock the frequency. Channel 1: Error signal. Channel 2: Vrp_out (voltage output from the Red Pitaya).&lt;br /&gt;
File:Capture2.PNG|thumb|300px|Figure 14. Exact moment at which the lock button is pressed. The PID takes control of the system and &amp;quot;pushes&amp;quot; the error signal to 0 by modulating the piezo voltage.&lt;br /&gt;
File:Capture3.PNG|thumb|300px|Figure 15. Locked mode. We show the error signal&#039;s  mean and standard deviation values&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Locked vs Unlocked====&lt;br /&gt;
[[File:Stability.png|thumb|400px|Figure 16. Locked and unlocked error signals behavior during 5 minutes]]&lt;br /&gt;
&lt;br /&gt;
We measured for 5 minutes the error signals for both locked and unlocked modes. The &amp;quot;locked&amp;quot; version of the setup stays pretty much at the same value for the error signal (setpoint value: 100mV) during the measurement time. The &amp;quot;unlocked &amp;quot; version of the setup drifts away from the setpoint in a matter of seconds. For comparison, in Figure 16 we use the same voltage scale as in Figure 13-15.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&lt;br /&gt;
- Victor Avalos&lt;br /&gt;
&lt;br /&gt;
- Joel Auccapuclla&lt;/div&gt;</summary>
		<author><name>Victor Avalos</name></author>
	</entry>
</feed>