FMCG/Data Acquisition with LabVIEW Software
This part of the guide will cover the actual data acquisition with the LabVIEW software. It will assume the user has N operational magnetometers which have been field-nulled and optimized. The first part will explain how to use the program to acquire data in DC-SERF mode, the second part in Z-mode.
DC-SERF mode
In DC-SERF mode, the magnetometers are sensitive to magnetic fields in the Y direction. The program is set up to calibrate the magnetometers' response using the shell-mounted Y coils, and then collect data.
Data Acquisition
- From the FPGA Magnetometer.lvproj project, under Main Programs, open the Magnetometer_16.1_chirp-calibration.vi program. The front panel can be somewhat intimidating, but a lot of it is not used. We'll hit on the parts that are necessary to take a measurement.
- In the top left, under Y Channel Settings are controls for the calibration. Depress the yellow Select? button under the channels that you wish to measure. The other three inputs will tell the program how large of a chirp signal should be sent to the magnetic field coils, as well as calculate the size of the field in magnetic field units for calibration purposes.
- The Amp. (V) determines the amplitude of the chirp. This voltage will be output from the FPGA to the current supplies. This voltage must be at least .02 V for noise reasons. To keep electronic noise down, large SR570 I-V gain is generally used so using too large of a calibration signal will cause the magnetometer to rail during calibration. Generally I keep this at .02 V.
- The R(out) value should match the chosen output resistor on the Y shell coils, most likely 5000 Ω.
- The Field Coils input simply points the LabVIEW program to a particular coil calibration number which calculates how large of a calibration field (in T) is being applied. This should almost always be left on Printed Y - Coil, which tells the program that a coil calibration of 4.3 x 10-5 T/A should be used.
- The only other settings that may need to be adjusted (though the default values are normally fine) are those under Run/Calib Settings.
- Regardless of the number of channels you are using, always leave Max Chans at 4.
- Sample Rate (Hz) will set the FPGA acquisition rate. Sampling faster and then later downsampling (see below) can give better averaging and lower noise, but generally this type of noise is not what limits a measurement. 100000 Hz is usually sufficient.
- Downsample (Hz) sets the downsampling rate. To save space and take advantage of signal averaging, the signals collected by the FPGA are downsampled by an averaging procedure which takes blocks of N points (where N = fsample/fdownsample) and averages them to a single value. The Nyquist frequency of the downsample rate must still be larger than our bandwidth of interest (DC-100 Hz), thus we've generally set this to 1000 Hz.
- The Run Time (s) will determine how long of a post-calibration time series is made. For noise-measurement purposes, usually a short scan (6-10 s) is used. For a patient measurement, a much longer sample (60-180 s) is more common.
- Chirp Iterations sets the number of calibration chirps sent to each magnetometer during the calibration. The responses to these chirps are averaged when calculating the response. Historically we have used 5 chirps for this purpose.
- I'm not 100% sure what Calib Freq Max does, but I think it should be set equal to the Downsample frquency, or 1000 Hz.
- That's all the setup for now! Click the Run arrow to start the program.
- The first prompt you'll see is one asking whether the heater PID circuit has been disabled. This is a relic of a previous-generation heater circuit, so you can always click Yes here.
- The next couple of prompts will ask the user to calibrate the device. If a calibration run has been completed already that day, the sequence will first ask the user if they'd like to re-calibrate the sensors. However, if it's the first time the program has been run that day, the calibration must be done before proceeding.
- The first prompt will tell you to calibrate the OPAMP_Y. During this stage of the calibration, the calibration chirp will be applied to the coil current supply circuit, and the monitor voltage from that circuit will be read. First, ensure on the main box that the Z-Mode switch is set to OFF and the Chirp switch is set to Y. Now, on the the FPGA breakout box, flip the switches under the green FPGA monitor BNC ports UP. This will connect the FPGA input to the monitor output on the Y current supply. Once this is done, click OK on the LabVIEW prompt and the sequence of 5 (or whatever you selected) chirp signals will be applied sequentially to the current supplies and the circuits' responses will be recorded.
- The next prompt will tell you to calibrate the MAGNETOMETER_Y. The chirp will be applied to the same current supply, except now the FPGA input should be connected to the magnetometer signals from the photodiodes (via the I-V converters). Flip the switches below the green ports DOWN to make that happen. Then click OK on the prompt. You should see the chirp signals appear on the scope. If the chirp signals are too large or a DC field has caused the magnetometer signal to swing such that the output rails during the calibration, it will have to be redone later. For now, just assume that it went fine.
- Lastly, a Noise/Heartbeat Sample prompt will show up. No further switching is necessary (besides maybe adjusting the room or coil fields) before hitting OK. A time series of length Run Time will be collected.
- When the time series has been collected, the progress bar will be completely lit up and the message DONE will flash above it. Collection complete! Don't hit the STOP button yet, though!
Data analysis
Now is the time to look at the data that was collected. The program does a really nice job of analyzing all of it as well.
- First, click on the Calibration tab. This tab will have information about the OPAMP (or circuit) calibration data. The upper-right window shows a fourier spectrum of the circuit's response to the calibration chrip. Because the circuit doesn't filter the signal at all, this should be pretty flat, outside of peaks near 60 Hz and higher harmonics caused by noise during the acquisition. It's also likely that the voltage recorded is close to 80-85% or the applied voltage (ie, applying a .02 V chirp will generally give you a ~.172 monitor voltage output. Never quite figured out why. The upper-right window is the phase response, which should also be pretty flat. The red Y Applied Field sub-tab basically takes the voltage spectrum recorded and converts it to an applied field spectrum using the output resistor and coil calibration values specified in the setup. Clicking the tall blue NEXT button at the far right will allow you to scroll through the various channels of data. The current channel is displayed at the top next to the large red STOP button. Note: this NEXT button becomes disabled if you click the STOP button. So don't hit that until you're done looking at the analyzed data.
- The Response Waveforms tab plots the magnetometer responses to the calibration chirps in the top window, and individually the applied (white) and response (color) in the windows below. This is a good way to ensure the calibrations have sufficient signal to noise and that the I-V outputs did not rail during calibration. Again, use the NEXT button to scroll between channels.
- The Response Fits tab plots the amplitude and phase response of the magnetometer by Fourier-transforming the data from the previous tab. Note that the data in the Y Resp Fit sub-tab is in units of V/fT, as it has taken into account the size of the applied field from the Calibration tab. The raw transformed voltage data can be found in the Y raw resp sub-tab.
- Under the Results tab you'll find the data taken during the Noise/Heartbeat Sample part of the procedure. The top window is the calibrated noise data (in units of fT/rHz), and the bottom window is the raw data collected (in units of V). The cursors in the top window are helpful for determining baseline noise levels. A particularly useful sub-tab is All Y or X which will display all four channels' worth of PSDs on the same plot for comparison.
- The Processing tab takes the time series from the Results tab and calibrates it using the response.
- The misc. and changelog tabs are not used on a day-to-day basis.
Taking more data
To acquire more data simply click STOP, and decide what you'd like to do.
- If there was an error during any of the calibration steps, simply click the Run arrow again. You'll start over from the beginning, except you'll be given prompts asking if you'd like to recalibrate either the circuit or magnetometer. The circuit only needs to be recalibrated if the chirp amplitude or output resistor is changed. The magnetometer should be recalibrated after any changes to the temperature, bias fields, or laser intensities/detunings. On the next run, the Run value at the top left will increment by 1, and the Noise value will reset to 00.
- If you're happy with your calibrations and would just like to acquire more data using those calibrations, click the button next to another noise run? at the top. You'll notice that the next time you click the RUN arrow, the Run number will not change, and the Noise number will increment by 1. When the RUN arrow is clicked, all of the calibration steps are skipped and the program jumps right to the Noise/Heartbeat Measurement prompt. Beyond simply taking more "Magnetic Noise" data, there are a couple of things you can do.
- Turning off the pump beam (almost completely) disables the device's sensitivity to magnetic fields. The noise collected during a measurement with the pump beam off is indicative of the technical noise (or probe noise, since much of thise noise is due to polarization or intensity fluctuations in the probe beam) in the system.
- Turning off the probe beam leaves only noise produced in the electronics of the system. Generally a battery of 3 runs Magnetic Noise, Probe Noise, and Electronic Noise is taken to compare the levels of each.
Z-mode
The setup and data acquisition for Z-mode is a little more involved, though not terribly so. Generally I do all of my field nulling and optimization in DC-SERF mode. Only small adjustments are then required to get Z-mode up and running. The process is aided by a "test" LabVIEW VI which allows one to play with the Z-mode parameters to optimize. All of the following will assume the magnetometer(s) are properly nulled and the laser powers and detunings are optimized.
Z-mode Setup
- Since Z-mode will involve applying a 1 kHz modulation to the atoms, and then using the LabVIEW code to demodulate that signal, it's necessary that there not be any low pass filters below 1 kHz between the photodiodes and the input to the ADC on the FPGA. It's likely that a ~300 Hz low pass filter was applied to data being taken in DC-SERF mode. Make sure to either move this filter up in frequency (10 kHz recommended for a 1 kHz modulation frequency) or disable it completely.
- Because the Z-mode modulation is quite large, it is necessary to reduce the output resistors on the shell coils. Using the 500 Ω resistors is sufficient for 1 kHz modulation, 2 kHz and above will likely require using the 100 Ω resistors. Remember that to maintain the correct field coupling, all channels should be adjusted to use the same Z output resistors.
- In order to allow the modulation to be sent to the current supplies, the Z-mode switch on the front of the main control box must be switched to ON.
- In the FPGA Magnetometer project, in the Main Programs folder, locate the XY Modulation+Z-mode v1.5 (Host).vi program. This program will help you set up and optimize Z-mode detection.
- First, make sure all of the buttons under Chan Settings are disabled, and click the LabVIEW Run arrow.
- Now, decide on a Z-mode frequency. Commonly used values are 1 kHz and 2 kHz. Enter your choice under Channel 1 in the Z-mode Settings box. As the text at the top of the front panel notes, when operating in Z-mode, all four channels' z-modulation fields will be output with the frequency of Channel 1 - the other three frequency boxes (which are by default set to 0) are useless. For now, leave the Amplitude (V) sliders where they are. They can be varied later.
- Once you've decided on a frequency, in the Chan Settings box, click the buttons in the z-mode? column corresponding to the channels you wish to measure. You should notice the modulation "fuzz" appear on the scope when you do so. If not, make sure all of your connections are right, the Z-Mode switch on the main box is set to ON, and there are no excessive low-pass filters on the SRS I-V converters.
- Use the room coils to apply a low-frequency (~ 20 Hz) signal in the X direction. You should now see the fuzz being modulated at that frequency. To optimize it may help to set up another function generator to output a sine wave at the modulation frequency and use the SYNC output to trigger the scope. Zoom in so there are a few cycles of the 1 kHz frequency visible on the scope. If done correctly, you should see a row of 20 Hz-modulated "bulbs" when looking at the magnetometer output.
- The program can be set up to output the demodulated signal so that signal can be optimized. To do so, locate the row of four switches on the FPGA breakout box near the red ANALOG OUT BNC ports. Flip the switch(es) up for the channel(s) you are optimizing. This will connect the FPGA AO channels 0-3 (normally outputting the chirp) to the top row of red BNC ports. Connect these outputs to a second scope triggered by the source of the 20 Hz modulation (likely the BK precision generator). In the LabVIEW program, make sure that AO Type is set to X Magnitude and then in the Chan Settings box, click the buttons in the chans? column to send the demodulated X Magnitude signal to the second scope.
- The optimization and field-nulling processes are a little different than the DC-SERF mode process, but if you're optimized for SERF operation, you'll be pretty close to the required settings for z-mode. Essentially, you goal is to have the modulation "bulbs" all be roughly the same size and in a nice straight line with a DC value near zero.
- First, optimize the z-modulation amplitude by dragging the Amplitude (V) bar up and down until the size of the demodulated signal on the second scope becomes largest. The reference phase can be optimized likewise. If you're optimizing multiple channels simultaneously, you'll probably find that you'll have to iterate between channels with the field amplitudes - the decoupling matrix only works with the applied DC nulling fields, so the Z-mode fields from one channel will affect the size of the modulation field the others.
- To set the nulling fields: Adjusting the X field will move the "bulbs" up and down relative to their neighbors. Adjusting the Y field will move the entire signal up and down (as the magnetometer signal is still sensitive to Y fields at DC).
- Once you are satisfied with the performance of each channel, note all of the modulation amplitudes and demodulation phases. The amplitudes can be copied directly into the main magnetometer program under the Modulation Settings box. Note again, the modulation frequency applied to all channels is the one in the top (channel 1) box, all others are irrelevant. Unfortunately, the size of the FPGA memory does not allow for independent demodulation phases in the main program, but generally they are all pretty close, so pick an "average" of the values and put it in the reference phase box below the Modulation Settings box.
- Click the STOP button in the XY Modulation+Z-mode v1.5.vi program. You can leave the program open. If you were using the analog outputs from the FPGA box to output the demodulated X signal to the scope, make sure to flip the corresponding Analog Output switches DOWN to reconnect the analog outputs (which will be sending chirp signals now) to the current supplies).
Data Acquisition
- You're now ready to take data in Z-mode. To enable z-mode, you need to select the appropriate channels in the X Channel Settings box on the far left. This will tell the program that both x and y directions must be calibrated before taking a noise measurement. The Field Coils should be set to Printed X - Coil and the R(out) will likely be 5000 Ω. By default, the chirp size is 0.05 V. The larger chirp size is to compensate for the fact that the printed X coils have more than a factor of two smaller current-to-field calibration, as well as the fact that in Z-mode, the response to X fields is often smaller than the response to Y fields.
- Now you're ready to go! Click the Run button to start the program.
- Again, the first prompt will be one regarding the heaters. Click Yes.
- You'll first be asked if you want to calibrate the OPAMP_Y. Click Yes. Again, make sure the Chirp selector on the main box is flipped to Y and the Mag/Mon switch on the FPGA breakout box is flipped UP. Click OK and the program will apply the chirp signals to the circuits and monitor their responses.
- Next, the program will prompt you to calibrate the OPAMP_X. Click Yes. Flip the Chirp selector to X. Click OK and the program will apply the chirp signals to the circuits and monitor their responses.
- Now you'll have to calibrate the magnetometers' responses to the applied Y and X fields. Flip the Mag/Mon switch down, and follow the prompts, making sure to flip the Chirp switch to the appropriate position when calibrating each direction.
- Finally, you'll be asked to make a noise or heartbeat measurement. Click OK and the program will run to completion.
Data Analysis and Taking More Data
The program will now analyze the calibration and noise data, but give you twice as many results as DC-SERF mode! On all of the tabs mentioned above, there are sub-tabs that contain the information about X data that were empty when collecting in DC-SERF mode. You can browse through all tabs (and all channels if you haven't hit STOP yet!) at your leisure. The Results tab contains one particularly helpful plot Compare Y to X which plots the X and Y noise for a particular channel on the same plot for comparison.
Taking more data is the same as in DC-SERF mode. Just select the another noise run? button, and you're good to go. We have noticed recently that the program often does not behave well when looking at small signals generally associated with "probe" and "electronic" noise runs. We think that has to do with the filtering and are currently investigating.