scieee AI-readable full text Open interactive document viewer

Advances in Gas Sensing and Mapping for Mobile Robotics

González-Monroy, Javier

Abstract

Esta tesis aborda el problema de la detección, cuantificación y mapeo de sustancias olorosas empleando un robot móvil equipado con una nariz electrónica. En robótica móvil se emplean los sistemas de muestreo abierto (Open Sampling Systems - OSS), los cuales están caracterizados por introducir importantes fuentes de incertidumbre en las medidas de gases obtenidas. Estas fuentes de incertidumbre se deben principalmente a los mecanismos de dispersión de los gases y al comportamiento dinámico de los sensores de gas, los cuales complican en gran medida las tareas de detección de gases con robots móviles. En esta tesis se proponen contribuciones en tres sub-áreas de la robótica móvil olfativa. Referente a la detección de sustancias olorosas en OSS, y especialmente enfocando a paliar el problema de la lenta recuperación de los sensores basados en tecnología de óxido de metal (Metal Oxide Semiconductor - MOX), se proponen dos contribuciones: un nuevo diseño de nariz electrónica (Multi Chamber Electronic Nose - MCE-nose) y un enfoque basado en el modelado dinámico de estos sensores. Referente a la cuantificación de gases, se propone un novedoso enfoque probabilístico el cual permite la estimación de la concentración del gas junto con su incertidumbre asociada, algo imprescindible para aplicaciones de robótica olfativa. Finalmente, relacionado con el estudio de la distribución espacial de los gases, esta tesis contribuye con la propuesta de un método probabilístico para la generación de mapas de gas. Este novedoso método permite, por primera vez, considerar tanto los obstáculos presentes en el entorno, como el envejecimiento (factor temporal) de las medidas de gas.

Full text

Doctoral Dissertation Advances in Gas Sensing and Mapping for Mobile Robotics Javier González Monroy 2013 Tesis doctoral Dpt. de Ingeniería de Sistemas y Automática Universidad de Málaga AUTOR: Javier González Monroy EDITA: Publicaciones y Divulgación Científica. Universidad de Málaga Esta obra está sujeta a una licencia Creative Commons: Reconocimiento - No comercial - SinObraDerivada (cc-by- nc-nd): Http://creativecommons.org/licences/by-nc-nd/3.0/es Cualquier parte de esta obra se puede reproducir sin autorización pero con el reconocimiento y atribución de los autores. No se puede hacer uso comercial de la obra y no se puede alterar, transformar o hacer obras derivadas. Esta Tesis Doctoral está depositada en el Repositorio Institucional de la Universidad de Málaga (RIUMA): riuma.uma.es UNIVERSIDAD DE MÁLAGA DEPARTAMENTO DE INGENIERÍA DE SISTEMAS Y AUTOMÁTICA El Dr. D. Javier González Jiménez y el Dr. D. Jose Luis Blanco Claraco, directores de la tesis titulada ”Advances in Gas Sensing and Mapping for Mobile Robotics” realizada por D. Javier González Monroy, certifican su idoneidad para la obtención del título de Doctor en Ingeniería Mecatrónica. Málaga, 4 de Septiembre de 2013 ——————————————– Dr. D. Javier González Jiménez ——————————————— Dr. D. Jose Luis Blanco Claraco Dept. of System Engineering and Automation University of Málaga Studies in Mechatronics Advances in Gas Sensing and Mapping for Mobile Robotics AUTHOR: Javier González Monroy SUPERVISORS: Javier González Jiménez Jose Luis Blanco Claraco Thesis defended on 20th November 2013 JURY: Achim Lilienthal (Örebro University, Sweden) Lino Marques (Coimbra University, Portugal) Santiago Marco (IBEC Barcelona, Spain) Juan Antonio Fernandez Madrigal (Malaga University, Spain) Alfonso García Cerezo (Malaga University, Spain) Acknowledgements First, I would like to express my deep gratitude to my supervisors Prof. Dr. Javier González Jiménez and Dr. Jose Luis Blanco Claraco for giving me the opportunity to join the Machine Perception and Intelligent Robotics Group (MAPIR) at the department of System Engineering and Automation (ISA) at Málaga University. I am also indebted to them for the uncountable hours we have spent together discussing about the different research topics and guiding me through the difficult art of writing scientific papers. I am also grateful to the committee members for having accepted to review this thesis, and to Dr. Patrick P. Neumann and Dr. Marco Trincavelli for their valuable comments and suggestions to improve the quality of this thesis. Naturally, a research project like this thesis would not have been possible without the great team of people in our lab. Thanks to Raul Ruiz, Ana Gago, Eduardo Fernandez, Francisco Moreno, Mariano Jaimez, Francisco Melendez, Carlos Sánchez, Manuel Lopez and Emil Khatib for being very good friends. Most of the highlights of this last four years would not have happened without them: thank you all for the good moments at work that made it a comfortable place to stay. My gratitude goes also to the senior researchers at MAPIR, in particular to Vicente Arevalo and Cipriano Galindo, for sharing their knowledge and expertise. During spring 2011 I visited the MR&O lab at the AASS Örebro University. I would like to thank Prof. Achim J. Lilienthal for giving me the opportunity of visiting his team, a group of wonderful and talented people. Special thanks goes for Dr. Marco Trincavelli, who invested a lot of time for helping me with suggestions and fruitful discussions. I also thank the other members of the lab and researchers I had the opportunity to meet there, for being not only colleagues but also good friends. I would like to acknowledge my close friends Zape, Andrés and Mari for the wonderful and fantastic weekends spent together at Sierra Nevada, Pyrenees, or sharing environmental volunteering activities at my village. They shared with me not only their passion and respect for nature and sport, but taught me a different way to look at everyday life, something that has been of great help along these years of hard research. Finally, I feel extremely grateful to my family, which has always supported me not only materially but more importantly, believing in me and inspiring me throughout this research career. Last but not least, I am completely indebted to Alex, who always encouraged me in the hardest moments. Yours is the warmest thank you. i Table of Contents Table of Contents iii Resumen de la Tesis Doctoral 1 1 Introduction 13 1.1 Scope .................................. 14 1.2 Contributions of this thesis . . . . . . . . . . . . . . . . . . . . . . . 16 1.3 Framework of this thesis . . . . . . . . . . . . . . . . . . . . . . . . 18 1.4 Structure of this thesis . . . . . . . . . . . . . . . . . . . . . . . . . 19 2 On technology and applications of mobile robotics olfaction 21 2.1 Electronicnoses............................. 21 2.2 Gas sensor technologies . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.1 Semiconducting metal oxide gas sensor . . . . . . . . . . . . 23 2.2.2 Photo ionization detector . . . . . . . . . . . . . . . . . . . . 24 2.2.3 Surface acoustic waves . . . . . . . . . . . . . . . . . . . . . 24 2.2.4 Conductive polymer sensors . . . . . . . . . . . . . . . . . . 25 2.3 Gas dispersal in natural environments . . . . . . . . . . . . . . . . . 25 2.4 Mobile Robotics Olfaction . . . . . . . . . . . . . . . . . . . . . . . 27 2.4.1 Gas source localization . . . . . . . . . . . . . . . . . . . . . 27 2.4.2 Trailfollowing ......................... 30 2.4.3 Gas distribution mapping . . . . . . . . . . . . . . . . . . . . 31 2.4.4 Gas discrimination . . . . . . . . . . . . . . . . . . . . . . . 33 3 Improving MOX-based gas sensing for mobile robots 35 3.1 Introduction............................... 36 3.2 On the importance of the e-nose long recovery time in mobile robotics olfaction................................. 38 3.3 The multi-chamber electronic nose - an improved olfaction sensor for mobilerobotics ............................. 40 3.3.1 Mechanical design . . . . . . . . . . . . . . . . . . . . . . . 40 3.3.2 Electronics ........................... 44 iii 4CONTENTS • ¿Cómo pueden obtenerse valores absolutos de concentración de gas a partir de la respuesta de sensores basados en tecnología MOX cuando son utilizados en entornos reales? Este tema se abordada en el Capítulo 4, empleando Procesos Gaussianos (Gaussian Processes - GP) para obtener una estimación de la distribución a posteriori de la concentración del gas dada la respuesta de un conjunto de sensores MOX. Adicionalmente, se presentan dos propuestas para considerar de forma automática la dinámica de los sensores MOX en el proceso de cuantificación, analizando de forma detallada su relevancia en la mejora de la precisión. Este enfoque probabilístico es especialmente conveniente para aplicaciones de robótica móvil olfativa, ya que de la distribución a posteriori de la concentración del gas se pueden obtener intervalos de confianza. De entre las diferentes tareas olfativas a realizar por un robot móvil, esta tesis se centra en la construcción de mapas de distribución de gas, que aborda el problema de estimar la distribución espacial de sustancias volátiles haciendo uso de un robot móvil equipado con una nariz electrónica. Teniendo en cuenta el hecho físico de que la información proporcionada por los sensores de gas se desvanece con el tiempo debido primeramente a la naturaleza volátil de los gases, pero también a los mecanismos de transporte turbulentos que dominan la dispersión de estos, se plantean las dos siguientes cuestiones: • ¿Cómo puede tenerse en cuenta el hecho de que los gases se desvanecen con el tiempo en la estimación de su distribución (GDM)? • Dado que estamos interesados en trabajar en ambientes reales dónde la presencia de obstáculos influye en la distribución de los gases, ¿puede este proceso de construcción de mapas de olor tenerlos en cuenta? Estas cuestiones se abordan en el Capítulo 5 donde se propone un nuevo enfoque a la construcción de mapas de distribución de gas basado en Gaussian Markov-Random Fields (GMRF). Este novedoso método no sólo atiende al "envejecimiento" de las observaciones de gas, sino que también considera la presencia de obstáculos en el entorno de trabajo. Diversos experimentos, tanto simulados como reales, validan este enfoque, proporcionando una comparación cualitativa y cuantitativa con métodos existentes. Contribuciones Las aportaciones más relevantes de esta tesis son: • El diseño e implementación de una novedosa nariz electrónica basada en tecnología MOX para la detección de cambios rápidos en la concentración de CONTENTS 5 sustancias olorosas. Resultado de este trabajo son una patente y diversas publicaciones [49, 50, 51]. • El desarrollo de un nuevo modelo de sensor MOX [38], el cual mitiga considerablemente una de sus principales limitaciones cuando se emplea junto a un robot móvil: el largo tiempo de recuperación. • La introducción de un nuevo método probabilístico para la cuantificación de gases con una nariz electrónica basada en sensores MOX. Este método permite obtener valores de concentración absolutos junto con una medida de la incertidumbre (intervalos de confianza), algo que representa un avance importante para las aplicaciones de olfato con robots móviles. Las siguientes publicaciones han surgido de este trabajo [39, 40]. • El desarrollo de un novedoso método probabilístico para la creación de mapas de distribución de gases basado en campos aleatorios de Markov Gaussianos (GMRF). Este método tiene en cuenta por primera vez dos aspectos fundamentales: primero la inclusión de los obstáculos presentes en el entorno de trabajo, obteniendo mapas que son más coherentes con los mecanismos de dispersión del gas; y segundo, la consideración de la "edad" de las observaciones como una medida del desvanecimiento de los gases en entornos reales. • La colaboración en el diseño y desarrollo de un entorno de simulación para aplicaciones olfativas con robots móviles [36]. Todas las publicaciones derivadas de esta tesis están disponibles en: http:// mapir.isa.uma.es Marco de esta tesis Esta tesis es el resultado de cuatro años de actividad investigadora de su autor como miembro del grupo de investigación MAPIR, el cual forma parte del departamento de Ingeniería de Sistemas y Automática de la Universidad de Málaga. La financiación de este periodo de investigación ha sido proporcionada por la Junta de Andalucía y el Fondo Europeo de Desarrollo Regional (FEDER) en el marco del proyecto TEP- 2008-4016. Dicho proyecto abordaba el problema de dotar a un robot móvil con la capacidad olfativa para poder reconocer y estimar la concentración de sustancias olorosas. Uno de los puntos más importantes de este proyecto era la combinación de la información obtenida mediante sensores de gas, con otras modalidades sensoriales tales como cámaras o escáneres láser para alcanzar dicho objetivo. Las múltiples modalidades de sensores incorporados en el robot Rhodon a lo largo de sus diferentes etapas de desarrollo (véase Apéndice A), son un claro ejemplo de este compromiso. 6CONTENTS El autor completó el programa de doctorado titulado Ingeniería Mecatrónica, coordinado por el departamento de Ingeniería de Sistemas y Automática. Este programa de doctorado otorgó al autor por un lado una visión general del campo multidisciplinario de la mecatrónica, el cual combina las ingenierías mecánica, electrónica, de control e informática, y por otro lado, un conocimiento más profundo sobre el campo de la robótica móvil, algo que ha resultado fundamental a lo largo de estos años de investigación. Además, el autor complementó su formación académica con la participación en un curso intensivo de invierno (2012), titulado "Análisis de datos, robótica y aplicaciones móviles de sensores químicos" organizado por la Sociedad Internacional para el Olfato y Detección Química (ISOCS), y con una estancia de tres meses en el Centre for Applied Autonomous Sensor Systems (AASS), de la universidad de Orebro (Suecia), junto al grupo de robótica móvil y olfato (MR&O group). Durante dicha estancia, la temática de investigación se centró en el estudio de los sensores MOX y particularmente en cómo obtener valores absolutos de concentración a partir de su respuesta transitoria. Resultados obtenidos durante este período han sido incluidos en el Capítulo 4 de esta tesis. Asimismo, durante el transcurso de esta tesis han surgido colaboraciones con otros grupos de investigación internacionales que han enriquecido y ampliado el alcance de la misma. Ejemplos son las colaboraciones con el Prof. Michael Biehl de la Universidad de Groningen (Países Bajos) y con el Dr. Frank-Michael Scheif del centro tecnológico de excelencia de interacción cognitiva (CITEC) de la Universidad de Bielefeld (Alemania), trabajando en el desarrollo de algoritmos de clasificación de olores para sistemas de muestreo abierto (open sampling systems – OSS). Aunque los resultados de dicha colaboración han sido presentados, no se encuentran publicados en el momento en que esta tesis ha sido escrita, por lo tanto, sólo los datos que se recogieron como parte de esta colaboración se presentan en el Apéndice C. Por último, destacar que el marco científico en el que se encuadra esta tesis se caracteriza por la pequeña comunidad científica dedicada a esta temática. Esto es corroborado por los escasos congresos y revistas internacionales, así como por los pocos grupos de investigación dedicados al olfato con robots móviles. Sin embargo, es opinión del autor que el rápido progreso de la robótica móvil, junto con los continuos avances en la tecnología de detección de gases, permitirán en un futuro cercano hacer uso de todo el potencial que un robot móvil equipado con la capacidad de oler posee. Estructura de la tesis Con el objetivo de obtener la mención de Doctorado Internacional por la universidad de Málaga, el desarrollo completo de esta tesis está escrito en español e inglés. Así, el texto está dividido en dos partes. La primera parte, escrita en español, describe de forma resumida el contenido del trabajo, mientras que en la segunda parte, redac- CONTENTS 7 tada íntegramente en inglés, se presenta una descripción completa del mismo. Esta segunda parte se compone de los siguientes capítulos: El Capítulo 1 introduce la temática de esta tesis y provee una visión general de las contribuciones, del ámbito y de la estructura de la misma. El Capítulo 2 introduce de forma general al campo del olfato artificial y la tecnología de narices electrónicas, así como los principales campos de aplicación de un robot móvil con capacidad olfativa. En la primera parte de este capítulo se aborda el concepto de nariz electrónica y se describen las principales tecnologías de sensores de gas. En la segunda parte se revisan los mecanismos físicos que controlan la dispersión de los gases en ambientes reales, y se detallan los principales campos de aplicación de un robot móvil con la capacidad de detectar y medir diferentes sustancias olorosas: localización de fuentes de gas, seguimiento de caminos y construcción de mapas de distribución de gas. El Capítulo 3 presenta dos enfoques para mejorar la detección de sustancias volátiles con sensores de gas basados en tecnología MOX (metal oxido semiconductor) en el ámbito de la robótica móvil. El primer enfoque detalla el diseño y la configuración de un nuevo dispositivo de nariz electrónica denominado nariz electrónica de múltiples cámaras (Multi Chamber E-nose – MCE-nose), mientras que el segundo enfoque aborda el uso de un modelo doble de primer orden del sensor MOX para anticipar valores estacionarios de la respuesta del sensor a partir de medidas transitorias. Ambos enfoques son validados a través de diferentes experimentos, demostrando la mejora en el desarrollo de las tareas olfativas con robots móviles. El Capítulo 4 presenta un nuevo algoritmo probabilístico basado en procesos Gaussianos para la cuantificación de sustancias volátiles empleando un conjunto de sensores de gas MOX. La primera parte de este capítulo se centra en la matemática subyacente y describe el uso de la herramienta de determinación automática por relevancia (ARD) para seleccionar las características más relevantes de la matriz de sensores. La segunda parte se enfoca en los mecanismos de validación empleados y en las diferentes configuraciones experimentales, mostrando una atención especial a la introducción de la dinámica de los sensores MOX en el proceso de cuantificación. El Capítulo 5 aborda una tarea importante de la robótica móvil olfativa: la estimación de la distribución espacial de sustancias volátiles. Este capítulo propone un nuevo método basado en campos aleatorios de Markov Gaussianos (GMRF) para hacer frente a dos problemas fundamentales que no se han tenido en cuenta en enfoques anteriores: la presencia de obstáculos en la zona inspeccionada, y la combinación de las medidas de los sensores de gas tomadas en diferentes instantes de tiempo. Resultados cuantitativos y cualitativos completan este capítulo, así como una comparación detallada con métodos existentes. 8CONTENTS El Capítulo 6 concluye esta tesis, proporcionando un resumen del trabajo presentado y dando una visión de cómo las técnicas y avances propuestos pueden ser extendidos en un futuro. Conclusiones En esta tesis se ha abordado el problema de la detección y cuantificación de gases con un robot móvil, y particularmente la construcción de mapas de distribución de gas. En aplicaciones de robótica móvil, los sensores de gas se emplean generalmente en configuraciones llamadas de muestreo abierto (Open Sampling Systems - OSS). Bajo esta configuración, los sensores son directamente expuestos al medio ambiente, sin disponer de dispositivos para el control del flujo de aire, tiempos de exposición o condiciones ambientales (temperatura, humedad, etc.). Esto permite obtener información muy valiosa acerca de la dinámica de la interacción entre los sensores y los gases a analizar, algo que no se puede lograr con un sistema de muestreo cerrado. No obstante, debido también a esa exposición directa, las medidas se ven fuertemente condicionadas por los mecanismos físicos de dispersión de los gases: difusión y advección. La difusión desempeña por lo general un papel mucho menos importante en la dispersión de las moléculas olorosas, incluso en ambientes cerrados sin ventilación, siendo la advección (generalmente de carácter turbulento) la que domina este proceso. Como consecuencia, la distribución espacial de un gas resulta ser generalmente irregular y caótica, y donde además la ubicación de la fuente del gas no se encuentra por lo general en el punto de máxima concentración. Aparte de las dificultades derivadas de los mecanismos de dispersión, una serie de limitaciones en el desarrollo de aplicaciones olfativas con robots móviles vienen impuestas por la actual tecnología de sensores para la detección de gases. Inconvenientes como la falta de selectividad o la lenta recuperación, hacen aún más difícil el desarrollo de robots capaces de llevar a cabo tareas como la localización de una fuente de gas o la estimación de su distribución espacial de forma autónoma. A lo largo de esta tesis, la tecnología mayormente empleada ha sido la basada en la unión de metal, óxido y semiconductor (MOX), debido principalmente a su alta sensibilidad, amplia disponibilidad comercial y bajo coste. Dos enfoques para paliar en cierta medida uno de sus principales inconvenientes (el largo período de recuperación), fueron propuestos en el Capítulo 3 de la presente tesis. Este largo período de recuperación (hasta decenas de segundos) limita notablemente su aplicabilidad en aplicaciones donde el sensor está expuesto a rápidos cambios en la concentración del gas, como es el caso de las aplicaciones de robótica móvil olfativa. Dicho efecto es particularmente notable en las fases de recuperación, cuando la respuesta del sensor retorna lentamente al nivel de reposo tras haber sido expuesto al gas. Consecuencia directa es la ausencia palpable de valores estacionarios en la respuesta de los sensores CONTENTS 9 MOX, siendo necesario por tanto la detección y cuantificación de gases empleando medidas pertenecientes al transitorio de las señales. El primer enfoque sugerido para paliar los efectos de la lenta recuperación de los sensores MOX, se ha basado en la introducción de la nariz electrónica de múltiples cámaras (MCE-nose). Esta novedosa nariz electrónica acomoda conjuntos redundantes de sensores en diferentes cámaras, las cuales alternan entre los estados de detección (cuando la cámara es expuesta al gas) y recuperación (cuando por ella circula aire limpio). En cada instante de tiempo, tan solo una de esas cámaras se encuentra en el estado de detección. La clave de su funcionamiento se basa descartar las medidas de los sensores cuando se detecta el comienzo de una fase de recuperación, delegando la tarea de detección a otra cámara que contenga sus sensores en estado de reposo. Siguiendo este procedimiento, la salida global de la MCE-nose viene dada por la concatenación de las fases de subida de una secuencia de sensores MOX. Aumentar el número de cámaras aumenta indudablemente la posibilidad de disponer un conjunto de sensores en el estado de reposo y, en consecuencia, la posibilidad de detectar cambios más rápidos en la concentración del gas objetivo. Sin embargo, mayor coste, consumo de energía y complejidad son también consecuencias directas de ello, por lo tanto el número óptimo de cámaras depende en gran medida de las características de la aplicación objetivo. En esta tesis, un prototipo de la MCE-nose compuesto de cuatro cámaras ha sido construido e integrado en una plataforma móvil bajo la arquitectura robótica OpenMORA. Además de la validación haciendo uso de entornos simulados, se han presentado varios experimentos reales que corroboran la mejora en la detección de cambios bruscos en la concentración de gases. Finalmente, y a través de esos experimentos, se encontró que aunque pequeñas, las diferencias en los sensores redundantes alojados en las diferentes cámaras (del mismo fabricante y modelo), influyen en el comportamiento de la MCE-nose. Estas diferencias, que se deben no solo al proceso de fabricación, sino también el envejecimiento y al envenenamiento (reacciones químicas que alteran las características de un sensor de forma permanente), requieren por tanto de una calibración previa del sistema para lograr resultados adecuados. En contraste con la introducción de la MCE-nose, el segundo enfoque, propuesto en la Sección 3.4, compensa la lenta dinámica de los sensores MOX estimando los correspondientes valores estacionarios a partir de una secuencia de medidas transitorias. En general, los modelos de sensor MOX propuestos en la literatura tratan de predecir su respuesta (valores de resistencia) cuando se expone a un cierto perfil de concentración de gas. Este segundo enfoque se inspira en la inversión de dicho modelo: dada una secuencia de medidas de la respuesta transitoria del sensor MOX, se predice el perfil de concentración del gas que ha producido dicha respuesta mediante la estimación de los valores estacionarios de la resistencia del sensor. El modelo empleado en esta tesis se basa en dos sistemas de primer orden (excitación y recuperación) con constantes de tiempo que dependen de la amplitud de respuesta del sensor. Diferentes experimentos han sido presentados para validar dicho enfoque. En primer lugar, y bajo condiciones de laboratorio en la que se controlaron los flujos de aire y la distribución de los gases, un experimento consistente en exponer periódi- 10 CONTENTS camente una nariz electrónica a una fuente de gas permitió la validación de este enfoque. A continuación, se consideraron dos experimentos de construcción de mapas de distribución de gas (1D y 2D) para enfatizar la aplicabilidad de dicho modelo en aplicaciones de olfato con robots móviles. Con estos experimentos se demostró cómo las "largas colas" producidas por la lenta recuperación de los sensores pueden ser evitadas, algo que conlleva implícitamente una mejora significativa en la detección de gases con estos sensores. No obstante, la mejora introducida por este enfoque no se debe solamente a que se previene la superposición entre las fases de excitación y recuperación (producidas cuando los cambios en la concentración del gas son más rápidos que el tiempo de respuesta del sensor), sino al hecho de que el perfil de concentración estimado por el modelo proporciona valores más consistentes con la excitación real que cuando tan solo se observa la respuesta del sensor. Además, se demostró que ambos enfoques, tanto la MCE-nose como el modelo inverso del sensor MOX, permiten un aumento considerable en la velocidad a la que una base móvil equipada con una nariz electrónica puede inspeccionar el entorno. Esto último conlleva en general una importante reducción en los tiempos de ejecución de las tareas relacionadas con el olfato. En robótica móvil, muchas de las tareas relacionadas con el olfato requieren poder determinar la concentración de los gases que se están analizando. Ejemplo de ello son las especificaciones legales y reglamentos de seguridad relacionados con los niveles de toxicidad, los cuales vienen definidos en términos de concentraciones absolutas. Además, atendiendo a la naturaleza caótica que domina la dispersión de los gases, es deseable proporcionar, junto con la estimación del valor de concentración, una estimación de la incertidumbre asociada. Este problema fue abordado en el Capítulo 4, donde se presentó una propuesta de aprendizaje supervisado basada en procesos Gaussianos (GP). El problema fue tratado desde un punto de vista probabilístico, estimando una distribución a posteriori sobre la concentración de gas, dada la respuesta de una matriz de sensores MOX. Esto permite no sólo predecir la concentración de gas, sino también la incertidumbre asociada por medio de la varianza de la distribución. Diferentes configuraciones de la matriz de sensores MOX fueron estudiadas, así como la consideración de herramientas para la determinación automática de la relevancia para excluir del proceso de cuantificación los sensores menos relevantes, reduciendo así la dimensionalidad del problema. Por último, se analizaron dos propuestas para introducir la dinámica de la respuesta de los sensores MOX en el proceso de cuantificación: considerar adicionalmente muestras retrasadas en el tiempo (efecto memoria), e incluir la primera derivada de la respuesta de la matriz de sensores. Resultados experimentales demostraron, sin embargo, que ninguna de las dos propuestas producía una mejora significativa. Habiendo dedicado la primera parte de esta tesis al estudio y la investigación de lo que se pueden considerar problemas a bajo nivel, el resto de la misma ha sido consagrada al estudio de una tarea de alto nivel dentro de la robótica olfativa: la construcción de mapas de distribución de gas (GDM). Desde la perspectiva de la robótica móvil, GDM aborda el problema de la estimación de la distribución espacial de sustancias volátiles utilizando un robot móvil equipado con una nariz electrónica. En CONTENTS 11 el Capítulo 5 de esta tesis, se presentó un nuevo algoritmo para la construcción de estos mapas de distribución de gas. El problema se abordó desde una perspectiva probabilística, modelando la estimación de la distribución espacial del gas como el cálculo del máximo a posteriori (MAP) sobre un campo aleatorio de Markov Gaussiano (GMRF). Este nuevo método incorporó por primera vez dos aspectos fundamentales que habían sido obviados anteriormente. El primero, relacionado con la validez de las observaciones de gas con el paso del tiempo, viene determinado por la naturaleza efímera de los olores y por el consiguiente hecho de que la información aportada por una observación de gas se desvanece con el tiempo. Para modelar este hecho se introdujo un factor decreciente con el tiempo como medida de la "edad" de cada observación de gas. Cuando dicho factor alcanza un valor suficientemente bajo (observación antigua) la observación asociada deja de tener validez y por tanto es descartada del proceso. La segunda novedad introducida es la de considerar obstáculos tales como paredes o muebles en el proceso de construcción del mapa de olores. Para ello, se propuso modelar la correlación entre celdas vecinas atendiendo a la presencia de estos obstáculos, así, por ejemplo, la concentración de gas de dos celdas que están separadas por una pared son consideradas independientes. Resultados experimentales, tanto simulados como reales, han sido propuestos, proporcionando una comparación detallada con métodos existentes. Líneas futuras Además de las propuestas para el trabajo futuro incluidas en los diferentes capítulos de esta tesis, una línea general de continuación del trabajo presentado en esta tesis estaría relacionada con la integración de los avances propuestos en esta tesis, en el campo de la robótica de servicio aplicada a los hogares. La robótica de servicio es actualmente un nicho de mercado en auge debido a los continuos avances en el campo de la robótica (SLAM, navegación autónoma, semántica, etc.) y a la mayor disponibilidad de robots comerciales. Sin embargo, dado que el olfato artificial aún se encuentra en sus primeras fases de desarrollo comercial, la mayoría de los robots comerciales aún no incorporan dispositivos de detección de gases. Se prestará especial cuidado a la colaboración activa entre el olfato y otras modalidades sensoriales, ya que para la mayoría de las aplicaciones reales de robótica el olfato no es por sí mismo el objetivo final, sino uno más de los sentidos del robot para obtener información útil del entorno que le rodea. Chapter 1 Introduction Smell is a very direct sense. In order for us to smell something, molecules from that thing have to make it to our nose. Everything we smell, therefore, is giving off molecules - whether it is a cake in the bakery, perfume, a piece of rotten fruit at the bottom of your fridge or a butane leak underneath the stove. Those molecules are generally light, volatile (easy to evaporate), chemicals that float through the air into our nose. The ability to detect chemicals in the environment is so basic and so important that every organism from single-celled amoebas to human beings are endowed with some kind of chemical awareness. All species use their chemical senses for the most basic and fundamental behavior: approaching and being attracted to pleasant and potentially safe aromas, as well as avoiding and being repelled by unpleasant or potentially harmful ones. Humans breathe, on average, 20,000 times a day [13]. With each breath, we inhale a general mixture of nitrogen, oxygen, argon and carbon monoxide, but also many other gases at lower concentrations, some of them which may be toxic [14]. It is said that humans can distinguish more than 10,000 different smells (odorants), which are detected by specialized olfactory receptor neurons lining the nose [3]. Despite this stunning quantity, there is a considerable variety of toxic gases, found not only in industrial environments but also in nature, which are odorless and generally colourless to humans. The presence of these contaminants and the potential risk they bear to human health, together with the economical interest of the perfume and food industries (especially for the quality control process) are the major motivations that have boosted the development of artificial olfaction. Devices called electronic noses or e-noses made their debut in the 1980’s with the challenge of distinguish a variety of odors using an array of gas sensors together with pattern recognition techniques [120, 119]. Since that debut, advances in electronics and sensor technologies have made possible the manufacturing of compact e-noses, enabling their integration into platforms such as mobile robots or intelligent appliances. 13 Chapter 2 On technology and applications of mobile robotics olfaction This chapter provides an overview of electronic olfaction and electronic nose technology, with especial interest in their applicability to mobile robots. The chapter summarizes the concept of electronic nose and devises relevant aspects of the most common gas sensor technologies. Then, it reviews the mechanisms of gas dispersal in natural environments to end with a review of the four main odorrelated tasks of mobile robotics olfaction. 2.1 Electronic noses A general accepted definition for an electronic nose was proposed by Gardner et al. [44], after refining the initial concept introduced by Persaud et al. [120] in the early 1980’s. According to this definition: "An electronic nose is an instrument which comprises of an array of electronic chemical sensors with partial specificity and an appropriate pattern recognition system, capable of recognising simple or complex odors." (Gardner, [44]). This "electronic nose" term is rather general and consequently may lead to confusion or misleading. In short, an electronic nose is a device designed to artificially 21 22 CHAPTER 2. ON TECHNOLOGY AND APPLICATIONS OF MOBILE ROBOTICS OLFACTION mimic the animal sense of smell by providing an analysis of chemical mixtures. It works as a non-separative mechanism: i.e. an odor is perceived as a global fingerprint, a signal pattern that is used to characterize it. This pattern is formed by collecting the signal response from each sensor in the array. The absorption of volatile molecules causes physical changes of the sensor, which are measured as electrical signals to compose the fingerprint. In most electronic noses, each sensor is sensitive to a broad range of volatile molecules (low selectivity), but each in their specific way. Thus, the degree of selectivity and the type of odors that can be detected largely depend on the choice and number of sensors in the array. 2.2 Gas sensor technologies According to the transduction principle applied, gas sensors can be classified into the following families: thermal, mass, electrochemical, and optical [72]. Thermal sensors use the heat generated by the chemical reaction between the analyte and the sensor as the source of analytical information. The general strategy is to place the chemically selective layer on top of a thermal probe and measure the heat evolved in the specific chemical reaction taking place in that layer. For mass sensors, the transduction principle is the detection of the change of mass through the variation in behavior of some oscillator, usually piezoelectric crystals. Change of mass accompanies many interactions of the chemical species with the sensor, thus, mass sensors represent an important segment of the chemical sensing field. However, electrochemical transducers are the largest and the oldest group employed for chemical sensors. This family includes potentiometric sensors, which measure voltage, amperometric sensors, which measure current, and conductometric sensors which measure conductivity. Finally, the measuring principle of optical gas sensors is based on the emission of electromagnetic radiation through the gas sample. Different chemical species exhibit absorption of such radiation at different regions of the electromagnetic spectrum. This property is the basis for their detection and measurement. Each of these sensor families has advantages and disadvantages over their counterpart and choosing the right technology strongly depends on the type of application. However, within the range of applications related to mobile robotics olfaction, there are a set of desired sensor properties: • High selectivity - It can be defined as the ability of a sensor to respond primarily to only one analyte in the presence of a mixture. Ideally, the reactive layer of the sensor should completely reject any interfering analyte, and respond exclusively to the desired one. • High sensitivity - Together with selectivity, they are possibly the most important issues in chemical sensing. Sensitivity is the amount of change in the measurable output magnitude per unit change in the volatile concentration. • Rapid response - In general, sensors do not change their output state immediately when a change in the analyte concentration occurs. Rather, they change 2.2. GAS SENSOR TECHNOLOGIES 23 over a period of time called the response time. This property is especially important when integrating gas sensors with mobile robots which are continuously inspecting an environment. Chapter 3 provides an exhaustive study of this property and its influence in the applicability to mobile robotics. • Robustness - Understood as stability of the sensor behavior under simultaneous changes in model parameters caused by humidity, temperature, or even physical motion. • Reliability - It can be defined as the ability of a system to perform and maintain its functions in routine circumstances. This property is closely related to the undesired drift, defined as "a gradual change in any quantitative characteristic that is supposed to remain constant" [155]. Thus, a drifting chemical sensor does not give exactly the same response even if it is exposed to exactly the same environment for a long time. There is no simple answer when looking for the best sensor because of the many different sensing situations and criteria that must be considered. Instead, a general precept must serve: the best sensor is the one that will do the job at a cost which justifies its use [72]. The cost must be viewed in terms of money, time, and ease of use. This is fully applicable to mobile robotics, particularly for out-of-the-lab applications. A complete survey of the different sensor technologies is out of scope of this thesis and therefore, only a brief overview of the most spread gas sensing technologies used in mobile robotics is provided in the following subsections. 2.2.1 Semiconducting metal oxide gas sensor Metal oxides (MOX) such as SnO2,ZnO,Fe2O3, and WO3are intrinsically semiconductors that at temperatures of 200 −500°C respond to reducible gases such as H2,CH4,CO,C2H5, or H2Sand increase their conductivity (conductometric family) [119]. Among the different semiconducting materials, SnO2doped with small amounts of impurities is the most widely employed for gas sensor fabrication. By changing the choice of impurity and operating conditions such as temperature (temperature modulation), many types of gas sensors can been developed. MOX competitive advantages include a good commercial availability, high sensitivity, an effective life span from three to five years, and low prices when compared with other sensing technologies. Additionally, they are usually small and light, which make them very appealing for mobile robotic applications. They present, however, different shortcomings, among others: • The need to be pre-heated at temperatures up to 200−500°C in order to facilitate the interaction with the target gas, which involves a relatively high power consumption. • Poor selectivity and relatively low robustness. 24 CHAPTER 2. ON TECHNOLOGY AND APPLICATIONS OF MOBILE ROBOTICS OLFACTION • The acquisition cycles are very long because of their slow response, especially when recovering to the baseline level after the exposure to the target gas ends [107]. This baseline level represents the sensor output in absence of target gases and varies with temperature, humidity and among sensors. These limitations come from the chemical mechanism underlying MOX sensors, related to the semiconductor behavior when exchanging oxygen molecules between the volatile and the MOX film [2, 135]. 2.2.2 Photo ionization detector A Photo Ionization Detector (PID) is a gas detector that is able to measure the concentration of a variety of volatile organic compounds (VOCs) by using photo ionization. This process occurs when an atom or molecule absorbs "light" of sufficient energy to cause an electron to leave and create a positive ion. The PID is comprised of an ultraviolet lamp that emits photons that are absorbed by the compound in an ionization chamber. Ions (atoms or molecules that have gained or lost electrons and thus have a net positive or negative charge) produced during this process are collected by means of an electric potential difference between electrodes. The current generated provides then a measure of the analyte concentration. Because only a small fraction of the analyte molecules are actually ionized, this method is considered nondestructive. The principal advantage of PIDs compared with MOX sensors is that concentration measurements are almost immediate, that is, PIDs have a very short response time, making them well-suited for mobile robotics applications where fast changing gas concentrations are expected to be faced. However, as stand alone detectors PIDs are not selective; that is, they ionize everything with an ionization energy less than or equal to the lamp output. The latter additionally involves that only analytes which have ionization energies similar to or lower than the energy of the photons produced by the PID lamp will be detected. 2.2.3 Surface acoustic waves Acoustic Wave (AW) gas sensors, also known as Quartz Crystal Microbalance (QCM) gas sensors, are devices that weigh gas molecules (mass sensors family) by measuring the change in frequency of a quartz crystal resonator [131]. The frequency of oscillation of the quartz crystal is partially dependent on the thickness of the crystal. As gas molecules are deposited on the surface of the crystal, the thickness increases; consequently the frequency of oscillation decreases from the initial value. By applying different chemical coatings to the crystal, the QCM sensor can be made responsive to different volatiles. Due to this dependency between thickness and frequency, QCM sensors are sometimes termed as thickness-shear resonators. Between the different modalities of AW sensors, surface acoustic waves (SAW) sensors make use of the fact that the amplitude of an acoustic wave propagating along the surface of a solid material decays rapidly, typically exponentially with the depth 2.3. GAS DISPERSAL IN NATURAL ENVIRONMENTS 25 of the material. SAW devices typically apply an alternating electric field to a piezoelectric material covered with a thin film, to generate a SAW. The mass of the film temporarily increases as molecules of the target gas are absorbed, perturbing the propagation of the acoustic waves. This causes a shift in resonance to a slightly lower frequency and thus information about the gas concentration can be obtained. A more detailed description is given by Gardner and Bartlett in [44]. The main advantages of this sensing technology are the low power consumption, the possibility to control the selectivity over a wide range, long term stability, long lifetime and a rapid response. The latter is especially important for applications on mobile systems, requiring in general a shorter recovery time than MOX gas sensors [81]. Disadvantages include comparatively low sensitivity to the target gas and limited robustness to variations in humidity and temperature. 2.2.4 Conductive polymer sensors The term polymer derives from the ancient Greek word polus, meaning many/much and meros, meaning parts. It refers to a molecule whose structure is composed of multiple repeating units (monomers), with the characteristic property of having a large molecular mass when compared to small molecule compounds. This large mass produces unique physical properties which make polymers an appealing material for sensor fabrication. Conducting polymers (CP) are a popular sensing technology that is based on measuring the resistance of a thin film polymer. The sensing mechanism is similar to this of MOX gas sensors except because a thin polymer film is used instead of a semiconductor material. The response given by the sensor is created by a chemical reaction that occurs on the surface of a polymer placed between two electrodes. Since the conductivity of pure conducting polymers is rather low, a doping process is usually necessary. The concept of doping is the central theme which distinguish conductive polymers from all other polymers [97]. When the doped polymer comes into contact with particular gases, carriers on the polymer chain become mobile and produce an electrical conductivity which is then measured as the sensor response. In comparison with MOX gas sensors, polymers can operate at room temperatures (with the consequent energy savings), they show a good sensitivity to a wide variety of organic compounds (but approximately one order of magnitude lower than the MOX sensors [81]), and have short time responses. 2.3 Gas dispersal in natural environments Far from the complex laboratory setups which use sophisticated sampling systems to keep constant along the olfaction process parameters such as air flow, temperature, humidity and analyte concentration, in most real-world applications, and particulary in mobile robotics, gas sensors are directly exposed to the environment to be analyzed with no control at all. This leads to additional sources of uncertainty, mainly due to 26 CHAPTER 2. ON TECHNOLOGY AND APPLICATIONS OF MOBILE ROBOTICS OLFACTION 0 20 40 60 80 100 x (cm) 20 0 -20 y (cm) 0,001 0,01 0,1 Figure 2.1: Sample of a instantaneous concentration field (figure taken from Webster et al. [154]). The chemical source is located at coordinates (0,0) releasing the gas into a turbulent stream flowing in the positive x-direction. the mechanisms that rule the dispersal of gases in natural environments: diffusion and turbulent advection. Diffusion, from Latin "diffundere", means "to spread out". This process causes mass transport without requiring bulk motion. Diffusion can be considered as a result of the "random walk" [74] of particles which are self-propelled by thermal energy. The rate of this movement is a function of temperature, viscosity of the fluid and the size (mass) of the particles. Although diffusion is present under almost all circumstances (as long as the temperature is over the absolute zero), in natural environments advective flow [137] is the process that dominates the dispersal of gases. In average, the diffusion length of typical gas molecules for one hour is only 20 cm, while in both outdoor and indoor environments we usually find airflows with much higher velocities [62]. Thus, in general, the extremely slow process of molecular diffusion can be neglected. A turbulent flow can be defined as the viscous flow in which fluid particles move in a random and chaotic way within the flow field [141, 139]. Velocity and all other fluid properties vary continuously, with strong concurrent molecular mixing between adjacent fluid layers. In natural environments, turbulence is the dominant mechanism in the mixing and dilution of gaseous releases [22]. Odor patches released by an odor source are mainly transported by the advective turbulent flow of an air stream, forming an odor plume. As the plume travels away from the source, it becomes more diluted due to molecular diffusion and turbulence that mixes the odor molecules with the clean air [99]. Figure 2.1 displays a representative example of the instantaneous concentration of a gas plume in a turbulent flow. For the case of MOX gas sensors (broadly employed in this thesis), given their slow dynamics and the rapid fluctuations in the gas concentration due to the mecha- 2.4. MOBILE ROBOTICS OLFACTION 27 nisms of gas dispersal, they never reach steady state but continuously fluctuate [146]. Thus, olfaction algorithms developed to work in such setups additionally require to extract information about the target gas (the type of analyte, its distribution, the source location, etc.) from the transient of the sensor response. Understanding how the odor molecules disperse through the environment under naturally turbulent flows is not a trivial task, being necessary the use of computational fluid dynamics (CFD) to numerically approximate the solution. However, CFD applications cannot run online because of their high computational cost, which preclude their use in mobile olfaction. 2.4 Mobile Robotics Olfaction Gas sensing is a relatively recent research area within the field of mobile robotics. This is in part because the technological progression of compact gas sensors is integral to the solution of detecting odors with mobile robots and there is still much development needed before the gas sensors are satisfactory for real applications [88]. Despite this, significant advances have been reported since the beginning of the 1990s. Four are the main odor-related tasks that have been addressed by the research community: gas source localization, trail following, gas distribution mapping and gas discrimination. In the following subsections a review of the most relevant works on each task is presented. 2.4.1 Gas source localization Inspired by biology and the fundamental mechanisms of animal olfaction, the task of localizing a gas source has been pursued since the first research works on mobile robotics olfaction. Researchers started to face the gas source tracing issue using techniques based on gradient-following [126, 134], trying to localize the point of highest concentration as a representative characteristic of a gas source. These methods assumed that diffusion is the dominant short-term method of odor dispersal, leading to a stable and smooth chemical concentrations [77]. Exploiting this "chemical gradient", the robot was expected to move towards the odor source, since on these scenarios the evolution of the chemical concentration along the gas plume is well defined by a continuous function with a peak close to the gas source location [116]. However, in real environments the dispersion of gases is not diffusion-based but it is governed by turbulence (see Section 2.3). The flow contains eddying motions of a wide range of sizes that produce a patchy and intermittent distribution of the gas. The gradient is then time varying, steep, and frequently in the opposite direction to the source [25, 73]. This makes gradient-following techniques not practical in real environments. 28 CHAPTER 2. ON TECHNOLOGY AND APPLICATIONS OF MOBILE ROBOTICS OLFACTION Gas source localization under strong constant airflows Methods designed to operate in the presence of strong and constant airflows are mostly based on "reactive plume tracking" [77]. These methods, largely based on the odor localizing behavior of microbes, insects, and crustaceans, employ reactive control schemes and local sensing to track the plume along its entire length to the source [79, 78, 27, 82, 86, 109]. The main characteristic of these scenarios is that reliable information about the air flow direction is available (anemotaxis), which can be used for upwind navigation together with chemotaxis (gradient based navigation behavior). The first example of an odor localizing robot that utilized both chemical and anemometric sensors was described by Ishida and colleagues [68]. Further developments have been introduced by a number of researchers, most of them based on biological inspired methods. Worth mentioning is the Zigzag/Dung Beetle method [63, 64, 132], which involves moving upwind within the odor plume in a zigzagging fashion. Each time the plume boundary is encountered (detected by measuring the gas concentration gradient), the robot turns back into the plume. Another version of this zigzag approach was implemented for underwater robots and reported by Farrell et al. [29]. Other methods include the Plume-Centered upwind search [129, 67, 100], which involves moving towards the center of the plume while tracking upwind, or the Silkworm Moth method, which is probably the most studied animal behavior for gas source localization. Male moths can trace a pheromone emitting source (female) even at very long distances in a turbulent environment. The chemotactic behavior of the silkworm moth has been implemented in many research works, as in the case of [80, 78, 101, 121]. It is not until the work of Martinez and Perrinet [102] that visual information was used in collaboration with local chemical sensing. They proposed a visual identification of salient features to locate candidates, reducing the time necessary to find the real gas source. In [95] a similar approach is presented but employing standard image processing techniques to detect cups (the potential odorsources), while in [70, 69] Ishida et al. proposed a subsumption architecture to combine random, visual and olfactory search behaviors. Another approach that requires a strong and constant airflow condition is to model the shape of the gas plume based on the measurements of the wind vector and chemical concentration. Analytical models of the gas plume [65] or stochastic methods [30, 116] can then be used to predict the gas source location. Gas source localization under weak airflows The localization of a gas source in weak airflow scenarios (e.g. unventilated indoor environments) cannot rely on the anemometry information. Under these conditions, an analyte plume can still be detected in most cases [152], however, with different properties concerning its shape, width, concentration profile and stability over time. 2.4. MOBILE ROBOTICS OLFACTION 29 (a) (b) Figure 2.2: (a) Source characterization with a strong airflow forced by a fan behind the gas source, and (b) without the fan. Sensor0 is placed at a distance of 30 cm from the source. All sensors are spaced 25 cm, so that the farthest sensor (Sensor4) is at a distance of 130 cm. For the case of strong airflow, the sensors are placed inside the plume. Figure taken from Ferri et al. [34] Few research works have been proposed in this case due to the complexity of gas dispersal in these scenarios: gas plumes are not well formed and the distribution of gases is dominated by turbulence, that is, it is patchy and chaotic as shown in Figure 2.2. The first works were proposed by Lilienthal et al. [92, 91] and Wandel et al. [153, 152], where only chemical sensing was employed to localize the gas source. The importance of these works lies in the raise of questions about the operation of mobile robots in more realistic environments, providing extent sets of experiments. Further efforts to improve the localization of gas sources under these complex scenarios were reported through the mimic of the repetitive movements of insects 36 CHAPTER 3. IMPROVING MOX-BASED GAS SENSING FOR MOBILE ROBOTS 3.1 Introduction The deployment of olfactory sensors is becoming an increasing practice in many industrial and environmental applications due to advances in the gas sensing technology. The exploitation of olfactory sensors can be classified into two main groups according to the level of control over the measurement conditions: Closed Sampling Systems (CSS), where the gas sensors are usually hosted in test chambers with controlled airflow, volatile exposure times, temperature and humidity, etc., and Open Sampling Systems (OSS), with no control over the sensing conditions. Our interest is in the latter, which are more flexible and practical for field applications. Examples of such uses are environmental exploration [148], gas distribution modeling [89], buried land mine detection [122] or pollution monitoring [149]. Some of these applications are usually accomplished with the help of a mobile robot carrying the sensors on board, which makes the sensing task even more challenging. Within the different technologies and materials available for gas sensor fabrication [119], MOX (Metal Oxide Semiconductor) transducers are one of the most popular and widely employed in mobile robotics olfaction, due to their high sensitivity and low prices. However they present some shortcomings including poor selectivity, response drift (age factor), influence by environmental factors such as humidity and temperature [107] and major limitations in their response speed [49]. These limitations come from the sensing mechanism underlying MOX technology, that is, the exchange of oxygen molecules between the volatile and the metal film [2, 135]. Among these drawbacks, the long duration of the acquisition cycles (up to tens of seconds) is of especial concern for OSS, since inaccurate readings are inevitable when measuring rapid changes of gas concentration, as illustrated in Figure 3.1. Observe how this limitation is particularly noticeable in the decay phase, when the output recovers to the baseline level (the steady output value given by a gas sensor when exposed to clean air). As a consequence of this slow dynamic response and because of the intermittent and chaotic nature of turbulent airflow in OSS [139, 91], steady state values are rarely reached, and therefore gas sensing based on MOX technology must deal with the transient information of the signals [147]. This problem becomes crucial when the sensors are carried on a vehicle (typically a mobile robot) to provide measurements along the way. The adopted solution in such cases is to reduce the vehicle velocity to a few cm/s, such in [68]. This proposal, however, is not acceptable in many applications since the sampling of space must be as quickly as possible to cope with the rapid dynamics intrinsic to gas propagation. To overcome this shortcoming of MOX-based electronic noses, in this chapter we propose two different approaches: one hardware and one software. The former is based on the design of a new MOX-based e-nose which comprises several identical sets of MOX sensors accommodated in separate chambers. It enables the sensing of faster changes in chemical concentrations by commuting the sensing task to another clean set of sensors when the decay phase is detected. The latter estimates the steady state sensor output from the noisy and distorted transient signal, which corresponds to the search for an inverse dynamical model of MOX sensors. The applicability of 3.1. INTRODUCTION 37 020 40 60 80 100 120 140 160 180 200 1.5 2 2.5 3 3.5 4 Time (s) Sensor Reading s (V) 10% 90% Rise time Recovery time MOXslow recovery (a) MOXslow recovery 3D Gassource Start point End point x y concentration (b) Figure 3.1: Rise and recovery phases of MOX sensor response to a step gas concentration. Subfigure (a) shows a 2D plot of the sensor response over time. The shaded blue region denotes the sensor exposure to the analyte. Subfigure (b) depicts a 3D gas distribution map generated from the readings of an MOX sensor carried by a mobile robot along a corridor. Observe how the recovery phase after the gas exposure is several times longer than the rise one. both approaches to OSS is validated through different experiments in real scenarios, performed with a mobile robot bearing an MOX-based e-nose. The rest of this chapter is outlined as follows: after a discussion of the important influence of the e-nose slow recovery in mobile robotic olfaction in Section 3.2, we introduce the proposed sensor configuration, called Multi-Chamber E-nose (MCE- nose, for short) in Section 3.3. Then, Section 3.4 describes the software alternative by introducing the proposed MOX model, giving especial attention to the experimental results. Finally, we end up with some conclusions and discussing future research. 38 CHAPTER 3. IMPROVING MOX-BASED GAS SENSING FOR MOBILE ROBOTS 3.2 On the importance of the e-nose long recovery time in mobile robotics olfaction For a mobile robot intended to accomplish olfaction-related tasks, the problems associated to the slow recovery of MOX gas sensors are manifested, among others, through the following issues: 1. A gas concentration may be masked by another close, stronger one. Suppose two gas sources of different concentrations, separated by a short distance. If the robot trajectory first leads to the lower-concentration gas source, both of them will be probably detected. However, if it happens the other way around, the lower one may be overlooked since it could be hidden below the decay of the stronger concentration. Figure 3.2 displays a simulation of such scenario. 2. Gas concentration maps are not accurate, as a consequence of the integration into the map of unreliable sensed values from the decay phase of the sensor response. 3. Gas source search methods that rely on gradient techniques may not be applicable. These methods require to measure and compare the gas concentration at different points, either successive readings (klinotaxis1) or simultaneously sensed intensities from two or more sensors (tropotaxis2) as in [86]. For the first case, we cannot trust in the sensor measurement if it is still in the decay phase of the previous sensing. Thus far, mobile olfaction tasks have managed this limitation in, basically, two ways: • Slowing down the robot speed up to a few cm/sin order to allow the sensor response to slowly follow the gas distribution even in the decaying phases [68]. • Defining paths that force the robot to pass several times over the same locations but along different directions, in such a way that the decay effect is averaged out over all the measurements. This is a common strategy employed to explore a space with the intention of building a gas concentration map, such as in [96]. Clearly, this type of solutions affect the overall efficiency of the olfactory task and, in many cases, it may be even unacceptable for the robot mission. It is important 1Klinotaxis is the achievement of orientation by alternate lateral movements of part or all of a body; there appears to occur a comparison of intensities of stimulation between one position and another and a "choice" between them. Klinotaxis is shown by animals with a single intensity receptor such as the protozoan Euglena, earthworms, and fly larvae. 2In tropotaxis, attainment of orientation is direct, resulting from turning toward the less stimulated (negative) or more stimulated (positive) side as simultaneous, automatic comparisons of intensities on two sides of the body are made. No deviations (trial movements) are required. Tropotaxis is shown by animals with paired intensity receptors. 3.2. ON THE IMPORTANCE OF THE E-NOSE LONG RECOVERY TIME IN MOBILE ROBOTICS OLFACTION 39 010 20 30 40 50 60 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 time(s) Normalized values gas concentration sensor response 1st source sensor response (a) 010 20 30 40 50 60 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 time(s) Normalized values gas concentration sensor response 1st source sensor response (b) 010 20 30 40 50 60 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 time ( s ) Normalized values gas concentration sensor response 1st source sensor response (c) Figure 3.2: Simulations of the behavior of a MOX sensor when sensing a low gas concentration right after being exposed to a stronger one. The MOX sensor response has been modeled as a double first-order system with time constants 1.7s, and 14.8s, for the rise and decay stages respectively (estimated from system identification techniques). Observe that, when the second gas source is much lower than the first, the response of the MOX sensor (in red) is very similar to that obtained from the first source alone (blue). 40 CHAPTER 3. IMPROVING MOX-BASED GAS SENSING FOR MOBILE ROBOTS to remark that, for most real robot applications, smell is not by itself the ultimate goal for the robot, but just another of the robot senses to gather useful information from the environment (along with vision, range sensing, touch, etc.). 3.3 The multi-chamber electronic nose - an improved olfaction sensor for mobile robotics It is well known that wine testers have a very developed and well trained sense of smell. In a typical session, to avoid mixing the smells or tastes of different wine samples, they have to clean their mouths and noses by eating a little piece of bread and wiping their noses, for example. Thus, they undergo a "purge/clean" stage between tests and they also stop for a few seconds to ensure their noses are ready to provide new accurate olfactory information. MOX gas sensors behave in a quite similar way, as they require a time (decay phase) to ensure their readings are accurate. The MCE-nose proposed in this chapter pretends to work in similar way that wine testers, but taking advantage of the reproducibility of electronic devices to avoid the off-time between readings. Thus, the key idea behind the proposed design is to ignore the MOX sensor output when the decay phase is detected and delegate the sensing task to another clean, almost identical sensor. In order to achieve that, we accommodate a set of redundant sensors in different chambers, which are alternatively activated. Thus, the output signal of the whole setup results from the concatenation of the rise phases of a sequence of MOX sensors. The design of the MCE-nose aims at providing the following characteristics: • To shorten the cycle of effective sensing as exposed above. • To recognize a variety of odors by hosting MOX sensors with different selectivity in each chamber. • To reduce the influence of residuals from previous measurements by scaling down both the chamber room where the sensors are accommodated and the air circuit volume. • To speed up the interchange of molecules onto the MOX film by feeding a pressured air flow into the chamber by means of a pneumatic pump. Next, the three main aspects of the MCE-nose design are exposed: mechanics, electronics, and software. 3.3.1 Mechanical design Figure 3.3 shows a schematic diagram illustrating the interconnections of the different components of the proposed e-nose. The design is conceived to comprise a general number of M chambers with N MOX sensors each. All chambers are identical and 3.3. THE MULTI-CHAMBER ELECTRONIC NOSE - AN IMPROVED OLFACTION SENSOR FOR MOBILE ROBOTICS 41 Chamber 1 •MOXSensor1 • • • •MOX SensorN Chamber M •MOX Sensor1 • • • •MOX SensorN Pump 1 Pump 2 Electrovalves pair for chamber 1 Electrovalves pair for chamber M Clean air Targetgas Figure 3.3: A functional schematic diagram of the MCE-nose. There are two pumps: one aspirating clean air and the other the target gas. At each time, only one chamber is receiving the target gas while the other M-1 chambers are being purged with clean air. contain the same set of sensors. Chambers are also isolated from each other, that is, no airflow circulates between them. There are two pneumatic circuits: one for clean air and one for the target gas (i.e. odor charged), which are connected to each chamber. Clean and contaminated air flows are taken from opposite sides of the MCE-nose device via two separate pumps. Besides, clean air is forced to flow through an active carbon filter to eliminate possible impurities. At any given time, only one chamber is fed with the target gas, while the others M-1 are being cleaned. This is done thanks to a set of electro-valves placed at the entrance of each chamber, controlled by embedded software built in the MCE-nose micro-controller, as will be described later in this section. At any time, each chamber can be found in one of the following three states: Clean: A chamber is said to be "clean" if all of its MOX sensors are at their baseline level. This may happen because either the chamber has not being used yet for sensing or because it has been injected with clean air long enough. On-Cleaning: Opposite to a clean chamber, an on-cleaning one is that whose sensors are not completely cleaned (i.e. they have not reached the baseline yet), despite the chamber is being injected with clean air. 42 CHAPTER 3. IMPROVING MOX-BASED GAS SENSING FOR MOBILE ROBOTS MOX gas sensor Scatteringcone Clean airflow input Poluted airflow input Chamber’s entrance (a) MOX gassensor Gassensorsocket Electro‐valves Chamber’s back Pump Tubes (b) Figure 3.4: Different views of the 3D model (a) upper view, (b) bottom view, of the pneumatic circuit and the main block containing four chambers which can accommodate up to 8 MOX sensors each. 3.3. THE MULTI-CHAMBER ELECTRONIC NOSE - AN IMPROVED OLFACTION SENSOR FOR MOBILE ROBOTICS 43 Active: The chamber is being injected with the target air. Figure 3.4 shows some of the 3D models created for the current prototype, which consists of four chambers with identical configuration which can accommodate up to 8 MOX sensors each. Our choice of such particular number of chambers obeys to a trade-off between two issues: • On the one hand, the obvious higher cost and complexity of the device as this number increases: more sensors, valves, A/D converters, etc. as well as problems for dissipating heat on the PCB, power consumption, etc. • On the other hand, the possibility of having an array of sensors at the baseline level and, consequently, the possibility of sensing at a higher frequency. The main block, which accommodates the 4 chambers, has been fabricated of resin with a stereolithography machine. Each chamber has a circular array of 8 sockets to lodge MOX sensors of standard size (8 mm diameter). It can be appreciated in Figure 3.4(b) how the sensors are hosted. They are introduced from the bottom side of the main block, leaving the sensing surface inside the chamber and, at same time, facilitating the electronic connections (pin soldering). A cone at the entrance of the chamber scatters the incoming airflow evenly directing it towards the active sensing surface of the sensors. The air is then forced to escape through the upper orifices of the chamber, as illustrated in Figure 3.5. Each of the 8 sockets can lodge a different sensor. In our case, each chamber contains 7 different MOX sensors, with the extra socket employed for a temperature Sensing MOXsurface Output airflows Input airflow Figure 3.5: Approximate airflow scheme inside each chamber. 44 CHAPTER 3. IMPROVING MOX-BASED GAS SENSING FOR MOBILE ROBOTS Clean airinput Contaminated air input Electro‐valves Chambers Figure 3.6: The complete MCE-nose. The current prototype contains 4 chambers, hosting 8 different MOX sensors each. sensor (ADT7301). The 7 MOX sensors were selected with different gas selectivity in order to facilitate odor classification. This amount of sensors has demonstrated to be large enough to allow the recognition of a wide range of odors. In our prototype, the pumps mounted are EAD NEO IP3 diaphragm pumps: 15V dc, 180kPa maximum attainable pressure, and working flow of 4 lpm. For each of the chambers, two SMC S070C6BG32 electro-valves are used: one for the clean and one for the polluted air flow. To interconnect pumps, electro-valves and chambers, we have used standard pneumatic PVC tubes with diameters of 8 and 3 mm, as well as the required plugs. Figure 3.6 shows a picture of the built prototype. 3.3.2 Electronics Any conventional MOX-based e-nose requires a minimum of electronics to cope with sensor pre-heating and sensor readings, including signal conditioning and A/D conversion. In our design, the electronic module has to take care also of the synchronization of the pneumatic circuits by controlling the eight electro-valves (one pair for each chamber). As seen in Figure 3.7, such electronics has been mounted on a single printed circuit board (PCB) which is connected to all the components by means of four 16-pins connectors (for the gas and temperature sensors) and eight 2-pins connectors (for the electro-valves). 3.3. THE MULTI-CHAMBER ELECTRONIC NOSE - AN IMPROVED OLFACTION SENSOR FOR MOBILE ROBOTICS 45 Figure 3.7: PCB where all the electronic components have been mounted. The core component of the PCB is an ATMega16 8-bit micro-controller at 16 MHz, which provides 32 programmable I/O lines to control two A/D 16-bits converters (connected to the gas sensors), four temperature chips (placed inside each chamber to measure working temperature), and the eight electro-valves. Additionally, the PCB comprises a USB connection to a PC host for easy interfacing and a standard JTAG interface for development. 3.3.3 Embedded software The firmware we designed for the ATMega16 micro-controller is in charge of controlling the behavior of the MCE-nose components. The operation flow is based on three main stages, described in Figure 3.8: • The first stage checks if a data frame containing the information about the next active chamber is received from the PC. If this is the case, the appropriate signals are issued such that the electro-valves switch the airflow into the newly selected active chamber. Notice that the switch strategy that dictates the active chamber at any given time has not been embedded into the micro-controller, but it relies on orders from the computer. This decision obeys to our interest in implementing high-level switching strategies that may take into account information from other sensors and the robot task. • The second stage is in charge of collecting the readings from all the sensors of the MCE-nose (28 MOX and 4 temperature sensors in our case). This is done by means of two A/D 12-bits converters of 16 channels each. 52 CHAPTER 3. IMPROVING MOX-BASED GAS SENSING FOR MOBILE ROBOTS 2m 2m GasSources (small caps filled with Acetone) Figure 3.13: Description of the multiple gas source experiment. Three small cups filled with acetone where placed along the robot trajectory to test the behavior of the MCE-nose. MCE‐nose output Conventional e‐nose output Normalized sensorresponse Normalized sensorresponse Time(s) Time(s) 00.250.50.751 00.250.50.751 050100 050100 Figure 3.14: Comparison between the readings of a conventional e-nose (right) and the MCE- nose (left) for the multiple gas source experiment. It can be appreciated how the MCE-nose can clearly distinguish the three gas sources presented along the robot path, while the conventional e-nose can hardly detect the second source, and how the third one became completely unnoticed. 3.3. THE MULTI-CHAMBER ELECTRONIC NOSE - AN IMPROVED OLFACTION SENSOR FOR MOBILE ROBOTICS 53 Notice that for such a robot speed, the readings provided for a conventional e-nose do not reveal the presence of the three odor sources and the low concentration zones between gas sources are not correctly gauged. The common solution to this problem would be to slow down the robot speed, so the MOX sensors could have time to recover their baseline level, which is not possible or practical in many real robotic applications. Observe, on the other hand, that the MCE-nose is able to provide more accurate measures. Detecting multiple odor sources of different concentrations The objective of this experiment is to demonstrate that using the MCE-nose, the problem of disguising lower concentrations or even additional gas sources (as stated in Section 3.2), can be notably palliated. The experiment was carried out in the same scenario than the previous experiment. In this case, only two gas sources separated one from each other 2m were used. The first one was a wide open vessel (approximately 15cm diameter), while the second one was a small cup (4cm diameter) covered by a grid lid to reduce the gas dissipation. Using this setup, two gas sources of different concentrations were presented to the robot along its path. Figure 3.15 shows the raw readings of the experiment. These values (after a previous normalization) were then applied to an ICP based SLAM process to generate the map shown in Figure 3.16. We must remark the improvement in the detection of a low concentration source after a high one. From a comparison of the "peak" concentrations from the MCE-nose and the conventional e-nose in Figure 3.16, one may wonder why in the former case the peak seems to extend in a larger area. How- 020 40 60 80 100 120 140 0 0.5 1 1.5 2 2.5 3 3.5 Time (s) Readings (V) MCE-nose Conventional e-nose Figure 3.15: 2D comparison of the raw readings between a conventional e-nose (dashed blue) and the MCE-nose (solid red), when faced to two sources of different concentration. 54 CHAPTER 3. IMPROVING MOX-BASED GAS SENSING FOR MOBILE ROBOTS Conventional e‐nose MCE‐nose High conc.Gassource Low conc.Gassource Figure 3.16: 3D comparison of the ICP SLAM generated maps between a conventional e-nose and the MCE-nose when faced to two gas sources of different concentration. ever, observing the raw readings in Figure 3.15, it becomes clear that the chamber’s switch in the MCE-nose takes place as soon as the decay phase starts. Thus, the observed differences are only due to the real differences between experiment repetitions. The MCE-nose switches to a different chamber when the readings from the active chamber decay bellow a threshold. This threshold was set to 0,1volts in the current experiment to avoid miss-switches due to noise or spurious readings. Decreasing the threshold value would mean faster switching after a gas source is detected, but it could then produce non-desired switches due to noise, spurious or because of the small fluctuations inherent in MOX sensors. Gas distribution mapping The objective pursued with this experiment is to analyze the performance of the MCE- nose when creating a gas distribution map of a room. A gas source composed by a 10 ×2 cm container filled with Acetone was placed in a 6×4 meters empty room, next to a wall. The robot was commanded to move following a predefined set of way-points to force the MCE-nose to prove most of the space. To be able to compare the results obtained in different trials, a methodology was established to ensure similar conditions in the room. Door and windows were kept closed during the experiments and sensors were conveniently preheated before operation. After each trial, the room was purged of residual gases by opening the door and windows, creating a strong airflow of clean air for at least 5 minutes. Figure 3.17 shows a comparative between the MCE-nose and a conventional enose for three different robot speeds. Each map represents the gas distribution estimated in the room at the end of the robot trajectory, making use of the robot positions given by an ICP-based SLAM method and the Kernel DM+V algorithm [89]. It is important to keep in mind that these maps come from different runs of the experiment and, even though we have tried to reproduce the tests in the same conditions, it is inevitable the appearance of some gas patches from one test to another. In our opinion, 3.4. OVERCOMING THE SLOW RECOVERY OF MOX SENSORS THROUGH A SYSTEM MODELLING APPROACH 55 Figure 3.17: Comparison of the ICP SLAM generated maps between a conventional e-nose and the MCE-nose for three different robot speeds. this explains, for example, the high concentrations near the source when using the MCE-nose at 10cm/s. In spite of this consideration, it can be seen how the MCE-nose is able to localize the gas source more accurately than a conventional e-nose. This improvement is more apparent when increasing the robot speed, which allows it to perform a simple gas reconnaissance of the environment in a shorter time while obtaining results of high quality. 3.4 Overcoming the slow recovery of MOX sensors through a system modelling approach In general, a model seeks to represent a system (empirical objects, phenomena, and physical processes) in a logical, objective and simplified way, allowing to predict the output of the system provided the input. Thus, a model of a MOX sensor must predict the sensor resistance (transient and steady state) when exposed to a certain gas concentration profile. Our interest in having such a model is to use it in a reverse way: given a sequence of measurements from the transient response of the MOX 56 CHAPTER 3. IMPROVING MOX-BASED GAS SENSING FOR MOBILE ROBOTS sensor, we seek the exciting gas distribution through the estimation of the steady state sensor resistance. The modeling of the dynamics of MOX sensors has been addressed in the literature for a variety of purposes. Gardner et al. [42] proposed a non-linear diffusionreaction model to obtain the theoretical transient and steady state responses based on the reactions taking place at semiconductor level. This model is not applicable to our approach since we pretend to obtain the gas distribution from the sensor readings rather than from the electrical and physical properties of the sensors. Later, aiming at increasing the response speed of gas sensors, T. Yamanaka et al. [158] reported a two-phases (corresponding to the rise and decay phases) second order linear model to describe the transient response of a semiconductor gas sensor from a visualized gas distribution image. Despite its success, this model requires the use of a CCD camera as a gas detector, which is neither our case. More recently, E. Llobet [94] reviewed the principal methods for dynamic analysis of the gas sensor response. Interestingly, the main use of these methods is to perform gas classification based on the transient response, from which a feature vector is extracted. For example, in [59] Box–Jenkins linear filters were applied to model an array of MOX sensors in the presence of four alcohols and water vapor with the aim of reducing the effect of the sensor drift in a classification process, and in [133] a multi-exponential transient spectroscopy (METS) method is proposed to improve the selectivity of chemical sensors in the analysis of gas mixtures. Especial mention deserves some works that rely, as it is our case, on modeling the sensor response to predict steady state values from the initial part of the transient. In [111], a so-called ARMA and multi-exponential models are proposed for reducing the time necessary to calibrate a sensor array. Nevertheless, since the focus is on the calibration of MOX sensors, the dynamic models are only applied to the rise transient signals recorded in Closed Sampling Systems over long time periods (over 800 s), while we aim to predict the gas distribution profile in real time and in OSS. In [117], A. Pardo et al. propose and compare different nonlinear inverse dynamic models of gas sensing systems for quantitative measurements. However, the considered dynamic conditions differ from those of OSS. First, a measurement chamber is used to obtain the gas sensor readings, which implicitly modifies the dynamic properties of the measured signals, and second, the acquisition frequency is too low (one sample per minute) to reflect the fast and highly dynamic changes of the gas concentration in OSS. Based on the multi-exponential model proposed elsewhere [111, 54], and taking into account the differences between rise and decay phases of MOX sensors, in this section we exploit a simplified version of it, where only one exponential is considered to model each phase (see Figure 3.18). According to this model, mathematically expressed in Eq. (3.1), three phases can be considered in the output of a typical MOX gas sensor when exposed to an ideal step in concentration: baseline, gas measurement (rise) and recovery. 3.4. OVERCOMING THE SLOW RECOVERY OF MOX SENSORS THROUGH A SYSTEM MODELLING APPROACH 57 050 100 150 0 10 20 30 40 50 60 70 80 90 100 Time(s) R(%) Gas concentration profile Ideal MOX sensor response tste R0R’0 Rmax R’max III III Figure 3.18: Ideal response of an MOX sensor (solid red line) when excited with a step gas concentration (dashed blue line). The curve shows the three phases of a measurement: (I) baseline, (II) gas measurement, and (III) recovery phase. R(t) =          R0t<ts R0+(Rmax −R0)1−e−(t−ts) τrts<t<te R0 0+(R0 max −R0 0)e −(t−ts−∆t) τdte<t (3.1) where τrand τdare the time constants for the rise and recovery phases respectively, ts and terepresent the starting and ending times of the step excitation, R0and R0 0are the sensor response level before and after the stimulus, Rmax is the saturation level, and R0 max is the maximum response level during the gas measurement phase. Notice that R0 max is usually lower than Rmax for short input pulses, as depicted in Figure 3.18. This model was used by [81] for characterizing the response of an MOX-based e-nose carried by a robot. In this section we also exploit this model but making use of its inverted form, that is, to predict the gas distribution that the sensor is exposed to from its readings. 3.4.1 The proposed MOX model As shown in the block diagram of Figure 3.19, three different sub-processes can be distinguished in an MOX-based gas sensing process: 1. A non-linear static system representing the measurement electronic circuit (Ω to V). 58 CHAPTER 3. IMPROVING MOX-BASED GAS SENSING FOR MOBILE ROBOTS H(s) X(s) Y(s) Gas Sensor Sensor readings Measurement Circuit Volatile [ppm] [Ohm] [V] MOX transducer Transient Behavior Transduction [Ohm] XR1R2Y Figure 3.19: Block diagram of a smelling process with an MOX gas sensor. The sensor is excited by a volatile [ppm] producing a variation in the sensor resistance that is measured as an electrical signal [V] by means of a measurement circuit. 2. A transformation (Ωto Ω) that captures the non-linear rate at which the sensor resistance varies over time (although we have separated the transduction and dynamic phases to explicitly denote both functionalities, both stages take place within the MOX transducer and they are most likely coupled). 3. A signal transduction mechanism (ppm to Ω) which results from the chemical interaction between the sensor sensitive surface and the molecules of reducing gases. Next, we model each of these stages and invert them to come up with a complete inverted MOX sensor model. It is important to remark that the proposed inverted model does not aim to recover the gas concentration (X[ppm]), which corresponds to a sensor quantification problem not addressed here, but only the gas distribution, providing relative results proportional to the gas concentration (R1). Measurement circuit This stage stands for the electronic circuit in charge of measuring the changes in the sensor resistance, which typically consists of a simple voltage divider: Y=VRL(t) = VCC ×RL R2(t)+RL (3.2) where VCC is the circuit voltage and RLis the load resistance. Since the magnitude measured is the output voltage Y(i), we can easily recover the MOX resistance changes R2(i)by solving Eq. (3.3). R2(i) = RL×(VCC −Y(i)) Y(i)(3.3) 3.4. OVERCOMING THE SLOW RECOVERY OF MOX SENSORS THROUGH A SYSTEM MODELLING APPROACH 59 Transient behavior stage As reported by previous authors [49, 81], the transient response of an MOX sensor can be expressed by two first-order systems, as depicted in Eq. (3.1). It clearly resembles a low-pass filter response with the particularity that the filter cutoff frequency (fc=1 2πτ ) is different for each phase the sensor is working at (rise or recovery). Equation (3.4) presents the two phases transfer function of this stage in the Laplace domain, where a common static delay (td) has additionally been considered in both phases to compensate for the delay introduced by the pneumatic circuit used to draw in the gas and flow it through the sensors: R2(s) R1(s)=     A τrs+1e−tds,for rise phases A τds+1e−tds,for recovery phases (3.4) where sis the Laplace variable, Ais the filter gain, τrandτdare the filter time constants in the rise or recovery phase respectively, and td(in seconds) is the system delay. For nomenclature clarification τrecovery has been denoted as τd, where the subindex d stands for decay. Since our interest remains in estimating the volatile distribution that the sensor is being exposed to, given the sensor readings, we work out R1as a function of the sensor resistance measurements R2by applying the inverse Laplace transform to Eq. (3.4). As the transfer function has different expressions according to the phase (rise or recovery) that the sensor is working at, the parameters of the resulting differential equation will have to switch accordingly. Approximating the derivative of the measured sensor resistance R0 2by a backward first order finite difference, such differential equation can be written as: R1(i−N)∝R2(i)+τR2(i)−R2(i−1) 4t(3.5) where R1(i)is the unknown steady resistance value for the given gas concentration at the time step i,R2is the measured sensor resistance, τis the time constant for either the rise (τr) or the recovery phase (τd), Nis the number of samples for the system delay, and 4tis the time between samples. Notice also that the scale factor Afrom Eq. (3.4) has been dropped. As observed in Eq. (3.5), at each time step this dynamic model requires to know the value of parameters τrand τd, and the phase the sensor is working at. The latter may be determined from the slope of the measured MOX resistance R2, considering that the sensor is working under rise phase for positive values of the derivative, and under decay phase for negative values of it. Notice that instead of working with the sensor resistance (which is inversely proportional to the volatile concentration), it may be more convenient to deal with the 60 CHAPTER 3. IMPROVING MOX-BASED GAS SENSING FOR MOBILE ROBOTS sensor conductance (GMOX =1/RMOX ), which is proportional to the gas concentration. For estimating the values of τrand τd, a common practice in system modelling is that of identifying the parameters of the system upon its step response [115]. The problem with such procedure is that the time constants, in practice, depend not only on the type of volatile but also on its concentration [117]. In this chapter this dependency is made explicit by adjusting a polynomial regression model over a sequence of concentration pulses with different amplitudes for each target gas. In Section 3.4.3, an example of such relation is depicted for the target gas ethanol. Transduction stage The transduction stage is commonly defined by the sensitivity characteristics and the temperature and humidity dependencies of the transducer. For the case of Closed Sampling Systems, those characteristics are usually provided by the sensor manufacturer, relating the volatile concentration [ppm] to the sensor resistance ratio RS/R0 (sensor resistance in gas over sensor resistance in air) for different target gases and test conditions. Nevertheless, those sensitivity characteristics are obtained by measuring steady state values of the MOX sensor resistance after very long and constant exposure times, which are not applicable to Open Sampling Systems and thus not considered in this chapter. 3.4.2 Signal conditioning and preprocessing The proposed model-based approach given by Eq. (3.3) and Eq. (3.5) relies on the sensor readings to obtain an estimation of the gas. As can be appreciated, a first order derivative needs to be computed to obtain such estimation, which notably degrades the signal-to-noise ratio and consequently the accuracy in the estimation (see Figure 3.20). Additionally, MOX sensors are susceptible to long and short term drift [119], gradually changing the sensor resistance even if exposed to exactly the same gas concentration under identical environmental conditions. It then becomes necessary to carry out a signal conditioning to prepare the sensor readings to the posterior estimation process. Initially, for the purpose of drift compensation and dynamic range enhancement, the raw sensor readings R2(i)are divided by the sensor baseline resistance at t=0, that is, R2(0). This transformation is known as relative baseline manipulation [119]. Later, in order to mitigate the noise effects on the model, a low pass filter followed by a sub-sampling process are applied to the signal, as depicted in Figure 3.20. The cutoff frequency of the filter and the down-sampling rate have been determined experimentally according to the sampling frequency. 3.4.3 Experimental results This section presents three different experiments designed with increasing complexity to test how the proposed model can anticipate the steady state values of the sensor resistance from transient measurements in Open Sampling Systems. We start by 3.4. OVERCOMING THE SLOW RECOVERY OF MOX SENSORS THROUGH A SYSTEM MODELLING APPROACH 61 200 220 240 260 280 300 0 0.1 0.2 0.3 0.4 0.5 Time (s) Sensor Conductance (Kohm)−1 Sensor conductance (1/R2) Noise filtered sensor conductance 200 210 220 230 9.6 9.8 10 10.2 10.4 x 10−3 200 220 240 260 280 300 −4 −2 0 2 4 6 8x 10−3 Time (s) diff (Kohm·s)−1 Diff of sensor conductance Diff of noise filtered sensor conductance Figure 3.20: Noisy sensor conductance readings and its derivative (solid red line), and the corresponding filtered versions (dashed blue line). testing our approach in a scenario where airflow and volatile distribution were well controlled. Then, two experiments of gas distribution mapping in unmodified environments are described. Train of gas pulses in a controlled scenario This experiment is designed to validate, in the simplest possible way, the ability of the proposed approach, given by Eq. (3.3) and Eq. (3.5), to estimate the volatile distribution that the MOX gas sensors are being exposed to. Since knowing the ground truth distribution of a volatile in an OSS is a tough task (we can even say utopian), a specific setup was designed to keep its concentration as constant as possible and to confine it in a predefined region, avoiding the dispersion of gas particles to undesired locations. The experiment setup is depicted in Figure 3.21. The gas source, composed by a small cup filled with acetone, was placed inside a cardboard box with a small upper aperture. A fan located at the bottom of the box 68 CHAPTER 3. IMPROVING MOX-BASED GAS SENSING FOR MOBILE ROBOTS X (m) Y (m) -8 -6 -4 -2 0 2 4 6 -4 -2 0 2 4 6 8 Meanmap X ( m ) Y (m) -8 -6 -4 -2 0 2 4 6 -4 -2 0 2 4 6 8 Variance map MOXraw readings X (m) Y (m) -8 -6 -4 -2 0 2 4 6 -4 -2 0 2 4 6 8 Meanmap X (m) Y (m) -8 -6 -4 -2 0 2 4 6 -4 -2 0 2 4 6 8 Variance map Figure 3.27: Mean and predictive variance gas distribution maps of the inspected area generated by the Kernel DM+V algorithm when fed with the sensor readings (after baseline manipulation and delay correction). The gas source location has been marked as a white circle. X (m) Y (m) -8 -6 -4 -2 0 2 4 6 -4 -2 0 2 4 6 8 Meanmap X ( m ) Y (m) -8 -6 -4 -2 0 2 4 6 -4 -2 0 2 4 6 8 Variance map MOXraw readings X (m) Y (m) -8 -6 -4 -2 0 2 4 6 -4 -2 0 2 4 6 8 Meanmap X (m) Y (m) -8 -6 -4 -2 0 2 4 6 -4 -2 0 2 4 6 8 Variance map Figure 3.28: Mean and predictive variance gas distribution maps of the inspected area generated by the Kernel DM+V algorithm after applying the proposed model-base estimation of the gas concentration. The gas source location has been marked as a white circle. to the actual robot path and the slow recovery of MOX sensors. When building the map from the gas concentration estimated by the proposed model (Figure 3.28), this "fake" plume does not appear, correctly representing the gas distribution in the inspected area. Focusing now on the predictive variance maps, it has been previously reported that the variance of a set of gas concentration measurements has been suggested as a feature that can identify the location of a source of gas [85, 57]. Following this principle, it can be seen that the gas source cannot be precisely located in the first case (Figure 3.27) since there are high variance values not only nearby the real location of the source but also along the corridor. Again, the application of the proposed MOX model leads to a predictive variance map where all high variance values fall near the real source location, allowing a correct estimation of it. 3.5. CONCLUSIONS AND OUTLOOK 69 3.5 Conclusions and outlook In this chapter, we have presented two approaches to deal with the long recovery period of MOX gas sensors. This is a serious drawback for mobile robot olfaction since a rapid cycle of measurement is required in many olfaction-related tasks: source finding, gas concentration mapping, etc. First, we have introduced a new electronic nose, the MCE-nose, which partially overcomes this problem by accommodating a set of redundant sensors in different chambers. These redundant sensors are alternatively activated, ignoring the sensor output when a decay phase is detected and delegating the sensing task to another clean, almost identical sensor. The output signal of the whole setup results then from the concatenation of the rise phases of a sequence of MOX sensors. A prototype of the MCE-nose has been built and integrated in a mobile robotic platform under the OpenMORA robotic architecture. Then, a modelling approach which compensates the slow dynamic behavior of the MOX sensor, by forecasting the steady state values of the sensor resistance from a sequence of transient measurements has been presented. The exploited model is based on two first order systems (rise and recovery) with time constants that depend on the sensor reading amplitude. Both approaches have been validated in different scenarios, demonstrating their utility in applications like gas source localization or gas distribution mapping. Additionally, we have proved that these approaches enable a considerable increase in the speed at which a mobile base carrying the MOX-based e-nose can inspect the environment, which directly implies an important reduction in the execution times of the olfaction task. Future work includes some improvements in the MCE-nose, such as the incorporation of another electro-valve to purge the pneumatic circuit or the enlargement of the tubes section to increase the airflow through the sensor’s surface. Related to the proposed model, modeling additional parameters as temperature and humidity to improve the gas distribution estimation in real complex scenarios will be considered. Besides, the study of the transduction stage (quantification) for open sampling systems will be considered to complete the MOX sensor model. Chapter 4 Gas quantification with MOX sensors in open sampling systems Gas quantification based on the response of an array of metal oxide (MOX) gas sensors in an open sampling system is a complex problem due to the highly dynamic characteristic of turbulent airflow and the slow dynamics of the MOX sensors. However, many gas related applications require to determine the gas concentration the sensors are being exposed to. Due to the chaotic nature that dominates gas dispersal, in most cases it is desirable to provide, together with an estimate of the mean concentration, an estimate of the uncertainty of the prediction. This chapter presents a probabilistic approach for gas quantification with an array of MOX gas sensors based on Gaussian Processes, estimating for every measurement of the sensors a posterior distribution of the concentration, from which confidence intervals can be obtained. The proposed approach has been tested with an experimental setup where an array of MOX sensors and a photo ionization detector (PID), used to obtain ground truth concentration, are placed downwind with respect to the gas source. Our approach has been implemented and compared with standard gas quantification methods, demonstrating the advantages when estimating gas concentrations. 71 72 CHAPTER 4. GAS QUANTIFICATION WITH MOX SENSORS IN OPEN SAMPLING SYSTEMS 4.1 Introduction The problem addressed in this chapter is the estimation of gas concentration from the readings of an array of metal oxide semiconductor (MOX) gas sensors (see Section 2.2) deployed in an open sampling system (OSS). In other words, the problem can be formalized as finding a function that maps the readings of Ngas sensors together with any other extra parameters (like temperature and humidity) to a posterior distribution over concentrations. Concentration estimation is a crucial step for realistic gas sensing applications since legal requirements and regulations are expressed in terms of absolute gas concentration, toxicity levels, etc. For example, it would be of little utility for many applications if we could detect a gas leak in an industrial scenario but we were unable to quantify the amount of leaked gas: should an alarm be issued for workers to abandon the area, or is localization of the source and subsequent notification to the maintenance unit enough to handle the problem? Gas quantification using an array of MOX sensors in an OSS is indeed an important problem. Most of the previous works dealing with OSS do not estimate the gas concentration but work directly with the sensor signal (conductance readings in case of MOX gas sensors). In contrast to gas quantification with sensors within a sensing chamber (where controlled conditions can be imposed), gas quantification in OSS implies additional complications due to the many sources of uncertainty. The most relevant source of uncertainty is the exposition of the sensors to the turbulent airflow that brings the chemical compound in contact with the sensors. As a consequence, given the slow dynamics of MOX gas sensors and the rapid fluctuations in concentration due to turbulent airflow, the sensors never reach a steady state but continuously fluctuate [146]. Instead of trying to find a deterministic function for mapping directly the sensors readings to concentration values, in this chapter we calculate instead a posterior distribution over concentrations cat time tgiven the measurements of Nsensors rt= (r1(t),r2(t)...rN(t)) at times t= (t1,...,tk). That is, we search a probability density function: pc(t)|rt1,...,rtk(4.1) where kis the number of past sensor readings considered for the prediction. Tasks like chemical detection, gas source localization, gas distribution mapping, and odor trail tracking are common tasks for working in OSS. For this kind of systems it is acceptable to have only an approximate estimate of the concentration if there is also an indication of the corresponding confidence. This is exactly what the method proposed in this chapter provides. We propose to estimate the posterior in Eq. (4.1) using a Gaussian Process (GP) model [123]. Gaussian Processes provide principled supervised machine learning methods which, given a set of samples (i.e. pairs of sensor readings and their corresponding concentration), can estimate the posterior joint probability of the process. 4.2. RELATED RESEARCH 73 We analyze gas quantification using either a single sensor or the whole sensor array. In the latter context we additionally investigate how Automatic Relevance Determination (ARD) [112, 98] can be used to identify which sensors in the array contribute most to the estimate of the concentration posterior distribution. Finally, we analyze to which extent considering past sensor readings can improve the accuracy of probabilistic quantification. The rest of this chapter is outlined as follow: After a discussion of related research in Section 4.2, we introduce in Section 4.3 the basics of Gaussian Process regression for gas quantification, giving especial attention to learning a GP from the data. Finally, Section 4.4 presents some experimental results under different configurations of the GP. 4.2 Related research Estimation of gas concentration from raw readings of MOX-based gas sensors has been traditionally focused on setups where such sensors are enclosed inside a chamber, where environmental conditions, gas exposure times and concentrations are known and controlled. This setup allows the measurement of steady state values, which are used as input to a regressor. Under such controlled conditions, the relation between sensor conductance (Ω−1)and gas concentration (ppm) is usually modelled as an exponential [61]: gi≡1 ri =Ai·cαi(4.2) where giis the conductance of sensor iwithin the array (inverse of sensor resistance ri), cis the gas concentration, and Aiand αiare the parameters of the exponential model to be estimated during an initial training process. For concentration estimation with an array of MOX sensors, multivariate linear regression methods like Principal Component Regression (PCR) and Partial Least Squares Regression (PLSR) have been proposed [45, 143, 23]. The main motivation behind the use of these two methods is the strong correlation of the response of different MOX sensors. This allows both PCR and PLSR to reduce the dimensionality of the input space before fitting a regression function, thus reducing the possibility of curse of dimensionality related issues. Alternatively, non-linear estimation methods like Artificial Neural Networks (ANN) [55, 12] or kernel algorithms like Support Vector Regression (SVR) [138, 19] have also been proposed. It is worth noting that some authors consider the transient information for gas quantification with MOX sensors. In [111], a multi-exponential model is used to describe the sensor dynamics and to predict the steady state value of the sensors which is then mapped to a concentration based on the initial values of the transient state. These existing approaches rely on steady state measurements of the sensor. Thus, they are not immediately applicable to OSS because steady state values are almost never reached [146]. 74 CHAPTER 4. GAS QUANTIFICATION WITH MOX SENSORS IN OPEN SAMPLING SYSTEMS The work in [151] addressed gas quantification for urban pollution monitoring. Measurements collected over a long period of time are averaged out and therefore the dynamic information in the sensor response is discarded. The focus of this chapter is instead on applications where sensors are deployed in a highly dynamic environment, where they are exposed to intermittent patches of gas. Most of the works in mobile robot olfaction avoids quantification issues and use instead the conductance readings of the sensors as an approximate measure of the gas concentration. An exception is [66], where Ishida et al. propose to use steady state calibration to obtain a rough approximation of gas concentration with an OSS. All the methods mentioned ignore the uncertainty in the quantification, while for OSS it is desirable to provide the uncertainty together with the concentration estimate. The GP-based method detailed in the following section generates an estimate of the uncertainty (as a variance), which can be used, for example, to calculate confidence intervals for the predictions. 4.3 An algorithm for probabilistic gas concentration estimation This section details our proposal for the concentration estimation in MOX-OSS. Initially, two signal preprocessing methods and their influence on the posterior distribution estimation are described. Next, Gaussian Process regression for the particular case of gas quantification with an array of sensors is summarized, and how Automatic Relevance Determination can be used to select the model parameters. Finally, two different loss functions are proposed for evaluating the results, allowing a comparison between the various proposed configurations. 4.3.1 Signal preprocessing In the first step, the raw sensor resistance readings ri(t)are divided by the baseline of the sensor at t=0, that is, ri(0). This transformation in Eq. (4.3), known as relative baseline manipulation [119],is applied for drift compensation and dynamic range enhancement: ˜ rt= [˜ri(t)]N i=1,˜ri(t) = ri(t) ri(0)(4.3) Next, GP regression is used to predict the gas concentration c(t)from the values ˜ rt. However, considering the commonly assumed exponential relation between sensor resistance and the concentration, see Eq. (4.2), we will also investigate applying a logarithmic transformation and perform regression between log(˜ rt)and log(c(t)). In summary, we will compare two regression problems: c(t) = f1(˜ rt)(4.4) logc(t) = f2(log ˜ rt)(4.5) 4.3. AN ALGORITHM FOR PROBABILISTIC GAS CONCENTRATION ESTIMATION 75 4.3.2 Gaussian Process regression for gas concentration estimation In the general case, the process of inferring the relationship f:rt7−→ c(t)between the response of an array of sensors and the gas concentration using a training dataset D={(rtj,c(tj)|j=1,...,n}is a supervised machine learning problem. Among the numerous available options, GPs provide a powerful non-parametric tool for Bayesian inference and learning [123]. GPs can be seen as a generalization of the Gaussian probability distribution to distributions over functions. That is, they perform inference directly in the space of functions, starting with a prior distribution over all possible functions and subsequently learning the target function from data samples. Defining a prior over functions corresponds to making assumptions about the characteristics of the function f, as otherwise any function which is consistent with the training data will be equally valid and therefore the learning problem would be ill-defined. A GP is completely specified by its mean and covariance functions, m(rt)and k(rt,rt0)respectively: m(rt) = E[f(rt)],(4.6) k(rt,rt0) = cov(f(rt),f(rt0)) (4.7) =E[(f(rt)−m(rt))( f(rt0)−m(rt0))].(4.8) we denote the GP as: f(rt)∼G P (m(rt),k(rt,rt0)).(4.9) To account for noise in the sensor it is assumed that the observed concentration values c(t)are corrupted with an additive i.i.d. Gaussian noise with zero mean and variance σ2 n, that is: c(t) = f(rt)+ε,(4.10) ε∼N(0,σ2 n). It is important to notice that we did not assess experimentally whether the noise is i.i.d. with Gaussian distribution. We rather make this assumption to obtain a closed form solution, and validate the resulting predictions with real sensor data. In our case of study we consider GPs with zero mean and the commonly used squared exponential (SE) covariance function, that is: m(rt) = 0,(4.11) k(rt,rt0) = σ2 fexp−1 2 krt−rt0k2 `2,(4.12) 76 CHAPTER 4. GAS QUANTIFICATION WITH MOX SENSORS IN OPEN SAMPLING SYSTEMS where σ2 fis the overall variance hyper-parameter and `is the characteristic length scale. It is common but not necessary to consider GPs with zero mean. Note that the mean of the posterior process is not restricted to be zero. The choice of the SE covariance function leads to GP predictions that are smooth over the characteristic length scale. That is, if rt≈rt0, then k(rt,rt0)approaches its maximum and f(rt) is strongly correlated with f(rt0). For large distances between rtand rt0,k(rt,rt0) approaches 0. So, when predicting the concentration value for new data points, distant observations will have a negligible effect. The region of influence, depends on the scale parameter `. The regression model depends on the selection of the hyper-parameters, which are summarized in a vector θ= (`2,σ2 f,σ2 n). The optimal hyper-parameters are found by maximizing the marginal likelihood function p(c|R,θ), where cis a vector of training concentration values, Ris the matrix containing the measurements of the sensor array, and θare the hyper-parameters. As it is common practice, we minimize the corresponding negative log-likelihood to avoid numerical issues: −log(p(c|R,θ)) = 1 2c>K−1c+1 2log|K|+n 2log2π(4.13) whereK=k(rt,rt0)+σ2 nI To find the minimum of Eq. (4.13) we use the scaled conjugate gradient method, which requires the calculation of the partial derivatives of the log marginal likelihood w.r.t. the hyper-parameters: ∂ ∂θj log(p(c|R,θ)) = 1 2tr αα>−K−1∂K ∂θj(4.14) whereα=K−1c The complexity of this step is dominated by the matrix inversion K−1in Eq. (4.14), which has a complexity O(n3)with nbeing the number of training points. This represents one of the principal inconveniences of GP. Learning the calibration GP corresponds to the selection of the hyper-parameters. The GP then allows to predict gas concentration values c∗and a corresponding variance for arbitrary sensor resistances r∗. The posterior distribution over functions (our prediction) is also a Gaussian, and it is given by: c∗|R,c,R∗∼N(¯ c∗,cov(c∗)),where (4.15) ¯ c∗,E[c∗|R,c,R∗] = K(R∗,R)[K(R,R)+ σ2 nI]−1c cov(c∗) = K(R∗,R∗)−K(R∗,R)[K(R,R)+σ2 nI]−1K(R,R∗) 4.3. AN ALGORITHM FOR PROBABILISTIC GAS CONCENTRATION ESTIMATION 77 and where R={r1...rn}is the n×Nmatrix of the ntraining samples of dimensionality N,R∗the matrix for the testing inputs, K(·,·)refers to the matrix with the entries given by the covariance function k(·,·)and cthe vector of the observed concentrations ci. Note that the predictive distribution is based on a mean value ¯ c∗(our best estimate for c∗), which is a linear combination of the observed values c, and a variance value cov(c∗)which denotes the uncertainty in our estimation, and does not depend on the observed targets but only on the inputs. 4.3.3 Automatic relevance determination Automatic Relevance Determination (ARD) is a method based on Bayesian interference for pruning large feature sets with the aim to obtain a sparse explanatory subset. Making use of this powerful tool we can consider different configurations of the input space of higher dimensionality, and then allow ARD to select the most relevant features, which avoids overfitting due to high input dimensionality. In order to introduce ARD Eq. (4.12) can be rewritten as: k(rt,rt0) = σ2 fexp−1 2(rt−rt0)>M(rt−rt0),(4.16) where Mdenotes the diagonal weight matrix M=`−2I. We have seen how maximizing the log marginal likelihood can be used to determine the value of the hyper-parameters. By incorporating a separate hyper-parameter `ifor each input variable [123], i.e. for each sensor in the array, we modify Mto be: M=diag[`−2 1,`−2 2,...,`−2 n](4.17) where `= [`1,`2,...,`n]is a vector of positive values, corresponding to the lengthscale of each input variable. This is in contrast to a global hyper-parameter `for all input variables. Since the inverse of the length-scale determines how relevant an input is, the extension (4.17) enables to identify the importance of each different input– if the length-scale has a very large value, the covariance will become almost independent of that input, effectively ignoring its values during the inference. ARD is performed during the training phase of the GP, specifically during the selection of the covariance function hyper-parameters. When the inputs related to a sensor are discarded by ARD, the corresponding sensors can be excluded from the array. ARD has been applied for two different configurations of the input space: (i) when the whole sensor array is considered at one instant of time in the inference process and (ii) when additional features from previous time steps of the sensor response are considered to account for the dynamics of the signal. 84 CHAPTER 4. GAS QUANTIFICATION WITH MOX SENSORS IN OPEN SAMPLING SYSTEMS (a) (b) Figure 4.4: Examples of the learned regression functions for the case where a single sensor (here TGS-2611) is considered. Blue dots represent the training data. The solid red line is the mean of the posterior, and its variance is visualized by the ±1σconfidence interval. (a) A typical calibration function learned when using linear pre-processing, Eq. (4.4). (b) Calibration after applying a logarithmic transformation not only to the input data, Eq. (4.5). 4.4. EXPERIMENTAL EVALUATION AND DISCUSSION 85 (a) (b) (c) (d) (e) (f) Figure 4.5: Estimation of the gas concentration for three different gas emitting strategies (rows), obtained from sensor TGS-2611 with linear pre-processing c=f(˜r(t)), and the proposed GP calibration. The left column shows the ground truth (blue) together with the GP calibration estimate (the red line is the posterior mean and the shaded grey region represents ±1σconfidence interval), the PLSR (green line), and the SVR estimate (magenta line). The right column shows for each scenario the error between the different estimates and ground truth (in the case of GPs only the mean value is taken into account). 86 CHAPTER 4. GAS QUANTIFICATION WITH MOX SENSORS IN OPEN SAMPLING SYSTEMS (a) (b) (c) (d) (e) (f) Figure 4.6: The predictions of the same experiment as in Figure 4.5, but after training on log-transformed inputs: log(c) = f(log(˜ri(t))). 4.4. EXPERIMENTAL EVALUATION AND DISCUSSION 87 cases. In Figure 4.7 and Figure 4.8 the NLPD and RMSE are plotted for each sensor in the array using a box-plot format. When calibrating using the linear relation we obtain, in average over all the sensors, a RMSE of 35.15±10.32ppm, and a NLPD of 5.16 ±0.71, while for logarithmic preprocessing the achieved average RMSE is 31.17 ±6.27ppm and the NLPD is 4.27 ±0.18. The results after applying the log transformation in Eq. (4.5) are better according to both performance measures. From the results in Figures 4.7 and 4.8 we can also see that the sensors TGS-2611 and MiCS-5121 perform best for the specific target gas (ethanol). Table 4.3 summarizes the comparison of the proposed GP quantification with PLSR and SVR. For the same input, the RMSE, averaged over all sensors is 33.77± 5.77ppm for the PLSR approach and 30.94 ±6.78ppm for the SVR approach. The PLSR approach performs slightly worse than SVR, and SVR is on par with the GP approach considering only the RMSE. A possible explanation for this result is that PLSR is a linear method while both SVR and GP are non-linear and use an SE (RBF) kernel. Sensor Model GPs PLSR SVR MiCS 2610 43.81±22.88 44.79±14.26 46.01±19.44 MiCS 2710 30.38±7.83 31.89±6.13 29.71±6.42 MiCS 5521-1 33.64±9.02 34.26 ±7.03 34.09±7.56 MiCS 5121 23.84 ±5.58 25.44 ±4.20 24.18 ±5.91 MiCS 5135 32.09±12.00 35.61±8.21 33.37±12.31 MiCS 5521-2 31.11±8.01 32.37 ±7.47 31.80±8.09 TGS 2600-1 26.05±10.08 31.10 ±5.42 25.71±8.79 TGS 2611 21.46 ±3.54 26.27 ±3.59 21.57 ±3.14 TGS 2620 34.16±24.02 35.41 ±7.08 29.61±8.38 TGS 2600-2 28.96±15.13 32.43 ±5.98 27.23±9.92 TGS 2602 44.64±15.58 41.87 ±8.21 37.12±12.69 OVERALL 31.17 ±6.27 33.77 ±5.77 30.94 ±6.78 Table 4.3: RMSE values (Mean ±1σ) of three different calibration methods when using only one sensor at a time. Sensors MiCS-5121 and TGS-2611 provide the overall best performance. 4.4.4 Gas quantification using a sensor array In OSS applications where the goal is discriminating among several different odors [148], an array of MOX sensors is usually employed instead of a single sensor. For this reason, we investigate whether also gas quantification benefits from using the whole sensor array. In order to do this we apply the GP calibration method with an input space of dimension d=11, and apply ARD (see Section 4.3.3) to automatically select the most relevant inputs, that is, the most relevant gas sensors in the array. Table 4.4 summarizes the mean and the ±1σconfidence interval of the normalized length scale hyper-parameter (l)for the different sensors in the array, after ARD has been computed for the 13 folds used in the cross-validation. As explained 88 CHAPTER 4. GAS QUANTIFICATION WITH MOX SENSORS IN OPEN SAMPLING SYSTEMS (a) (b) Figure 4.7: NLPD and RMSE box-plot for the case of one-sensor GP calibration. For both indicators, as lower the value the better the calibration. On each box, the central red mark is the median, the edges of the box are the 25th and 75th percentiles, the whiskers extend to the most extreme data points not considering outliers, and outliers are plotted individually as red crosses. 4.4. EXPERIMENTAL EVALUATION AND DISCUSSION 89 (a) (b) Figure 4.8: NLPD and RMSE box-plot for the case of one-sensor GP calibration with logarithmic transformation. For both indicators, as lower the value the better the calibration. On each box, the central red mark is the median, the edges of the box are the 25th and 75th percentiles, the whiskers extend to the most extreme data points not considering outliers, and outliers are plotted individually as red crosses. 90 CHAPTER 4. GAS QUANTIFICATION WITH MOX SENSORS IN OPEN SAMPLING SYSTEMS in Section 4.3, large values of the length scale corresponds to less relevant sources of information. Sensor Length scale (l) MiCS 2610 0.386±0.272 MiCS 2710 0.732±0.337 MiCS 5521-1 0.869±0.145 MiCS 5121 0.212 ±0.175 MiCS 5135 0.533±0.312 MiCS 5521-2 0.761±0.305 TGS 2600-1 0.200±0.167 TGS 2611 0.001 ±0.004 TGS 2620 0.554±0.387 TGS 2600-2 0.749±0.247 TGS 2602 0.116 ±0.042 Table 4.4: Mean ±1σinterval of the length scale hyper-parameter for the different sensors in the array as obtained from ARD. Our results show that sensors which perform well in the case of single sensor quantification are in most cases also relevant for array quantification. An exception is the sensor TGS-2602, which did not perform well individually, but was found to provide valuable information when considering the whole array (TGS-2602 is the second most relevant sensor according to ARD but was ranked last in its individual quantification performance, see Table 4.3). Figures 4.9 and 4.10 show gas concentration estimates for three different scenarios when considering the readings of the eleven sensors at once. In general, the gas concentration estimation obtained using the whole array of sensors outperforms the estimation based on a single sensor. Linear preprocessing provides an average RMSE of 16.44 ±3.38ppm and a NLPD of 4.22 ±0.20, while for the logarithmic preprocessing the results are slightly better: RMSE of 15.97 ± 2.77ppm, NLPD of 3.59±0.76. In comparison, PLSR applied to the same input achieves a RMSE of 17.55 ± 2.42ppm which, is slightly worse than the GPs quantification, as in the single sensor case (Section 4.4.3). SVR achieves a RMSE of 16.20±2.50ppm, very similar to the results obtained with the GP approach but without providing the additional information about the uncertainty in the prediction. The uncertainty estimate is particularly meaningful when the posterior distribution is modelled as a Log-Normal distribution, rather than with a Gaussian distribution. High uncertainty estimates (which can be identified in the left column of Figure 4.10 and Figure 4.8 in the case of predictions performed with a single sensor) correspond to an increased mean and variance of the RMSE (observable in the right column of Figures 4.10 and 4.8). This describes the observed fluctuations in the signal well and thus provides a reliable confidence measure for concentration predictions. 4.4. EXPERIMENTAL EVALUATION AND DISCUSSION 91 (a) (b) (c) (d) (e) (f) Figure 4.9: Estimation of the gas concentration for three different gas emitting strategies (rows) when considering the readings of the whole array and linear pre-processing c=f(˜ rt). The left column shows the ground truth (blue), together with the GP calibration estimate (the red line is the posterior mean and the shaded grey region represents the ±1σconfidence interval), the PLSR (green line), and the SVR estimate (magenta line). The right column shows for each scenario the error between the different estimates and ground truth (in the case of GPs only the mean value is taken into account). 92 CHAPTER 4. GAS QUANTIFICATION WITH MOX SENSORS IN OPEN SAMPLING SYSTEMS (a) (b) (c) (d) (e) (f) Figure 4.10: The predictions of the same experiment as in Figure 4.9, but after training with the logarithmic relation log(c) = f(log(rb(t))) 4.5. CONCLUSIONS AND OUTLOOK 93 Our results also lead to the conclusion that it is recommendable to start using the whole sensor array and select the most relevant sensors with ARD. This allows for better concentration estimate. 4.4.5 Taking into account the dynamics of MOX gas sensors The signals from MOX gas sensors in an OSS are strongly influenced by the sensor dynamics (see Section 2.3). The uncertainty about concentration estimates is due to the chaotic nature of gas transport in combination with the sensor dynamics, i.e. the non-negligible response and recovery times of the MOX sensors. In this section we propose two different extensions so that the proposed GP quantification can automatically account for the dynamics of MOX sensors. Both methods augment the input signal: the first method ("Memory") by additionally considering delayed samples of every sensor in the input variables (in a so called tapped delay line). The second method ("Derivatives") accounts for the dynamics of each sensor by considering the derivatives of the signal in addition to the signal itself. Figure 4.11 depicts the gas quantification results when considering both alternatives. For the first case ("Memory"), the x-axis k=0...5 represents the number of additional delayed samples for each training point, while in the second case it represents the maximum order of derivatives taken into account as additional inputs to the inference process. The first conclusion from these results is that our GP quantification was not able to infer the dynamics of MOX sensors from delayed samples of the sensor signals, and thus, the quantification results do not improve when increasing k. Furthermore, and possibly due to the increase in the input dimensionality, the results tend to get worse for high values of k, probably due to curse of dimensionality. On the other hand, the "Derivatives" approach yields slightly positive results. The improvement is mainly observable in the RMSE where mean as well as the confidence intervals decrease when increasing k. 4.5 Conclusions and outlook In this chapter we proposed a new approach for gas concentration estimation using an array of MOX gas sensors in a Open Sampling System (OSS). Despite its importance, this topic has been largely neglected. We addressed the problem in a probabilistic manner and used Gaussian Processes to estimate a posterior distribution over the gas concentration given the response from an array of MOX sensors. This has the advantage of enabling not only predictions of the expected gas concentration but also predictions of the uncertainty of this estimate. This advantage is particularly relevant for OSS applications where typically many sources of uncertainty exist. In the first part of this chapter, we focussed on gas quantification using a single MOX sensor, and then turned to gas quantification using a sensor array. We found a clearly improved prediction quality with a sensor array compared to using a single sensor. Given the high correlation among different MOX sensors, we used ARD to 100 CHAPTER 5. DEALING WITH OBSTACLES AND THE EPHEMERAL NATURE OF ODORS IN GAS DISTRIBUTION MAPPING than older ones. Thus, observations taken at the same locations and separated in time will be combined according to their respective weights. As estimation tool for the gas mapping process, we propose to employ a Gaussian Markov-Random-Field (GMRF), which perfectly suits the characteristics of GDM by accounting not only for the information carried by the gas observations, but also for any prior knowledge which, in our case, includes both the obstacles in the environment (detected by the robot sensors), and the physics of how gases spatially distribute. A C++ implementation of this method has been integrated into the Mobile Robot Programming Toolkit (MRPT), and its source code is available online1at http://mrpt.org. The rest of this chapter is organized as follows. We first discuss the related literature on GDM with mobile robots in Section 5.2, to continue with the introduction of the proposed probabilistic model for GDM in Section 5.3. Then, we show how the maximum a posteriori (MAP) estimation becomes a sparse least squared problem in Section 5.4, and finally, in Section 5.5, we report simulated and real experimental results. 5.2 Related research We are interested in statistical modeling of gas distributions without making strong assumptions about the environmental conditions (temperature, pressure or airflows). Given that analytical solutions are intractable, it is common practice to divide the space into a regular lattice of cells (gridmap), and then estimate a probability density function (pdf) of the gas concentration at each cell of the grid. Under these circumstances, only a few gas distribution modeling methods have been proposed in the literature. As mentioned in Section 2.4.3, the most remarkable works in this field have been reported by Lilienthal and colleagues. In the pioneer work [85] they proposed the kernel-based method, which consists of convolving sensor readings with a Gaussian kernel, thus providing a representation of the gas map without assuming any predefined parametric form for the distribution. This method was later extended for the case of multiple odor sources [96] and to the three-dimensional case [124]. It was further shown how gas distribution mapping methods can be embedded into a Blackwellized particle filter approach to account for the uncertainty about the position of the robot [87]. More recently we find approaches that, in addition to providing the most-likely value for the gas distribution, also estimate the uncertainty (via a variance value) for each grid cell of the map. In [89], Lilienthal et al. carried out two parallel estimation processes, one for the mean and another for the variance, understanding the latter as the variability of the gas readings, not the uncertainty in the mean estimation which is the standard in probabilistic estimators. In [9], Blanco et al. proposed another ap- 1In particular, the method described in this chapter is implemented in the class mrpt::slam::CRandomFieldGridMap2D, part of the mrpt-maps library. 5.3. MODELING GDM AS A MARKOV RANDOM-FIELD 101 proach, in this case based on a Bayesian interpretation of the problem, which also obtains the variance of each map cell employing a sparsified Kalman filter. None of these works take into account the constraints imposed by the obstacles of the environment when estimating the gas distribution, neither the physical fact that the information provided by a gas sensor vanishes with time. The latter, however, was pointed out by Assadi et.al [5], although, as far as the author knows, no map estimator taking this into account was ever reported. Therefore, the GMRF-based approach proposed in this chapter exploits, for the first time, both concepts. 5.3 Modeling GDM as a Markov Random-Field In this section we introduce the basis for the estimation of the gas distribution over a 2D lattice of cells using GMRFs. We also describe the highly-sparse structure of the problem which leads to efficient estimates of the problem and, finally, we present our model for observation time-varying uncertainty. 5.3.1 Probabilistic model for GDM The proposed approach aims at estimating the probability density function of the gas concentration in an environment. As in most previous works on GDM we simplify the problem by estimating a discrete two-dimensional map, dividing the space into a rectangular lattice of cells. A map m={mi}N i=1is then modeled as a random field where miare scalar variables standing for the gas concentration inside the i0th cell with coordinates (xi,yi). Let Nbe the overall number of variables in the map, such that if the map is Nx×Nycells, N=NxNy. Notice that this model resembles occupancy grids in robotics, with the difference of not holding a discrete distribution (occupied vs. free) but a continuous magnitude. Concretely, the gas concentration at each cell is modeled as a univariate Gaussian distribution Nµi,σ2 i, with µiits mean estimate and σ2 ithe corresponding uncertainty (see Figure 5.2). Our goal is obtaining the maximum a posteriori (MAP) estimation of m, along with its uncertainty, given the gas concentrations measured by the robot e-nose (random variables z) and some prior knowledge that includes (i) how the gas spread over the environment, and (ii) how the perceived obstacles affect the propagation of gases between nearby cells. Given the small space sampled by an e-nose (even when employing pumps or fans to aspire the air), this prior is extremely important for inferring the gas concentration at distant locations not subject to direct sensing. Our proposal is to use a Markov Random-Field (MRF), a tool widely employed in other estimation problems on grids. For example, in image processing, where statistical models are defined for the intensity of image pixels [157]. Notice the strong analogy between problems such as image de-noising or image restoration and the GDM stated here, where gridmap cells play the role of pixels. According to the Hammersley-Clifford theorem [18], the joint probability distribution p(m,z)can be expressed as a Gibbs distribution, that is, it can be factored 102 CHAPTER 5. DEALING WITH OBSTACLES AND THE EPHEMERAL NATURE OF ODORS IN GAS DISTRIBUTION MAPPING x y Gas concentration pdf of the concentration at cell (xi,yj) yj xi i j x y µ i j x y σ Figure 5.2: The 2D map is represented by a lattice where each cell keeps the estimate of gas concentration by means of a Gaussian density, represented here along the vertical axis. as the product of the potential functions ϕ(·)for the set of all its maximal cliques (Cm) [6]: p(m,z) = 1 Z∏ C∈Cm ϕC(nC)(5.1) where the proportionality constant Z(called the partition function) is not relevant in our problem, Cdenotes the different cliques and nCthe set of variables (m,z) in that clique. Since we are restricted to potential functions which are strictly positive ( ϕ(·)>0 ), it is convenient to express them as exponentials: p(m,z)∝∏ C∈Cm exp{−E(nC)}(5.2) =exp(−∑ C∈Cm E(nC)) where Eis the energy function, obtained by adding up the energies of each of the maximal cliques. An intuitive and convenient way of dealing with the dependencies encoded in a MRF is to consider its factor graph [20] as the graphical model from which to derive the optimization equations. In this graphical model, each potential functions ϕ(·) 5.3. MODELING GDM AS A MARKOV RANDOM-FIELD 103 Observations Nodes represent cell concentrations mx,y zk zi mx‐1,y mx+1,y mx,y+1 mx,y‐1 Figure 5.3: Factor graph derived from the MRF employed in our approach. There are two types of nodes: gas concentrations at cells (white circles), and gas observations (grey shaded circles), and two kind of factors: prior factors (Fp), and observation factors (Fo). over a maximal clique becomes a factor F. As shown in Figure 5.3, this model comprises two kinds of nodes: (i) gas concentrations at cells (unknowns to be estimated), and (ii) gas observations (known data). We also define two distinct sets of factors between nodes: observation factors which represent sensor observations and constrain the concentration value of a cell iaccording to all sensor measurements taken by the robot at that cell, and prior factors, which being independent of observations capture our a priori knowledge on how the gas distribution behaves over space. Attending to the two different set of factors, the joint probability distribution can then be expressed as: p(m,z)∝exp(−∑ Co Eo(nCo)−∑ Cp Ep(nCp))(5.3) 5.3.2 Factor parameters We assume that all the conditional distributions involved in the problem can be reasonably modeled as Gaussians, thus the underlying graphical model becomes a Gaussian MRF (GMRF). This assumption works well in practice, as demonstrated experimentally. Therefore, we need to provide the parameters of each Gaussian distribution that appears in our graphical model in order to have it completely defined. 104 CHAPTER 5. DEALING WITH OBSTACLES AND THE EPHEMERAL NATURE OF ODORS IN GAS DISTRIBUTION MAPPING Observation factors They encode the observation model, that is, the relationship between an e-nose reading and the true gas concentration of the cell at which it was taken. Let Mbe the number of e-nose observations collected by the robot. Each observation consists of a gas concentration value zktaken at a particular cell ikat a given instant of time tk, with k=1...M. Each such observation is assumed to be corrupted with two additive Gaussian errors: one from the inherent sensor noise (ωk∼N(0,σ2 s)) and another time-dependent term that models the potential changes that may have occurred since the sensing time (ζk∼N(0,σ2 ζ(t−tk))). With this last noise, we model the loss of information of a measurement as an increase of uncertainty (variance). Denoting the ideal (noiseless) sensor model as h(m), we have: zk=h(m)+ωk+ζk(5.4) Given the moderately large size of grid cells in GDM (typically in the range of decimeters) it becomes reasonable to assume that every measurement is associated to one single cell, the one which the robot e-nose is sniffing at, which takes us to the minimalistic sensor model h(m) = h(mik) = mik. Under a probabilistic point of view, each observation factor in the graphical model then stands for the conditional pdf: p(zk|m) = p(zk|mik) = N(mik,σ2 s+σ2 ζ(t−tk)) (5.5) where we have applied the conditional independence between zkand the rest of the cells given mik. Then, the energy function associated to the observation factors can be expressed as: Eo=∑ Co Eo(nCo) = M ∑ k=1 (mik−zk)2 σ2 s+σ2 ζ(t−tk)(5.6) We must stress the novelty of the time-increasing variance σ2 ζ(t−tk)above: if two observations from the same cell are combined to estimate its gas concentration, this variable variance gives more weight to the most recent one. This physical-grounded concept has been obviated in previous works. Eventually, during a GDM process the variance of older measurements will become large enough as to neglect them. Thus, in practice, only a finite set of Mobservations will account for the estimation, bounding the overall computational complexity of our method for a fixed-size map. Prior factors These factors capture the knowledge about how gases distribute spatially. Particularly, we want to model the correlation between gas concentrations of neighboring cells. 5.3. MODELING GDM AS A MARKOV RANDOM-FIELD 105 We insist in the necessity and relevance of this term in GDM, since gas observations provide us very localized information, i.e. only for the cell at which the sample was taken. Correlation between cells: Previous approaches based on kernel methods [89] or Kalman filtering [9] have modeled these correlations as Gaussian functions. Similarly, we model the correlation between cells by penalizing the difference in the gas concentration (li j) between pairs of (vertically and horizontally) adjacent cells: li,j=mi−mj(5.7) where mi,mjare the gas concentrations at adjacent cells with lattice indices iand j, respectively. Each prior factor then stands for the following pdf: p(li,j|¬oi,j) = N(0,σ2 p)(5.8) meaning that adjacent cells are forced to have the same gas concentration with a tolerance stated by σ2 p. The meaning of the conditioning on ¬oi,jis explained next. Obstacles: Environment obstacles and their influence in the gas distribution must be accounted for while modeling the expected difference between adjacent cells in Eq. (5.7). We assume that the probability of their intermediary space to be occupied, P(oi,j)∈[0,1], is readily available in the form of an occupancy grid representation of the environment. Note that the cell size of this grid is not required to match that of the gas map and, in practice, will often be finer. Denoting as oi,jthe fact that an obstacle exists between cells iand j, we can then apply the law of total probability over the two only possibilities (either oi,jor ¬oi,j) to obtain: p(li,j) = p(li,j|oi,j)P(oi,j)+ p(li,j|¬oi,j)P(¬oi,j)(5.9) where P(¬oi,j) = 1−P(oi,j)and p(li,j|¬oi,j)was already given in Eq. (5.8). Regarding our a priori distribution for li,jin the case of an obstacle blocking the way between two cells, it seems reasonable to assume no correlation at all. Then, a good candidate for p(li,j|oi,j)is a uniform distribution over a sufficiently large interval. Since mixing Gaussians and uniform densities would prevent the formulation of the estimator as a least-squares problem, the following approximation is conveniently proposed: p(li,j)≈N 0,σ2 p (1−P(oi,j))2!(5.10) which only exactly matches the ideal model in Eq. (5.9) for P(oi,j)equals to 0 or 1, while providing a smoothly changing Gaussian model for intermediary values. Since the relevant parts of the map will have occupancy probabilities close to these extremes 106 CHAPTER 5. DEALING WITH OBSTACLES AND THE EPHEMERAL NATURE OF ODORS IN GAS DISTRIBUTION MAPPING Isolated room Opendoor Closed door Figure 5.4: Example MRF which considers the physical obstacles in the environment. Nodes represent the gas concentration at cells and edges encode the a priori assumption of correlation between some adjacent nodes. Factors and observations have been omitted here for clarity. it becomes a minor issue that Eq. (5.10) only poorly models Eq. (5.9) in unexplored areas where P(oi,j)is close to 0.5. As depicted in Figure 5.4, when two adjacent cells are physically separated by an obstacle (P(oi,j)→1), no correlation is assumed between these cells. Note that this leads to infinite variance in Eq.(5.10), which is not problematic since the estimator ultimately handles inverse variances instead. Finally, the energy function capturing the prior constraints reads: Ep=∑ Cp Ep(nCp) = L ∑ k=1 (mik−mjk)2 σ2 p/(1−P(oik,jk))2(5.11) with Lthe number of pairwise cliques of cell nodes in the GMRF, and ik,jkthe adjacent cells for each such pairwise clique k. 5.4 Maximum a posteriori estimation of the GDM We show next how the MAP estimation of the GDM becomes a least-squares problem for the proposed GMRF model. We also describe that the uncertainty of the estimated map can be retrieved from its graphical model. 5.4.1 Derivation We start by conditioning the gas concentration map mto all available data, that is, to all gas observations z={z1,...,zM}. Then, we seek to maximize the posterior p(m|z1:M)∝p(m,z1:M)which gives us the MAP estimate ˆ m. 5.4. MAXIMUM A POSTERIORI ESTIMATION OF THE GDM 107 By taking the negative logarithm over such posterior, the complete energy function becomes the well-known least-squares form of a GMRF inference problem, which in our case reads: E(n) = L ∑ k=1 (mik−mjk)2 σ2 p/(1−P(oi,j))2+ M ∑ k=1 (mik−zk)2 σ2 s+σ2 ζ(t−tk)(5.12) We can rearrange the terms of the energy function E(·)as a sum of quadratic errors rweighted by an information matrix Λ, i.e. E(n) = r>Λr. Errors can be conveniently defined in terms of a prediction function f(m)such that r=f(m)−yfor some vector of known data y. From the assumed statistical independence between variables and model noises, it follows that Λis diagonal, leading to: E(n) = r>Λr= L+M ∑ k=1 Λk(fk(m)−yk)2(5.13) where the ksubscript denotes the corresponding scalar entry in each matrix or vector. The minimum of the quadratic expression in Eq. (5.13) can be found by solving the Newton method equations [31, 21] (refer to Appendix D): (J>ΛJ) | {z } Hessian H ∆m∗=−J>Λ(f(m)−y) | {z } Gradient g (5.14) where J=dr dmis the Jacobian of the error function r, and ∆m∗is the increment that leads to the MAP estimate ˆ m. It should be emphasized that unlike other mapping problems in mobile robotics, both factor types (Fp,Fo) are linear with the map m, which implies that ˆ mcan be solved in closed form, without iterating. Matching the generic Eq. (5.13) to our particular case in Eq. (5.12) we have: f(m) = [ l1(·)··· lL(·)|mi1··· miM]> y= [ 0··· 0|z1··· zM]>(5.15) from which in section 5.4.2 we will derive the sparse Jacobian expressions. Regarding the (L+M)×(L+M)information matrix Λ, its first Ldiagonal entries correspond to the prior factors, that is, to the correlation between adjacent cells, and is Λpk= (1−P(oi,j))2/σ2 p. The rest Mdiagonal entries are the weights of enose observations, which decrease over time according to their "age", that is, Λok= 1/(σ2 s+σ2 ζ(t−tk)). As a important remark for an efficient implementation, the Ax =b-like system of equations to be solved in Eq. (5.14) is highly sparse due to the strongly local structure of the constraints, leading to a symmetric banded Hessian matrix with a bandwidth ofW=max(Nx,Ny). Then, a sparse LL>(Cholesky) decomposition can be 108 CHAPTER 5. DEALING WITH OBSTACLES AND THE EPHEMERAL NATURE OF ODORS IN GAS DISTRIBUTION MAPPING used for efficiently factoring and solving the system in O(NxNyW2)and O(NxNyW) time, respectively [7, p.220]. This means that, for example, estimating a square map with N=NxNycells has an overall cost that grows with O(N1.5). 5.4.2 Jacobian, Hessian and Gradient Based on Eq. (5.14) and the particular structure denoted in Eq. (5.15), next we devise the structure of the system matrices: • Jacobian J: The Jmatrix contains the dr dmfor every factor in the graph. Rows of the Jacobian derived from prior factors contain zeros but for the i’th and j’th columns, corresponding to adjacent cells in the map (see Eq. (5.11)), which have values 1 and −1, respectively. Rows for observation factors are all zeros except at the column of the observed cell. J=                     m1m2··· mi··· mj··· mN 11−1··· 0··· 0··· 0 21 0 ··· −1··· 0··· 0 . . .. . . L0 0 ··· 1··· −1··· 0 L+10 1 ··· 0··· 0··· 0 L+21 0 ··· 0··· 0··· 0 . . .. . . L+M0 0 ··· 1··· 0··· 0                     • Hessian H: Since all functions in our problem are linear, the Hessian is exactly J>ΛJ. The existence of two blocks in the Jacobian matrix, with its upper block corresponding to the prior factors which typically will not change over time, advices us to decompose the Hessian into the sum of two components: H=Hp+Ho(5.16) The first part, Hp, only contains the following nonzero entries: –Each off-diagonal entry Hp(i,j)is the sum ∑kJ(k,j)Λpkfor each prior factor k relating cells (i,j). Following the graphical model in Figure 5.3, and attending to the sparse structure of the Jacobian, in our case Hp(i,j) = −Λpkif cell iis adjacent to cell j, zero otherwise. –Each diagonal element Hp(i,i)becomes the sum ∑kJ(k,i)ΛpkJ(k,i) = ∑kΛpk, for each prior factor k defined over cell i, that is, for each neighbor of cell i. 5.5. EXPERIMENTAL EVALUATION AND DISCUSSION 109 The second part, Ho, is exactly diagonal and depends only on the observations. The i0th element of its diagonal Ho(i,i)amounts to ∑kΛok, being k the index of each observation taken at cell i. • Gradient vector g: The gradient vector g=J>Λr, with length the number of grid cells N, simply becomes: gi=∑ k Λok(mi−zk)+∑ j Λpk(mi−mj)(5.17) for all the observations ktaken at cell i, and all the neighbor cells jof cell i. 5.4.3 Recovering the uncertainty To obtain the uncertainty of the gas distribution at each cell, we have to compute the diagonal of H−1. Each diagonal element H−1(i,i)corresponds to the variance of cell i(σ2 ii ). Given that matrix inversion is a computationally expensive operation, and since we are only interested in recovering the diagonal of the inverse Hessian, efficient approximations as the one presented by Golub and Plemmons [48] can be employed. They proposed a method for recovering only the entries σi j of the covariance matrix Σ that coincide with nonzero entries in the factor matrix R, being Rthe upper triangular matrix that results from the Cholesky decomposition of H. 5.5 Experimental evaluation and discussion This section presents an experiment aimed at validating the performance of the proposed method when estimating the GDM of a time-variant gas distribution in an indoor scenario. The experiment consists of a mobile robot which is patrolling an area with several rooms while building a GDM of the inspected environment. To provide quantitative results of the accuracy of the estimated gas maps, as well as to allow for a stringent comparison between different GDM methods, we first perform the experiment in simulation in order to have a ground truth (GT) of the gas distribution. Then, we carry out a real experiment in a very similar scenario. 5.5.1 Experiment setup Both the real and simulated experiment are conducted in an indoor scenario composed of two adjacent rooms connected through a corridor (see Figure 5.5). Each room is inspected through a complete loop by a mobile robot equipped with an e-nose which collects samples along the path (red-dashed line). To go from one room to the other, the robot traverses the corridor (path marked as blue-dashed line). 116 CHAPTER 5. DEALING WITH OBSTACLES AND THE EPHEMERAL NATURE OF ODORS IN GAS DISTRIBUTION MAPPING As can be noticed, the results are quite similar to those obtained in simulation, which corroborates the already highlighted advantages of our proposal. The main difference resides in the presence of low concentration gases in the left room at timesteps t4and t5, after the ethanol bottle is closed. This can be attributed to the fact that the time elapsed since the ethanol bottle was closed till the robot inspected back the room, was not enough to allow the gas to be completely "removed" from the environment. 5.6 Conclusions and outlook In this chapter we have revised the problem of creating a map of the gas distribution and proposed a new approach that accounts for two important issues that had been ignored in previous works: the validity of the observations over time and the presence of obstacles in the environment. The former is achieved by introducing a time-decreasing weighting factor to each gas observation. Thus, when combining observations taken at close locations, their longevity is used to determine their respective relevances, avoiding the detrimental "average" effect of previous approaches. On the other hand, obstacles such as walls or furniture are now taken into account by modeling the correlation between the map cells they separate. We have addressed the problem in a probabilistic manner modeling the problem as a MAP estimation over a Gaussian Markov Random-Field (GMRF). Our approach has been validated with simulated and real experiments, providing qualitative and quantitative comparison with classical methods and demonstrating the advantages in the estimation of the gas distribution. Future work includes the consideration of additional sources of information such as vision or semantics to improve the way cell correlations are modeled, exploiting properties of the obstacles that influence the gas dispersion (shape, height, etc). Furthermore, efficient alternatives to obtain the GDM of non rectangular scenarios will be studied, for example, by only estimating the gas concentration at desired areas instead of the complete rectangular lattice. Chapter 6 Conclusions This thesis has addressed the problem of gas sensing with mobile robots, paying particular attention to the detection of gases with an array of metal oxide semiconductor (MOX) gas sensors, and to the tasks of gas distribution mapping in natural environments. In robotics applications gas sensors are usually deployed in the so called open sampling systems (OSS). Here, sensors are directly exposed to the environment, which enables gathering valuable information about the dynamics of the interaction between the sensors and the gases to be analyzed. However, this also entails that gas readings are strongly influenced by the dispersal mechanisms of gases, especially in natural, real environments where turbulent advection produces the distribution of gases to be patchy and chaotic. Additionally, the limitations of the current state of the gas sensing technology make even more difficult the development of olfactory robots able to autonomously accomplish tasks like gas source localization or gas distribution mapping. This is specially important for MOX sensors due to their lack of selectivity, slow recovery and dependence of the environmental conditions. Two approaches to palliate one of their main drawbacks, the long recovery period, were proposed in Chapter 3. This disadvantage limits their suitability to applications where the sensors are exposed to rapid changes of the gas concentration. The long duration of the acquisition cycles (up to tens of seconds) is of especial concern for mobile robotics, since inaccurate readings are inevitable when measuring the gas concentration. It is particularly noticeable in the decaying phases, when the output of the sensor recovers to the baseline level. Consequently, steady state values are rarely reached, and therefore gas sensing based on MOX technology must deal with the transient information of the signals. The first proposal to overcome the slow recovery of MOX sensors consisted of the introduction of a new electronic nose, the multi chamber electronic nose (MCE- nose). The key of the proposed design is the accommodation of a set of redundant sensors in different chambers, being alternatively activated to ignore the inaccurate 117 118 CHAPTER 6. CONCLUSIONS sensor output when a decay phase is detected. The output signal then results from the concatenation of the rise phases of a sequence of MOX sensors. Increasing the number of chambers also increase the possibility of having an array of sensors at the desired baseline level and, consequently, the possibility of sensing faster changes in the gas concentration. However, a higher cost, power consumption and complexity are also a direct consequence of having more chambers, thus the optimal number strongly depends on the characteristics of the target application. A prototype of the MCE- nose was built and integrated in a mobile robotic platform under the OpenMORA robotic architecture, being tested in real experiments to measure the improvement in the sensing of rapid changing gas concentrations. Through these experiments it was found that although small, the differences on the replicated sensors hosted in the different chambers, compromised the correct chamber-switching functionality of the MCE-nose. These differences, which are mostly due to the fabrication process, but also ageing or poisoning, require therefore a pre-calibration of the system to achieve proper results. In contrast to the MCE-nose, the second approach suggested in Section 3.4 compensates the slow dynamic behavior of MOX sensors by forecasting the steady state values of the sensor resistance from a sequence of transient measurements. In general, MOX sensor models proposed in the literature seek to predict the sensor output (resistance) when exposed to a certain gas concentration profile. The suggested approach is inspired on reversing such a model: given a sequence of measurements from the transient response of the MOX sensor, the concentration profile of the exciting gas is forecasted by estimating the steady state values of the sensor resistance. The exploited model is based on two first order systems (rise and recovery) with time constants that depend on the sensor reading amplitude. Different experimental scenarios were presented for the validation of the suggested model-based approach. These experiments demonstrated how the "long tail" effect of the recovery phases could be effectively avoided, something that prevents the overlapping between the rise and recovery phases of the MOX sensor. On this basis, the profile of the gas concentration as estimated by the model, provides values more consistent with the reality than when using the raw sensor signal. Additionally, it was proved that both, the MCE-nose and the inverse MOX model, entail a considerable increase in the speed at which a mobile base carrying a MOX-based e-nose can inspect the environment. The latter directly implies an important reduction in the execution times of olfaction related tasks. In mobile robotics, many of the olfaction related tasks require determining the gas concentration the sensors are being exposed to. This is a crucial step for realistic gas sensing applications since legal requirements and regulations are expressed in terms of absolute gas concentration, toxicity levels, etc. Additionally, and due to the chaotic nature that dominates gas dispersal in OSS, in most cases it is desirable to provide, together with an estimate of the mean concentration, an estimate of the uncertainty of the prediction. As a solution to this quantification problem, a supervised machine learning approach based on Gaussian Processes (GPs) was presented in Chapter 4. This issue has been addressed in a probabilistic manner, estimating a posterior distribution over the gas concentration given the response from an array of 119 MOX gas sensors. This has the advantage of enabling not only predictions of the expected gas concentration but also predictions of the uncertainty of this estimate. Different configurations of the array of gas sensors were studied, and automatic relevance determination (ARD) was considered to exclude those sensors not relevant for the estimation of the posterior gas distribution. Finally, two suggestions to account for the dynamics of the MOX response within the quantification problem were analyzed. Interestingly enough, Experiments showed that neither using additional samples from previous time steps, nor adding the signal derivatives, produced any significant improvement. From a mobile robotics perspective, GDM addresses the problem of estimating the spatial distribution of volatile substances using a mobile robot equipped with an electronic nose (e-nose). The proposed algorithm described in Chapter 5 presents the novelty of accounting for two important issues that have been ignored in previous works: the validity of a gas observation as time goes by (ageing) and the presence of obstacles in the environment. Odors are ephemeral, thus, we can say that the information carried by a given gas measurement quickly vanishes as time goes by. A timedecreasing weighting factor was then suggested as a measure of the "age" of each gas measurement, modeling the fact that recent measurements more significantly represent the current gas distribution than older ones. On the other hand, obstacles such as walls or furniture are also taken into account in the GDM process by modeling the correlation between the map cells they separate. These two considerations produce maps of the gas distribution which are more compliant with the actual mechanisms of gas dispersion. The problem was addressed in a probabilistic manner, modeling it as an efficient MAP estimation over a Gaussian Markov Random-Field (GMRF). Results of time-variant GDM experiments were presented, providing a detailed comparison with existing mapping methods in both, simulated and real scenarios. Among the important advantages introduced with this new method, highlight the fact that the "averaging" effect between recent observations and older ones is avoided, which presents a faster adaptation of the map to changing gas concentrations. Apart from the specific lines for future work included in the different chapters of this thesis, we envisage as a long-term path the integration of the gas sensing advances and algorithms presented in this thesis within the area of home-oriented robotics applications. Service robots are a potential market niche that is nowadays blooming because of the continuous advances in the field (SLAM, navigation, semantics, etc) and the greater availability of commercial robots. However, since artificial olfaction is not mature enough, most commercial robots do not yet incorporate gas sensing devices. In spite of this, we believe that olfaction can play a key role in making service robots more intelligent and valuable, by combining it with other sensing modalities like vision, range sensing or touch. Appendices 121 Appendix A Rhodon: a gas sensitive robot This appendix is devoted to Rhodon, the gas-sensitive robot that has been used in most of the experiments presented in this thesis. Rhodon has been built with the funding supplied by the Andalucía Government and the European Regional Development Fund (ERDF) under project TEP-2008-4016. The author, among the rest of the MAPIR group, has devoted great efforts to the development of this robot, including both software and hardware implementation tasks. Rhodon is a mobile robot intended to perform olfaction tasks. It has been constructed upon a Patrolbot commercial platform [106], on which a number of sensors and devices have been integrated. Additionally, a structure has been mounted on the platform in order to support the sensory system, which comprises, among other devices, two radial laser scanners (front and back), a ring of sonar sensors and a Kinect sensor. However, during the course of this thesis, both its structure and components have varied significatively to cope with the requirements of the new experiments and to adapt to the advances in the sensing technology. Next, we detail the main characteristics of the robot along its different stages. A.1 First Stage: Experimental mobile platform At the beginning of this thesis, Rhodon was composed only by the Patrolbot mobile platform on which a laptop, a SICK LMS200 and a custom designed e-nose were mounted. Due to the simplicity of the sensory system, no structure was necessary as shown in Figure A.1. The SICK laser range scanner (embedded in an internal compartment designed to accommodate such sensor) was only intended to provide precise detection of obstacles, since localization was still not achieved at this early stage. The robot olfaction capability was provided by an e-nose which design was based in a mono-PCB with a central circular opening. The array of gas sensors composed by 6 TGS (Figaro) and 2 MiCS (e2V) gas sensors, was distributed around this aperture. A small fan placed over 123 124 APPENDIX A. RHODON: A GAS SENSITIVE ROBOT (a) (b) (c) Figure A.1: Images of Rhodon at its initial stage of development. Only a laptop and a custom designed e-nose were then mounted on the Patrolbot mobile platform. the circular opening generated then a constant airflow through the array of sensors, allowing the sensing of different volatile substances. This simple setup was employed on the first olfaction experiments of this thesis, those related to improve the gas sensing process with a mobile robot as detailed in Chapter 3. The onboard e-nose was then substituted by an improved sensor: the MCE-nose (see Section 3.3). Figure A.2 shows different snapshots of experiments carried out with this robotic setup. Due to the simplicity of the experiments at this stage where neither precise localization nor high computation was required, no additional sensors or electronic devices where integrated. Even the sonar ring (embedded in the Patrolbot platform) was not employed at this stage. (a) (b) (c) Figure A.2: Images of Rhodon during different experiments carrying the novel MCE-nose. A.2. SECOND STAGE: AUTONOMOUS MOBILE OLFACTION ROBOT 125 A.2 Second Stage: Autonomous mobile olfaction robot Raised by the the need of computational power for executing the more and more sophisticated and complex algorithms, as well as to provide autonomy to the robot with tasks such as navigation, obstacle avoidance, path planning, etc., Rhodon was rebuilt completely. At this stage, a structure to organize the different devices, sensors and electronics was built. To improve the range sensing capabilities for tasks as localization and mapping, another laser scanner (Hokuyo UTM-30LX) was integrated at the rear of Rhodon, providing together with the already mounted SICK a 360° field of vision. The laptop was then replaced by a compact and powerful computer to cope with the requirements of high computational capacity. Additionally, a touch screen was placed at the top of the structure to improve the interaction with the user. Due to the consequent increase in power consumption, a set of commercial 12Vbatteries was mounted to avoid an excessive discharge of the mobile platform batteries, improving the robot autonomy time. Finally, a panel of switches was placed at one side of Rhodon, allowing the control of which components are turned-on or off. Figure A.3 shows two pictures of the resulting setup, pinpointing the onboard components. Naturally, a software architecture was then a necessary step towards an autonomous gas sensitive robot. The open mobile robot architecture (OpenMORA) [41] was then introduced. It is a MOOS [114] and MRPT [108] based distributed architecture for (a) (b) Figure A.3: (a) Picture of Rhodon during an olfaction experiment.(b) Description of the different elements onboard. 132 APPENDIX B. AN OLFACTION PLUGIN FOR SIMULATING MOBILE ROBOTICS OLFACTION associated observations (generally laser scans). These simplemap files can be easily obtained by a generic ICP-based algorithm. Figure B.2 displays an example of both alternatives. Additionally, there exists also the possibility for arranging the map in a metric-topological structure as described in [8]. B.2.2 Robot simulation block This block concerns three modules related to the simulation of the robot: the motion control, the localization of the robot in the environment, and the simulation of the sensors onboard. Motion control: This module is in charge of simulating the movements of the robot. It implements different control alternatives: 1. Joystick mode, where the simulated robot moves following the commands provided by a user controlled joystick/keyboard. 2. Path planning with reactive navigation. In this mode, the robot automatically plans the best route to follow according to the distance to a user defined destination, while avoiding obstacles encountered along the path. The reactive navigation employs space transformations (PTGs) to drive the simulated robot using an internal simpler holonomic algorithm [10]. 3. Predefined paths. In this mode the path is given as a sequence of nodes for the robot to go through and, as before, a reactive navigator takes care Ground truth gasmap Laserscans Geometric map Ground truth wind map (a) Ground truth gasmap Laserscans Geometric map Ground truth wind map (b) Figure B.2: Two examples of geometric map input files: (a) a png image, and (b) a simplemap format file (created from odometry and laser scan observations of a real robot experiment). For both file formats, white colors represent free space while black occupied zones. B.2. DESCRIPTION OF THE OPENMORA’S SIMULATION ENVIRONMENT 133 of the obstacle avoidance. This mode allows defining paths for inspecting complex scenarios, as well as for reproducing the same paths in the experiments. Localization: The localization of the robot is handled by an efficient particle filter implementation [11], upon the information provided by the simulated robot odometry and laser scans, and a known map (see Section B.2.1). This method performs pose tracking of the robot using an adaptive number of particles. Sensing: This module simulates the responses of different sensory systems that can be configured on the simulated robot. Implemented sensors include: • Range scan lasers, as the SICK [140] or Hokuyo [58], which are useful for the correct localization of the robot, a fundamental requisite for the generation of GDM. • The robot odometry, which is simulated by providing linear and angular speeds. • Sonar sensors, which can be used to detect obstacles at low range. Gas sensors as the MOX or PID (see Section 2.2) are also considered. Nonetheless, a detailed description of their implementation is left for Section B.3, where the specific modules related to olfaction are described. B.2.3 Graphical user interface To visualize and manage all the simulated information, a powerful 3D graphical user interface (GUI) is integrated in the environment. Figure B.3 depicts its main components: 1. The system bar, which hosts the navigation buttons related to the localization and motion control of the robot (e.g. re-localize, stop, move to, etc), as well as with some visualization options. 2. The navigation planning, which details the nodes visited by the robot along the planned path (see Section B.2.2), as well as the coordinates of the target node where the robot is heading to. 3. The panel view. It is composed of a checkbox list that allows the customization of the 3D view by selecting which sensors and layers are to be displayed (e.g. the robot shape, position of the particles used for localization, laser beams, mean and variance gas distribution maps, wind, etc). 4. The 3D view. An OpenGL based viewer to visualize the simulation. 5. The system messages panel. It displays valuable information about the simulation status (exceptions, warnings, flags, etc) of the different modules being executed. 134 APPENDIX B. AN OLFACTION PLUGIN FOR SIMULATING MOBILE ROBOTICS OLFACTION 1 2 3 4 5 1. System bar 2. Current navigation planning 3. Panelview 4. 3Dview 5. System messages Figure B.3: Snapshot of the graphical user interface. B.3 The proposed olfaction plugin The olfaction plugin, which has been developed as part of this thesis, comprises three important parts as depicted in Figure B.1: a sensor model for MOX gas sensors, gas and wind ground truth maps, and several GDM algorithms. B.3.1 Model of MOX gas sensors A fundamental requirement for simulating olfaction tasks with mobile robots is to accurately describe the response of the gas sensors being simulated. This is even more important for the case of MOX gas sensors, since, as explained in Section 3.2, their long recovery times has a strong influence in the task performance. In the proposed plugin, the MOX sensor is modeled as low pass filters with different time constants for the rise and decay phases of the response (see Section 3.4 for a detailed description). Additionally, an additive Gaussian noise is considered to account for both the intrinsic sensor noise and the one in the measurement system. The plugin allows the simulation of multiple MOX sensors simultaneously (array of sensors). Each simulated sensor is defined by selecting the target gas it is sensitive to and the characterization of its parameters: time constants and noise. This enables the simulation of complex tasks which require to detect multiple gases. B.3.2 Ground-truth of gas concentration maps As mentioned in above, having a ground truth (GT) of the gas distribution at each time step is fundamental for validating and comparing GDM approaches. The plugin provides two different types of ground truth maps (see Figure B.4): B.3. THE PROPOSED OLFACTION PLUGIN 135 • GT wind maps: By default, the plugin is only able to simulate constant wind fields, that is, homogeneous laminar flows. Although constant flows are not a very realistic model, they are very simple to configure and straightforward for comparison of different GDM approaches. To account for more realistic wind fields, including turbulence and obstacles, future development will consider the loading of computational fluid dynamic (CFD) simulations. • GT gas maps: Given the complexity of the gas dispersal mechanisms and the many different configurations for the simulation (turbulence strength, single or multiple gas sources, source positions, obstacles, etc), the proposed plugin does not generate the GT gas maps itself, but rather it allows loading them from third party software. One interesting property is the fact that it can handle multiple GT gas maps simultaneously. This enables, for example, to account for the simulation of multiple gases in the environment (e.g. multiple and different gas sources). Additionally, GT gas maps can be static (e.g. being obtained from a simple grayscale image), or dynamic, being loaded from a sequence of successive gas maps at a configurable rate. B.3.3 Gas distribution mapping algorithms The plugin is specifically designed for developing and testing GDM algorithms, thus, it implements the most important alternatives proposed in literature. • Kernel methods: Two different kernel methods for GDM are included. The first one, described in [85], convolves the sensor readings using a radially symmetric two-dimensional Gaussian functions to estimate the gas distribution, while Ground truth gasmap Laserscans Geometric map Ground truth wind map Figure B.4: Snapshot of a gas ground truth map (left) as displayed by the GUI, together with the geometric map and the simulated laser scans. (right) Sample of a wind ground truth map, displaying the vector grid that indicates the wind direction and strength (color scaled). 136 APPENDIX B. AN OLFACTION PLUGIN FOR SIMULATING MOBILE ROBOTICS OLFACTION a later version called kernel DM+V [89], aims at probabilistic GDM by incorporating the variance in the estimation. • Kalman filter based method: This approach to GDM is based on sequential Bayesian estimation given a lattice of 2D cells treated as hidden variables using a Kalman filter [9]. Two implementations of the algorithm are available: a standard version which employs the whole covariance matrix in the computation of the posterior, characteristic of Kalman filters, and an efficient and optimized version for real time applications. The implementation and advantages of the latter are described in detail in the cited work. • Gaussian Markov Random-Field method: This is the novel approach to GDM presented in Chapter 5 which accounts for the aging of sensor observations as well as for the obstacles in the map. B.4 An illustrative example To illustrate the usefulness and potential of the proposed olfaction plugin, apart from the results presented in Section 5.5.2, in this section we estimate the GDM of a simulated environment, providing a detailed description for the different components, as well as the resulting maps for two different GDM methods. The simulated scenario consists of two adjacent rooms that the robot inspects to check for dangerous levels of contaminant gases. The robot path is defined in order to explore both rooms sequentially, as depicted in Figure B.5(a). For this experiment, and considering that the tested GDM methods do not account for wind information, we set a constant wind field of zero strength, while the gas ground truth map (see Figure B.5(b)) is set to simulate a gas leak in the leftmost room, by generating different gas patches dispersed around the middle table. Figure B.5(c-f) show the estimated maps using the kernel DM+V and the Kalman based method. The results can be analyzed in the GUI, or they can be saved to a file for a posterior analysis (e.g. using Matlab). A video of a similar simulation experiment can be found at: youtu.be/UKhtIem7u0g B.4. AN ILLUSTRATIVE EXAMPLE 137 (a) (b) (c) (d) (e) (f) Figure B.5: Snapshots of the illustrative example: (a) Metric map with the predefined inspection path (red circles represent nodes to visit, while green lines represent allowed paths). (b) Gas ground truth map and detailed view of the laser beams emitted by the simulated SICK laser. (c-d) 3D snapshots of the mean and variance maps for the Kernel DM+V method, and (e-f) for the Kalman based method. Appendix C Data-Sets for odor classification Odor classification by a robot equipped with an electronic nose (e-nose) is a challenging task for pattern recognition since volatiles have to be classified quickly and reliably even in the case of short measurement sequences, gathered under operation in the field. The discrimination of gases performed with this setup presents a number of additional challenges when compared to standard analyte identification applications, mostly due to the differences in the measurement conditions. While standard classification tasks usually host gas sensors inside a chamber with controlled humidity, temperature and airflow conditions; in robotics olfaction there is no control over the sensing conditions. This entails that the sensor signals to be processed are noisy and dominated by the signal transient behavior, as described in Section 2.3. Although classification is not the main focus of this thesis, in this chapter different classification data-sets gathered with an array of MOX gas sensors in an open sampling system are presented. These data-sets, available online at http://mrpt. org/Robotics_olfaction_dataset, are the result of a collaboration with the University of Bielefeld (Germany) and the University of Groningen (The Netherlands), which aims at classifying different volatiles using only short data sequences of high dimensionality. Nevertheless, by the time this thesis was written no published results were available, thus only the data-sets gathered for the experiments are presented next. C.1 Data-set 1: Controlled gas pulses The first data-set is composed by samples gathered under restrained environmental conditions. The objective is to collect a set of e-nose signals from different volatile substances under very similar conditions. It can then be used for training and validation at the initial developing stages of new classification algorithms. The odor samples are recorded from an e-nose containing an array of six different MOX gas sensors, whose readings are recorded to obtain an odor fingerprint of 139 140 APPENDIX C. DATA-SETS FOR ODOR CLASSIFICATION the odor. These sensors are Figaro TGS-2600, TGS-2602, TGS-2611 and TGS-2620, and two e2v sensors: MICS-5135 and MICS-5521. Those sensors are hosted within a small-volume chamber where a continuous airflow is injected through a pneumatic circuit powered by a pump. The aspiration of that circuit is done through a thin tube, allowing an easy handling in the smelling process described in Section C.1.1. Figure C.1 shows a snapshot of this setup. This data-set is comprised by 69 odor samples gathered by exposing the e-nose aspiration to gas pulses of seven different analytes (see Figure C.2): four of them are commercial alcoholic beverages (Negrita Rum, Larios and Gordon Gin, and Cointreau), and the other three are commercial polish remover based on acetone, standard ethanol and lighter’s gas (usually butane, but sometimes mixed with propane). Acetone is given by 9 samples and the other classes by 10 samples each. C.1.1 Setup Odor samples have been collected following a fixed and systematic protocol for all the samples and test runs. In all cases, the bottle containing the target odor (in liquid or gas state) was used directly to smell from it. Each sample is collected according to the following three-phases procedure: Seconds (0-30): For the initial 30s, the baseline level of each sensor in the array is estimated by measuring the sensor response in absence of the target gas. This is achieved by leaving the target volatile container closed and separated from the Figure C.1: Snapshot during the collection of the first presented data-set. It can be seen the e-nose aspiration (blue thin tube) and containers of different target odors. C.1. DATA-SET 1: CONTROLLED GAS PULSES 141 Negrita Rum Larios Gin Gordon’s Gin Cointreau Polish remover (Acetone) Ethanol Butane- Propane Figure C.2: The seven odor volatiles used on the first classification data-set. e-nose aspiration. After the first 20s, the container is opened and left unattended for another 10 seconds, allowing the stabilization of the gas dispersion rate and avoiding measuring a burst of concentration due to the time the container was closed. Seconds (30-90): For a duration of 60s the e-nose aspiration is placed next to the gas source (at a distance of 10cm approximately) exposing the sensor array to the target volatile. Seconds (90- ): Finally, the e-nose aspiration is taken away from the gas source allowing the sensor array to recover to its initial state (baseline). The volatile container is then closed to avoid an excessive contamination of the testing room. Due to the long recovery time of MOX sensors (see Chapter 3), the e-nose was left to recover its baseline level for almost 10 min. before starting a new run. Figure C.3 shows two different samples of such data-set. Notice that although the gas exposure was "controlled" by time exposure and distance to the source, strong fluctuations in the sensor readings occur due to the chaotic nature of gas dispersal. C.1.2 Data-set structure Each target analyte is represented by a folder containing all the samples in a plain text file format ("*.txt"). Each of these txt files (recorded using a sampling frequency of approximately 7Hz) is organized in columns as follows: Column 1 Time Column 2 Temperature (Not available) Column 3 MICS 5521 readings Column 4 MICS 5135 readings