
%% Original Author: Eduardo Martinez Pedroza.
%% Updates and Modifications by: Gustavo Britto Hupsel de Azevedo APR/2020.

%% Note from the author:  My dissertation document was created with this file. It passed the general formatting guidelines for PhD dissertations of the Graduate College at the University of Oklahoma. I accept no responsibility in connection with the use of this file. Use it under your own risk.

\documentclass[12pt]{report}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Standard AMS packages
\usepackage{amssymb, amsmath, amsthm}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  For mathematical diagrams
\usepackage{xypic}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% For inserting graphic files
\usepackage{graphicx} %

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Hyper-references
%\usepackage[pdftex, plainpages=false]{hyperref}   %To be use with PDF-TEX

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Graduate college required margins
\usepackage[left=1in, top=1in, right=1in, bottom=1in]{geometry}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% line spacing
\usepackage{setspace}
\doublespacing

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Gus' aux libs    
\usepackage{float}
\usepackage[hidelinks]{hyperref}
\usepackage{comment}
\usepackage[capitalise]{cleveref} 
\usepackage{siunitx}
\usepackage[bottom]{footmisc}
\usepackage[table]{xcolor}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Personal Environments and Commands
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{example}{Example}
\numberwithin{equation}{chapter}
\numberwithin{figure}{chapter}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% My commands
\newcommand{\reals}{\mathbb{R}}   %Real numbers' symbol
\newcommand{\hyperbolic}{\mathbb{H}}  %Hyperbolic symbol
\newcommand{\complex}{\mathbb{C}} %Complex numbers' symbol
\newcommand{\integers}{\mathbb{Z}}   %Integer numbers' symbol
\newcommand{\presentation}[2]{\langle \, #1  \, | \, #2 \,  \rangle}
\newcommand{\GammaH}{Cayley (G, X\cup \widetilde{\mathcal{H}}) }
\newcommand{\Hs}{\{ H_i \}_{i=1}^m}
\newcommand{\sys}{LACAS v2.5}
\newcommand{\kfr}{K30-FR}
\newcommand{\skfr}{Senseair K30-FR}
\newcommand{\ndir}{NDIR CO\textsubscript{2}}
\newcommand{\co}{CO\textsubscript{2}}
\newcommand{\licor}{LI-840A gas analyzer}
\newcommand{\ardu}{Ardupilot}%\texttrademark}
\newcommand{\pix}{Pixhawk}%\texttrademark}
\newcommand{\ic}{I\textsuperscript{2}C}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% THESIS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\title{Spatially-Temporally Resolved Sampling System for Carbon Dioxide Concentration in the Atmospheric Boundary Layer: A Low-cost UAS Approach}
\author{Gustavo Britto Hupsel de Azevedo}
\date{April 2020}

\pagenumbering{roman}
{%% PAGE NUMBERING ROMAN

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% TITLE PAGE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{\singlespacing

\newpage
\thispagestyle{empty}
\begin{center}
{ %\large
UNIVERSITY OF OKLAHOMA
\par
\vspace{0.16in}
GRADUATE COLLEGE
\par
\vspace{1.2in}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
SPATIALLY-TEMPORALLY RESOLVED SAMPLING SYSTEM FOR 
\par
\vspace{0.17in}
CARBON DIOXIDE CONCENTRATION IN THE ATMOSPHERIC 
\par
\vspace{0.17in}
BOUNDARY LAYER: A LOW-COST UAS APPROACH
\par
\vspace{1.2in}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A THESIS
\par
\vspace{0.17in}
SUBMITTED TO THE GRADUATE FACULTY
\par
\vspace{0.17in}
in partial fulfillment of the requirements for the
\par
\vspace{0.17in}
Degree of
\par
\vspace{0.17in}
MASTER OF SCIENCE %IN ELECTRICAL AND COMPUTER ENGINEERING
\par
\vfill
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
By
\par
\vspace{0.17in}
GUSTAVO BRITTO HUPSEL DE AZEVEDO
\par
%\vspace{0.05in}
Norman, Oklahoma
\par
%\vspace{0.05in}
2020
}
\end{center}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% SIGNATURE PAGE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\thispagestyle{empty}
\begin{center}
{%\large
SPATIALLY-TEMPORALLY RESOLVED SAMPLING SYSTEM FOR 
\par
\vspace{0.17in}
CARBON DIOXIDE CONCENTRATION IN THE ATMOSPHERIC 
\par
\vspace{0.17in}
BOUNDARY LAYER: A LOW-COST UAS APPROACH
\par
\vspace{0.9in}
A THESIS APPROVED FOR THE
\par
SCHOOL OF ELECTRICAL AND COMPUTER ENGINEERING
\par
\vspace{0.9in}
BY THE COMMITTEE CONSISTING OF
\par
\vfill
\begin{flushright}
\begin{tabular}{cr}
\  \  \  \  \  \  \  & Dr. Phillip B. Chilson, Chair\\
\\ &  \\
& Dr. Robert D. Palmer \\
\\ &  \\
& Dr. Tian-You Yu \\
\end{tabular}
\end{flushright}
}
\end{center}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% COPYRIGHT PAGE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\thispagestyle{empty}
\   \
\par
\vfill
\begin{center}
\copyright \    Copyright by GUSTAVO BRITTO HUPSEL DE AZEVEDO 2020

All Rights Reserved.
\end{center}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% DEDICATION PAGE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\thispagestyle{empty}
{\singlespacing
\begin{center}
{
\par
\vspace{1.2in}
%\large
DEDICATION
\par
\vspace{0.17in}
to
\par
\vspace{1.2in}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
My wife
\par
\vspace{0.17in}
Renata
\par
\vspace{0.17in}
For
\par
\vspace{0.17in}
Encouraging me to pursue my passion
\par
\vspace{0.17in}
for engineering.
\par
\vspace{1.2in}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
My parents
\par
\vspace{0.17in}
Yara and Carlos
\par
\vspace{0.17in}
For
\par
\vspace{0.17in}
Fostering curiosity
\par
\vspace{1.2in}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
My siblings
\par
\vspace{0.17in}
Livia, Marta, Julia and Bernardo
\par
\vspace{0.17in}
For
\par
\vspace{0.17in}
Inspiring me to better
\par
\vspace{1.2in}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vfill
}
\end{center}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ACKNOWLEDGEMENTS PAGE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter*{Acknowledgements}

First, I wish to express my gratitude to my advisor Dr. Phillip B. Chilson, for believing in me and allowing me to advance my knowledge beyond the boundaries of engineering. 

I also wish to thank Dr. Chris Fiebrich and Dr. David Grimsley from the Oklahoma Mesonet for providing access to the calibration laboratory and furthering my knowledge of measurements and instrumentation. 

I also wish to express my gratitude to all the staff of the Advanced Radar Research Center, where a significant portion of this thesis was developed. 

Many thanks to my research and graduate school peers, Tyler Bell, Brian Green, and Tony Segal\'es, for helping me throughout the entire master's program. 

I would be remiss if I did not thank my peers at the Center for Autonomous Sensing and Sampling (CASS), in particular, William Doyle who built several tools used during the development of this project; Chris Hughes and Brandon Albert, for collecting data with me at 5 am, on Sundays.
I would also like to thank Dr. Martin, Dr. Pillar-Little, Dr. Frazier, and Dr. Kunwar for the opportunity to be co-author in a book chapter based on data collected with the Lower Atmosphere Carbon Dioxide Acquisition System. 

Finally, I wish to thank my friends and family. In particular, David Schvartzman for mentoring me through the master's program. The South American community and Providence Road for making Renata and me feel at home away from home, and my wife, Renata, for being my home wherever I am.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% TABLE OF CONTENTS PAGE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

{\singlespacing
\tableofcontents
\listoffigures
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ABSTRACT PAGE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}

Given the consensus around the importance of atmospheric carbon dioxide (\co) to human life on earth, its monitoring has grown significantly in the past 60 years. However, there is still a knowledge gap regarding the intricacies of the relationship between atmospheric \co, the biosphere, and the weather patterns. Such a knowledge gap can be explained by limitations in technology, the physical challenges of measuring atmospheric \co, and the natural complexity of the atmosphere-biosphere interactions. Another component in this explanation is the different scales of the impacts of \co, ranging from global greenhouse effects to stomatal closure on plants.

The limitations of current atmospheric \co\ monitoring technologies motivated this thesis, which details the initial development process of a complementary Unmanned Aerial System (UAS) based sampling tool proposed in hopes of better understanding the behavior of \co\ in the atmospheric boundary layer. This new tool is expected to be suitable for remote instrument augmentation, initial exploratory studies, and measurements in under-surveyed areas.

This thesis proposes a UAS autopilot integration for a fast response non-dispersive infrared (NDIR) \co\ sensor (Sensair K30-FR). Such integration provides a single source of timestamp and position for any data point acquired, ensuring data comparability across platforms. It also allows for deployment across  rotary- and fixed-wing UAS, generating spatially and temporally resolved \co\ sampling. Accompanied by a customized sensor housing and a post-processing desktop application, the proposed UAS autopilot integration can make a standard UAS into a system capable of autonomously collecting atmospheric \co\ concentrations, and automatically generating a graphical presentation of the collected data for analysis by the end user. This thesis presents an overview of the challenges faced, solutions adopted, field deployment practiced, and results achieved.

\newpage
} %% END PAGE NUMBERING ROMAN


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\pagenumbering{arabic}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% INTRODUCTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Introduction}\label{chap:intro}
Carbon dioxide (CO\textsubscript{2}) levels in the atmosphere have greatly increased in the past centuries and continue to rise according to the Global Monitoring Division of NOAA/Earth System Research Laboratory \cite{NOAA}. Due to carbon dioxide's greenhouse effects, there has been considerable interest in monitoring its concentration in the Earth's atmosphere. Ground-based and space-based observations have grown over the past decades; however, weather conditions can hinder both methods of CO\textsubscript{2} concentration retrieval. Also, global measurement networks are not able to generate detailed information about how local conditions of the atmospheric boundary layer (ABL) cycle affects the local CO\textsubscript{2} cycle. Given the successful deployment of unmanned aircraft systems (UAS) to measure and characterize the thermodynamic structures of the ABL \cite{22, 23}, the utilization of these platforms for CO\textsubscript{2} measurements may prove to be a valuable source of complementary data to the current measurement systems.
	
\section{Motivation}\label{sec:motivation}

Even though there has been scientific consensus for the past 60 years regarding the importance of atmospheric \co\ to human life on Earth, there is not a complete understanding of its consequences regarding weather patterns, agriculture, ocean levels, and many other topics in geosciences \cite{1,2,3,6,7}. One example of such is the relationship between anthropogenic \co\ emissions and the mean global temperature. A recent study demonstrates how the effects of anthropogenic emissions can go beyond the increase in mean global temperature \cite{1}. This finding is of particular importance because it demonstrates that the temperature-driven goals of the Paris agreement are not enough to prevent the risks of the increased concentrations of atmospheric \co\ \cite{1}. Through modeling, the authors demonstrate how even within the \SI{1.5}{\celsius} target of the Paris agreement, increased emissions can produce extreme temperature and precipitation events. The authors call for an emission specific goal and increased local monitoring.

A different study shows the impacts of extreme temperature and precipitation events on the global carbon cycle \cite{2}. Analyzing five decades worth of data from satellites and FLUXNET\footnote{``FLUXNET is a global network of micrometeorological tower sites that use eddy covariance methods to measure the exchanges of carbon dioxide, water vapor, and energy between the biosphere and atmosphere.'' Source: https://fluxnet.ornl.gov/}, the authors were able to demonstrate that the natural carbon balance (sources and sinks, without anthropogenic emissions) has remained the same and is capable of absorbing from \SI{25}{\percent} up to \SI{30}{\percent} of all anthropogenic emissions \cite{2}. However, extreme temperature and precipitation events (e.g., droughts, heatwaves, extreme frost, heavy precipitation) that immediately affect the carbon cycle can also have a legacy effect on the local environment \cite{2}. 

One example of an extreme event with a legacy effect is a dry spell. The combination of high temperatures and low humidity can lead to stomatal closure of plants. The closure decreases leaf transpiration and reduces evaporative cooling \cite{2}. This reduction enhances the effects of the dry spell. If there is no stomatal closure, higher vapor pressure gradients between the leaves and the atmosphere cause higher stress on the plant's hydraulic system, possibly leading to plant mortality. Either mechanism has an immediate impact on \co\ flux. However, little is known about their legacy effects. Some extreme cases of plant mortality can reduce soil cover and have lasting impacts on regional hydrology, which can change the regional carbon balance and lead to new cycles of droughts, heatwaves, or soil frost. 

Even though the study was only possible due to the existence of five decades of satellite and tower measurements, Reichstein et al. \cite{2} warn the data was not enough to eliminate the high sensitivity of gross primary producers present in their model, when compared to Earth observations. The authors claim that such biases exist because of the difficulty of obtaining useful data from satellite and FLUXNET. The authors also claim that the state of the art modeling and current observations systems are insufficient to provide definitive answers regarding all effects of extreme events on the carbon cycle. Moreover, the authors call for targeted assessments of regions impacted by climate extremes.

The knowledge gap regarding the intricacies between the atmosphere and the biosphere is such that even events that initially seem positive are being investigated as possible sources of adverse legacy effects. For example, higher concentrations of \co\ in the atmosphere stimulates plant growth, which traps atmospheric \co\ as organic matter. One mechanism that can produce extreme plant growth is a combination of higher concentrations of \co\ in the atmosphere and a warmer than usual winter. However, extreme plant growth can shock the soil by draining nutrients and water too fast. Such shock can produce extreme die-offs. Nevertheless, it is still uncertain if this type of event can release back to the atmosphere more \co\ than originally captured.

The level of uncertainty is such that two other studies indicate contradicting effects for the same atmospheric conditions \cite{4, 5}. Both studies point out possible negative impacts on plant tissue growth due to increasing concentrations of atmospheric \co. The first study recreated the atmospheric conditions of the last 400 million years using tree rings in secular trees \cite{4}. According to the authors, the negative impact occurs via decreased photorespiration. Instead of fixing carbon as organic tissue, \co\ is returned to the atmosphere. The second study furthers this analysis by looking into isotopic discrimination in the photorespiration process \cite{5}. The authors also point out that the \textsuperscript{13}C-Suess effect in the atmosphere is producing changes in the water use of land-based plant life across the globe. With full implications still to be fully understood, the findings in both studies highlight the need for an atmospheric measurement system capable of capturing the land air interaction for temperature, humidity, and \co. 

Another common theme across geoscience's literature is the need for a tool capable of performing measurements in harsh environments. In this type of environment, the knowledge gap stems from the challenges of accessing locations. A few examples of harsh environments are volcanos, eroding unfrozen permafrost coastlines, and thunderstorms. 

Volcanos studies are important because they generate sharp local increases in atmospheric \co\ concentration levels. Another critical aspect of volcano eruptions is their ability to introduce to the atmosphere deep carbon. These are carbon molecules trapped in the Earth for millions of years and are not part of the short-term carbon cycle. Data from Italy's Etna and Stromboli, as well as data from USA's Kilauea and Redoubt volcanos, shows that volcanos can outgas almost twice as much deep carbon into the atmosphere as all global natural outgas sources \cite{3}. Potentially, outgas rates can be used as an eruption forecasting tool \cite{3}. However, with current technology, monitoring volcanos is dangerous and expensive.

Organic carbon stored in the permafrost (which covers approximately \SI{34}{\percent} of the planet's total coastline) is not buried nor transported from the coastal zones. Instead, it may be directly released into the atmosphere as \co\ during thaw and erosion processes \cite{7}. Understanding these processes is of extreme importance, given that most climate models consider the arctic permafrost as a sink in the global carbon budget. Considering that \SI{20}{\percent} of the total permafrost landscape features thermokarst and erosion \cite{7}, a tool capable of performing in-situ measurements in large areas could reduce these model uncertainties.

The challenges presented above highlight the magnitude of the knowledge gap of the behavior and impacts of atmospheric \co. The dimension of these challenges makes it evident that there is not a single tool capable of facing all of them. Therefore, a multitool effort is necessary. On the measurement side of this effort, UAS are a new tool capable of complementing well-established tools such as satellites, towers, and ground-based infrared Fourier transform spectrometers. The remote control characteristic of UAS makes it a bridge tool, capable of linking tower and satellite measurements, amongst others. This characteristic also renders access to harsh environments with reduced or no risk to humans.
	
	Comparatively, UAS can be considered a low-cost tool. This aspect makes it a suitable tool for initial exploratory studies, measurements in under-surveyed areas, or even as an initial reference during the development process of more expensive and accurate instruments. For these reasons, this thesis proposes a UAS-based spatially-temporally resolved sampling system for carbon dioxide concentration in the atmospheric boundary layer, from this point onwards, named the Lower Atmosphere Carbon Dioxide Acquisition System (LACAS). The following section provides an overview of the system.
	
\section{System overview}
	
	LACAS is a UAS-based sampling system for atmospheric \co\ concentrations constituted of three components (\cref{fig:3Components}). The first is a \textbf{UAS sensor package} (detailed in \cref{chap:pkg}) capable of measuring temperature, relative humidity, pressure, and \co\ concentrations. It was designed to enhance sensor accuracy through controlled airflow, counteracting the natural air disturbances created by the aircraft. The second is the \textbf{autopilot sensor integration} (detailed in \cref{chap:c++}), responsible for reading the measurements from the sensors, storing each of them with the aircraft's flight data on the autopilot's internal SD card, and transmitting these values to a ground-station computer via the flight telemetry radio. It was designed to allow the sensor package to be platform agnostic. This modularity allows LACAS to leverage the best aircraft type based on the needs of the mission.\\
	
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.55\textwidth]{../images/3Components}
	
	\caption{Main components of LACAS.}
	\label{fig:3Components}
	\end{center}
\end{figure}

The final component is the \textbf{desktop application}, which is detailed in \cref{chap:java}. Developed in Java standard edition, this program was designed to aid the science team of the Center for Autonomous Sensing and Sampling (CASS). It provides an easy to use graphical user interface (GUI) for initial analysis of the collected data and converts sensor data and flight data into end-user files. It features a laboratory sensor-calibration analysis mode and a field-collected data analysis mode. All plots and analysis presented in this thesis were done using the LACAS desktop application.

The three components of LACAS were developed entirely by the author for this thesis (\cref{chap:pkg,chap:c++,chap:java}). However, it is important to highlight that LACAS was developed as a tool within CASS, and for this reason maintained some of CASS's development standards and UAS technology. \Cref{chap:sens,chap:pixArdu} detail the CASS development environment and serve as a contextualization for the LACAS design choices detailed in \cref{chap:pkg,chap:c++,chap:java}. \cref{chap:application} offers a use-case for the system, and \cref{chap:chamb} details the most recent experiments performed to characterize to system's limitations. Finally, \cref{chap:final} presents comments on the current stages of the system's development and discusses recommendations for future work.

%%%%%%%%%%%%%%%%%%%%%
% Sensors
%%%%%%%%%%%%%%%%%%%%%
\chapter{Sensors}\label{chap:sens}

The sensor selection for all of CASS's platforms was performed before the work on this thesis started. In the spirit of standardization, data comparability, and dataset continuity, the LACAS project adopted CASS's pre-selected sensor suite. They are the PT-100 bead thermistor, the HYT 271 hygrometer, the MS5611 pressure transducer, and the K30-FR \co\ sensor. This chapter offers a brief description of these sensors.

The PT-100 glass bead thermistor (\cref{fig:bead}) is sold by InterMet Systems (iMet) in tandem with the ADS1115 ADC manufactured by Texas Instruments. As can be seen in \cref{tab:pt100}, its form factor is small and uses little power, making it suitable for UAS deployment. The 16-bit ADC allows high-resolution measurements of temperature, with increments of \SI{0.003}{\celsius}. Unfortunately, the thermistor's quality limits the sensor's resolution to \SI{0.01}{\celsius} steps. Measurements can be read on the ADC via \ic, through four different addresses.\\ 

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.6\textwidth]{../images/Bead_Thermistor}
		\caption{PT-100 bead thermistor and ADC as sold by InterMet Systems, AA battery shown for scale.}
	\label{fig:bead}
\end{center}
\end{figure}

\begin{table}[H]
\begin{center}
\begin{tabular}{|c|c|} 
\hline
\rowcolor{lightgray}\multicolumn{2}{|c|}{PT-100} \\ [0.3ex]
\hline
\hline
Measurement range & \SI{-90}{\celsius} to \SI{50}{\celsius} \\ 
\hline
Accuracy & $\pm\SI{0.3}{\celsius}$ \\
\hline
Time response (t\textsubscript{63}) & \SI{1}{\second} at \SI{5}{\meter\per\second} flow \\
\hline
Current consumption & \SI{150}{\micro\ampere} \\
\hline
Dimensions & \SI{30}{\milli\meter} x \SI{15}{\milli\meter} x \SI{3}{\milli\meter} \\
\hline
Cost & US\$135 \\
\hline
\end{tabular}
\caption{PT-100 specifications}\label{tab:pt100}
\end{center}
\end{table}

The hygrometer adopted by CASS is the HYT 271 (\cref{fig:hyt}). It is manufactured by Innovative Sensor Technology (IST), using a capacitive polymer humidity sensor technology. Besides measuring relative humidity, this sensor also measures temperature, at a broader range and more accurately than the PT-100. However, the PT-100 thermistor is still necessary due to its faster time response. The hygrometer's \SI{5}{\second} response highlighted in \cref{tab:hyt} would either reduce LACAS's spatial resolution or reduce the UAS's total flight time. Nonetheless, its temperature measurements can be used to validate the PT-100 measurements. The HYT 271's small and light form factor, its low cost, low power consumption, and mechanical robustness, make it appropriate for repeated UAS field deployments. \Cref{tab:hyt} highlights the technical specifications for the relative humidity and temperature measurements.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.5\textwidth]{../images/HYT271}
	
	\caption{The HYT 271 capacitive hygrometer. Source: www.ist-ag.com}
	\label{fig:hyt}
\end{center}
\end{figure}

\begin{table}[H]
\begin{center}
\begin{tabular}{|c|c|c|} 
\hline
\rowcolor{lightgray} HYT 271 & RH & Temperature \\ [0.3ex] 
\hline
\hline
Measurement range & \SI{0}{\percent} to \SI{100}{\percent}& \SI{-40}{\celsius} to \SI{125}{\celsius} \\ 
\hline
Accuracy & $\pm\SI{1.8}{\percent}$ & $\pm\SI{0.2}{\celsius}$ \\
\hline
Time response (t\textsubscript{63}) & $<\SI{4}{\second}$& $<\SI{5}{\second}$ \\
\hline
Current consumption &\multicolumn{2}{c|}{\SI{850}{\micro\ampere}} \\
\hline
Dimensions & \multicolumn{2}{c|}{\SI{10.2}{\milli\meter} x \SI{5.1}{\milli\meter} x \SI{1.8}{\milli\meter}} \\
\hline
Cost & \multicolumn{2}{c|}{US\$17} \\
\hline
\end{tabular}
\caption{HYT 271 specifications}\label{tab:hyt}
\end{center}
\end{table}

The \skfr\ is a non-dispersive infrared (NDIR) \co\ sensor. It is sold in the USA by Digikey\footnote{https://www.digikey.com}, CO2Meter\footnote{https://www.co2meter.com}, and a few other companies. \Cref{fig:k30} shows the sensor with the metal adaptor for pump-plumbing connection, manufactured and sold by CO2Meter. The sensor has digital (\ic\ and UART) and analog outputs and reports values in parts per million (ppm). The sensor accuracy shown in \cref{tab:k30} indicates that this sensor may not appropriate for atmospheric measurements. However, there are only a few other sensors in the same physical dimension and price range. Previous studies have indicated that the \kfr\ has the best accuracy when compared to other small \co\ sensors \cite{12, 20, 21} and that through a multivariable linear regression, its accuracy can be improved to $\pm$5 ppm \cite{21}. \Cref{chap:pkg} proposes a sensor housing with controlled airflow that further improves the accuracy of this sensor and \cref{chap:chamb} details the impacts of temperature, relative humidity (RH), and pressure on the NDIR sensor.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.4\textwidth]{../images/K30}
		\caption{The \skfr\ as sold by CO2Meter, with the metal adaptor for pump-plumbing connection.}
		\label{fig:k30}
	\end{center}
\end{figure}

\begin{table}[H]
\begin{center}
\begin{tabular}{|c|c|} 
\hline
\rowcolor{lightgray}\multicolumn{2}{|c|}{K30-FR} \\ [0.3ex]
\hline
\hline
Measurement range & 0 ppm to 5000 ppm \\ 
\hline
Accuracy & $\pm30$ ppm \\
\hline
Time response (t\textsubscript{90}) & \SI{2}{\second} at \SI{0.5}{\liter\per\minute} \\
\hline
Current consumption & \SI{600}{\milli\ampere} \\
\hline
Dimensions & \SI{51}{\milli\meter} x \SI{57}{\milli\meter} x \SI{14}{\milli\meter} \\
\hline
Cost & US\$72 \\
\hline
\end{tabular}
\caption{K30 specifications}\label{tab:k30}
\end{center}
\end{table}

The CASS team did not explicitly select the MS5611 pressure sensor. The MS5611 is an internal sensor of the Pixhawk2 cube black autopilot board, used for altitude and aircraft control (more information in \cref{chap:c++}). However, it is detailed here because its measured values are crucial to post-process data from all the other sensors. It is manufactured by TE connectivity and has a resolution of \SI{0.0042}{\kilo\pascal}. \Cref{tab:MS5611} highlights the sensor's specifications.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.4\textwidth]{../images/MS5611}
	
	\caption{Internal pressure sensor of the Pixhawk2 cube black autopilot board.}
	\label{fig:MS5611}
\end{center}
\end{figure}

\begin{table}[H]
\begin{center}
\begin{tabular}{|c|c|} 
\hline
\rowcolor{lightgray}\multicolumn{2}{|c|}{MS5611} \\ [0.3ex]
\hline
\hline
Measurement range & \SI{1}{\kilo\pascal} to \SI{120}{\kilo\pascal} \\ 
\hline
Accuracy & $\pm\SI{1.5}{\kilo\pascal}$ \\
\hline
Time response (t\textsubscript{90}) & \SI{2.1}{\milli\second} \\
\hline
Current consumption & \SI{1.4}{\milli\ampere} \\
\hline
Dimensions & \SI{5}{\milli\meter} x \SI{3}{\milli\meter} x \SI{1}{\milli\meter} \\
\hline
Cost & US\$7 \\
\hline
\end{tabular}
\caption{MS5611 specifications}\label{tab:MS5611}
\end{center}
\end{table}

%%%%%%%%%%%%%%%%%%%%%
% Flight controller
% 	   and 
%	autopilot
%%%%%%%%%%%%%%%%%%%%%
\chapter{Flight controller: hardware and software}\label{chap:pixArdu}

When the LACAS project started, CASS had been successfully developing weather UAS solutions for about two years. In this time, CASS had moved away from commercial off-the-shelf aircraft to customized aircraft based on commercially available aircraft kits. To support the autonomy of these new aircraft, CASS adopted a commercially available open-source flight controller hardware running an open-source autopilot software. This chapter gives a brief description of both as a preamble to many of the LACAS project decisions.

The \pix\footnote{https://pixhawk.org} is a community-based open-hardware project that created a standard design for flight-control boards. Through a licensing system, companies are allowed to manufacture and market flight-control boards based on this standard hardware-design. This licensing system creates an environment where researchers and developers have a variety of reliable and well-supported products readily available. Another important aspect of the \pix\ project is its compatibility with two major open-source autopilot flight-control software frameworks, the \ardu\footnote{https://ardupilot.org} and the PX4\footnote{https://px4.io}.

The \pix2 Cube Black (\cref{fig:Pixhawk}), manufactured by ProfiCNC and Hex, is based on version 3 of the \pix\ project's flight management unit. The Cube Black is intended primarily for manufacturers of commercial systems. It carries a 32-bit STM32F427 ARM Cortex-M4F core processor with a dedicated floating-point unit. This processor performs 252 MIPS at 168 MHz, supported by 256 KB RAM, 2 MB Flash (fully accessible). The \pix\ also has a 32-bit STM32F103 failsafe co-processor. Besides the flexibility and processing power, the abundant connectivity was amongst the main reasons behind CASS's adoption of the Cube Black. This connectivity allows for more flexibility in the selection of additional peripherals. The Cube Black has five UART ports, two I2C, two CAN, SPI, analog, RSSI, and USB. The four cores of the ARM Cortex-M4F, allow the peripherals to be in separate threads from the flight management, making this a safe flight controller for sensor integration.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.45\textwidth]{../images/Pixhawk}
	
	\caption{The \pix2 Cube Black, manufactured by ProfiCNC and Hex.}
	\label{fig:Pixhawk}
\end{center}
\end{figure}

The \ardu\ was created in 2007 by Jordi Munoz and today is maintained by nearly 500 developers across the globe. Its GitHub\footnote{https://github.com/ArduPilot/ardupilot} repository has over 41000 commits. As an autonomous flight-control framework, \ardu\ encompasses a large variety of vehicles, from aircraft to submarines. Developers can build tailored solutions to a specific vehicle by extending the vehicle type or via the parameterization of generic vehicles within the vehicle type. As an open-source project, \ardu\ is available to be downloaded and extended and the GPL3.0 license. The LACAS sensor-integration library, detailed in \cref{chap:c++}, was developed on CASS's repository of \ardu. This new repository was forked from the original \ardu\ repository. Within the forked repository, CASS is able to choose which \ardu\ updates are brought into the CASS repository and which are not. The CASS-\ardu\ repository is shared and maintained by the LACAS and CopterSonde projects (see \cref{chap:pkg}).

Mission Planner\footnote{https://ardupilot.org/planner} is another important open-source tool in the \ardu-\pix\ environment adopted by CASS. This software is a full-featured ground station application for the \ardu\ project. It is used in CASS's field operations workflow to determine the path and actions of the aircraft at each mission waypoint and to monitor the flight-critical parameters of the aircraft in real-time. Mission Planner is also used to transmit data from the ground-station GPS antenna to the aircraft for real-time kinematic (RTK) GPS corrections.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/MP0}
		\caption{Screenshot of the flight programming feature of the Mission Planner software. The top panel shows the mission's waypoints while the bottom panel shows the waypoint action commands.}
		\label{fig:MP0}
	\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/MP1}
		\caption{Screenshot of the flight-critical parameters monitoring feature of the Mission Planner software. The left panel shows the flight-critical parameters while the right panel shows the aircraft's previous positions on the map.}
		\label{fig:MP1}
	\end{center}
\end{figure}


%%%%%%%%%%%%%%%%%%%%%
% UAS sensor package
%%%%%%%%%%%%%%%%%%%%%
\chapter{UAS sensor package}\label{chap:pkg}

The first attempt to deploy the \kfr\ \co\ sensor on a UAS at CASS was made by Santiago Mazuera, a former undergraduate research assistant. In this attempt, the \kfr\ was a ``passenger'' on the aircraft. It was a standalone sensor inside a sealed housing with its microcontroller, clock, and SD card writer (\cref{fig:LACAS0}). The standalone approach is interesting because it makes the sensor-package platform-agnostic, allowing it to be quickly deployed on the aircraft most suited for the measurement conditions (e.g., rotary-wing or fixed-wing). However, this approach increases the aircraft's total weight, limits the access to sensor data, and increases the post-processing workload because it requires manual matching of log files to post-process sensor data based on flight data (e.g., GPS and barometer).

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/LACAS0}
		\caption{3D printed sealed housing for the \kfr\ with its microcontroller, clock, and SD card writer. Photo by: Mazuera and Pillar-Little.}
		\label{fig:LACAS0}
	\end{center}
\end{figure}

In January of 2018, this ``passenger'' system was deployed on-board a fixed-wing aircraft for the Innovative Strategies for Observations in the Arctic Atmospheric Boundary Layer (ISOBAR) field campaign in Hailuoto, Finland \cite{ISOBAR2018}. Unfortunately, nearly all the data collected during this campaign was lost due to an error on the SD card file writer. The limited access to the sensor's data prevented this error from being detected and corrected during the campaign. This chain of events guided the decision to develop the autopilot-level sensor integration solution described in \cref{chap:c++}. With this integration, the external microcontroller, clock, and SD card writer were no longer needed. The removal of these components allowed for the development of a new light-weight UAS sensor package (\cref{fig:LACAS1}) and marked the beginning of the LACAS project.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/LACAS1}
	
	\caption{Striped-down sensor housing for two \kfr\ \co\ sensor in LACAS v1, with direct wiring to the \pix.}
	\label{fig:LACAS1}
\end{center}
\end{figure}

%%%%Version 1%%%%%
\section{Version 1}

	The first version of the UAS sensor package for the LACAS project had two goals, proving the feasibility of the autopilot-level sensor integration and exploring the sensor's behavior in field conditions. In this version, the \kfr\ was deployed using the CO2Meter metal adaptor for pump-plumbing connection (shown in \cref{fig:k30} and \cref{fig:K304} A). The diagram in \cref{fig:LACAS1_3} illustrates how two pumps (\SI{0.5}{\liter\per\minute} each) were used to promote airflow over the two \kfr\ \co\ sensors. The main idea behind this design was to have one parcel of air be sampled twice, once by each \kfr. The two samples would then be averaged to increase the accuracy of the concentration value reported by LACAS v1.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/LACAS1_3}
	\caption{Airflow diagram for LACAS v1. Gray arrows indicate airflow direction. The first pump (left) pushes air from the atmosphere into the first \kfr. The second pump (right) sucks the air out of the second \kfr. The intake for the second \kfr\ is the exhaust of the first \kfr.}
	\label{fig:LACAS1_3}
		\end{center}
\end{figure}

In hopes of having a system that was modular and compatible with CASS's other platforms, the LACAS v1 housing for the \kfr\ was adapted into the front sensor housing of the CopterSonde 2.5 (in development at the time) \cite{23}. The CopterSonde is a rotary-wing UAS for measurements of the thermodynamic and kinematic states of the atmosphere, developed in-house by a team of engineers and meteorologists at CASS. The LACAS adaptation of the front sensor housing of the CopterSonde 2.5 added three bead thermistors and three hygrometers to LACAS v1. The combined 8-sensor package was integrated to the CopterSonde 3, a new experimental platform (\cref{fig:CS3}) designed and built by William Doyle.
 	
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/CS3}
		\includegraphics[width=0.8\textwidth]{../images/CS31}
	\caption{The CopterSonde 3 (top) with the front sensor housing of the CopterSonde 2.5, and an additional intake for the \kfr\ sensors (bottom).}
	\label{fig:CS3}
		\end{center}
\end{figure}

After acceptable workbench results, LACAS v1 was flown 28 times to approximately \SI{300}{\meter} above ground level (AGL) during the summer of 2018. These flights showed that the sensors could be integrated to the autopilot safely without jeopardizing aircraft control. However, the raw \co\ concentrations as a function of height plotted in the two rightmost panels of \cref{fig:LACAS1_4} indicated that improvements were needed to achieve meaningful atmospheric measurements.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/LACAS1_4}
		\caption{Screenshot of LACAS desktop application showing the results of a LACAS v1 test flight. The top plot shows aircraft height over time, the bottom plot shows raw \co\ concentrations over time, and the plots on the right show the raw \co\ concentrations with height. The red square denotes a period of random sensor noise.}
		\label{fig:LACAS1_4}
	\end{center}
\end{figure}

The sensor noise highlighted by the red square on the bottom plot of \cref{fig:LACAS1_4} appeared randomly on the data of several of the 28 test flights and was never reproduced in the laboratory. To further investigate the issue, three experiments were performed in the netted flight-facility of the Advanced Radar Research Center (ARRC). These experiments did not yield a conclusive result. However, it indicated that sunlight could have been overheating the K30-FR sensors. To solve this issue and others, a new version of the UAS sensor package was designed. \Cref{sec:v2} details the design characteristics of this new version. 

%%%%Version 2%%%%%
\section{Version 2}\label{sec:v2}

The 28 test flights for version 1 also revealed an issue with the airflow control. It seemed that connecting the exhaust of the first \kfr\ to the intake of the second was not ensuring that both sensors were sampling the same parcel of air (\cref{fig:LACAS1_3}). Solving this problem was crucial to the success of LACAS because its improved accuracy depended, in part, on the double sampling strategy. To investigate the matter, a couple of \kfr\ sensors were fully disassembled. \Cref{fig:K304} shows the sensor during stages of this process.

The metal adaptor for the pump-plumbing connection designed by CO2Meter (\cref{fig:K304} A) had two flaws that affected the accuracy of LACAS v1. The first flaw is highlighted in the bottom image of \cref{fig:K304} (B), the hole on the metal plate below the black plastic tube adapter is not directly above the intake holes of the \kfr\ (\cref{fig:K304} D). The second design flaw is the lack of sealant between the metal plate (\cref{fig:K304} B) and the paper filter membrane (\cref{fig:K304} C), on top of the \kfr. Together, these two flaws meant that the first pump could push air out of the first \kfr, and the second pump could pull air from the environment instead of pulling from the first \kfr. This leak made it nearly impossible to control the airflow over the two sensors. To solve this issue, the new proposed UAS housing design for the \kfr\ eliminated the CO2Meter adaptor for pump-plumbing connection.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.7\textwidth]{../images/K30FRCO2MeterLegend}
		\includegraphics[width=0.7\textwidth]{../images/K30FRCO2MeterDetail}
	\caption{Top, images from the step-by-step disassembly of the CO2Meter adaptor for pump-plumbing connection. Bottom, a highlight of steps B and D.}\label{fig:K304}
		\end{center}
\end{figure}

Considering that Senseair designed the \kfr\ as an indoor, ambient sensor for industrial applications, the proposed solution for version 2 was a miniaturized chamber that could emulate this environment for two \kfr\ sensors. The LACAS \co\ mini-chamber is a sealed 3D printed box with airflow controlled by two diaphragm pumps (\SI{1}{\liter\per\minute} each). The diagram in \cref{fig:LACAS2Dia} illustrates how fresh air enters the chamber as the two pumps remove air from it. Because this new design created an isolated environment for the \kfr, an HYT 271 hygrometer was also placed inside the mini-chamber to evaluate if the temperature and humidity of the air parcel were being affected by the plumbing and the mini-chamber itself. \Cref{fig:LACAS2_12} (left) shows the sensor placement inside the mini-chamber. The two \kfr s faced the airflow in between them, and the HYT 271 was placed on the outer wall near the exhaust port (\cref{fig:LACAS2_12}, right).

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.7\textwidth]{../images/LACAS2}
	\caption{Airflow diagram for the LACAS v2 mini-chamber. Gray arrows indicate airflow direction. Air from the atmosphere enters the mini-chamber as both pumps remove air from it.}\label{fig:LACAS2Dia}
		\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.4\textwidth]{../images/LACAS2_1}
		\includegraphics[width=0.4\textwidth]{../images/LACAS2_2}
	\caption{Left, full view of the LACAS \co\ mini-chamber with two \kfr\ sensors before it was sealed. Right, detailed view of internal HYT 271 hygrometer.}\label{fig:LACAS2_12}
		\end{center}
\end{figure}

A workbench comparison was performed to test this new conceptual design. In this test, LACAS v2 measured \co\ concentration levels inside CASS's sensor laboratory side-by-side to a reference instrument. The adopted reference was the \licor, considered the low-cost (under ten thousand dollars) benchmark instrument for \co\ sampling \cite{4, 10, 14, 15}.

\Cref{fig:LicorComp2,fig:LicorComp3,fig:LicorComp4} show the results obtained using the LACAS desktop application (\cref{chap:application}), from a 24-hour test run. In all three figures, the blue and red time series show the raw values from each of the two \kfr s inside the mini-chamber, the green time series represents the \licor\ reference value, and the yellow time series represents the final LACAS v2 value. The LACAS v2 value is the average concentration from both \kfr\ sensors. \Cref{fig:LicorComp2} demonstrates that LACAS v2 was able to track the \licor\ reference values through steady concentration periods and rapid concentration change periods. \Cref{fig:LicorComp3,fig:LicorComp4} quantify how well LACAS v2 was able to track the reference in both cases. For a steady concentration period of nearly seven hours, LACAS reported a root mean square error (RMSE) of $\pm$1.10 ppm to the \licor. For a rapid concentration change period of nearly two hours, LACAS reported an RMSE of $\pm$2.06 ppm to the \licor. This experiment was repeated three more times, two of which were performed with another instance of the LACAS v2 mini chamber (with two other instances of \kfr). All four test runs reported results of RMSEs of $\pm$3.12 ppm or less.\\ 

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.75\textwidth]{../images/LicorComp2}
	\caption{Calibration mode feature of the LACAS desktop application showing \co\ concentration levels over time for the Workbench comparison between the LACAS v2 and the \licor.}\label{fig:LicorComp2}
		\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.75\textwidth]{../images/LicorComp3}
	\caption{Calibration mode feature of the LACAS desktop application showing the calculated RMSE between the LACAS v2 to the \licor\ in a steady concentration period.}\label{fig:LicorComp3}
		\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/LicorComp4}
	\caption{Calibration mode feature of the LACAS desktop application showing the calculated RMSE between the LACAS v2 to the \licor\ in a rapid concentration change period.}\label{fig:LicorComp4}
		\end{center}
\end{figure}

Version 2 of the UAS sensor package also marked the return of CASS's gas sampling to fixed-wing aircraft. This return was made because fixed-wing aircraft are capable of performing long horizontal transects, which are important in atmospheric \co\ studies. However, this return also meant that the CopterSonde 2.5's thermodynamic sensor housing or sensor scoop, for short, could no longer be used. So, a new fixed-wing thermodynamic sensor scoop was developed.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/0ScoopV1}
	\caption{CAD model of the LACAS v2 thermodynamics and gas intake scoop.}\label{fig:v2Scoop}
		\end{center}
\end{figure}

The LACAS v2 scoop (\cref{fig:v2Scoop}) was designed to be outside of the aircraft and conduct air over two HYT 271 sensors while shielding them from sunlight heating. In this version, the gas intake was moved inside the scoop as opposed to the external setting of the previous version. In version 1, the gas intake was adjacent to the thermodynamic sensors scoop entrance (\cref{fig:CS3}); this did not present a problem. However, to ensure comparability between the atmospheric conditions and the ambient conditions inside the LACAS mini-chamber, the gas intake on version 2 was placed inside the scoop, immediately behind the two HYT 271 sensors (\cref{fig:v2ScoopDetail}). The HYT 271 inside the mini-chamber is exposed to parcels of air that passed over the HYT 271s on the scoop first. \Cref{fig:v2ScoopDetail} highlights the position of the gas intake relative to the HYT 271 hygrometers and the diagram in \cref{fig:LACAS2_3} details the airflow over all the sensors of the system.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/0ScoopV1Cut}
	\caption{CAD model of the LACAS v2 scoop. Top, vertical slice of the scoop. Bottom, horizontal slice of the LACAS v2 scoop. Both detail the sensor and intake placements.}\label{fig:v2ScoopDetail}
		\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/LACAS2_3}
	\caption{Airflow diagram of the LACAS UAS sensor package version 2. Air is collected outside the aircraft by the scoop and plumbed inside to the mini-chamber by two diaphragm pumps.}\label{fig:LACAS2_3}
		\end{center}
\end{figure}

All the parts for the LACAS UAS sensor package version 2 were 3D printed and assembled on a foam flying-wing manufactured by Tuffwing (\cref{fig:TWZoomed}). During the assembly and tuning of the aircraft, some radio frequency (RF) interference was noticed on the \kfr. This was quickly solved by wrapping the mini-chamber with an RF blocking adhesive manufactured by 3M. The final assembly of version 2 performed a little over 80 test flights in 11 days over five months. \Cref{chap:application} details this five-month field experiment.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/2TWZoomed600}
	\caption{The final assembly of the LACAS UAS sensor package v2 on a Tuffwing UAVMapper.}\label{fig:TWZoomed}
		\end{center}
\end{figure}

%%%%Version 2.5%%%%%	
\section{Version 2.5}\label{sec:v2.5}

The workbench test results and the field experiment preliminary-results (see \cref{chap:application}) for version 2 indicated that the mini-chamber concept improved the performance of the \kfr. However, the near \SI{200}{\milli\liter} volume of the mini-chamber in version 2 required two pumps (\SI{1}{\liter\per\minute} each) working for approximately \SI{6}{\second} to fully recycle its air content. Given the average \SI{14}{\meter\per\second} ground speed of the aircraft, the 6-second cycle-time hindered the system's spatial resolution. \sys\ maintained version 2's concept, merely improving the mini-chamber design and increasing the number of sensors in the scoop. 

The main reason for the \SI{200}{\milli\liter} chamber size in version 2 was the size of the printed circuit board (PCB) of the \kfr\ sensor. However, the sensor disassembly shown in \cref{fig:K304} revealed that the inlets on the \kfr\ were only located on the top paper membrane. Through a variety of measuring techniques and many hours of computer-aided design (CAD), a new mini-chamber version was developed to fit only the \kfr 's optic chamber. This smaller-fit exposed only the inlets of the \kfr's optic chamber to the airflow.

This new chamber design (\cref{fig:LACAS25CAD}) reduced the mini-chamber's volume from \SI{200}{\milli\liter} to \SI{7.933}{\milli\liter}. This reduced volume, allows the \sys\ to be deployed with a single \SI{1}{\liter\per\minute} pump or even with a single \SI{0.5}{\liter\per\minute} pump. With the larger pump, the airflow rate in the chamber matches the \SI{2}{\hertz} sampling rate of the \kfr. With the smaller pump, the content of the box is fully recycled every second. The smaller pump setting is recommended considering that the sensor has a t\textsubscript{90} response of \SI{2}{\second} at \SI{0.5}{\liter\per\minute} airflow.

Another noteworthy aspect of this new design is the new position for the internal HYT 271 sensor (\cref{fig:LACAS25Print}). The concept behind this new position is to deliver direct airflow to the HYT 271, improving its measurements and turning it into a minor flow barrier, in hopes of promoting small turbulent-mixing inside the mini-chamber. Unfortunately, the COVID-19 outbreak prevented this concept from being tested via computerized flow dynamics (CFD) models on the CASS main processing computer for inclusion in this thesis.

Version 2.5 of the sensor scoop features the addition of the three bead thermistors and another two HYT 271, making the total sensor count in the scoop equal to six. The second version of the scoop already had two HYT 271. In this new scoop (\cref{fig:1ScoopV2}), the gas intake is still behind the sensors. In this 6-sensor configuration both, the LACAS and the CopterSonde projects have equivalent and inter-comparable thermodynamics measurement capabilities.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.4\textwidth]{../images/LACAS25}
		\includegraphics[width=0.4\textwidth]{../images/LACAS251}		
	\caption{The CAD model of the \sys\ \co\ mini-chamber.}\label{fig:LACAS25CAD}
		\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.4\textwidth]{../images/LACAS254}
		\includegraphics[width=0.4\textwidth]{../images/LACAS253}		
	\caption{The 3D printed \sys\ \co\ mini-chamber with the bottom \kfr\ and the HYT 271.}\label{fig:LACAS25Print}
		\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.7\textwidth]{../images/1ScoopV2}
	\caption{The CAD model of the \sys\ scoop. Top, vertical slice of the scoop. Bottom, horizontal slice of the LACAS v2 scoop. Both detail the sensor and intake placements.}\label{fig:1ScoopV2}
		\end{center}
\end{figure}


%%%%%%%%%%%%%%%%%%%%%%%%%%
% Ardupilot C$++$ library
%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Autopilot sensor integration}\label{chap:c++}

When designing or developing a UAS-based atmospheric sampling system, one is presented with many choices (e.g., aircraft type and size, power system type, type of sensors, and sensor placement). Some choices are determined by the nature of the measurement needs and the acceptable range of operational conditions; however, some choices remain undetermined. For example, the level of sensor integration is particularly important as it impacts the system's measurement quality, which may limit the type of phenomenon studied with the system (e.g., using wind direction measurements to improve temperature measurements \cite{23}).

Within the spectrum of sensor integration, the lowest level would be attaching a standalone sensor to an off-the-shelf aircraft, and the highest level would be integrating sensors to the flight controller of a custom-designed aircraft for a specific type of measurement. When making this type of choice, one must take into consideration the available time and budget. Using an open-source commercial flight controller is a compromise solution that leverages the benefits of a flight-controller-level integration, with the modularity and cost-effectiveness of a standalone sensor. As detailed in \cref{chap:pixArdu}, CASS had already adopted the \pix\ Cube Black and the \ardu\ as a standardized solution for the flight control hardware and software. In this thesis, an \ardu-based flight-controller-level sensor integration library was developed using a Composite design-pattern and the programming practices of modularity and portability \cite{25, 24}.

The modularity aspect of the proposed solution is naturally occurring once a Composite design-pattern is combined with \ardu's vehicle-type architecture. The diagram in \cref{fig:ArduPilot} emphasizes this concept by illustrating that all vehicle binaries compiled from the CASS-\ardu\ framework are composed of the vehicle-specific code and the framework shared code. As mentioned in \cref{chap:pixArdu}, the CASS-\ardu\ repository is developed in collaboration with the CopterSonde project. The CASS Common package represents the shared functionalities. 

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/ArduPilotComp}
		\caption{Diagram of the LACAS modularity concept through the Composite design-pattern and \ardu's vehicle-type architecture.}
		\label{fig:ArduPilot}
	\end{center}
\end{figure} 

This modularity makes the LACAS UAS sensor package suitable for fixed- and rotary-wing vehicles, similar to standalone sensor packages. However, it maintains the LACAS's ability to influence the aircraft's behavior (e.g., for measurement-based adaptive sampling). Besides optimizing the development work, having a single library for all vehicles reduces the probability of persistency of code errors (bugs), given that once adjusted in a single location, the correction is automatically applied to all vehicles.

Another noteworthy feature of an \ardu-based flight-controller-level sensor integration is the ability to leverage \ardu's features to enhance the availability of information to scientists during field data collection. Part of the CASS Common package is an extension of \ardu's Mavlink telemetry messaging. This extension developed by Joshua Martin, a research assistant at CASS at the time, allowed the sensors' live-data to be streamed to the ground-station computer using the UAS flight telemetry radio. This functionality was also widely used during the development of the LACAS library as a debugging tool. 

%%%%%%LACAS library
\section{LACAS library}

The first version of the LACAS UAS sensor package was composed of three bead thermistors, three hygrometers, and two \co\ sensors. The thermistor and the hygrometer only communicate via \ic\ protocol. The \kfr\ \co\ sensor communicates via \ic\ or UART. The \pix\ Cube Black offers two \ic\ buses for sensor integration. The first bus is dedicated to flight-critical sensors (e.g., barometer and GPS), and the second bus is available for flight peripherals (e.g., cameras, landing lidars). In the \ardu\ framework, the peripherals bus is executed on a separate thread. This separation creates a safety barrier between peripheral processes and flight-critical processes. All of these factors influenced the joint decision of the LACAS and CopterSonde projects to standardize CASS's sensor integration using the peripherals \ic\ bus.

Unfortunately, early tests revealed a possible impedance incompatibility on the data pin between the Cube Black, the HYT 271, the PT-100, and the \kfr. A brief analysis showed that when all eight sensors of the three types were connected to the same bus, the logic ``0'' did not pass the threshold voltage level, corrupting the messages. Subsequent tests showed that all six HYT 271 and PT-100 sensors could be deployed on the same bus without problems. Given the commercial nature of the \kfr, the documentation on its internal circuitry is not readily available. This lack of information created uncertainty as to the time needed to solve this communication issue. So, a project decision was made to attempt the integration of the \kfr\ via UART.

The \pix\ Cube Black does not officially support non-flight-critical peripherals via UART, because the UART hardware is responsible for reading the remote control inputs to the aircraft (RCIN) and produce the proper actions on the flight control surfaces via the servos connected to RCOUT ports. The UART protocol does not support master-slave style communication. Therefore, each \kfr\ needed a separate RX/TX set of pins. \Cref{fig:UARTConn} shows how the GPS2 and TELEM2 ports on the Cube Black breakout board were used to gain access to the UART hardware.

Using a pseudo Facade design-pattern, the LACAS library implemented an \ic\ communication for the HYT 271 and PT-100 sensors and a UART communication for the \kfr. This design-pattern choice helped to protect and isolate the intricacies of UART communication. This safety feature is necessary given the potential of this code to interfere with the flight control. The LACAS library was written in C$++$ for seamless integration within the \ardu\ framework, which is also written in C$++$. Within the CASS-\ardu\ repository, the library is registered in the compilation build script. This registration ensures the library is compiled and linked in the binary every time a vehicle is compiled. The diagram in \cref{fig:LACASLib} illustrates this integration. The ``Sensor Communication'' block illustrates the abstraction that separates the communication type from the tasks that are common to all sensors. The diagram also illustrates how the library has access to all internal functions of the flight controller. The dashed ``Sensor-based Decision Making'' block symbolizes the possibility of developing smart/adaptive sampling strategies in the future.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/IMG_0340}
		\caption{UART hardware access for the \kfr\ integration via the GP2 and TELEM2 ports of the \pix\ Cube Black's breakout board.}
		\label{fig:UARTConn}
	\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.5\textwidth]{../images/LACASLib}
		\caption{Diagram illustrating the internal structure of the LACAS library.}
		\label{fig:LACASLib}
	\end{center}
\end{figure} 

The ``Sensor Data Insertion'' feature is worth highlighting because it injects the meteorological sensor data into the flight control sensor data-pool. During the regular autopilot internal data logging routine, the meteorological sensor data and the aircraft data are registered together, creating a snapshot of the environment and the aircraft at a point in time and space. This coupling allows sensor data to be post-processed relative to the aircraft data. For example, in some quadcopter aircraft, the rotorwash has the potential to bias the temperature sensors, in particular during the descent. In this case, the flight data can be used to determine if the aircraft is ascending or descending to discard the biased data. Similar pre-processing routines are not uncommon when processing UAS-acquired data. Many times these routines are performed manually. The ``Sensor Data Insertion'' feature allows post-processing software, like the one described in \cref{chap:java}, to perform this routine automatically. 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Java post-processing application
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Desktop application}\label{chap:java}

As explained in \cref{chap:c++}, the sensor data and flight data are logged into the \pix's internal SD card in a binary file format. Even after converting the log to a human-readable file, a single flight file contains tens of thousands of entries. These files also reflect some of the internal design choices of LACAS. For example, out of the four RH values present in the log files, only three are representative of the atmospheric conditions. The fourth RH value comes from the hygrometer placed inside the \co\ mini-chamber and is used to correct the atmospheric \co\ concentration values measured by LACAS. Given that the end users of the data collected by LACAS are the members of the CASS science team, requiring this knowledge-level of the system's design creates an unwanted barrier. To solve this problem, a desktop application was developed to provide access to the data collected by LACAS through an easy to use graphical user interface (GUI).

The application provides access to the data collected with the LACAS UAS sensor package through two workflow modes, the calibration analysis mode and the flight analysis mode. If the user desires to analyze the sensor data and flight data collected by LACAS elsewhere, the application also features a file converter functionality that accepts a binary log file and exports it to JSON or CSV. In the flight analysis mode, the user can view the post-processed values for the physical properties measured by LACAS, relative to the flight pattern, for example, \co\ concentration as a function of height (\cref{fig:FlightMode}). This post-processed view is available for one flight or multiple flights together. The multiple flights view can be used to analyze the temporal evolution of atmospheric properties that vary in space. For example, this feature can be used to analyze how the vertical structure of atmospheric \co\ concentration changes as the atmospheric boundary layer evolves from stable, in the early morning, to well mixed in the afternoon. \Cref{fig:Inversion}, in the next chapter, shows a use case of the multiple flight feature. The flight analysis mode also allows the user to view the raw reported values from each sensor in the system.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/FlightMode}
		\caption{Screenshot of the dashboard of the LACAS desktop application's flight mode. The top panel shows variations in height over time, the bottom panel shows the time series of the raw \co\ measurements, and the rightmost panels show vertical profiles of atmospheric \co\ concentrations.}
		\label{fig:FlightMode}
	\end{center}
\end{figure} 
\newpage
In the calibration analysis mode, the user can load log files from a variety of known calibration instruments and compare them to each sensor in LACAS. For example, the user can compare the \co\ concentrations from each \kfr\ inside the LACAS mini-chamber to the reference concentrations of an \licor\ after a calibration run. This mode also features a root mean square error calculator that allows the user to determine start and end points for the calculation (\cref{fig:LicorComp3,fig:LicorComp4}). A full description of all of the features of the LACAS desktop application does not fit the scope of this document. However, every data plot and analysis in this document was created using the LACAS desktop application. The following section highlights some of the technical aspects of the LACAS desktop application.

%%%Architecture%%%%
\section{Architecture}

The features described above create a significant architectural challenge due to large variability of data sources (e.g., the LACAS UAS sensor package and the calibration instruments), that represent a common set of data types (e.g., temperature and pressure data). This challenge is further enhanced when considering that, in some cases, the same data source can have multiple input file formats. For example, data collected with the LACAS UAS sensor package can be loaded to the system through three different file formats, a \pix\ binary file, a \pix\ JSON file, or a ground station CSV file. In this example, all three of these different file formats will have the same data source and data types. \Cref{fig:Matrix} attempts to illustrate the complexity-level of this architectural challenge, by presenting a few of the possible input-combinations accepted by the LACAS desktop application.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.63\textwidth]{../images/JAVAFiles}
		\caption{System input variability matrix, shows the possible combinations of file type and data source (rows) to data type (columns).}
		\label{fig:Matrix}
	\end{center}
\end{figure}

The LACAS desktop application's architecture was developed based on the Builder, Template-method, Factory-method, and Facade design-patterns \cite{25}, in hopes of providing a suitable solution to the above-mentioned challenge. This proposed architecture also intended to make the application scalable and easy to maintain \cite{24}. Detailing the full architecture of the LACAS desktop application is a task that does not fit the scope of this document. However, the following paragraphs present one implementation example for each of the guiding design patterns. A partial pseudo-class diagram is presented in \cref{fig:ClassDiagram}, to facilitate the understanding of these examples without full knowledge of the architecture.

In this diagram, the abstract class ``Data'' is extended by the concrete classes ``ChamberInstrumentData'' and ``AircraftData''. The ``AircraftData'' class is the logical representation of information loaded from a LACAS UAS sensor package data file. The ``ChamberInstrumentData'' class is the logical representation of any instrument used for calibration in the chamber (e.g., values form the chamber itself, from the reference instrument, or auxiliary probes).

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.73\textwidth]{../images/ClassDiagram}
		\caption{Pseudo-class-diagram for part of the logical structure for the LACAS desktop application. Cream-colored blocks are abstract classes, crimson blocks are concrete classes, and gray blocks are interfaces.}
		\label{fig:ClassDiagram}
	\end{center}
\end{figure}

``Data'' objects are composed of 0 or ``n'' ``DataPoint'' objects. ``DataPoint'' is an abstract class, extended by the concrete classes ``ChamberInstrumentDataPoint'' and ``AircraftDataPoint''. The ``ChamberInstrumentDataPoint'' class is the logical representation of an entry on the chamber instrument log file, and ``AircraftDataPoint'' is an entry on the LACAS UAS sensor package data file. The ``\co DataPoint'', ``PressureDataPoint'', and ``TemperatureDataPoint'' interfaces each have a single getter method definition. The diagram in \cref{fig:ClassDiagram} represents a very small part of the complete architecture and was presented here only as an aid for the following design pattern implementation examples.

%%%%%Design pattern implementation examples
\subsection{Design pattern implementation examples}

When in the calibration analysis mode, the application compares the UAS sensor package measurements (logically branded AircraftData) with the calibration chamber's desired and actual value. In the case of the Temperature/Humidity chamber, the desired and actual values are measured by two distinct instruments. The LACAS application receives these chamber values in two files. Using the Template-method design pattern, the ``ChamberInstrumentFileReader'' class is capable of using a single algorithm to construct a new ``ChamberInstrumentData'' object for each file. This unified solution is achieved because the Template-method design-pattern stipulates that file reading substeps should be deferred to subclasses \cite{25}. In this case, each subclass is responsible for locating the requested value in its file structure.

Following the same example, the construction of the ``ChamberInstrumentData'' object is performed using the Factory-method design pattern. As shown in \cref{fig:ClassDiagram} the ``ChamberInstrumentData'' class is an extension of ``Data'', therefore, the ``DataPoint'' collection in the constructed object is, in fact, a collection of instances of ``ChamberInstrumentDataPoint''. The Factory-method design pattern makes this possible by defining an object construction interface and deferring the object instantiation for the subclass \cite{25}.      

The Builder design pattern was used in the application's architecture to separate the complex structure of ``Data'' objects from its end-user representation \cite{25}. The differences in representation of \co\ concentrations measured with the UAS sensor package between the calibration analysis mode and the flight analysis mode serves as an example of the implementation of this concept. In the calibration analysis mode, the \co\ concentrations measured with the UAS sensor package are presented as a function of time and compared with the \licor's measurements. In the flight analysis mode, the \co\ concentrations measured with the UAS sensor package are presented as a function of height. Both representations are possible because of the separation between the data structure and representation. The ``AircraftData'' object contains the ``DataPoints'' with the UAS sensor package's concentration values, the timestamps, and the flight altitudes, while two external builders are responsible for constructing each specific representation object. This architecture is scalable, and new representations can be added through the addition of new builders.

In the example above, in the case of the calibration analysis mode, the \co\ concentration measurements from the UAS sensor package and the \licor\ share the same end-user representation. To avoid code replication, the Facade design-pattern informed the development of the representation object builders. For example, the ``\co TimeSeriesBuilder'' receives a ``Data'' object composed of many ``DataPoint'' objects. Through the ``\co DataPoint'' interface, the received ``DataPoint'' objects can be typecast, and the concentration values can be retrieved. Because the ``AircraftDataPoint'' and the ``GasAnalyserDataPoint'' classes implement the ``\co DataPoint'' interface, the ``\co TimeSeriesBuilder'' can be used to build representation objects for both cases.

The selection of design patterns for the architecture of the LACAS desktop application was also guided by the patterns' ability to complement each other. For example, the Builder and Facade patterns were used to isolate the internal rules of each logical entity from the end-user representation. The \co\ concentration levels illustrate this concept. The ``\co DataPoint'' interface allows each entity's implementation to apply distinct logical rules to the reported concentration values. In the case of the ``GasAnalyserDataPoint'', the reported value is the direct value read from the file. In the case of the ``AircraftDataPoint'', the reported value is the arithmetic average of the two \kfr\ sensors inside the LACAS mini-chamber. This type of implementation isolates entity logical-rules and allows the application to be safely scaled. For example, if a third \kfr\ sensor is added to the mini-chamber, all features of the application are automatically updated by the refactoring one class instead of multiple points in the application's source code.

\section{Development considerations}
 
The LACAS desktop application was developed in Java standard edition using the java swing and jfreechart\footnote{http://www.jfree.org/jfreechart} libraries. The application also uses a Python script from the \ardu's main repository to perform the binary-level log-file conversion. An important requisite for this application was the ability to process potentially large volumes of data while being executed in standard PCs and laptop computers. For this reason, data-retrieval algorithm-efficiency limited the selection of data structures. All of the selected structures have data-retrieval algorithms with proven $\mathcal{O}(1)$ computational complexity.    


%%%%%%%%%%%%%%%%%%%%%%
% System applications
%%%%%%%%%%%%%%%%%%%%%%
\chapter{System applications}\label{chap:application}

This thesis proposed a UAS-based atmospheric \co\ sampling system as a complementary tool to other well-established instruments (e.g., satellites, towers, and ground-based infrared Fourier transform spectrometers) in hopes of helping bridge the knowledge gap of the behavior and impacts of atmospheric \co. The basis for the proposed system is the UAS's mobility and the UAS sensor package's measurement quality and comparability to these well-established instruments. For example, a UAS-based sampling system can perform vertical profiles next to a meteorological tower and above it, or even perform horizontal transects between two towers. Because the measurements of the tower and the UAS-based sampling system are comparable, the measurements from the UAS-based system above the tower, or between two towers, can be considered an extension of the tower(s).

This concept of using a UAS-based sampling system as a complement to a well-established instrument has been proposed previously, for example, the 3D Mesonet \cite{3DMes}. The 3D Mesonet is a partnership between CASS and Oklahoma Mesonet that proposed a network of UAS augmented towers to further the knowledge of the thermodynamic and kinematic states of the atmosphere in hopes of improving weather forecasting. This thesis can be considered a stepping stone into enhancing the 3D Mesonet concept to also further the knowledge of chemical and air quality states of the atmosphere. This is supported by LACAS's ability to perform the pressure, temperature, humidity, wind speed, and wind direction (only in rotary-wing configuration) measurements proposed in the 3D Mesonet concept and by LACAS's ability to perform \co\ concentration measurements, the first to be developed in a series of desired atmospheric chemistry measurements.

In 2019, LACAS v2 was deployed in a conceptual field experiment at The Kessler Atmospheric and Ecological Field Station (KAEFS\footnote{http://www.ou.edu/kaefs}). KAEFS is a 360-acre research facility located in Purcell, OK, equipped with remote and in-situ instruments. Amongst the instruments installed at KAEFS, the CASS tower (right side of \cref{fig:instruments}), The KAEFS flux-station (left side of \cref{fig:instruments}), and the Washington site of the Oklahoma Mesonet system\footnote{https://www.mesonet.org/index.php/site/about} are of particular interest for this thesis.

The CASS tower is a 10-meter tall fixed structure instrumented with a four-level multiplex pump-system, built by William Doyle, that allows an \licor\ to sample \co\ concentrations at 2, 3, 5, and \SI{10}{\meter}. The KAEFS flux-station is capable of measuring \co\ concentration levels, \co\ fluxes, along with other parameters at the \SI{2}{\meter} level. The Washington site of the Oklahoma Mesonet system, from now on referred to as the Mesonet Tower, is an instrument installation\footnote{https://www.mesonet.org/index.php/site/about/instruments} that measures physical parameters ranging from soil moisture sensors to wind speed and direction at \SI{10}{\meter}. The combination of all sensors on the Mesonet tower provides insight into the local climatology from the ground up to \SI{10}{\meter}.\\  

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.472\textwidth]{../images/IMG_6993}
		\includegraphics[width=0.265\textwidth]{../images/IMG_7020}
	\caption{The left panel shows the KAEFS flux-station, and the right panel shows the CASS tower.}
	\label{fig:instruments}
\end{center}
\end{figure}

Besides housing these instruments, KAEFS also has a renewable certificate of authorization (COA) from the Federal Aviation Administration (FAA), allowing UAS flights up to \SI{1524}{\meter} (or 5000 ft) above the ground. All of these conditions make KAEFS an ideal site for testing LACAS's ability to enhance the measurements of well-established instruments. The following section details how a field experiment was organized and executed.

\section{Conceptual field experiment}

The LACAS conceptual field experiment had two goals. The first was to evaluate LACAS's ability to augment the instruments at KAEFS. The second was to evaluate LACAS's ability to detect seasonal changes in the vertical structure of atmospheric \co\ concentrations. To gather the data for both evaluations, LACAS was deployed in its fixed-wing configuration, integrated to the Tuffwing UAVMapper platform (\cref{fig:tw}). The aircraft was programmed to perform a stepped spiral ascent following the highlighted perimeter in \cref{fig:MapOperation}. The perimeter path was approximately \SI{471}{\meter} and was defined based on the position of the CASS tower, the KAEFS flux station, and Mesonet tower. This flight plan ensured a low-pass of the UAS on all three ground reference instruments, before ascending to \SI{1524}{\meter}.\\ 

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/Tuffwing}
	\caption{The Tuffwing UAVMapper with the LACAS v2 scoop and navigation lights for the flights before sunrise. Photo: Brian Greene.}
	\label{fig:tw}
\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/MapOperation}
	\caption{Top view of the KAEFS site with the CASS tower, KAEFS flux station, and Mesonet tower. The yellow circle shows the perimeter of the stepped spiral ascent over the three instruments.}
	\label{fig:MapOperation}
\end{center}
\end{figure}

The flights for the LACAS conceptual field experiment were performed in 11 days over a five-month period, from May to October 2019. Each flight day started \SI{30}{\minute} before sunrise and went until 11:00 am. These hours were chosen in hopes of capturing the impact of the boundary layer's morning transition on the vertical structure of atmospheric \co\ concentrations. On an average flight day, at least seven flights would be performed at a cadence of approximately \SI{30}{\minute}.

A dataset composed of measurements from the aircraft, the CASS tower, and the Mesonet tower was delivered to the CASS atmospheric chemistry nucleus. This research nucleus is led by Dr. Pillar-Little. Later, this dataset was complemented by the files from the KAEFS flux-station.

\subsection{Results}

Unfortunately, as this document was written, a detailed scientific evaluation of the data from this experiment had not been completed. Meteorology undergraduate research assistants, under the Four Year Research Engagement (FYRE) program, were still analyzing the collected data. From an engineering perspective; however, the campaign can be considered successful. Over 80 autonomous flights were performed without incident and preliminary results suggest that the system was able to capture interesting atmospheric features. \Cref{fig:Inversion,fig:NoInversion} show raw \co\ concentration values for flights on May 30\textsuperscript{th} and June 7\textsuperscript{th}, 2019. As discussed in \cref{chap:chamb}, \co\ concentrations reported by the K30-FR must be corrected for environmental effects. These corrections have not been applied to the raw data presented in \cref{fig:Inversion,fig:NoInversion}. Even without environmental variable corrections, it is possible to observe a significant change in the temporal evolution of the vertical structure of the atmospheric \co\ concentrations in the raw values from the May flights to the June flights.

Other parameters from LACAS can be used to complement the analysis of these preliminary results. As an example, \cref{fig:profiles} provides a comparison of the \co\ concentrations and the temperature values measured by the system for the first flight of May 30\textsuperscript{th}. The left panel shows the 1-meter average of the raw \co\ concentrations and the right panel shows the 1-meter average of the raw temperature values. In this comparison, the raw data can be viewed as a suggestion of the general structure of the vertical profile of these quantities. The temperature inversion (increase of temperature with height) observed between \SI{50}{\meter} and \SI{100}{\meter} is indicative of a stable atmospheric layer, which limits the amount of vertical mixing. Therefore, \co\ was likely trapped near the surface in the early morning.
As the sun rose (sunrise occurred at 12:18 GMT) and began to heat the surface, the temperature inversion should have dissipated, allowing for vertical mixing and reduced concentrations of \co\ near the surface. This effect is observed in \cref{fig:Inversion}. A thorough scientific analysis of all atmospheric conditions for all days is needed to fully evaluate if these preliminary results are confirmed and if they are representative of the seasonal changes or merely consequences of the conditions of the day.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/Inversion}
	\caption{Vertical profile data for May 30\textsuperscript{th}, showing the temporal evolution of the vertical structure of atmospheric \co\ concentrations.}
	\label{fig:Inversion}
\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/NoInversion}
	\caption{Vertical profile data for June 7\textsuperscript{th}, showing the temporal evolution of the vertical structure of atmospheric \co\ concentrations.}
	\label{fig:NoInversion}
\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.31\textwidth]{../images/ProfileC}
		\includegraphics[width=0.319\textwidth]{../images/ProfileT}
	\caption{Vertical profile of atmospheric \co\ concentrations (left panel) and temperature (right panel) on May 30\textsuperscript{th}, 06:41 am (local time).}
	\label{fig:profiles}
\end{center}
\end{figure}

The LACAS conceptual field experiment was also an opportunity to study the impacts of flight conditions on the measurement-strategies and aircraft endurance. During the 11 flight days, over a five-month period, the UAS encountered a large variety of operational conditions (e.g., night flights, windy, drizzle, and intense heat). Of all environmental conditions encountered, high winds had the most impact on system's performance.

Initially, the aircraft was programmed to perform a full lap around the perimeter indicated in \cref{fig:MapOperation} before stepping to the next altitude. This measurement strategy was adopted to maintain the spatial representation of the near-ground lap, for instrument comparison, and to account for the \SI{6}{\second} cycle time of the LACAS v2 mini-chamber (see \cref{sec:v2}). However, in high wind speed conditions, the headwind section of the lap drained the LiPO battery excessively, reducing the aircraft endurance and preventing the aircraft from completing all programmed steps. Another wind-speed related problem is the change in total time needed to complete a lap from one step to the next. When wind speeds change with height and so will the lap time because the aircraft will take more time to penetrate the wind and complete the lap. These changes in lap time can produce a significant difference in the number of samples per step. \Cref{fig:Dist} shows an example of the impact of wind speed change with altitude on the step time.

Considering that horizontal homogeneity of the the measured parameters can be assumed within the \SI{150}{\meter} diameter lap of each step, the stepped spiral ascent is interpreted as a vertical line in the center of the lap circle. With this assumption, the step change no longer needs to be associated with a full lap around the perimeter shown in \cref{fig:MapOperation}. To leverage this new assumption into flight endurance, the aircraft was reprogramed to perform a full lap at \SI{10}{\meter}, for instrument comparison, and then change steps every \SI{30}{\second}. \Cref{fig:Time} shows the uniform step times produced by this new algorithm.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/DistanceAscent}
	\caption{Example of a flight with variable wind speeds. Steps around \SI{470}{\meter} and \SI{600}{\meter} presented higher wind speeds than the remaining steps. The difference in wind speeds from \SI{420}{\meter} to \SI{470}{\meter} produces a difference in the total step time and consequently produces a difference in samples per step.}
	\label{fig:Dist}
\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/TimedAscent}
	\caption{Example of a flight with high wind speeds and improved mission algorithm. In this case, all steps, except the first, have approximately the same duration and number of samples.}
	\label{fig:Time}
\end{center}
\end{figure}
\newpage
The height overshoot in the step transitions is a product of the high wind speeds encountered during the algorithm test. If analyzed closely, the overshoots present differences in magnitude that reflect the wind direction at the time of the step change. Headwind step changes produce higher overshoots than tailwind step changes. The correction of this step height overshoot is not trivial because it would involve predicting the effects of wind on the aircraft and attenuating motor and control surface outputs. Fortunately, the step height overshoots do not represent a problem to the sampling strategy as every sample is tagged with the aircraft's position and GPS time. In summary, the overall performance of the LACAS v2 showed promising results and motivated the further development of the system. \Cref{chap:chamb} details how three calibration chamber experiments were performed to calibrate and study the impact of environmental variables on LACAS's sensors.

\section{Other possible applications}

As mentioned in \cref{sec:motivation}, UAS-based sampling systems can also serve as a source of initialization parameters for more expensive and accurate instruments. One example of this type of application for LACAS would be the deployment of the system in tandem with the Collaborative Lower Atmosphere Profiling System (CLAMPS). The ground-based Fourier transform spectrometer onboard CLAMPS is dependent on an initial parameterization of atmospheric conditions for each new location the system is deployed. In this scenario, LACAS could provide these parameters for deployment in remote locations. Another example would be to deploy LACAS at the Department of Energy's Atmospheric Radiation Measurement (ARM) research facility as an in-situ tool for intercomparison and validation of the future Geostationary Carbon Cycle Observatory satellite (GeoCarb).


%%%%%%%%%%%%%%%%%%%%%
% Chamber experiments
%%%%%%%%%%%%%%%%%%%%%
\chapter{Chamber experiments}\label{chap:chamb}

As mentioned in \cref{sec:v2.5}, \sys\ is composed of three bead thermistors, four capacitive hygrometers, and two \ndir\ sensors. Where the three thermistors and three hygrometers are used to characterize the atmosphere, and the other hygrometer is used to compensate for the effects of the \co\ mini-chamber plumbing (for more details refer back to \cref{sec:v2.5}). For this reason, it is important to calibrate the thermistors and hygrometers against a trustworthy instrument and to understand how the fourth hygrometer compares to the three thermistors and three hygrometers used to characterize the atmosphere. Fortunately, CASS is located at the National Weather Center, home of the Oklahoma Mesonet, which has a dedicated laboratory for the calibration and validation of sensors.

The Oklahoma Mesonet has been operating sensors deployed in 120 towers in each of the 77 counties of the state of Oklahoma for the past 25 years \cite{OKMes1,OKMes2}. Each 10-meter tower measures physical parameters ranging from soil moisture sensors to wind speed and direction at \SI{10}{\meter}. The maintenance of this statewide system requires near-constant sensor reconditioning and replacement. However, both of these procedures need to be performed whilst maintaining data continuity (in time) and comparability (geographically). To perform such a feat, the Oklahoma Mesonet team utilizes a highly accurate and precise suite of calibration chambers. Through a partnership with the Oklahoma Mesonet, CASS was given access to the temperature/RH and pressure calibration chambers in the Oklahoma Mesonet calibration laboratory.

Besides the calibration of the thermistors and hygrometers, the Oklahoma Mesonet chamber calibration experiments served a crucial characterization role for the \skfr\ \ndir\ sensors. The \kfr\ was designed as an ambient sensor to be operated in conditions with small variations in temperature, RH, and pressure. Whereas, significant changes to all of these three variables are expected when performing atmospheric vertical profiles from the ground to 5000 ft AGL. Therefore, the improvements in airflow through the sensor would be meaningless without the study of the isolated effects of temperature, RH, and pressure on the \co\ concentration values reported by the \kfr. A careful characterization of these parameters is what makes the UAS deployment of the \kfr\ for atmospheric research possible. This chapter details details how three distinct chamber experiments were designed and carried out to calibrate and characterize the sensors of the \sys.

%%%%Temperature/RH chamber characteristics%%%%%%
\section{Temperature/RH chamber characteristics}

The Thunder Scientific Model 2500 benchtop humidity generator (\cref{fig:tempChamber}) is a calibration chamber capable of producing known humidity values using the Two-pressure method (\cref{fig:TwoPressureDiagram}). This method was developed by the National Institute of Standards and Technology (NIST). The chamber is capable of automatically changing temperature and RH conditions using a script written by the user. \Cref{fig:tempChamberSpecs} shows the full specifications of the Thunder Scientific chamber.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.35\textwidth]{../images/TempRHChamber}
	\caption{Thunder Scientific Model 2500 benchtop humidity generator. Source: Thunder Scientific manual.}
	\label{fig:tempChamber}
		\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.80\textwidth]{../images/TempRHChamberPresDiagram}
	\caption{Diagram of the Two-pressure humidity generation method developed by NIST, where P\textsubscript{c} is the water vapor pressure measured inside the chamber and P\textsubscript{s} is the water vapor pressure measured inside the air saturation chamber. Source: Thunder Scientific manual.}
	\label{fig:TwoPressureDiagram}	
		\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.80\textwidth]{../images/TempRHChamberSpecs}
	\caption{Specifications for the Thunder Scientific Model 2500 benchtop humidity generator. Source: Thunder Scientific manual.}
	\label{fig:tempChamberSpecs}
	\end{center}	
\end{figure}

The frequency of utilization and the physical size of this calibration chamber pose a logistical challenge on performing regular recalibration of the instrument with the manufacturer. To circumvent this issue while maintaining confidence in the chamber's measurements, the manufacturer performs regular maintenance visits to the Oklahoma Mesonet calibration laboratory, and a smaller secondary instrument was added to the calibration system. This secondary instrument is an RH Systems 473 Dew Point Mirror with SH2 measuring head and temperature probe. This instrument is recalibrated periodically and serves as the reference measurement of the temperature/RH calibration chamber. From this point onward, its measured values will be referred to as the reference temperature and reference RH. As this thesis was written, the last calibration of the instrument was performed by NVLAP on December 19\textsuperscript{th}, 2019, which reported an ``as left'' accuracy in temperature and RH of $\pm\SI{0.03}{\celsius}$ and $\pm\SI{0.08}{\percent}$, respectively.

%%%%%Temperature/RH experiment setup%%%%%
\section{Temperature/RH experiment setup}\label{sec:tempChamber}

Two experiments were executed to test the impacts of temperature and relative humidity on the sensors present in LACAS. The sensor placements for both experiments are shown in the diagram in \cref{fig:TRHChambDiagram} and in the images in \cref{fig:tempChamberExp}. In this setting, the ``Set RH'' and ``Set Temp'' represent the measurements made by the Thunder Scientific Model 2500 benchtop humidity generator to determine if a particular setpoint in the user's test routine was achieved. The ``Reference Temp'' and ``Reference RH'' represent the actual values inside the calibration chamber. The reference values are used to evaluate the sensors in LACAS. The ``Temp/RH auxiliary probe'' represents measurements from a Vaisala temperature and relative humidity probe placed in the calibration chamber to help configure the chamber's set values for this specific experiment. This probe is not a part of the calibration chamber system and its measurements were only used for secondary analysis. The ``LI-840A'' represents the measurements from an \licor. For these experiments, the ``LI-840A'' values are the reference \co\ concentration values. As detailed in \cref{sec:v2}, the \licor's measurements are independent of temperature and humidity. The ``LI-820'' block represents the measurements from an LI-820 gas analyzer placed outside of the calibration chamber as an experiment control, measuring the background \co\ concentrations inside the calibration laboratory.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.80\textwidth]{../images/TRHChambExp}
	\caption{Diagram of the sensor placement for the temperature and RH runs of the calibration chamber experiments. The cream-colored blocks represent reference instruments, the crimson blocks represent the sensors being tested, and the gray block represents a fan used for airflow over the sensors. The gray arrows indicate the airflow in and out of the measurement chamber.}
	\label{fig:TRHChambDiagram}
	\end{center}	
\end{figure}

In these experiments, both \kfr\ sensors were removed from the LACAS mini-chamber and placed fully exposed to the air in the calibration  chamber (bottom rightmost image of \cref{fig:tempChamberExp}). This setup isolated the effects of temperature and humidity on the \co\ concentration values reported by the \kfr\ from any interference from LACAS's mini-chamber plumbing. This experiment design creates  another reference of the impacts of temperature and relative humidity on the sensor's behavior \cite{21}, to be used in future systems developed using this same sensor.

The top image in \cref{fig:tempChamberExp} shows the physical arrangement of the sensors inside the temperature/RH calibration chamber. As can be seen, two plane scoops were present inside the calibration chamber during the experiment. However, the diagram in \cref{fig:TRHChambDiagram} only shows one scoop. This setting change was done to minimize the total calibration time and still achieve CASS's operational goals. Given that both scoops are identical and the experiment's goal was to understand the characteristics of the \sys, from this point forward, only one scoop will be considered present inside the calibration chamber. The following analysis refers only to scoop number 1.

A minimum \SI{5}{\meter\per\second} flow over the bead thermistors is necessary to mitigate self-induced electrical heating that occurs in stagnate air. At the same time, a well-mixed chamber reduces sensor placement sensitivity. Therefore, besides the \SI{20}{\liter\per\minute} flow of the chamber, a ducted fan was added to promote flow over the sensors and to ensure that the air volume of the entire chamber was well-mixed. The placement shown in \cref{fig:tempChamberExp} was used for both the temperature and the humidity experiments.  

In both experiments, the fourth hygrometer was placed inside the LACAS scoop, immediately behind the six scoop sensors (refer to \cref{fig:1ScoopV2}). This modification was needed because the LACAS mini-chamber was dismantled for these experiments. This temporary placement ensured that the fourth hygrometer was under the same conditions as the six scoop sensors. This creates the conditions necessary to understand how the fourth hygrometer compares to the three thermistors and three hygrometers used to characterize the atmosphere. This comparison allows LACAS to correct the \co\ concentrations reported by the \kfr\ for differences in temperature and humidity between the atmosphere and the parcel of air inside the LACAS mini-chamber. The following sections detail each of the two experiments and present the respective results.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.80\textwidth]{../images/IMG_3940.JPG}
		\includegraphics[width=0.395\textwidth]{../images/IMG_3944.JPG}
		\includegraphics[width=0.395\textwidth]{../images/IMG_3943.JPG}
	\caption{Instrument placements inside the calibration chamber for the temperature and humidity experiments. Top, general view of the arrangement. The bottom left image shows a detailed view of the temperature probes' placement. The bottom right image shows a detailed view of the reference RH probe placement.}
	\label{fig:tempChamberExp}
	\end{center}	
\end{figure}

%%%% Temperature experiment %%%%
\section{Temperature experiment}

Martin et al. \cite{21} have shown the impacts of temperature on the \kfr\ concentration values. This impact is coherent with details provided by Senseair regarding the assumptions made when converting the measured moles of \co\ per unit volume to the reported parts per million \cite{18}. The following experiment was performed to evaluate the effects of temperature on the \co\ concentration values from the \kfr\ and calibrate the three thermistors and four hygrometers. As seen in \cref{sec:v2.5}, the hygrometers measure RH and temperature. In this experiment only its temperature values were analyzed. 

\subsection{Procedure}

The experiment started with the calibration chamber at room temperature and RH, taking approximately \SI{20}{\minute} to reach the initial setpoint. The calibration chamber was set to \SI{50}{\percent} RH for the duration of the experiment. Every two hours, a new temperature was set. The experiment consisted of four temperatures and lasted for eight hours, as detailed below.

\begin{enumerate}
\item{Temperature \SI{10}{\celsius}, RH \SI{50}{\percent}, for 2 hours.}
\item{Temperature \SI{20}{\celsius}, RH \SI{50}{\percent}, for 2 hours.}
\item{Temperature \SI{30}{\celsius}, RH \SI{50}{\percent}, for 2 hours.}
\item{Temperature \SI{40}{\celsius}, RH \SI{50}{\percent}, for 2 hours.}
\end{enumerate}

\subsection{Hypotheses}

\begin{enumerate}
\item{The \co\ concentration value of both \kfr\ will decrease as temperature rises, while the reference \co\ concentration values will remain constant.}\label{hyp:co2t}

\item{All three iMet bead thermistors in the scoop will maintain a temperature accuracy of $\pm\SI{0.2}{\celsius}$ in the 1-second averaged data, across the full duration of the procedure.}\label{hyp:temp1}

\item{All four HYT 271 capacitive hygrometers in the scoop will maintain a temperature accuracy of $\pm\SI{0.2}{\celsius}$ in the 1-second averaged data, across the full duration of the procedure.}\label{hyp:temp2}
\end{enumerate}


\subsection{Results}\label{sec:TResult}

The experiment results were analyzed using the LACAS desktop application. \Cref{fig:TempRes1_5} shows a screenshot of the initial experimental results. The pressure as a function of time plot shows that the pressure inside the calibration chamber and inside the calibration laboratory did not remain constant during the experiment. The red time series represents the pressure values measured by the sensor inside the \pix\ Cube Black, inside the calibration chamber. The red time series showed a slow increase of \SI{0.15}{\kilo\pascal} in the first four hours and a \SI{0.50}{\kilo\pascal} decrease in the following five hours. A similar trend in pressure was also observed by the \licor\ (blue line), and in the LI-820 gas analyzer (green line).\\

\begin{figure}[H]
	\begin{center}
%		\includegraphics[width=0.80\textwidth]{../images/TempRes1}
		\includegraphics[width=0.80\textwidth]{../images/TempRes5}	
	\caption{LACAS desktop application's dashboard pressure-view showing the experimental conditions inside and outside the calibration chamber. The red time series represents the pressure measured by LACAS. The green time series represents the pressure measured by the \licor. Green and red represent the pressure inside the calibration chamber. The blue time series represents the pressure measured by the LI-820 gas analyzer, in the calibration laboratory.} 
	\label{fig:TempRes1_5}
\end{center}
\end{figure}

The bottom panel of \cref{fig:TempRes2} indicates that the actual relative humidity value for the experiment was \SI{46}{\percent} $\pm\SI{1}{\percent}$ (green line), instead of the \SI{50}{\percent} programmed value. The blue time series indicates that the calibration chamber believed it had reached the programmed value. The bottom panel of \cref{fig:TempRes2} also shows satisfactory agreement for RH values between the reference RH (green) and the auxiliary T/RH probe (yellow).\\ 

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.80\textwidth]{../images/TempRes2}
		\caption{LACAS desktop application's temperature and relative humidity view of the initial experimental results. The color is the same for both plots. The red time series represents the measurements made by LACAS. The green time series represents the measurements made by the chamber reference instrument. The blue time series represents the chamber set values. The yellow time series represents the measurements made by the temp/RH auxiliary probe.}
		\label{fig:TempRes2}
	\end{center}
\end{figure}

The variations in pressure and relative humidity were not considered impactful on the performance of the calibration chamber. The set temperature (blue time series) and the reference temperature (green times series) maintained a difference smaller than \SI{0.05}{\celsius} throughout the experiment, making their time series nearly indistinguishable on the top panel of \cref{fig:TempRes2}.

A first glance at the top panel of \cref{fig:TempRes2} seems to indicate the presence of bias on the LACAS scoop temperature (red time series). Using the temperature analysis feature of the LACAS desktop application to investigate the temperature values of each sensor, the presence of the bias was confirmed (\cref{fig:TempRes3_4}). \Cref{fig:TempRes7_9} shows the results of removing the bias on the LACAS scoop temperature.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/TempRes4}
		\caption{LACAS desktop application's detailed view of temperature measurements, individual temperature sensor against the chamber reference. In this plot, the red, blue, and green time series represent the raw values of the three thermistors (1, 2, and 3, respectively), and the yellow, pink, light blue, and orange time series represent the raw temperatures measured by the hygrometers (1, 2, 3, and 4, respectively). The gray time series represents the reference temperature.}
		\label{fig:TempRes3_4}
	\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/TempRes7}
		\includegraphics[width=0.8\textwidth]{../images/TempRes8}
		\includegraphics[width=0.8\textwidth]{../images/TempRes9}
		\caption{LACAS desktop application's dashboard view of temperature. The top panel shows the set, reference, auxiliary, and LACAS temperature for the entire duration of the experiment. The middle panel shows a detailed view of the \SI{20}{\celsius} to \SI{30}{\celsius} step transition. The bottom panel shows the detailed view of the dwell part of the \SI{30}{\celsius} step. For all plots, the red time series represents the measurements made by LACAS, the green time series represents the chamber reference, the blue time series represents the chamber set values, and the yellow time series represents the temp/RH auxiliary probe.}
		\label{fig:TempRes7_9}
	\end{center}
\end{figure}

To evaluate the temperature measurements of each sensor, the mean absolute error (MAE) and the root mean square error (RMSE) were calculated and are presented in \cref{tab:TempRMSE}. For this analysis, a few premises are worth mentioning:

\begin{enumerate}
\item{The LACAS library logs the values of each sensor at \SI{10}{\hertz} on the \pix's internal SD card.}
\item{Due to the lack of a GPS signal inside the Oklahoma Mesonet calibration laboratory, the measurements collected during all experiments were logged through the ground-station computer. The LACAS library transmits values to the ground-station at \SI{4}{\hertz}.}
\item{The bead thermistors have a \SI{1}{\second} time response and the temperature on the hygrometers have a \SI{5}{\second} time response.}
\item{The LACAS temperature is a \SI{1}{\hertz} average of all three thermistors.}
\end{enumerate}

\begin{table}[H]
\begin{center}
\begin{tabular}{|c|c|c|c|} 
\hline
\rowcolor{lightgray} & RMSE (\SI{4}{\hertz}) & RMSE (\SI{1}{\hertz}) & MAE (\SI{1}{\hertz}) \\ [0.3ex]
\hline
\hline
Thermistor 1 & $\pm\SI{0.17525}{\celsius}$ & $\pm\SI{0.13730}{\celsius}$ & $\pm\SI{0.10076}{\celsius}$ \\ 
\hline
Thermistor 2 & $\pm\SI{0.17586}{\celsius}$ & $\pm\SI{0.13842}{\celsius}$ & $\pm\SI{0.10087}{\celsius}$\\
\hline
Thermistor 3 & $\pm\SI{0.17323}{\celsius}$ & $\pm\SI{0.13559}{\celsius}$ & $\pm\SI{0.09836}{\celsius}$\\
\hline
Hygrometer (Temp) 1 & $\pm\SI{0.11008}{\celsius}$ & $\pm\SI{0.10863}{\celsius}$ & $\pm\SI{0.08492}{\celsius}$\\
\hline
Hygrometer (Temp) 2 & $\pm\SI{0.10746}{\celsius}$ & $\pm\SI{0.10713}{\celsius}$ & $\pm\SI{0.08041}{\celsius}$\\
\hline
Hygrometer (Temp) 3 & $\pm\SI{0.10374}{\celsius}$ & $\pm\SI{0.10355}{\celsius}$ & $\pm\SI{0.07107}{\celsius}$\\
\hline
Hygrometer (Temp) 4 & $\pm\SI{0.12207}{\celsius}$ & $\pm\SI{0.12285}{\celsius}$ & $\pm\SI{0.09067}{\celsius}$\\
\hline
\end{tabular}
\caption{MAE and RMSE for raw sensor values and 1-second average.}\label{tab:TempRMSE}
\end{center}
\end{table}
 
The results in \cref{tab:TempRMSE} indicate that all sensors performed better than their respective datasheet accuracy, $\pm\SI{0.3}{\celsius}$ for the thermistors, and $\pm\SI{0.2}{\celsius}$ for the hygrometer. As expected, averaging to \SI{1}{\hertz} improved the sensor error. However, it is important to note that the ground-station log used in this analysis has fewer samples per second than a regular flight log file. Further accuracy improvements can be expected when using the autopilot binary files.

Analyzing the difference in RMSE and MAE, in conjunction with the plots in the middle and bottom panels of \cref{fig:TempRes7_9}, it is notable that the sensors performed worst in the temperature-step changes than during the dwell periods of each temperature step. Considering that the step change is done in approximately \SI{25}{\minute}, the sensors' time responses should not have affected this result.

As expected, all four hygrometers were more accurate than the thermistors. However, the \sys\ can not discard the thermistors because they have faster time responses than the temperature on the hygrometers. This faster time response is what gives \sys\ a high enough spatial resolution to characterize the thermodynamic structure of the atmospheric boundary layer. Characterizing this structure is crucial in understanding the spatial distribution of \co.

The thermistor and hygrometer errors are within the $\pm\SI{0.2}{\celsius}$ standard for atmospheric temperature measurements set by the NASA/Goddard Space Flight Center/Wallops Flight Facility for the Accurate Temperature Measuring (ATM) Radiosonde \cite{TempStandard}. The results presented above support hypotheses \ref{hyp:temp1} and \ref{hyp:temp2}.

The LACAS desktop application was also used to analyze the behavior of \co\ concentrations with changes in temperature. \Cref{fig:TEMPCO2Res1_2} shows the \co\ concentration values measured by both LI-COR gas analyzers and by LACAS (red time series). As mentioned in \cref{sec:tempChamber}, the \licor\ (blue time series) is the reference value inside the chamber, and the LI-820 gas analyzer (green time series) represents the background levels of \co\ concentrations inside the Oklahoma Mesonet calibration laboratory. Air flows from the laboratory through the calibration chamber at a rate of \SI{20}{\liter\per\minute}.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/TEMPCO2Res2}
		\caption{LACAS desktop application's dashboard view of carbon dioxide. The red time series represents the concentrations measured by LACAS. The blue time series represents the concentrations measured by the \licor. Green and red represent the concentrations inside the calibration chamber. The green time series represents the concentrations measured by the LI-820 gas analyzer, in the calibration laboratory.} 
		\label{fig:TEMPCO2Res1_2}
	\end{center}
\end{figure}

Unfortunately, no statements about LACAS's accuracy can be made, given that both LI-COR gas analyzers were not calibrated at the time of this experiment. However, their values can be taken as a suggestion of trends in concentration levels because side-by-side bench experiments showed their ability to track each other. 

\Cref{fig:TEMPCO2Res1_2} shows that the LACAS and the \licor\ followed the trend of the concentration levels in the calibration laboratory, measured by the external LI-820 gas analyzer. The laboratory was not isolated and people came in and out of it randomly during the experiment. 

With no indication of influence in the reported \co\ concentration values by the temperature changes, hypothesis \ref{hyp:co2t} can not be supported. This result is corroborated by the trend agreement between the \licor\ and LACAS, considering that the \licor's internal measurement is temperature-controlled to always sample at approximately \SI{51}{\celsius}.



%%%% RH experiment %%%%
\section{RH experiment}

Martin et al. \cite{21} have also shown impacts of changes in humidity changes on the \kfr. Considering the proximity of the absorption bands of H\textsubscript{2}O and \co, it is possible that the \ndir\ method used by the \kfr\ may suffer interference in high humidity environments. The following experiment was performed to evaluate the effects of humidity on the \co\ concentration values from the \kfr\ and calibrate the four hygrometers in the LACAS scoop. The physical arrangement for this experiment is identical to the arrangement described in \cref{sec:tempChamber}.

\subsection{Procedure}

The experiment started with the calibration chamber at room temperature and RH, taking approximately \SI{1}{\hour} to reach the initial setpoint. The calibration chamber was set to \SI{25}{\celsius} for the duration of the experiment. Every hour a new RH was set. The experiment consisted of seven RH values and lasted for \SI{8}{\hour}, as detailed below. The initial RH value was set for \SI{2}{\hour} because the chamber needs \SI{1}{\hour} to reach \SI{25}{\celsius}.

\begin{enumerate}
\item{Temperature \SI{25}{\celsius}, RH \SI{15}{\percent}, for 2 hours.}
\item{Temperature \SI{25}{\celsius}, RH \SI{35}{\percent}, for 1 hour.}
\item{Temperature \SI{25}{\celsius}, RH \SI{55}{\percent}, for 1 hour.}
\item{Temperature \SI{25}{\celsius}, RH \SI{65}{\percent}, for 1 hour.}
\item{Temperature \SI{25}{\celsius}, RH \SI{75}{\percent}, for 1 hour.}
\item{Temperature \SI{25}{\celsius}, RH \SI{85}{\percent}, for 1 hour.}
\item{Temperature \SI{25}{\celsius}, RH \SI{95}{\percent}, for 1 hour.}
\end{enumerate}

The choice to change the step size from 20 to 10, from the first three steps to the last four steps was due to hypothesis \ref{hyp:corh} (detailed in \cref{sec:hyp}). This change allowed for a more detailed investigation of the behavior of the \kfr\ in the range where humidity interference on the infrared spectroscopy was possible.

\subsection{Hypotheses}\label{sec:hyp}

\begin{enumerate}
\item{The \co\ concentration value of both \kfr\ will increase as humidity rises, while the reference \co\ concentration values will remain constant.}\label{hyp:corh}

\item{All four HYT 271 capacitive hygrometers will maintain an RH accuracy of $\pm\SI{1.8}{\percent}$ in the 1-second averaged data, across the full duration of the procedure.}\label{hyp:rh1}
\end{enumerate}

\subsection{Results}

\Cref{fig:RHRes1_3} shows three screenshots from the LACAS desktop application's dashboard view showing the initial experimental results. The top panel shows that the pressure inside the chamber did not remain constant during the experiment. It slowly increased by \SI{0.55}{\kilo\pascal} during the first six hours, decreasing only \SI{0.05}{\kilo\pascal} in the remaining two hours. Similar to what occurred in the temperature experiment, both LI-COR gas analyzers (green and blue time series, respectively) agreed with the trend measured by the LACAS (red time series).

The middle panel of \cref{fig:RHRes1_3} indicates that the actual temperature (green time series) for the experiment was \SI{25.5}{\celsius} $\pm\SI{0.1}{\celsius}$, instead of the programmed \SI{25.0}{\celsius}. This panel also illustrates satisfactory agreement between the set temperature, the reference temperature, and LACAS. The auxiliary T/RH probe presented a constant bias of approximately \SI{0.2}{\celsius}.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.80\textwidth]{../images/RHRes1}
		\includegraphics[width=0.80\textwidth]{../images/RHRes2}
		\includegraphics[width=0.80\textwidth]{../images/RHRes3}
		\caption{LACAS desktop application's dashboard view for pressure (top), temperature (middle), and relative humidity (bottom). The red time series represents the measurements made by LACAS in all three plots. On the top plot, the green time series represents the pressure measured by the \licor, and the blue time series represents the concentrations measured by the LI-820 gas analyzer, in the calibration laboratory. On the middle and bottom plots, the green time series represents the chamber reference values, the blue time series represents the chamber set values, and the yellow time series represents the temp/RH auxiliary probe values.}
	\label{fig:RHRes1_3}
\end{center}
\end{figure}

None of the variations in pressure and temperature described above were considered impactful on the performance of the calibration chamber. However, the bottom panel of \cref{fig:RHRes1_3} indicates that the set RH (blue time series) and reference RH (green time series) presented a difference of approximately \SI{2}{\percent} for the \SI{65}{\percent} and \SI{75}{\percent} steps. The LACAS scoop RH (red time series) seems to present bias. 

Using the RH analysis feature of the LACAS desktop application to investigate the RH values of each individual sensor, the presence of the bias was confirmed. \Cref{fig:RHRes4} shows the results of removing the bias on the LACAS scoop RH.  There is an improvement in the RH values higher than \SI{55}{\percent}. However, this comes at the cost of over correcting the values at \SI{35}{\percent} and below.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.80\textwidth]{../images/RHRes4}
		\caption{LACAS desktop application's dashboard view for relative humidity showing the results of the bias correction. The red time series represents the corrected values measured by LACAS, the green time series represents the chamber reference values, the blue time series represents the chamber set values, and the yellow time series represents the temp/RH auxiliary probe values.}
		\label{fig:RHRes4}
	\end{center}
\end{figure}

Even without an ideal correction for the LACAS scoop RH values, the MAE and the RMSE were calculated for each of the four hygrometers. Their results are presented in \cref{tab:RHRMES}. For this analysis, the same premises from the temperature experiment are still valid (see \cref{sec:TResult}).\\

\begin{table}[H]
\begin{center}
\begin{tabular}{|c|c|c|c|} 
\hline
\rowcolor{lightgray}& RMSE (\SI{4}{\hertz}) & RMSE (\SI{1}{\hertz}) & MAE (\SI{1}{\hertz}) \\ [0.3ex]
\hline
\hline
Hygrometer (RH) 1 & $\pm\SI{2.20146}{\percent}$ & $\pm\SI{2.19838}{\percent}$ & $\pm\SI{1.89547}{\percent}$ \\
\hline
Hygrometer (RH) 2 & $\pm\SI{2.45957}{\percent}$ & $\pm\SI{2.45674}{\percent}$ & $\pm\SI{2.12256}{\percent}$ \\
\hline
Hygrometer (RH) 3 & $\pm\SI{2.33411}{\percent}$ & $\pm\SI{2.33109}{\percent}$ & $\pm\SI{2.00920}{\percent}$ \\
\hline
Hygrometer (RH) 4 & $\pm\SI{2.58989}{\percent}$ & $\pm\SI{2.58724}{\percent}$ & $\pm\SI{2.24037}{\percent}$ \\
\hline
\end{tabular}
\caption{MAE and RMSE for raw sensor values and 1-second average.}\label{tab:RHRMES}
\end{center}
\end{table}

The RH accuracy accepted by CASS within the CopterSonde project is $\pm\SI{2.5}{\percent}$. However, the IST HYT 271 datasheet claims an accuracy of $\pm\SI{1.8}{\percent}$. Therefore, the results presented above do not support hypothesis \ref{hyp:rh1}. Nonetheless, it is worth noting that before the experiment was set up, the chamber presented difficulty generating RH levels higher than \SI{55}{\percent}. It was believed, at the time, that poor mixing within the chamber was causing this problem. These problems prompted the use of the auxiliary temp/RH probe, mentioned in \cref{sec:tempChamber}. It is concluded here that the experiment should be repeated in the near future.

The LACAS desktop application was also used to analyze the behavior of \co\ concentrations with changes in RH. \Cref{fig:RHRes6} indicates the \co\ concentration values measured by the \licor\ (blue time series), the LI-820 gas analyzer (green time series), and by LACAS (red time series). In this experiment, LACAS and the \licor\ followed the trend of the concentration levels in the calibration laboratory, measured by the external LI-820 gas analyzer. The laboratory was not isolated and people came in and out of it randomly during the experiment.\\ 

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.80\textwidth]{../images/RHRes6}
		\caption{LACAS desktop application's dashboard view of carbon dioxide. The red time series represents the concentrations measured by LACAS. The blue time series represents the concentrations measured by the \licor. Blue and red represent the concentrations inside the calibration chamber. The green time series represents the concentrations measured by the LI-820 gas analyzer, in the calibration laboratory.}
		\label{fig:RHRes6}
	\end{center}
\end{figure}

With no indication of influence in the reported \co\ concentration values by the RH changes, hypothesis \ref{hyp:corh} is rejected. This result is corroborated by the trend agreement between the \licor\ and LACAS. In this experiment, this agreement is of particular importance because besides having a temperature-independent sampling chamber, the \licor\ also measures water concentration. \Cref{fig:RHRes7} shows the corrected values for all four of LACAS's hygrometers, the reference RH (pink time series), and the \licor's water concentration (light blue). The increase in humidity confirmed by the \licor\ did not impact the \co\ concentrations reported by LACAS.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.80\textwidth]{../images/RHRes7}
		\caption{LACAS desktop application's detailed view of humidity measurements (RH and concentration). The red, blue, green, and yellow time series represent the RH values measured by the four hygrometers (1, 2, 3, and 4 respectively). The pink time series represents the chamber's reference RH. The light blue time series represents the water concentrations in parts per thousand (ppt) measured by the \licor.}
		\label{fig:RHRes7}
\end{center}
\end{figure}

%%%% Pressure chamber characteristics %%%%
\section{Pressure chamber characteristics}

The Cincinnati Sub-Zero Z16 is an environmental simulation chamber for temperature and humidity experiments (left panel of \cref{fig:PresChamber}). The Oklahoma Mesonet's calibration laboratory manager, David Grimsley, developed a gasket-based vacuum and compression system (right panel of \cref{fig:PresChamber}) on this chamber, making it a pressure calibration chamber under controlled temperature and humidity. The temperature range of the Z16 chamber goes from \SI{-73}{\celsius} to \SI{190}{\celsius}. The reference pressure instrument for this calibration chamber is the Paroscientific 6015A pressure transducer, calibrate by Fluke on January 17\textsuperscript{th}, 2020, to an accuracy of $\pm\SI{0.001}{\kilo\pascal}$.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.4\textwidth]{../images/IMG_3863}
		\includegraphics[width=0.4\textwidth]{../images/IMG_3869}
		\caption{The Cincinnati Sub-Zero Z16 environmental simulation chamber (left) with the added gasket-based vacuum and compression system (right).}
	\label{fig:PresChamber}
\end{center}
\end{figure}

%%%% Pressure experiment %%%%
\section{Pressure experiment}

The reported values available on the \kfr's digital port are given in parts per million (ppm). However, as an \ndir\ sensor, the \kfr\ inherently measures moles per unit volume, making it prone to pressure dependence. Understating the level of this dependence on pressure is critical to the sensor's deployment onboard UAS. This experiment was used to validate the pressure correction equation provided by Senseair \cite{18} and evaluate the need for an improved equation taking into account other atmospheric variables \cite{21}.

\subsection{Setup}

	In this calibration chamber, the pressure effects are only available through a direct connection to the pressure gasket system. Therefore, the \kfr\ could not be tested fully exposed, as it was in the temperature/RH calibration chamber. Luckily, the LACAS mini-chamber is already a sealed environment with a readily available gasket connector. \Cref{fig:PresChamberDiagram} illustrates how the sensors were placed inside the calibration chamber for this experiment.\\

	\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.74\textwidth]{../images/PressDiagram}
		\caption{Sensor placement diagram for the pressure experiment. Cream-colored blocks represent reference instruments, the crimson is the tested instrument, and the gray blocks represent the airflow pumps. The dark gray arrows represent the pressure gasket system.}
	\label{fig:PresChamberDiagram}
\end{center}
\end{figure}

	In this setup, the autopilot board ``Pixhawk Cube Black'' was placed inside the calibration chamber, but was not exposed to the pressure changes. The same is true for the ``Reference Temp''. The ``LI-840A'' block represents the \licor\ placed outside the calibration chamber's inlets. The ``LACAS Mini-chamber'' represents the \SI{200}{\milli\liter} sealed enclosure of the LACAS v2 mini-chamber, with two \kfr\ sensors and one HYT 271 hygrometer.

\Cref{fig:PresChamberInternal} shows how the intake of the LACAS v2 mini-chamber was connected to the calibration chamber's gasket, and its exhaust was plugged to create a pressurized environment. \Cref{fig:PresChamberRefCO} shows how an \licor\ was used to create a \co\ concentration reference value during the experiment. The \licor\ measured the \co\ concentrations of the Oklahoma Mesonet's calibration laboratory, where the calibration chamber is located. This was important because the chamber's pump system exchanges air with the room to create the desired pressure. The experiment was performed unattended overnight to avoid ``contamination'' of the laboratory's \co\ concentration levels during the experiment.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/IMG_3858}
		\caption{Test chamber of the Z16 with the LACAS v2 mini-chamber connected to the gasket system and to a \pix\ Cube Black autopilot (as a data logger).}
		\label{fig:PresChamberInternal}
	\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.4\textwidth]{../images/IMG_3866}
		\includegraphics[width=0.4\textwidth]{../images/IMG_3870}
		\caption{Left, \licor\ used as a control concentration-level. Right, detailed view of \licor\ intake placement.}
		\label{fig:PresChamberRefCO}
	\end{center}
\end{figure}

\subsection{Procedure}

For this experiment the calibration chamber's temperature was set to \SI{25}{\celsius} for the duration of the experiment. The chamber started at room temperature and pressure, then set to the initial temperature and pressure values. The experiment consisted of a series of descents to \SI{60}{\kilo\pascal} and ascents to \SI{105}{\kilo\pascal} in \SI{1}{\kilo\pascal} steps, producing a triangle signal (top panel in \cref{fig:CO2RES1}). The dwell period at each step was \SI{1}{\minute}, and the whole experiment lasted approximately \SI{6}{\hour}.

\subsection{Hypothesis}

\begin{enumerate}
\item{The reported \co\ concentration values from both \kfr\ sensors will decrease as pressure decreases, while the reference \co\ concentration values will remain constant.}\label{hyp:coP}
\end{enumerate}

\subsection{Results}

The top panel in \cref{fig:CO2RES1} illustrates the pressure profiles for all instruments during the experiment. The blue time series shows the measured values by the reference pressure transducer. The green time series shows the pressure inside the \licor's internal sampling chamber, this pressure is representative of the ambient value of the calibration laboratory. Finally, the red time series is the pressure measured by the \pix\ autopilot board inside the Z16 chamber, but not connected to the gasket system. It indicates that there was no significant pressure change inside the Z16 test chamber during the experiment.

The bottom panel in \cref{fig:CO2RES1} exhibits the temperature profiles for all instruments during the experiment. The blue time series shows reference temperature. The green time series shows the constant temperature inside the \licor's internal sampling chamber. The red time series shows the hygrometer temperature inside the LACAS v2 mini-chamber. All temperatures remained undisturbed for the entire duration of the experiment.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/CO2RES1}
		\caption{LACAS desktop application's dashboard view of pressure and temperature. In both plots, the red time series represents the values measured by LACAS, the blue time series represents the chamber's reference values, and the green time series represents the values measured by the \licor.}
		\label{fig:CO2RES1}
	\end{center}
\end{figure}

The bottom panel in \cref{fig:CO2RES2} shows the \co\ concentrations inside the LACAS v2 mini-chamber (red time series) and in the calibration laboratory (blue time series). Given the experiment design, the laboratory's \co\ concentrations should have remained unaltered. However, the concentrations measured by the \licor\ presented an unexplained random noise. This noise is particularly concerning, considering that the experiment was performed unattended overnight.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/CO2RES2}
		\caption{LACAS desktop application's dashboard view of humidity and carbon dioxide. The blue time series represents the concentrations measured by the \licor\ in the bottom plots. The red time series represents the values measured by LACAS, in both plots.}
	\label{fig:CO2RES2}
\end{center}
\end{figure}

To investigate this noise, another LI-COR gas analyzer was colocated with the original \licor\ during another pressure experiment executed for an Oklahoma Mesonet internal test. \Cref{fig:CO2RES5_7} shows the results for this second run. The random \co\ concentration level noise appeared again. This time, it appeared on both LI-COR gas analyzers. However, its expression was much weaker and only occurred in the first two hours. Unfortunately in the time-frame of this thesis a satisfactory explanation for this noise was not found.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/CO2RES6}
	\caption{\sys\ desktop application dashboard view of carbon dioxide, showing the concentrations for both LI-COR gas analyzers during the noise investigation. The red time series represents concentrations measured by the \licor, and the blue time series represents the concentrations measured by the LI-820 gas analyzer.}
	\label{fig:CO2RES5_7}
\end{center}
\end{figure}

Nonetheless, considering the average concentration value of the \licor\ as a loose indication of the laboratory's concentration levels, the impact of the pressure change on the \co\ concentration values reported by the \kfr\ is evident. These results support hypothesis \ref{hyp:coP}.

In an application notes document, Senseair provides two pressure correction methods. The first method is limited for applications between 100 and \SI{101.3}{\kilo\pascal}, which is not useful for most UAS applications. In the second method, the corrected \kfr\ reading is given by
\begin{equation}\label{eq:SenseairPress}
\mbox{Corrected reading} = \frac{\mbox{\kfr\ reading}}{4.026\times10^{-3}\times \mbox{Pressure} + 5.780\times10^{-5}\times \mbox{Pressure}^2},
\end{equation}
where Pressure is in \SI{}{\kilo\pascal} and the \kfr\ reading is in ppm. In the application notes there is no clarification regarding a pressure range limitation for \cref{eq:SenseairPress}. Therefore, the data from this experiment was also used to validate \cref{eq:SenseairPress}. The green time series on the top panel of \cref{fig:CO2RES3} shows an attempt to use \cref{eq:SenseairPress} to correct the raw data (red time series). The results shown on the top panel of \cref{fig:CO2RES3} suggest that \cref{eq:SenseairPress} is only applicable for values close to \SI{101.3}{\kilo\pascal}, over correcting the reported \co\ concentration values in most cases applicable to UAS flights.

Another goal of this thesis was to evaluate the need for an improved equation taking into account atmospheric variables. The results found in the three experiments performed in this thesis did not support the need for a multivariable regression approach to correct the concentration values \cite{21}. However, developing a pressure correction equation is critical for the success of LACAS. The yellow time series on the top panel of \cref{fig:CO2RES3} shows the results for \cref{eq:GusPress}, a simplified first attempt to find this correction equation is given by 
\begin{equation}\label{eq:GusPress}
\mbox{Corrected reading} = \frac{\mbox{Pressure}}{\SI{101.3}{\kilo\pascal}}\times\mbox{\kfr\ reading}.
\end{equation}
It performed significantly better than \cref{eq:SenseairPress}, but its results are still not satisfactory.\\


\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/CO2RES3}
		\caption{LACAS desktop application's carbon dioxide pressure study feature. The top panel shows the raw (red), Senseair corrected (green), and LACAS correct (yellow) \co\ concentrations. It also shows the pressure (blue time series). The bottom panel shows the raw concentrations as a function of pressure.}
	\label{fig:CO2RES3}
\end{center}
\end{figure}
\newpage
An unexpected result for this experiment was the RH values reported by the HYT 271 capacitive hygrometer inside the LACAS v2 mini-chamber (top panel in \cref{fig:CO2RES2}). It presented the decrease in humidity in the laboratory, reported by the \licor\ (pink time series in \cref{fig:CO2RES4}). However, it also presented a strong influence of the pressure change (red through yellow time series in \cref{fig:CO2RES4}). It is also important to note that the temperature reported by the hygrometer did not change significantly during the same time period. 

At this point, it is unclear if this dependence is artificial due to product development choices or if the relative humidity inside the LACAS v2 mini-chamber actually changed. Further investigation of this result is warranted. However, it cannot be performed within the time frame of this thesis.\\

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.8\textwidth]{../images/CO2RES4}
	
	\caption{LACAS desktop application's detailed humidity view. The red, blue, green, and yellow time series represent the raw RH values from the four hygrometers (1, 2, 3, and 4 respectively). The pink time series represents the water concentration in parts per thousand (ppt) measured by the \licor.}
	\label{fig:CO2RES4}
\end{center}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%
% Final Considerations
%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Final Considerations}\label{chap:final}

Even after 60 years of scientific consensus around the importance of atmospheric \co\ to human life on earth, there is still little understanding about its consequences regarding weather patterns, agriculture, ocean levels, and many other areas of impact \cite{1,2,3,6,7}. The magnitude of this knowledge gap and the physical challenges of studying atmospheric \co\ make it impossible for a single tool to solve this problem. Therefore, a multitool approach is necessary.

The Lower Atmosphere Carbon Dioxide Acquisition System (LACAS) is being developed to be a complementary tool within atmospheric \co\ research suitable for remote instrument augmentation, initial exploratory studies, and measurements in under-surveyed areas. The three components of LACAS detailed in \cref{chap:pkg,chap:c++,chap:java} are what makes a standard UAS into a system capable of autonomously collecting atmospheric \co\ concentrations, and automatically generating a graphical presentation of the collected data for analysis by the end-user. The three components were entirely developed by the author for this thesis. However, the development process should continue beyond the scope of this thesis.

Besides being a complementary tool within atmospheric \co\ research, LACAS is also a stepping stone for a broader UAS-based tool for atmospheric chemistry studies. Within atmospheric chemistry, aerosol studies show similar challenges and social impact potential as atmospheric \co\ studies. A broader UAS-based tool that adds aerosol measurements to LACAS has the potential for great impact in the scientific community. One such example is to aid in studies of aerosol impacts on thunderstorms. The uncertainty around these impacts has split the severe weather community. While some authors hypothesize that smoke can enhance severe weather through suppression of onset warm rain, others hypothesize that aerosol loads can suppress severe weather via reduction in cloudiness \cite{6}. In spite of evidences to aerosol impacts on atmospheric conditions, most numerical simulations do not take aerosol interactions into account \cite{6}. Satellite dataset absorption into models only produces a mild impact in tornado genesis when smoke is present. However, this underestimation of aerosols is due to the limitations in satellite retrievals caused by smoke and clouds \cite{6}. An improved in-situ instrument capable of taking measurements from the ground, up to cloud level could enhance the measurements of colocated remote sensing instruments. Potentially aiding the scientific to reach a consensus for this specific topic amongst others.

Certainly, the lessons learned during the development of LACAS can be leveraged to the development of other UAS-based atmospheric chemistry tools. This thesis presented a few of the challenges faced in the initial development stages of LACAS. Surely the future holds many more, but a few new challenges have already presented themselves in this thesis. One example is the development of a pressure correction equation for the \kfr. As this thesis was being finalized, communications with Senseair confirmed the results from the pressure calibration chamber experiment. Another benefit of sharing these results with Senseair was the opportunity to discuss these issues with Dr. Bakhram Gaynullin. In his Ph.D. dissertation Dr. Gaynullin studied the practical solutions for accurate studies of NDIR gas sensor pressure-dependence. Even though his results were for the Senseair K30, they should translate well to the \kfr.

Another future challenge is to redesign and repeat all three calibration chamber experiments and evaluate if indeed LACAS shows contradicting results to the ones found by Martin et al \cite{21}. The experiment repetition will be particularly important for relative humidity effects. The choice to have two LACAS scoops inside the chamber at the same time, to reduce the total calibration time, may have overwhelmed the calibration chamber's capacity to ensure a homogenous volume.

The future also holds a few choices for the development directions of UAS \co\ measurements. During the development of LACAS two new prototypes for NDIR sensors were being developed and perfected. The first is the ADMONT, also by Senseair. The second is the prototype developed by Dr. Ru-Shan Gao, Dr. Cory Dixon, and Dr. Troy Thornberry at the NOAA UAS program. The possibility of integrating the NOAA \co\ prototype with the LACAS autopilot library creates a unique opportunity for adaptive sampling for plume tracking in wild fire research. In summary, there is a lot of work to be done. This thesis represents the first step in a long research road.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% BIBLIOGRAPHY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
\singlespacing

\bibliographystyle{ieeetr}
\bibliography{Xbib}
}
\end{document}
