Fuzzy logic applied to gas sensors

Fuzzy logic applied to gas sensors

Sensors and Actuators B, 15-16 (1993) 105-109 105 Fuzzy logic applied to gas sensors J. A. de Agapito”, L. de Agapitob, M. Schneiderb, R. Garcia Ros...

391KB Sizes 0 Downloads 61 Views

Sensors and Actuators B, 15-16 (1993) 105-109

105

Fuzzy logic applied to gas sensors J. A. de Agapito”, L. de Agapitob, M. Schneiderb, R. Garcia Rosab and T. de Pedrob uDepartamento Electrbnica, F. Fisicas, Universidad Complutense, Ciuahd Universitaria, 28040 Madrid (Spain) bInstituto de Automitica Industrial, C.S.I.C. N III Km 22 800 La Poveda, Arganda a’el Rey, 28500 Madrid (Spain)

Abstract The main problem in gas sensing, using semiconductor gas sensors, is that they are not only sensitive to one gas but also to all others present in the surrounding atmosphere, i.e., the crossed-sensibility problem. A technique to approach this is to use an array of sensors.Every elementis doped with differentimpurities.Therefore,we have not only one, but multiple outputs which will give us more information about the system. However, the lack of precision associated with the data is evident, due to the interactions between gases, and is thus very difficult to compute, but easy to be interpreted by a human expert. Fuzzy logic is extremely useful in handling vagueness, ambiguity and lack of precision inherent to data. In this logic, truth is treated as a linguistic variable that takes values from the [0, I] interval, given by a pertinence function. Each variable has a number of linguistic labels associated with it. For example, the variable ‘concentration of NO,’ may have the linguistic labels, ‘very high’, ‘high’, ‘medium’, ‘low’ and ‘very low’, as a function of the detector’s location (industrial or urban environment. .). The knowledge of the expert is stated as a set of rules for a sensor array. Applying the appropriate set of rules we shall infer the linguistic label, or the precise numeric value, which describes the output variable (in this case, the gas concentration). Therefore, we propose the use of fuzzy logic applied to an array of semiconductor gas sensors to analyse the different atmospheres due to the presence of different gases.

1. Introduction

The high concentration of pollutant gases in certain atmospheres, such as industrial or urban areas, may be dangerous and must be therefore controlled. Optic sensors are the most sensitive gas sensors used nowadays. They make use of the chemiluminescencc property that gas molecules present to detect the concentration of a gas in a given atmosphere. They are composed of an ultraviolet light emitter and a spectrum analyser of the light emitted by the gas molecules. This provides a high precision as only the wavelength of light emitted by the molecules of the selected gas will be studied. However, this high precision has a very high cost associated with it. An optic sensor will detect the gas to which it is sensitive, even in very low concentration, but at a very high price. On the other hand, semiconductor gas sensors are sensitive to all the gases present in the surrounding atmosphere. A change in the concentration of any gas will modify the characteristics of the semiconductor. The properties of semiconductor materials change when chemical reactions take place in their surface. A reaction that provokes electron exchange modifies the number of free carriers in the semiconductor and a variation on the conductivity takes place. All the reactions occurring in the neighbourhood of the surface affect the conductivity of the material. The only way to make

0925-4005/93/$6.00

them more sensitive to a particular gas is to promote some reactions. This is achieved by introducing catalysis inductor elements, more sensitive to one gas than to the others. This does not mean that the presence of other gases will not affect the measurement, masking in part the behaviour of the gas to which the semiconductor is specially sensitive. This is known as the crossedsensibility problem. One of the methods used to sense the presence of several gases is to prepare an array of sensors where each one is specially sensitive to a different gas. If the atmosphere in which we are working contains three gases, then the array would be formed by three sensors, each one in charge of one gas. The knowledge of the relationship between the response of every element of the array and the concentration of gases permits us to establish the spectrum of the surrounding atmosphere. However, an array of sensors is particularly useful when the gases present in the atmosphere do not interact with each other. In this case, it is only necessary to calibrate individually each element for different concentrations of the gas in the atmosphere. A single measurement of each element of the array gives the global content of the atmosphere formed by the gases. The problem appears when an element of the array is not only sensitive to a given gas but also to the presence of another, i.e. water vapour or another reducing agent, when an oxidant gas is to be detected. The result of the

@ 1993 - Ekvier Sequoia. All rights reserved

106

measurement provided by the sensor is, indeed, higher or lower than if the second agent was not present and must therefore be corrected. Besides, the presence of all gases will affect the value of every element of the array and, thus, the output they provide can only be considered as qualitative information. It is difficult to determine the concentration of all gases in an atmosphere by a direct method because a large table (taking into account all the possible concentrations of the gases to be detected) must be provided. Here, we find difficulty in handling these data mathematically due to the vague and imprecise nature. However, a human expert could easily interpret these data applying his experience and intuition by means of approximate reasoning. He could give some practice rules such as: if the concentration of gas 1 is high and the output of the second sensor is medium, then we must modify slightly the value given by the first sensor as gas 2 is influencing the measurement of gas 1. The expert expresses his knowledge using linguistic terms instead of using precise numeric values. When describing the concentration of a gas, he will bear in mind whether it is high or low, but he will not look for an exact number. This characteristic of expert reasoning is what makes him able to deal with imprecise, incomplete and unreliable information. Fuzzy logic is extremely useful in handling vagueness, ambiguity and lack of precision inherent to data. It permits a quantified representation of abstract concepts such as high concentration or slight modification. This is why it is employed to solve this problem.

2. Fuzzy logic Fuzzy logic is a type of logic that attempts to deal with imprecise information. It is an extension of Boolean logic. In Boolean logic, an entity is considered to be a member of a set or not. In fuzzy logic, membership in a set is a matter of degree. A given object may belong to different classifications with varying degrees. The fuzzy theory was conceived to allow machines to deal with human concepts and to work with the advanced knowledge of an expert. It improves interfaces between man and machine. A fuzzy logic-based system consists of two main parts: a knowledge base and an inference engine. We will briefly describe each of these entities. 2.1. Knowledge base The expert must describe his own experience as a set of rules and variables. (1) The rules are called production rules. They represent knowledge as if-then statements: ZfX is A then Y is B.

For example: RULE 1: If the concentration of gas A is low and the concentration of gas B is medium then the correction is low. RULE 2: If the concentration of gas A is medium and concentration of gas B is very high then the correction is very high. (2) All the variables that appear on each side of the rules have a set of fuzzy qualifiers associated with them. Fuzzy qualifiers are words used in fuzzy logic that stand for portions of continuous mathematical functions, called membership functions. These functions may have different shapes (triangular, trapezoidal, bell, etc.), depending on the characteristics of the problem. The expert must choose the appropriate form for the fuzzy qualifier and its domain. For example, the expert could interpret that a low concentration of gas A is described by Fig. 1. All the qualifiers of the fuzzy variable must be described in this way. Finally, the variable ‘concentration of gas A’ with all its attributes could be described by Fig. 2. 2.2. Fuzzy infkrence engine Once the user has defined the rules, they must be interpreted by the system in order to obtain the output value. The operations to be performed are: (1) Establishment of the grade of membership of the inputs, in terms of the fuzzy sets defined by the rules (see Fig. 3). (2) Determination of the grade of membership of the antecedent of each rule. Different functions that fulfil several restrictions (conditions) are used to accomplish this operation. The most popular and widely used is the MTN (minimum) operation (Fig. 4). It selects the lowest grade of the antecedent. Other functions can be used, i.e., the product function [ 11. (3) Adjustment of the fuzzy qualifier of the consequent of each rule. The fuzzy qualifier of the consequent is adjusted with the grade of truth of the antecedent determined by the MIN operation. The consequent of this rule is represented by the shaded area in Fig. 5.

x1

5 cooccntmlion

“3 of gas A @mm)

Fig. 1. Concentration of gas A considered as low.

107

Fig. 2. Attributes of concentration

of gas A.

\

0

inp’vahe corrcntration

uf gas A @mm)

Fig. 5. Adjustment of the fuzzy qualifier of the consequent (shaded area = consequent).

Fig. 3. Establishment of the grade of membership of the input.

(4) Evaluation of the output variables. Once we have obtained the fuzzy qualifiers of the consequent of each rule they must be combined in order to obtain the final output [ 21.This is the defuzzyfication process [ I]. As we have seen, the fuzzy set given by each consequent has a wide range of values. One of the methods to calculate the final output is to determine the centre of gravity of the union of the fuzzy set areas. An important point to remark is that, in fuzzy inference, all the rules participate in obtaining the output (Fig. 6). Rule-based systems select a unique rule from the set to be fired. In fuzzy logic-based systems, all the rules are applied and the final output is calculated as a combination of the consequents of all the rules in which it appears. This makes fuzzy inference more robust, as all the knowledge of the expert (captured in the rules) will be present in the output.

Fig. 4. MIN operation.

3. Application to a gas sensor array We will now apply this method to the measurement of the concentration of NO in air where CO and water vapour are also present. This will affect the conductivity of the semiconductor sensor in a different way than if they were not present. Therefore, the crossed-sensibility problem of the three gases must be solved and the output given by the NO sensor will be corrected depending on the concentration of CO and water vapour (WV. An array of three semiconductor sensors, to measure the three concentrations, will be used. These concentrations will be the input variables to our system, while the correction to be applied to the NO sensor will be the output variable. The correction is the factor by which the concentration of NO must be multiplied. Each

Rulel:If

C-i=lowaod(j

= medium then correction = low

TABLE 1. Rules for obtaining

the correction factor as a function of

[CO1and WI WI

5

correclion

5

Fuzzy

[Low1

[Medium]

[High1

[Very low]

zero

[LOWI Wish1

low-decrement medium-decrement low-increment

[Very high]

medium-increment

medium-increment low-increment zero medium-increment high-increment

high-increment medium-increment low-increment low-increment high-increment

[Medium]

Rule 2: If ‘; = low and s = high &en correction = medium

Fig. 6.

1wv1

inference.

variable will have a set of fuzzy qualifiers associated with it. The membership functions of these fuzzy sets have been adjusted regarding the experimental data provided by the individual calibration of each sensor. The variables and their qualifiers are given in Figs. 7-9.

The rules to be used by the inference engine are the second part of the knowledge base of the system. These rules express, in linguistic terms, such as a human expert would do, the influence that CO and the water vapour have on the measurement of NO. The rules model the actions of the expert when trying to solve the problem (as the correction factor to be applied to the readings of the NO concentration (Table I)). The expert would rather use the approximate reasoning, present in these rules, than a mathematical model of the system, which would be very difficult to obtain. Therefore, what we are modelling is the behaviour of the expert and not the behaviour of the system. The system has been simulated using the ‘fuzzyshell’ [3] environment. It provides an easy to handle interface (to build the fuzzy variables and the rules) and an inference engine to obtain the output (Table 2).

1

0

I 10 28

I 30

40

50

Fig. 7. Water vapour concentration

I

60

70

90

Km

hiRh

I:@ 200

Fig. 8. CO concentration

400

WV concenlratlon (%)

and its fuzzy qualifier for a gas sensor array.

medium

low

50

80

500

700

loo0

and its fuzzy qualifier for a gas sensor array.

109 low increment

high

medium increment

inaement

1

0 0.80 0.85 0.90 0.95

1

1.05 1.1

1.15 1.2

1.25 1.3

1.35 1.4

1.45

1.5

correction Fig. 9. Correction to be applied to the NO sensor.

TABLE 2. Corrected vah~es for a virtual reading of IOOOppb of NO as a function of [CO] and [WVj

Pm WI

10

SO

100

200

300

400

500

600

700

800

900

10 20 30 40 50 60 70 80 90 100

1000 950 950 883 883 883 898 950 1187 1199

1000 950 950 883 883 883 898 950 1187 1199

1143 1025 1025 908 897 897 1017 1079 1270 1287

1199 1100 1100 1000

1100 1108 1000 1000 1000 1000 1147 1192 1369 1400

1199 1100 1100 1000 1000 1000 1147 1192 1369 1400

1199 1100 1100 1000 1000 1000 1147 1189 1355 1400

1296 1135 1135 1076 1076 1076 1145 1153 1287 1400

1400 1199 1199 1100 1100 1100 1100 1100 1293 1400

1400 1199 1199 1100 1100 1100 1100 1100 1319 1400

1400 1199 1199 1100 1100 1100 1100 1100 1335 1400

IO00 1000 1147 1192 I369 1400

4. Conclusions

A very simple application has been illustrated to show how the fuzzy logic method works. We have implemented the inference engine for an array of sensors in order to obtain a more accurate value for [NO] in air in the presence of WV and CO. We have only considered crossed-sensibility between these gases with NO, independent of the concentration of the former. Nevertheless, the accuracy in determining [NO] has increased to + lo%, compared with about +25% before correction. However, in future studies we shall consider the concentration of NO as another input. This will improve the actual accuracy. The higher error has been found in both upper and lower borders; the lower error for the whole set for all [NO]. Another problem that can be solved by this method is the lack of reproducibility of semiconductor sensors. This doubt can be reduced to a reasonably con-

trolled uncertainty using the fuzzy logic inference techniques. We hope that the fuzzy logic method, concurrent with an appropriate signal analysis of the elements of an array of sensors, will be a powerful tool for solidstate gas sensors.

I M. M. Gupta and J. Qi, Theory of T-norms and fuzzy inference methods, Fuzzy Sers Sysr., 40 (1991) 473-489. 2 R. Garcia, M. T. de Pedro and M. T. de Andrade, A knowledge base structure for fuzzy controllers, Proc. 2nd ht. Conf. Fuzzy bgic and Neural Networks, Iizuka, Japan, July 1992, Fuzzy Logic Systems Institute (FLSI), Japan, Vol. 1, pp. 257260. 3 1. Gas&, P. D. Femindez, M. C. Garcia and R. Garcia, Environment for the development of fuzzy controllers, Artificial InleNigence Applications and Neural Networks. AINN ‘90, Acta Press, Zurich, Switzerland, 1990, pp. 121-124.