• No results found

Gas Dispersal Simulation in ROS

N/A
N/A
Protected

Academic year: 2021

Share "Gas Dispersal Simulation in ROS"

Copied!
91
0
0

Loading.... (view fulltext now)

Full text

(1)

International Master’s Thesis

Gas Dispersal Simulation in ROS

Ali Abdul Khaliq

Technology

Studies from the Department of Technology at Örebro University 0

(2)
(3)
(4)
(5)

Studies from the Department of Technology

at Örebro University 0

Ali Abdul Khaliq

(6)

© Ali Abdul Khaliq, 2011

Title: Gas Dispersal Simulation in ROS ISSN1650-8580

(7)

Abstract

This work presents a 3-D gas dispersal simulation and olfactory detection sys-tem implemented in ROS. Gas dispersal simulation integrates OpenFOAM flow simulation and a filament-based gas propagation model to simulate gas disper-sion for compressible flows with a realistic turbulence model. The olfactory detection system models the response of metal oxide gas sensor to the simu-lated gas.

Olfaction related experiments in mobile robots can be highly complex and hazardous due to the involvement of flammable and toxic gases. Moreover, the results of mobile olfaction task depends on the characteristics of environment and on the characteristics of odor detection system. The precision of results of this task is usually effected due to the variability of interrelationships between these characteristics which can create complications to focus on task aspect. The motivation behind the development of this simulation package is to make environment and odor detection system controllable, where experiments can be repeated under identical conditions, bypassing the environmental hazards so that the research work can concentrate on task aspect.

The simulation package is validated through the results obtained by various tests including constant concentrations in ideal conditions as well as changing concentration in turbulent environment.

(8)
(9)

Acknowledgements

First, I would like to show my deepest gratitude to my supervisors, Sepideh Pashami and Achim J. Lilienthal, for their precious academic support, fruitful discussions and suggestions throughout the project work and thesis writing.

I would like to thank Sahar Asadi and Marco Trincavelli for their guidance and help. I would also like to thank researchers at AASS lab for their valuable ideas and comments.

Many thanks to my classmates for pleasant time we spent together in these two years. I also like to thank my friends here in Sweden for their support and friends back home because they always make me feel their presence, especially when I needed it.

I also thank my sisters and brother Khuram Abdul Khaliq for their uncon-ditional love, for supporting and cheering me up during these years.

Finally, I am grateful to my parents who have supported me remarkably. I am thankful for their love, prayers and moral support which gave me the strength in difficult times. They encouraged me to pursue my Masters stud-ies and without their encouragement and faith on me, I would not be able to achieve this.

(10)
(11)

Contents

1 Introduction 1

1.1 Motivation . . . 1

1.2 Related research . . . 2

1.3 Contributions . . . 4

2 Gas Dispersal Simulation 5 2.1 Introduction. . . 5

2.2 Gas Propagation Model . . . 5

2.2.1 OpenFOAM Turbulent Flow Model . . . 6

2.2.2 Filament-base Gas Dispersion . . . 6

2.3 Three-dimensional Gas Dispersion . . . 7

2.3.1 Acceleration Rate Estimation . . . 8

3 Gas Sensor Model 11 3.1 Introduction. . . 11

3.2 Gas Sensor Model Implementation . . . 12

3.2.1 Filament-based Concentration Calculation . . . 12

3.2.2 Gas Sensor Model Description. . . 12

3.2.3 Nonlinear Least-Squares Method . . . 13

3.2.4 Sensor Response Generation . . . 14

3.2.5 Low Pass Filter . . . 14

3.2.6 Rise and Decay Time Estimation . . . 16

4 Three-Dimensional Gas Dispersion Package in ROS 19 4.1 Introduction. . . 19

4.1.1 Robot Operating System (ROS) . . . 19

4.1.2 Used ROS Packages and Terminologies . . . 19

4.2 Stack Implementation in ROS . . . 21

4.2.1 Environment . . . 22

4.2.2 Dispersal_Simulation . . . 22

4.2.3 Simulated_MOX . . . 23

(12)

vi CONTENTS

4.2.4 Path_Planning. . . 23

4.3 Detailed Description of Message Pass System between Nodes . . 27

4.3.1 User Input: Source height . . . 27

4.3.2 Node: Environment. . . 27

4.3.3 Topic: Environment visualization . . . 27

4.3.4 User Input: Name of the gas for simulation . . . 27

4.3.5 Node: Dispersal_Simulation . . . 28

4.3.6 Topic: Dispersion visualizatio . . . 28

4.3.7 Topic: Chemical value . . . 28

4.3.8 User Input: Sensor height and sensor model . . . 28

4.3.9 Node: Simulated_MOX . . . 28

4.3.10 Topic: robot/odom . . . 29

4.3.11 Service: Odor value . . . 30

4.3.12 Topic: Sensor display . . . 30

4.3.13 Topic: Sensor readings . . . 30

4.3.14 Rxplot. . . 30 4.3.15 Log file . . . 30 4.3.16 Way points . . . 30 4.3.17 Node: Path_Planning . . . 30 4.3.18 Node: rviz. . . 31 5 Results 33 5.1 Gas Dispersal Simulation Results . . . 33

5.1.1 Visualization of Changing Width of Filaments . . . 33

5.1.2 Visualization of Changing Concentration . . . 33

5.1.3 Results without Considering Air Resistance and Density 34 5.1.4 Results with Considering Air Resistance and Density . . 35

5.2 Gas Sensor Simulation Results . . . 39

5.2.1 Sensor Response against Constant Concentration . . . . 39

5.2.2 Sensor Response against Changing Concentrations . . . 39

5.2.3 Sensor Response in Turbulent Environment . . . 40

6 Discussions and summary 51 6.1 Discussions . . . 51

6.1.1 Why ROS (Robot Operating System)? . . . 51

6.1.2 Why another Olfaction simulator for ROS . . . 52

6.1.3 Code reusability . . . 55

6.1.4 Why Time Constants from Mark III are used? . . . 56

6.1.5 What is the Reason for Creating Path_Planning Package? 57 6.1.6 What are the Future Works? . . . 58

(13)

CONTENTS vii

A Manual for 3-D Gas Dispersal Simulation in ROS 63

A.1 Introduction. . . 63

A.2 Getting Started . . . 63

A.2.1 Prerequisites. . . 63

A.2.2 Downloading Odor Simulation . . . 64

A.2.3 Installing Odor Simulation. . . 64

A.2.4 Executing Odor Simulation . . . 64

(14)
(15)

List of Figures

1.1 Entities that effect the result of a mobile robot experiment. . . . 2

2.1 Free-falling motion of objects of different weights . . . 8

2.2 Buoyant and gravitational forces acting on an object. . . 10

3.1 Typical sensitivity chatacterstics of gas sensor TGS 2620. . . 13

3.2 Sensor responce without any delay against concentration. . . 15

3.3 Traditional three phase sampling process.. . . 16

3.4 Filtered sensor response. . . 17

3.5 Final sensor response. . . 17

4.1 Visualization of environment Simulation in rviz . . . 23

4.2 2-D simulation of environment in stageros. . . 24

4.3 Simulation of gas dispersion displayed in rviz. . . 25

4.4 Simulation of gas sensor collecting data from environment. . . . 25

4.5 Gas sensor response represented in rxplot. . . 26

4.6 Path plan of a robot for a given goal in environment. . . 26

4.7 Simplified input/output flow of ”Simulated_MOX” node. . . 29

4.8 Simulation process flow diagram. . . 32

5.1 Change in width of each filament indicate by change in color. . 34

5.2 Top view of concentration levels of the plume. . . 35

5.3 Plume acceleration without air resistance and density . . . 36

5.4 Plume acceleration with density and air resistance. . . 37

5.5 Heights of plumes of gases with different densities. . . 38

5.6 Response of different model sensors at same concentration. . . . 40

5.7 Response of sensors against steps concentration. . . 43

5.8 Response of sensors against upstairs concentration. . . 44

5.9 Response of sensors against downstairs concentration. . . 45

5.10 Response of sensors against random concentration. . . 46

5.11 Robots crossing plume for data collection. . . 47

(16)

x LIST OF FIGURES

5.12 Response of TGS sensors while crossing the plume. . . 48

5.13 Robots placed in the way of plume for data collection. . . 49

5.14 Response of TGS 2611 gas sensors placed accros the plume . . . 49

6.1 Plume generated with PlumeSim. . . 53

6.2 Odor sensing setup with PlumeSim. . . 54

6.3 rxplots of rise and decay time of odor sensor used in PlumeSim. 55 6.4 3-D dispersal simulation with obstacle in Dispersal simulation. . 56

6.5 3-D visualization setup for gas sensor with Dispersal simulation. 57 6.6 rxplots of rise/decay time of sensor response in Dispersal simulation 58 6.7 rxgraph of each node of package that is working separately. . . 59

6.8 Visualization of each node that is simulated separately. . . 60

A.1 Visualization of environment Simulation . . . 65

A.2 Visualization of three MOX gas sensors in rviz. . . 66

A.3 rxplot of a MOX gas sensor response. . . 67

(17)

List of Tables

5.1 Environment configuration for data collection test. . . 41

5.2 Constants estimated by curve fitting. . . 42

(18)
(19)

Chapter 1

Introduction

This chapter is composed of the motivation, related research and the outline of the thesis.

1.1

Motivation

Olfaction plays an important role in the survival of most of the living crea-tures. Animals use sense of olfaction for tracking their hunt, mate or predator avoidance etc. Despite the fact that olfaction plays an important role in natural life, researchers are investigating sense of smell and trying to use this prop-erty artificially with mobile robots to achieve certain goals. Artificial devices that mimic the functionality of olfactory system are known as electronic noses (e-noses) [10]. The metal oxide (MOX) gas sensors are extensively used in elec-tronic noses applications. Metal oxide (MOX) gas sensors equipped on mobile robot can be used in different applications which are described below:

Mobile robots with olfaction can be beneficial for the applications where humans work with the collaboration of well trained animals having well de-veloped sense of smell. These applications includes detection of explosives and finding buried land mines [39], security, surveillance or finding people in search and rescue operations [22]. Furthermore, integration of olfaction in mobile robotics is carried-out in chemically related tasks, such as environmental mon-itoring [34]. Mobile robot olfaction mainly focuses on search and tracking of odor plumes and localization of their source; the mapping of odor fields and the tracking of volatile chemical trails [6]. Additionally, some gases which are harmful for human health, cannot be sensed by humans. Carbon monoxide is one of these gases, is responsible of the deaths and poisonings reported through-out the world each year. It is also purposed that prolonged exposure to low concentrations of carbon monoxide may have unfavorable effects on the brain [44]. Normally at homes, accidental carbon monoxide poisoning can be caused by deficient ventilation. The simplest way to overcome this issue is by installing olfaction sensors i.e. stationary carbon monoxide detectors [26].

(20)

2 CHAPTER 1. INTRODUCTION

Figure 1.1: Entities that effect the result of a mobile robot experiment [6].

From the above paragraph, the perception is revived that toxic, flammable and explosive chemicals are involved in olfaction related tasks which enhances the environmental hazards and risk of life. Moreover, experiments conducted by mobile robotics can be notably complicated and the precision of the results of repeated experiments usually show large degree of variations. It is due to the variability of the relationships between the entities involved in experiments [6]. Figure1.1shows the entities that effect the result of a mobile robot experiment. The results of mobile robot olfaction tasks depends upon the environment and olfactory detection system equipped on a mobile robot. If the environment and olfaction system is kept in control, research attention can be more focused to-wards the task [6]. This thesis focuses on the simulation of odor transport en-vironment and olfaction detection system to make them controllable. The used simulation framework is Robot Operation System (ROS). ROS was designed to meet a specific set of challenges encountered when developing large-scale service robots as part of the STAIR project [37] at Stanford University and the Personal Robots Program [48] at Willow Garage, but the resulting architecture is far more general than the service-robot and mobile-manipulation domains. ROS is not just a simulation environment; actually, it is a complete Robot Op-erating System that supports messaging infrastructure and provides means to develop and share solutions with other researchers [35].

1.2

Related research

Research in the field of olfaction is continuing in various directions including trail odor source localization, trail following, mapping of odor distributions, odor plume simulation and tracking. Number of experiments are performed using both 2-dimensional [36] and 3-dimensional [17] environments. Experi-mental setups use both single [27] and multiple [30] mobile robots.

Goncalo Cabrita, Pedro Sousa and Lino Marques [6] described a Player-/Stage simulation framework for mobile robot olfactory experiments. They

(21)

1.2. RELATED RESEARCH 3

work on PlumeSim framework which does not only simulate odor transport in the environment, but includes also an olfactory detection systems. The odor sensing process is modeled against data received by different time response sensors gas sensors. They performed the experiments which showed that the PlumeSim framework is able to feed real-like simulations of chemical plumes into Stage. From the experiments they observed that the plume used for the sim-ulated experiment is very similar to the plume measured during the real world experiment. There package is able to provide plumes based on Meandering al-gorithm and Gaussian alal-gorithm. It also allows to reading a log file and fluent log files designed specifically for this application. However, their model can be more improved. They suggested that future works will focus on enhancing the current sensor modeling package, movement of the robot itself and the airflow that it generates by the movement of robot. Furthermore, Player/Stage provides 2-dimensional simulation platform. Working with simulation in 3-dimensional platform such as Robot Operating System (ROS) can provide the simulation which is more near to real world as compare to 2-dimensional simulation. Af-ter the success of Plumesim framework in Player/Stage, they implemented their framework in ROS in order to get more robust and detailed simulation.

In the paper [8], a computationally efficient Filament based plume simula-tion model is designed to mimic both the short-time and long-time exposure statistics of an odor plume in turbulent medium. Filament is a collection of molecules or particles. The interaction of gas with its surrounding is domi-nated by three physical effects. First, molecular diffusion which slowly mixes the gas with the surroundings. Second, turbulent air flow that breaks the gas into segments of patches of high concentration with steep gradients at their edges. Third, flow advection that moves these patches. A continuous wind field that varies with location and time in both magnitude and direction is involved in the model. The plume shape is determined by the integrated effect of these three effects. The objective behind the development of this simulation model was to simulate a plume that is able to reproduce the long-term time-averaged plume data accurately, reproduce the short time-scale signature for sensed con-centrations realistically and to evaluate various source localization and plume tracing algorithms under identical conditions.

The paper [36] presents a gas dispersal simulation package. This package integrates OpenFOAM flow simulation and a filament-based gas propagation model to simulate gas dispersion. This gas dispersal model simulates gas disper-sion for compressible flows with a realistic turbulence model based on filament-based gas dispersal model [8]. Furthermore, the governing equations of turbu-lent flow model, the gas propagation model, implementation of gas dispersal simulation method and the results under the compressible flow are also dis-cussed. Derived data- driven statistical gas distribution models are also shown in the paper. The objective behind the development of this gas dispersal simu-lation package was the evaluation of statistical gas distribution models and to provide comprehensive information about a large number of gas sensor

(22)

mea-4 CHAPTER 1. INTRODUCTION

surements. The statistical distribution model can also be useful for gas source localizations and for estimating where to take the future measurement. More-over, the simulation package is published as open source software. The paper also describes the future work as; using the simulation package to evaluate sen-sor planning methods and different temporal and spatial sampling approaches and to extend the gas dispersion to 3-dimensions and to integrate the gas dis-persion package with a robot simulation tool.

1.3

Contributions

Ambition of the thesis lies in the extension the gas dispersal simulation pack-age discussed in [36] and integration of this extended package with a robot simulation tool. The essential extended sections are:

• Visualization of gas dispersion from 2-dimensions to 3-dimensions. The already existing 2-dimensional simulation engine that integrates Open-FOAM flow simulation and a filament-based gas propagation model to simulate the gas dispersion is extended from 2-dimensions to 3-dimensions. • Acceleration estimation for various gas plumes. Different gases accelerate

with different rates depending upon their density and the air resistance. Gases denser than air tends to move towards the ground and gases less denser than air moves upwards in the presence of air resistance. The ac-celeration for different gases is introduces in the simulation by taking air resistance and density into account.

• Implementation of olfaction detection system. The olfactory detection system models the response of metal oxide gas sensors to the simulated gas.

• Integration of the extended gas dispersion package with ROS. The simu-lation of gas dispersion and olfation detection system is useful for many applications, therefore, it is intended to publish this package as open source software and integrate with a robot simulation tool.

(23)

Chapter 2

Gas Dispersal Simulation

This chapter discusses the turbulent flow model and filament-based gas disper-sal simulation [8] in detail and the implementation of filament-base gas disper-sion without and with acceleration considering the air resistance.

2.1

Introduction

The combination of gas sensors and mobile robots is useful for a number of ap-plication areas which are described in Chapter1. Inspired by these applications, the research in mobile robotics has been focused on Gas source Localization, Gas Discrimination and Sensor planning etc [46]. Odor source localization with mobile robots is a search problem, with the goal of finding a source that releases some chemical substance which can be measured by an appropriate sensor [31]. Gas discrimination is a classification problem that discriminates one gas or gas source from another [46]. Sensor planning involves with what to sense and when to sense [21]. Complex experiments are performed where environmental hazards are also involved in the development of these applications. Moreover, results of the experiments shows fluctuations where repetition of experiments are involved due to the variability of relationship between environment and olfaction detection system. Making the environment controllable is one of the approaches to deal with the situation [6]. This is the intention of gas dispersion simulation to make environment controllable.

2.2

Gas Propagation Model

When a gas interacts with its surroundings it experiences three physical ef-fects: molecular diffusion, turbulent air flow and advection [36]. Molecular diffusion or simply diffusion is described as the spread of particles through random motion from regions of higher concentration to regions of lower con-centration [3]. Turbulence is that state of fluid motion which is characterized by apparently random and chaotic three-dimensional vorticity [11]. When

(24)

6 CHAPTER 2. GAS DISPERSAL SIMULATION

lence is present, it fragments the gas emanating from a source into intermediate patches of high concentration with steep gradient at their edges [40]. Advection is a transport mechanism of a substance. An example of advection could be the transport of pollutants or silt in a river and the motion of the water carries these impurities downstream [43].

Gas dispersion model used in our implementation is described in [36] con-siders all three above mentioned effects. Gas is represented by a sequence of puffs. Each puff contains a number of particles. A gas released from its source is affected by the turbulent air flow, molecular diffusion and advectively trans-ported by the wind.

The Gas dispersion is divided into two parts: one is air flow simulation by using OpenFOAM and the second is the gas propagation using filament based approach.

2.2.1

OpenFOAM Turbulent Flow Model

Fluid flows can be defined in three categories: laminar, in transition from lam-inar to turbulent or fully turbulent. Turbulence flow models are mostly based on Reynolds Averaged Navier-Stokes (RANS) equations which can be classified as Reynolds stress model or eddy-viscosity model [36].

OpenFOAM is an open source CFD software package, which has an exten-sive range of solving complex fluid flows involving chemical reactions, turbu-lence and heat transfer. It offers different CFD algorithms to model laminar or turbulent flow [1].

There are a number of OpenFOAM solvers available. The compressible flow model is chosen from the available models. It is because of model all possi-ble future phenomena in the air flow field. In compressipossi-ble flows, availapossi-ble solvers suitable for this implementation are: rhoCentralFoam, rhoSimpleFoam, rhoPisoFoam and rhoPimpleFoam. Any one of these solvers can be used be-cause the initial conditions required to be set are same for all these solvers. Each of these solvers can apply either an eddy-viscosity or Reynold stress model. Eddy-viscosity is used because the computational cost of Eddy-viscosity is less than the Reynold stress model. Moreover, the gas propagation model is inde-pendent of this turbulent Flow model and any other model can be used.

2.2.2

Filament-base Gas Dispersion

Filament-based Gas dispersion is modeled by the approach used in [8]. Gas is simulated in the environment as a set of filaments (i = 0, 1, 2, ..., N). Each filament contains constant amount of molecules. Filaments have position Pi,t

and width Ri,t. The position of every filament is updated according to the flow

of wind wpi,t at each time step t.

(25)

2.3. THREE-DIMENSIONAL GAS DISPERSION 7

where wpi,t represents the wind vector at position Pi,t. εp is a vector of

three independent Gaussian random variables, N(0, σ2

p), with standard

devia-tion σp = 0.1m. Due to molecular diffusion, the filament becomes wider and the concentration decreases with the time. The width of a filament is defined as: Ri,t+∆t= Ri,t+ γ 2Ri,t (2.2) where, γ = 4 × 10−7and R

i,tis the parameter for controlling the width.

2.3

Three-dimensional Gas Dispersion

Almost everything in the real world experiences the gravitational force. In three-dimensional representation of a filament this force is an important fac-tor to bring the dispersal simulation one step closer to real scenario. The fil-aments dispersing with certain velocity will produce some acceleration due to the presence of gravitational force (gravitational acceleration).

Let’s calculate the acceleration for a filament. For a given initial velocity, ~

v0, and initial position, ~p0 the position of a filament, ~p, as a function of time,

under constant acceleration, ~a can be described as [18]:

~p = ~p0+ ~v0t +

1 2~at

2 (2.3)

The Equation (2.3) is a vector equation, let’s break it into its components i.e. x, y and z. If we neglect the air resistance, the acceleration is −g in z direction due to the gravity. The acceleration in the x and y direction is zero. Therefore, the above vector equation can be written as three scalar equations:

x = x0+ v0t (2.4) y = y0+ v0t (2.5) z = z0+ v0t − 1 2at 2 (2.6)

From the above three equations, the 3-dimensional position (x,y,z) of a fil-ament can be determined. In the Equation (2.6) the acceleration of a filament is a = −g = −9.8m/s2. Therefore, the filaments will accelerate towards the

ground with the rate of 9.8m/s2.

It is noted the acceleration in Equation (2.6) is without encountering a sig-nificant force of air resistance which means that the only force acting on the filament the gravitational force. Filaments of various gases will accelerate with the same rate regardless their different physical or chemical properties.

In order to understand this phenomena, let’s consider the free-falling mo-tion of a 1000-kg sphere object and a 1-kg sphere object in Figure2.1. In this figure, if only force is considered, then it would be seen that the 1000-kg object would experiences a greater force of gravity. But according to the Newton’s

(26)

8 CHAPTER 2. GAS DISPERSAL SIMULATION

Figure 2.1: Free-falling motion of objects of different weights

second law, acceleration depends upon two factors: force and mass. The 1000-kg object experiences more force but it has more mass as well and this mass has an inverse affect upon the acceleration of this object. Similarly, the 1-kg object experiences less force and has less mass. Thus, the ratio of force to mass (Fnet/m) is the same for the 1-kg and the 1000-kg object without air resistance

situations.

2.3.1

Acceleration Rate Estimation

Gases with different densities accelerate with different rates and form different plume shapes. Gases with high mass or density remains closer to the surface of the earth. Such as: ethanol, methanol, acetone and etc. Gases with less mass or density disperse away from the surface of the earth. Such as: hydrogen, neon, ammonia and etc.

In order to estimate the acceleration rate for different gases in the presence of air resistance, Buoyant force is calculated. When an object is completely or partially submerged in a fluid, a resultant force acting on the body pushes the object upward. This force is called the buoyant force [12]. Let’s now calculate the buoyant force for the filament. The magnitude of buoyant force is given by the weight of the fluid (air) displaced by the filament:

(27)

2.3. THREE-DIMENSIONAL GAS DISPERSION 9

where ρair is the density of the fluid i.e. air, g is the gravitational force and

V is the displaced volume. The direction of this buoyant force is upward. The downwards force of gravity is given by:

Fg = −mg (2.8)

where m is the mass of the filament. This equation can be written as:

Fg = −ρflmgV (2.9)

where ρflmis the density of the filament.

The Equation(2.7) and Equation(2.9) shows that there are two forces acting on the filament that are: buoyant force acting upwards and gravitational force acting downwards which is also shown in Figure2.2. The net force acting upon the filament is given by:

Fnet= FB+ Fg (2.10)

Fnet= (ρairgV) − (ρflmgV) (2.11)

The above equation can be written as:

Fnet= gV(ρair− ρflm) (2.12)

Total mass is given as:

mtotlal= mair+ mflm (2.13)

where mairis the mass of air and mflmis the mass of filament.

the Equation(2.13) can be written as:

mtotlal = V(ρair+ ρflm) (2.14)

as we know that: a = F

m, here, F = Fnetand m = mtotlal, therefore;

a =g(ρair− ρflm) ρflm+ ρair

(2.15) where; ρflmis the density of filament and ρairis the density of air.

The Equation(2.15) shows that if the density of the filament is less then the density of air then filament will accelerate upwards and if the density of filament is greater than air, the filament will accelerate downwards. By calculating the value of a from Equation (2.15) and putting this acceleration value in Equation (2.6), the position of a filament that depends upon the density of filament and air resistance can be calculated.

(28)

10 CHAPTER 2. GAS DISPERSAL SIMULATION

(29)

Chapter 3

Gas Sensor Model

This chapter describes the modeled gas sensor by using the concentration ac-quired from the simulated gas dispersion. Typical sensitivity characteristics of different gas sensor models are used to simulate the gas sensor response. To produce real like response, various techniques are use to enhance this simu-lated response such as: filtering and rise/decay time estimation.

3.1

Introduction

The metal oxide (MOX) gas sensors own the characteristics such as: low cost, commercially availability, simplicity of use, relatively fast response and sensitiv-ity than other sensing technologies. These characteristics are dominant reasons for the widely usage of metal oxide sensors in electronic nose applications and mobile robotics olfaction [45]. Researchers and developers are contributing to understand the sensing mechanism of MOX gas sensors with phenomenolog-ical and spectroscopic technologies [49]. There are two types of metal oxide gas sensors: n-type and p-type. N-type responds to reducing gases like hydro-gen, methane, ethanol and etc. P-type responds to oxidizing gases like oxyhydro-gen, chlorine and etc [19]. N-type metal oxide gas sensors are considered in this im-plementation. MOX gas sensors measure the change in the conductance of the oxide when a gas interacts with the sensing surface. The change in conduction is linearly proportional to the logarithm of the concentration of the gas [14]. A simple electric circuit in MOX converts the change in conductivity to an output signal which corresponds to the gas concentration.

MOX gas sensors operates on high temperatures and typically they have to be heated for 30 to 60 minutes before operation [29]. These limitations con-sume comparatively much power and time. One of the solution to overcome these limitations can be the simulation of MOX gas sensor response. In sim-ulation, the simulated response of the MOX gas sensor should copy the real response as close as possible. The study and understating of MOX gas sensor’s dynamics and its response to different gases is essential for copying the real

(30)

12 CHAPTER 3. GAS SENSOR MODEL

response of the sensor [6]. Moreover, MOX gas sensor response varies against different chemicals. Different models of MOX gas sensor can also produce dif-ferent response against the same concentration of same chemical [24]. This thesis covers a reasonable model that explains the important aspects of MOX gas sensor such as: sensitivity characteristics of different models of MOX gas sensor against different chemicals, rise time and decay time. The sensor model is designed for different series of FIRGO sensors such as: TGS 2600, TGS 2611 and TGS 2620 (model can be extended for any other types of sensors). The sensor model can detect different chemicals such as: ethanol, hydrogen and methane.

3.2

Gas Sensor Model Implementation

3.2.1

Filament-based Concentration Calculation

The position of each filament is calculated in Chapter2. The concentration at any position X=(x,y,z) at time t is calculated as the sum over the concentration at the location contributed by each filament.

C(x, t) = N X i=1 C(x, t)molecules cm3 (3.1)

The concentration at location X due to the filament i is modeled as: Ci(x, t) = Q R3i, texp( |x − Pi,t| R2 i,t )molecules cm3 (3.2)

Where; Q represents the number of molecules per filament, Ri,tis a

param-eter controlling the width, and Pi,tis the current position of the i − th filament.

Equation(3.2) shows that the concentration of filament decreases exponen-tially when distance increases from its center. This calculated concentration is further given as input to the gas sensor model which is described in this chapter.

3.2.2

Gas Sensor Model Description

The MOX gas sensor response varies from chemical to chemical. The Figure3.1

is taken from the data sheets of “FIGARO TGS 2620” which represents the typical sensitivity characteristics of this sensor.

In the Figure3.1, x-axis indicated the Gas concentration and y-axis indi-cates the sensor resistance ratio Rs/R0, Where:

RS=Sensor resistance in displayed gases at various concentrations.

R0=Sensor resistance at 300ppm of ethanol.

This figure shows that as the concentration increases, the resistance (in-verse of conductance) decreases. It is observed that concentration and sensor

(31)

3.2. GAS SENSOR MODEL IMPLEMENTATION 13

Figure 3.1: Typical sensitivity chatacterstics of gas sensor TGS 2620 against five different

chemicals and air is shown in this Figure [42].

response are inversely proportional to each other and this proportional is ex-ponential.

The typical sensitivity characteristics of the sensors are used as a reference to determine the response of the sensors on different concentrations. It is re-alized that the typical response of sensor on different concentrations can be determined by using the curve fitting method. Since the response of the sensor on concentration is not linear, Nonlinear Least-Squares Method is used.

3.2.3

Nonlinear Least-Squares Method

Nonlinear least squares is the form of least-squares analysis which is used to fit a set of m observations with a model that is nonlinear in n unknown parameters (m > n) [20].

By visualizing the response of different models of MOX gas sensors from their typical sensitivity characteristics, sample data points (x1, y1), (x2, y2), ...,

(xN, yN) are extracted and the exponential curve is fitted. The exponential

(32)

14 CHAPTER 3. GAS SENSOR MODEL

yout= A.eBx (3.3)

yout= A.eBx+ C.eDx (3.4)

The Equation(3.3) is the mono-exponential and Equation(3.4) is the bi-exponential. Where, A ,B C and D are constants, x is the input data. The nonlinear least-squares procedure requires the minimum of:

E(A, B, C, D) =

N

X

k=1

((yout)k− yk)2 (3.5)

Where, yout is the mono-exponential or bi-exponential, yk is the output

against the input x data. A ,B C and D are the estimated constants.

For each of the gas sensors (TGS 2600, TGS 2611 and TGS 2620) the con-stants: A ,B C and D are estimated for different chemicals (hydrogen, ethanol and methane) by using Equation(3.5). The equation for each chemical is con-structed by using Equation(3.4).

3.2.4

Sensor Response Generation

By using the above calculated Equations(3.5) and (3.4), sample response of TGS 2620 is generated against ethanol in order to examine the output response of the sensor. Figure3.2shows the simulated sample sensor response generated against ethanol by TGS 2620.

Figure 3.2 shows that the sensor response to the input concentration is immediate without any time delay. But in reality, the gas sensor cannot re-sponse immediately to the input concentration. The sensor rere-sponse to change in concentration is an exponential function with some time delay. Figure3.3is taken from the [47] which explains the traditional three phase sampling pro-cess. Where, 0 indicates the baseline, 1 transient, 2 steady state and 3 recov-ery. The simulated sensors response must mimic this real sensor response. This means that some enhancement is required in the simulated sensor response. It is realized that using some filtering technique, delay can be obtained in sensor response. Low pass filter is used to produce some delay in the sensor response.

3.2.5

Low Pass Filter

The opposite of a high-pass filter is low pass filter, that allows low frequency signals to pass but attenuates the signals with frequencies higher than cutoff frequency [41]. In Algorithmic implementation, low-pass filter can be expressed as:

(33)

3.2. GAS SENSOR MODEL IMPLEMENTATION 15

Figure 3.2: Upper: input concentration given to the gas sensor. Lower: simulated

re-sponse of the gas sensor.

α = dt

τ + dt (3.7)

where, ftis the filtered output, α is smoothing factor, ytis the input sensor

response, dt is the time interval and τ is the time constant.

Figure 3.4shows the filtered sensor response. It can be observed that sensor response on given concentration is smooth with some time delay and simulated sensor response is almost copying the real sensor response. It is also observed that the response and recovery time of simulated sensor response are same. But in real sensor response it is not the case. In real sensor response, rise time is not equal to recovery time. Final enhancement in simulated sensor response is to estimate the response and recovery time.

(34)

16 CHAPTER 3. GAS SENSOR MODEL

Figure 3.3: Traditional three phae sampling process [47].

3.2.6

Rise and Decay Time Estimation

The rise and decay time used in simulated sensor response are based on [24]. In this paper, the statistical analyses of the experiments provide the rise and de-cay time constant estimations for Mark III mobile nose. Experiment was con-ducted by using Six MOX gas sensors (two each of TGS 2600, TGS 2610 and TGS 2620). The summarized results of experiment include the parameters that describe the average of the time constants of rise and decay. A reasonable esti-mate of the sensor response is provided by the mean value of the time constants (averaged over all six sensors):

τr=1.8s (3.8)

τd=20.7s (3.9)

where τr is the estimated time constant for rise period and τd is the

esti-mated time constant for decay period.

Equations(3.8) and(3.9) are used as time constant for rise and decay. Fig-ure 3.5shows the implementation of these time constants for rise and decay time. It is also noticed that the best estimation of rise and decay time constants cannot be determined. It is due to the rise and decay time constants depend on the sensor type as well as the different sensors of same type. Moreover, rise and decay time constants are also dependent on concentration [24].

(35)

3.2. GAS SENSOR MODEL IMPLEMENTATION 17

Figure 3.4: Filtered sensor response. Notce that rise and decay time are almost same i.e

2000(ms)

Figure 3.5: Final sensor response with estimated rise and decay time constants. Notce

(36)
(37)

Chapter 4

Three-Dimensional Gas

Dispersion Package in ROS

This chapter discusses the implementation of the Dispersal simulation (de-scribed in Chapter2) and gas sensor model (discussed in Chapter3) in ROS. The implemented packages in a stack, their nodes, topics and their flow is also discussed in details.

4.1

Introduction

4.1.1

Robot Operating System (ROS)

As mentioned in previous chapter, ROS is an operating system that contains a collection of user contributed nodes that implement functionality such as perception, localization and mapping, simulation and etc.

4.1.2

Used ROS Packages and Terminologies

This section describes the different ROS packages and terminologies used in simulation of the Gas dispersal [4].

ROS Node

“Node” is the ROS term for an executable that is connected to the ROS net-work.

ROS Publisher and Subscriber

Publisher is a node that broadcasts a message. Subscriber node is the node that receives the messages that is being published by publisher node.

(38)

20 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

ROS Topics

Topics are buses over which nodes exchange messages. Topics have anonymous publish/subscribe semantics. In general, nodes are not aware of who they are communicating with.

ROS Packages

Packages are the main unit for organizing software in ROS. It might contain ROS runtime processes (nodes) or anything else that is usefully organized to-gether. The purpose of creating packages is to provide the useful functionality in an easy-to-consume manner so that software can be easily reused.

ROS Stacks

Stacks are collections of packages that provide aggregate functionality. ROS Messages

Nodes communicate with each other by publishing and subscribing messages on topics. A message is a data structure that consists of type fields. Standard types of messages are: integer, float, boolean etc.

ROS Services

In ROS, the request and reply procedure is handled by a Service. Sevice consist of a pair of messages: one for request and one for reply.

Roscore

Roscore is a collection of nodes and programs that are pre-requisites of a ROS-based system. Roscore is important for ROS nodes to communicate.

Visualization_msgs

Visualization_msgs is a set of messages used by higher level packages, such as rviz, that deal in visualization-specific data. The main messages in visualization msgs is visualization msgs/Marker. The marker message is used to send visual-ization "markers" such as boxes, spheres, arrows, lines, etc. to a visualvisual-ization environment such as rviz.

The nav_msgs/Odometry Message

It is a navigation message that stores the estimate of the position and velocity of a robot in free space.

(39)

4.2. STACK IMPLEMENTATION IN ROS 21

Move_base

Move_base is a package that implements the action of reaching the given goal in the world with a mobile base.

Move_base_msgs

Move_base_msgs contains the messages used to communicate with the move base node.

Std_msgs

Std_msgs contains common message types representing primitive data types and other basic message constructs, such as multi-arrays.

Rviz

Rviz is a 3-d visualization environment for simulations using ROS. Rviz has various types of displays such as; point clouds, grid, axis and markers etc. A display is that draws something in the 3-D world. Each display gets its own list of properties. For example: style, color and topic etc. Each display also gets its own status to help user to know if everything is working fine or not. The status can be one of four: OK, Warning, Error and Disabled. There are three different camera types available in the rviz: Orbital Camera (default), FPS (first-person) Camera and Top-down Orthographic.

Stageros

The stageros is a wrapper on the Stage. Stage is a 2-dimension multi-robot simulator that simulates a world which is defined in a “.world file”. This file contains information about the world such as obstacles etc.

Rxgraph

Rxgraph is a command-line tool for visualizing a ROS computation graph. Rxplot

Rxplot is a tool that plots data from one or more ROS topics.

4.2

Stack Implementation in ROS

A stack “Odor_Simulation” is implemented in ROS. “Odor_Simulation” con-sists of packages: “Environment”, “Dispersal_Simulation”, “Simulated_MOX” and “Path_Planning”.

(40)

22 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

4.2.1

Environment

An environment.vcg file and environment node includes in environment pack-age.

Environment.vcg

This is a configuration file that contains settings, status and properties of dis-play. A display is something that draws objects in the 3-dimensional world such as: axis, marker and grid etc.

Environment node

Using ROS (Robot Operation System), a node of 3-dimensional environment model is created. The environment is a rectangular area of “74×46×5” meters. Two rectangular cube shaped obstacles are placed in the environment. First obstacles, sized “6 × 8 × 5” meters is placed at “15, 14, 2.5” (obstacle center position) and second obstacle, sized “6 × 6 × 5” meters is placed at “45, 6, 2.5” (obstacle center position). A source is placed in the environment. The height of the source is adjustable between the range of 0 − 5 meters. The laminar airflow approximately “1m/s” with the direction from left to right is introduced in the environment. Three mobile robot bases are placed at different positions in arena. The navigation of mobile robots is in 2-dimensions (x,y) in arena. Each robot base consists of an odor sensor and a connector. The connector is used to move odor sensor up and down in z-axis for sensing the odor in 3-dimensions in arena. Rviz is used for the visualization of whole 3-dimensional simulation process. Stageros is also used as an additional 2-dimensional visualization of environment and robots in order to manually drag robot in arena by clicking on them. Note that stageros displays only the simulation of the environment. While the simulation of gas dispersion and odor sensor is displayed in rviz. Figure4.1shows the environment displayed in “rviz” and Figure4.2shows the environment displayed in “stageros”.

4.2.2

Dispersal_Simulation

To generate realistic simulated plumes, a package is created that contains a node “Dispersal_Simulation”. The node implements the filament-base gas dispersal simulation discussed in Chapter 2. At each time step, the puffs of filaments are sequentially released at a source location. Each puff is composed of n fila-ments. Filaments are affected by turbulence and molecular diffusion along its path while being transported by advection with the wind. The 3-dimensional positions of these filaments are represented by the points of the “visualization msgs/markers”. At each time step,“Dispersal_Simulation” node calculates or determines the positions of n filaments. Gas plumes are simulated by using both

(41)

4.2. STACK IMPLEMENTATION IN ROS 23

Figure 4.1: Visualization of environment. Where, blue colored walls are boundaries of

environment, green boxes are obstacles, three small squares are robots and green pipe is a gas source. Yellow colored spheres are the sensors and cylindrical lines connecting robot with sensors are connectors for moving sensors up and down in z-axis.

methods i.e. with and without acceleration which are discussed in Chapter2in detail. Figure4.3is the visualization of gas dispersal simulation.

4.2.3

Simulated_MOX

A package “Simulated_MOX” is created in order to mimic the repose of a real gas sensor against the concentration of a gas. In package “Simulated_MOX”, gas sensor model is implemented that is discussed in Chapter 3. At each time step t, the input concentration is given to the gas sensor and gas sensor produces corresponding output sensor response. The record of gas sensor response is maintained by using a log file. This log file contains the information of gas sensor response at 3-dimensional position (x,y,z) at time t. The gas sensor also “publishes” its response so that the response can also be visualized during the simulation runtime by using “rxplot”. Figure4.4shows the visualization of gas sensor simulation in “rviz” which is installed on a mobile robot base. The gas sensor is collecting data (concentration) and produces the response against this data which is shown in Figure4.5.

4.2.4

Path_Planning

A package “Path_Planning” created that contains a node “Path_Planning” which uses ROS “navigation stack” [33] to drive robot base from one location

(42)

24 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

Figure 4.2: 2-dimensional simulation of environment in stageros. Where, big red squares

are obstacles, three small squares are robots. On the right side, thick line represents the right boundry.

to another while safely avoiding obstacles. By using “Path_Planning” node, mobile robot bases on which gas sensor is installed, are sent in different areas in environment for data collection. Robots are sent to goals by using an input “.txt” file which contains way points for each robot. As the navigation of robot is in 2-dimensions (x,y), gas sensor is installed on robot by using a connector. A connector is a simple long rod like structure that is able to move sensor up and down in z-axis in order to gather the information in 3-dimensions (x, y, z). Another node is which is extracted from “navigation stage” [7] is created that is used for running the ROS navigation stack in stage. This node is crated for 2-dimensional visualization of environment and robots and to drag the robots anywhere in environment. Figure4.6is the visualization of simulation of mo-bile robot base that is sent to some (x,y) goal in environment.

(43)

4.2. STACK IMPLEMENTATION IN ROS 25

Figure 4.3: Simulation of gas dispersion displayed in rviz.

(44)

26 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

Figure 4.5: Gas sensor response during the data collection from environment which is

represented in rxplot. X-axis represents the time(s) and y-axis represents sensor resis-tance ratio(KOhm).

Figure 4.6: Robot is moving towards the goal in environment. Where, red line shows

(45)

4.3. DETAILED DESCRIPTION OF MESSAGE PASS SYSTEM BETWEEN

NODES 27

4.3

Detailed Description of Message Pass System

between Nodes

The details of whole simulation process are described here such as: connections between nodes, messages passing between nodes, service clients and servers etc for example. Figure4.8shows the flow of whole simulation process. Let’s discuss this figure in detail.

4.3.1

User Input: Source height (1)

User can change the height of the source in order to visualize the dispersal simulation of different gases at different heights. The range of the source height is 0 − 5 meters.

4.3.2

Node: Environment (2)

The “environment” is a node that implements the simulation of environment. Environment consists of obstacles, arena boundaries and gas source. The posi-tion, size and color of obstacles, boundaries and gas source are determined by “visualization msgs/markers”. The environment node publishes this “visualiza-tion msgs/markers” on the topic “environment visualiza“visualiza-tion”. In other words, the node, “environment” tells to the topic “Environment visualization” that “I am publishing the message through you”.

4.3.3

Topic: Environment visualization (3)

The “environment visualization” is a topic on which “environment” node pub-lishes the “visualization msgs/markers”. This message contains the information about the each obstacle, boundary and gas source’s color, position and size in 3 dimensional world. This topic is further subscribed by “rviz” node. In other words, the topic “environment visualization” tells to everyone that “I have a message is it required by anyone ? ”

4.3.4

User Input: Name of the gas for simulation (4)

Different types of gases have different plume shapes. For simulating different types of gases, user input is required in this step. The input is the information about the gas i.e. name or Id which user wishes to simulate. For example (0-hydrogen, 1-ethanol, 2-methane). This information is further passes to the node “Dispersal_Simulation”.

(46)

28 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

4.3.5

Node: Dispersal_Simulation (5)

The “Dispersal_Simulation” is the node in which implements the simulation of gas dispersal. The node “Dispersal_Simulation” computes the positions of fil-aments. The node is publisher of two messages and server of one service. Two messages are published on two different topics: on the topic “dispersion visu-alization”, the information is about the filament position at time t, its size and color. On the other topic “Chemical value ”, it publishes information about the gas which it is currently being simulated. This information can be gas id, name or density etc. The node is also acting as a server of a service “Odor value”. On client’s request, this server provides the concentration of gas that is cur-rently being simulated at any 3-dimensional position. In other words, the node “Dispersal_simulation” tells to topics “dispersion visualization” and “Chem-ical value” that “I have two messages for publish one for each of you”. The node also tells to everyone that “I have a service for providing the concentra-tion, does anyone require this service?”

4.3.6

Topic: Dispersion visualization (6)

The “dispersion visualization” is a topic on which the node “Dispersal_Simulation” publishes the message. The published message is the visualization message that contains the information about the positions of filaments that is computed by the node “Dispersal_Simulation”, size and color of the filaments. In the mes-sage the filaments are represented by points. This mesmes-sage is further subscribed by the “rviz” via the same topic “dispersion visualization”.

4.3.7

Topic: Chemical value (7)

On this topic, the node “Dispersal_Simulation” publishes the message that contains information about the simulated gas such as; id, name or density of gas. The node “Simulated_MOX” subscribes the message which is published through this topic.

4.3.8

User Input: Sensor height and sensor model (8)

Gas sensors with different models have different response on same chemical. The user provides the input sensor model (TGS 2600, TGS 2611 and TGS2620) for simulating their response. As the robot movement is in 2-dimensions (x,y), the user also provides the (z-axis) position in order to be able to gather the concentration information in 3-dimensional world.

4.3.9

Node: Simulated_MOX (9)

The node “Simulated_MOX” is the busiest node in the simulation because it has to deal with many publications and subscriptions at the same time. The

(47)

4.3. DETAILED DESCRIPTION OF MESSAGE PASS SYSTEM BETWEEN

NODES 29

Figure 4.7: Simplified input/output flow of “Simulated_MOX” node. Where, gas

con-centration, simulated gas sensor id and simulated gas id are inputs and gas sensor re-sponse is output

“Simulated_MOX” is the node that implements the simulation of gas sensor model and produces gas sensor response against the given concentration. This node is subscriber of two messages, client of one service and publisher of two messages. Two subscribed topics of the node are: one topic is “chemical value” which contains the information about gas which is currently being simulated. This information helps in the production of sensor response for this gas. The other subscription is the message on topic “robot/odom”. This message stores an estimate of the position and velocity of a robot in free space. The node requests for the service provided by the node server “Dispersal_Simulation”. The request is in the form of (x,y,z) position of the sensor, the server sends back the response in the form of concentration of the gas at position (x,y,z) that is currently being simulated. Two messages are published on two different topics: on the topic “sensor display”, the information about the sensor position at time t , its size and color is published. On the other topic “sensor readings”, the sensor response at time t is published. For this node, service response and subscriptions act as input and the publications are the corresponding outputs. A simplified flow of the node “Simulated_MOX” is shown in Figure4.7. Finally at the end of whole simulation process, a log file is maintained that contains the information about the sensor position (x,y,z), concentration at this position and gas sensor response at this concentration at time t.

In other words, the node “Simulated_MOX” tells to topics “chemical value” and “robot/odom” that “I need the information from you”. The node also pro-vides the sensor position to the server and request that “give me the gas con-centration on this point”. After getting all this information, the node uses this information and tells to the topics “sensor display” and “sensor readings” that “I have something to publish”.

4.3.10

Topic: robot/odom (10)

On the topic “robot/odom”, the message that contains information of robot’s position in 2-dimensions and velocity is published. The subscriber of the mes-sage on this topic is the node “Simulated_MOX”.

(48)

30 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

4.3.11

Service: Odor value (11)

The service “odor value” has three inputs as request and one output as a sponse. The request to the service is (x,y,z) position of the gas sensor and re-sponse is the gas concentration at this position.

4.3.12

Topic: Sensor display (12)

The node “Simulated_MOX” publishes the message of gas sensor position (x,y,z) and color of the sensor for display in “rviz” through topic “sensor dis-play”.

4.3.13

Topic: Sensor readings (13)

After computing the gas sensor’s response against concentration at time t, the node “Simulated_MOX” publishes a message of sensor response. This mes-sages is published through topic “sensor readings”. This topic is further sub-scribed by “rxplot”.

4.3.14

Rxplot (14)

“Rxplot” subscribes the message on the topic “sensor reading” that contains data of the gas sensor response and plots this data.

4.3.15

Log file (15)

After the completion of whole process of the node “Simulated_MOX”, a log file is created that records the required information of the simulation process. The log file contains information of position (x, y, z) of gas sensor, gas concen-tration at this position, the sensor response at this concenconcen-tration and the time of the recorded information.

4.3.16

Way points (16)

File consists of way points is an input file to the node “Path_Planning”. The file is a simple “.txt” file that contains the way points (x, y) for each robot. Through these way points robot has to pass during the simulation process.

4.3.17

Node: Path_Planning (17)

The “Path_Planning” is responsible to move robot in the environment. The node gets the input way points from an input “.txt” file. The node plans the path for robot to reach these way points. If any obstacle appears during the movement of robot towards the goal, the robot re-plans the path in or-der to avoid the obstacle. The node “Path_Planning” uses ROS “navigation

(49)

4.3. DETAILED DESCRIPTION OF MESSAGE PASS SYSTEM BETWEEN

NODES 31

stack” [33] that has several subscriptions and publications for generating the path such as; “fake localization”, “base scan”, “global plan”, “local plan” and “robot foot print” etc . These processes are not discussed here in detail because the focus of the thesis is to show the possibility of the integration of the path planning.

4.3.18

Node: rviz (18)

Rviz is basically a visualization environment in ROS. Here Rviz is subscriber of three messages on different topics to display the simulation of these messages. The first subscription of node “rviz” is the message on topic “environment visu-alization”. The message contains information about the position, size and color of objects of environment. The second subscription of “rviz” is the message on topic “dispersion visualization”. The message contains information about the position, size and color of filaments. The third subscription is of message on topic “sensor display”. The message contains information about the position, size and color of the gas sensor. Rviz uses these information from all these sub-scriptions and displays the simulation of environment, gas dispersal, gas sensor and sensor response.

(50)

32 CHAPTER 4. THREE-DIMENSIONAL GAS DISPERSION PACKAGE IN ROS

Figure 4.8: Figure shows the flow of services, inputs and messages publish/subscribe on

(51)

Chapter 5

Results

The simulation of both gas dispersal and sensor response are tested using the various gases and in different scenarios. The results of these tests are presented in this chapter. Moreover, ethanol is considered in most of the tests for the rea-son that it is mostly used in the robotic olfaction literature [9], [24], [32], [16], [25] because it is non-toxic, easily detectable by tin oxide sensors [23] a and convenient target chemical [2].

5.1

Gas Dispersal Simulation Results

5.1.1

Visualization of Changing Width of Filaments

The width of the filament is determined by Equation 2.2 in Chapter 2. The width of the filament increases over time and the concentration decreases. Fig-ure 5.1shows the change in width and implicitly change in concentration of the filament. Width of filament is indicated by color. The filaments near the source are less wider then the filaments away from the source due to the molec-ular diffusion. As the filaments near source are less wider, the concentration of the filaments is higher. One of the reason for this high concentration is the short average distance between the particles of each filament. This concentra-tion decreases with the time due to increase in the average distance between the particles. As the distance between the particles increases the width of the filament is also increases.

5.1.2

Visualization of Changing Concentration

The concentration of the plume is determined by Equation3.2in Chapter 3. The concentration at any location X = (x, y, z) is the sum of all the concen-trations at this location contributing by each filament. Figure5.2is the visual-ization of different concentration levels in plume. Each block of grid is equal to 1m3. The measure of concentration at each block of 1m3 is the sum of all

the concentrations at this block contributing by each filament. From the figure,

(52)

34 CHAPTER 5. RESULTS

Figure 5.1: Change in width of each filament indicate by change in color.

high concentration blocks can be seen near to the source. The concentration of blocks decreases as their distance increases from the source. But it can also be observed that some concentration blocks (yellow blocks) appear away from the source. It is due to the dominance of turbulence and the prevailing air flow on the dispersal [28].

For determining the 3-dimensional position of filaments, the (x,y,z) posi-tions are given by the Equaposi-tions2.4, 2.5and2.6in Chapter 2. The value of a in Equation 2.6is estimated by two different approaches: first considering acceleration without air resistance and density of gases, second, acceleration with air resistance and density of gases. Results of these two approaches are discussed in5.1.3and5.1.4.

5.1.3

Results without Considering Air Resistance and Density

In this approach, the plume is generated without considering acceleration fol-lowed by the plume generation with acceleration. In real world, dispersion of gas in the 3-dimensions is effected by gravity. Intention behind this approach was to see the difference between plumes generated with and without ation. For the generation of plume without acceleration, the value of acceler-ation in Equacceler-ation 2.6 is kept 0. For plume generation with acceleration this value is kept −9.8m/s2which is the gravitational force acting on the gas

par-ticles or filaments without taking air resistance and density into account. The two generated plumes are shown in Figure5.3. The difference between the two plumes can be observed. The plume with 0 gravitational force has almost con-stant height, dispersing along with the direction of wind. While the plume with

(53)

5.1. GAS DISPERSAL SIMULATION RESULTS 35

Figure 5.2: Top view of concentration levels of the plume.

gravitational force is dispersing down wards and reaches to ground after some time.

5.1.4

Results with Considering Air Resistance and Density

For simulating the plumes of various gases, one of the physical properties i.e. density is introduced in the simulation process in order to distinguish the plumes of various gases. Different gases have different densities. Gases with density higher than air tends to disperse downwards and the gases less dense than air disperse upwards. The density was introduced in the presence of air resistance in to the gas dispersal simulation by using Equation(2.15) in Equa-tion(2.6) and the plumes of gases with different densities generated by the dis-persal simulation. The visualization of four different gas (ethanol, fluorine, he-lium and methane) plumes, with densities (789g/L, 1.696g/L, 0.1786g/L and 0.717g/L), each with two different angles is shown in Figure5.4. From the fig-ure, the effect of density on the plume shape can be observed. The height of the plumes approaches to a constant level after few time stamps. This effect is due to the floor and ceiling boundaries of the simulation environment. To observe the change in height of gas plumes with time, the average height of filaments of first puff (i.e. 100 filaments) is calculated . The average of filaments of first puff is considered because it remains in the environment throughout the simulation process. A log file that contains the height of the plume is generated at the end of the simulation process. Figure5.5shows the heights of different gas plumes at the time of simulation. The floor and ceiling are the boundaries in the way of gas particles therefore, these particles are forced to remain near the floor or ceiling. It can be observed that as the densities of different gases increases, their plume height decreases and vice versa.

(54)

36 CHAPTER 5. RESULTS

Figure 5.3: Plume acceleration without considering air resistance and density. 1: plume

(55)

5.1. GAS DISPERSAL SIMULATION RESULTS 37

Figure 5.4: Taking air resistance into account, the plumes of four gases with different

densities are simulated. 1 and 2 are ethanol and fluorine with density higher then air are dispersing towards ground. 3 and 4 are helium and methane with less density then air dispersing away from ground. (a) and (b) in each row are two different view of same experiment. Top right sub-figure indicates the axis where, red: x-axis, green: y-axis, blue: z-axis.

(56)

38 CHAPTER 5. RESULTS

Figure 5.5: Average heights of filaments in first puff of gases with different densities

are shown in this figure. Upper: heights of plumes that are more dens than air. Lower: heights of plumes that are less dens than air.

(57)

5.2. GAS SENSOR SIMULATION RESULTS 39

5.2

Gas Sensor Simulation Results

The gas sensor is modeled by fitting the bi-exponential curve on the data created by using the typical sensitivity characteristic of TGS sensors. The bi-exponential curve is fitted for three different TGS sensors (TGS 2600, TGS 2611 and TGS 2620) and three different gases (ethanol, methane and hydrogen) by using the Equation(3.4) described in Chapter3. The estimated constants by this curve fitting method are shown in table 5.2. The gas sensor model is tested in dif-ferent scenarios including constant concentrations in ideal conditions as well as changing concentration at the presence of turbulence which are described in the following subsections.

5.2.1

Sensor Response against Constant Concentration

All three modeled sensors i.e. TGS 2600, TGS 2611 and TGS 2620 are tested against the continuous constant concentration of ethanol. The aim of this test was to observe the response of different sensors against the same gas and con-centration. Figure5.6is the response generated by this test. It can be observed from the figure that the starting point or the response in air is different for all three sensors. These sensors were continuously exposed to the gas source (500 ppm of ethanol) in 1000-5000ms after the start of the experiment. The response of each sensor is different at the same concentration. The explanation about this change is the sensitivity characteristic of all three sensor models. Each sensor model have different sensitivity characteristic at same concentration.

5.2.2

Sensor Response against Changing Concentrations

The simulated sensor model is also tested with different strategies: steps, up stairway, down stairway and random stairway, which are based on the real ex-periments conducted by Marco Trincavelli in [9]. In real experiments ethanol and 2-propanol are involved but in our tests only ethanol is taken into ac-count. The results of these strategies using TGS 2620 are shown in following figures5.7, 5.8, 5.9and 5.10. It can be seen in these figures that the simulated response is smooth without any fluctuation. In the steps strategy, the simulated sensor has enough time for full recovery (i.e. more than 20 seconds) and reaches back to the initial state (response in air). In rest of strategies, both simulated and real sensors do not get enough time for recovery during the experiments. Fur-thermore, the real sensor response does not reach to the initial state and have fluctuation depends upon various characteristic such as: noise, partial pressure of oxygen, heater voltage, temperature and humidity. During the experiments noise can affect the actual response of the sensor. Reduced oxygen pressure de-creases the resistance of the sensor. TGS sensors need certain constant heater voltage to show optimum sensitivity characteristic. Since the operation of TGS sensor lies on the chemical adsorption and desorption of gas on the surface

References

Related documents

The case study pointed towards that two hours of training is not enough for a completely new user to control a on-screen cursor in one dimension as all participants had

Antal studerande och intensivvårdssjuksköterskor med 0-1 års respektive 1-2 års erfarenhet som ansåg situationer avseende snabba beslut, nya patienter och svåra uppgifter

Det är författarens ambition att undersökningen erhåller potential att bilda ett fundament till en kartläggning eller redogörelse för ISIS strategiska inriktning med stöd

In contrast to research findings in the general work and organizational psychology literature [ 44 – 46 ], job value incongruence during the middle of the season did not predict

The strategies are based on sensor planning algorithms that minimize the number of measurements and distance traveled while optimizing the inspection criteria: full sensing coverage

Detta uppnåddes genom att ett efter- rötningssteg lades till nuvarande process och att rötslammet avvattnades till strax under 10 % TS innan pastörisering och efterrötning, samt

The weight map is a graphical representation of the density of measurements; the confidence map, highlights areas in which the model is considered being trustful; the map of the

The Kernel DM+V/W algorithm incorporates wind measurements in the com- putation of the models by modifying the shape of the Gaussian kernel according to the local wind direction